feat: refs #7758 Add code mandateType and accountDetailType #2876

Merged
ivanm merged 5 commits from 7758-Add_code_mandateType_accountDetailType into dev 2024-08-23 10:16:27 +00:00
9 changed files with 26 additions and 13 deletions
Showing only changes of commit d9d2ae2f7b - Show all commits

View File

@ -412,7 +412,7 @@ INSERT INTO `vn`.`clientManaCache`(`clientFk`, `mana`, `dated`)
(1103, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), (1103, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
(1104, -30, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)); (1104, -30, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH));
INSERT INTO `vn`.`mandateType`(`id`, `name`) INSERT INTO `vn`.`mandateType`(`id`, `code`)
VALUES VALUES
(1, 'B2B'), (1, 'B2B'),
(2, 'CORE'), (2, 'CORE'),
@ -3945,11 +3945,11 @@ VALUES
(35, 'ES12346B12345679', 3, 241); (35, 'ES12346B12345679', 3, 241);
INSERT INTO vn.accountDetailType INSERT INTO vn.accountDetailType
(id, description) (id, description, code)
VALUES VALUES
(1, 'IBAN'), (1, 'IBAN', 'IBAN'),
(2, 'SWIFT'), (2, 'SWIFT', 'SWIFT'),
(3, 'Referencia Remesas'), (3, 'Referencia Remesas', 'REM'),
ivanm marked this conversation as resolved Outdated

codigos en ingles, pregunta a chatgpt,
el code
Se llamará code si es un identificador alfanumérico en lowerCamelCase[1], se añadirá como PRIMARY o UNIQUE, y siempre NOT NULL.

codigos en ingles, pregunta a chatgpt, el code `Se llamará code si es un identificador alfanumérico en lowerCamelCase[1], se añadirá como PRIMARY o UNIQUE, y siempre NOT NULL.`
Outdated
Review

M'ha proposat 'remRef' com a Remittance Reference, 'trnRef' com a Transfer Reference i 'payRef' com a Payroll Reference.

Les fique en lowerCamelCase i com a UNIQUE ja que tenen 'id' que es el PRIMARY

M'ha proposat 'remRef' com a Remittance Reference, 'trnRef' com a Transfer Reference i 'payRef' com a Payroll Reference. Les fique en lowerCamelCase i com a UNIQUE ja que tenen 'id' que es el PRIMARY
(4, 'Referencia Transferencias'), (4, 'Referencia Transferencias', 'TRAN'),
(5, 'Referencia Nominas'), (5, 'Referencia Nominas', 'NOM'),
(6, 'ABA'); (6, 'ABA', 'ABA');

View File

@ -2,5 +2,5 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `vn2008`.`mandato_tipo` VIEW `vn2008`.`mandato_tipo`
AS SELECT `m`.`id` AS `idmandato_tipo`, AS SELECT `m`.`id` AS `idmandato_tipo`,
`m`.`name` AS `Nombre` `m`.`code` AS `Nombre`
FROM `vn`.`mandateType` `m` FROM `vn`.`mandateType` `m`

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.mandateType
CHANGE name code VARCHAR(45) DEFAULT NULL;

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.accountDetailType
ADD COLUMN code VARCHAR(45) DEFAULT NULL;

View File

@ -0,0 +1,9 @@
UPDATE vn.accountDetailType
SET code = CASE id
ivanm marked this conversation as resolved Outdated

gasta el camp description, no es pot cambiar gastant id

gasta el camp description, no es pot cambiar gastant id
WHEN 1 THEN 'IBAN'
WHEN 2 THEN 'SWIFT'
WHEN 3 THEN 'REM'
WHEN 4 THEN 'TRAN'
WHEN 5 THEN 'NOM'
WHEN 6 THEN 'ABA'
END;

View File

@ -27,7 +27,7 @@ module.exports = Self => {
// Renew mandate // Renew mandate
if (mandate) { if (mandate) {
const mandateType = await models.MandateType.findOne({ const mandateType = await models.MandateType.findOne({
where: {name: mandate.type} where: {code: mandate.type}
}); });
const oldMandate = await models.Mandate.findOne({ const oldMandate = await models.Mandate.findOne({

View File

@ -12,7 +12,7 @@
"type": "number", "type": "number",
"description": "Identifier" "description": "Identifier"
}, },
"name": { "code": {
"type": "string" "type": "string"
} }
} }

View File

@ -26,7 +26,7 @@
<vn-tr ng-repeat="mandate in mandates"> <vn-tr ng-repeat="mandate in mandates">
<vn-td number>{{::mandate.id}}</vn-td> <vn-td number>{{::mandate.id}}</vn-td>
<vn-td>{{::mandate.company.code}}</vn-td> <vn-td>{{::mandate.company.code}}</vn-td>
<vn-td>{{::mandate.mandateType.name}}</vn-td> <vn-td>{{::mandate.mandateType.code}}</vn-td>
<vn-td shrink-datetime>{{::mandate.created | date:'dd/MM/yyyy HH:mm' | dashIfEmpty}}</vn-td> <vn-td shrink-datetime>{{::mandate.created | date:'dd/MM/yyyy HH:mm' | dashIfEmpty}}</vn-td>
<vn-td shrink-datetime>{{::mandate.finished | date:'dd/MM/yyyy HH:mm' | dashIfEmpty}}</vn-td> <vn-td shrink-datetime>{{::mandate.finished | date:'dd/MM/yyyy HH:mm' | dashIfEmpty}}</vn-td>
</vn-tr> </vn-tr>

View File

@ -9,7 +9,7 @@ class Controller extends Section {
{ {
relation: 'mandateType', relation: 'mandateType',
scope: { scope: {
fields: ['id', 'name'] fields: ['id', 'code']
} }
}, { }, {
relation: 'company', relation: 'company',