feat: refs #7758 Add code mandateType and accountDetailType #2876
|
@ -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', 'remRef'),
|
||||||
ivanm marked this conversation as resolved
Outdated
|
|||||||
(4, 'Referencia Transferencias'),
|
(4, 'Referencia Transferencias', 'trnRef'),
|
||||||
(5, 'Referencia Nominas'),
|
(5, 'Referencia Nominas', 'payRef'),
|
||||||
(6, 'ABA');
|
(6, 'ABA', 'aba');
|
||||||
|
|
|
@ -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`
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE vn.mandateType
|
||||||
|
CHANGE name code VARCHAR(45) NOT NULL,
|
||||||
|
ADD UNIQUE (code);
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE vn.accountDetailType
|
||||||
|
ADD COLUMN code VARCHAR(45) NOT NULL,
|
||||||
|
ADD UNIQUE (code);
|
|
@ -0,0 +1,9 @@
|
||||||
|
UPDATE vn.accountDetailType
|
||||||
|
SET code = CASE description
|
||||||
ivanm marked this conversation as resolved
Outdated
jgallego
commented
gasta el camp description, no es pot cambiar gastant id gasta el camp description, no es pot cambiar gastant id
|
|||||||
|
WHEN 'IBAN' THEN 'iban'
|
||||||
|
WHEN 'SWIFT' THEN 'swift'
|
||||||
|
WHEN 'Referencia Remesas' THEN 'remRef'
|
||||||
|
WHEN 'Referencia Transferencias' THEN 'trnRef'
|
||||||
|
WHEN 'Referencia Nominas' THEN 'payRef'
|
||||||
|
WHEN 'ABA' THEN 'aba'
|
||||||
|
END;
|
|
@ -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({
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "Identifier"
|
"description": "Identifier"
|
||||||
},
|
},
|
||||||
"name": {
|
"code": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Controller extends Section {
|
||||||
{
|
{
|
||||||
relation: 'mandateType',
|
relation: 'mandateType',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'name']
|
fields: ['id', 'code']
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
relation: 'company',
|
relation: 'company',
|
||||||
|
|
Loading…
Reference in New Issue
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.
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