feat: refs #7758 Add code mandateType and accountDetailType
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Ivan Mas 2024-08-21 16:45:46 +02:00
parent 00dc58221e
commit d9d2ae2f7b
9 changed files with 26 additions and 13 deletions

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'),
(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
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',