fix(payMethod): alter colums name
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2021-11-19 10:07:33 +01:00
parent c101bbb6be
commit 8f2e29787b
7 changed files with 9 additions and 7 deletions

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.payMethod CHANGE ibanRequiredForClients isIbanRequiredForClients tinyint(3) DEFAULT 0 NULL;
ALTER TABLE vn.payMethod CHANGE ibanRequiredForSuppliers isIbanRequiredForSuppliers tinyint(3) DEFAULT 0 NULL;

View File

@ -217,7 +217,7 @@ UPDATE `vn`.`agencyMode` SET `web` = 1, `reportMail` = 'no-reply@gothamcity.com'
UPDATE `vn`.`agencyMode` SET `code` = 'refund' WHERE `id` = 23; UPDATE `vn`.`agencyMode` SET `code` = 'refund' WHERE `id` = 23;
INSERT INTO `vn`.`payMethod`(`id`,`code`, `name`, `graceDays`, `outstandingDebt`, `ibanRequiredForClients`, `ibanRequiredForSuppliers`) INSERT INTO `vn`.`payMethod`(`id`,`code`, `name`, `graceDays`, `outstandingDebt`, `isIbanRequiredForClients`, `isIbanRequiredForSuppliers`)
VALUES VALUES
(1, NULL, 'PayMethod one', 0, 001, 0, 0), (1, NULL, 'PayMethod one', 0, 001, 0, 0),
(2, NULL, 'PayMethod two', 10, 001, 0, 0), (2, NULL, 'PayMethod two', 10, 001, 0, 0),

View File

@ -138,7 +138,7 @@ module.exports = Self => {
function hasIban(err, done) { function hasIban(err, done) {
Self.app.models.PayMethod.findById(this.payMethodFk, (_, instance) => { Self.app.models.PayMethod.findById(this.payMethodFk, (_, instance) => {
if (instance && instance.ibanRequiredForClients && !this.iban) if (instance && instance.isIbanRequiredForClients && !this.iban)
err(); err();
done(); done();
}); });

View File

@ -25,10 +25,10 @@
"outstandingDebt": { "outstandingDebt": {
"type": "Number" "type": "Number"
}, },
"ibanRequiredForClients": { "isIbanRequiredForClients": {
"type": "boolean" "type": "boolean"
}, },
"ibanRequiredForSuppliers": { "isIbanRequiredForSuppliers": {
"type": "boolean" "type": "boolean"
} }
} }

View File

@ -19,7 +19,7 @@
vn-acl="salesAssistant" vn-acl="salesAssistant"
ng-model="$ctrl.client.payMethodFk" ng-model="$ctrl.client.payMethodFk"
data="paymethods" data="paymethods"
fields="['ibanRequiredForClients']" fields="['isIbanRequiredForClients']"
initial-data="$ctrl.client.payMethod"> initial-data="$ctrl.client.payMethod">
</vn-autocomplete> </vn-autocomplete>
<vn-input-number <vn-input-number

View File

@ -80,7 +80,7 @@ module.exports = Self => {
const supplierAccount = await Self.app.models.SupplierAccount.findOne({where: {supplierFk: this.id}}); const supplierAccount = await Self.app.models.SupplierAccount.findOne({where: {supplierFk: this.id}});
const hasIban = supplierAccount && supplierAccount.iban; const hasIban = supplierAccount && supplierAccount.iban;
if (payMethod && payMethod.ibanRequiredForSuppliers && !hasIban) if (payMethod && payMethod.isIbanRequiredForSuppliers && !hasIban)
err(); err();
done(); done();

View File

@ -24,7 +24,7 @@
vn-acl="salesAssistant" vn-acl="salesAssistant"
ng-model="$ctrl.supplier.payMethodFk" ng-model="$ctrl.supplier.payMethodFk"
data="paymethods" data="paymethods"
fields="['ibanRequiredForSuppliers']" fields="['isIbanRequiredForSuppliers']"
initial-data="$ctrl.supplier.payMethod"> initial-data="$ctrl.supplier.payMethod">
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete