feat: refs #7348 hasDailyInvoice field #2670

Merged
jgallego merged 9 commits from 7348-client-hasDailyInvoice into dev 2024-07-15 12:16:32 +00:00
4 changed files with 24 additions and 11 deletions

View File

@ -34,20 +34,25 @@ BEGIN
DECLARE vIsTaxDataChecked TINYINT(1);
DECLARE vHasCoreVnl BOOLEAN;
DECLARE vMandateTypeFk INT;
DECLARE vHasDailyInvoice BOOLEAN;
SELECT defaultPayMethodFk,
defaultDueDay,
defaultCredit,
defaultIsTaxDataChecked,
defaultHasCoreVnl,
defaultMandateTypeFk
SELECT cc.defaultPayMethodFk,
cc.defaultDueDay,
cc.defaultCredit,
cc.defaultIsTaxDataChecked,
cc.defaultHasCoreVnl,
cc.defaultMandateTypeFk,
c.hasDailyInvoice
INTO vPayMethodFk,
vDueDay,
vDefaultCredit,
vIsTaxDataChecked,
vHasCoreVnl,
vMandateTypeFk
FROM clientConfig;
vMandateTypeFk,
vHasDailyInvoice
FROM clientConfig cc
LEFT JOIN province p ON p.id = vProvinceFk
LEFT JOIN country c ON c.id = p.countryFk;
INSERT INTO `client`
SET id = vUserFk,
@ -65,7 +70,8 @@ BEGIN
credit = vDefaultCredit,
isTaxDataChecked = vIsTaxDataChecked,
hasCoreVnl = vHasCoreVnl,
isEqualizated = FALSE
isEqualizated = FALSE,
hasDailyInvoice = vHasDailyInvoice
ON duplicate KEY UPDATE
payMethodFk = vPayMethodFk,
dueDay = vDueDay,

View File

@ -0,0 +1,2 @@
ALTER TABLE `vn`.`client`
ADD COLUMN `hasDailyInvoice` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Indica si el cliente requiere facturación diaria por defecto se copiará lo que tenga country.hasDailyInvoice';

View File

@ -99,6 +99,10 @@ module.exports = Self => {
{
arg: 'hasElectronicInvoice',
type: 'boolean'
},
{
arg: 'hasDailyInvoice',
type: 'boolean'
}
],
returns: {
@ -117,8 +121,6 @@ module.exports = Self => {
const myOptions = {};
const models = Self.app.models;
const args = ctx.args;
const userId = ctx.req.accessToken.userId;
const $t = ctx.req.__;
if (typeof options == 'object')
Object.assign(myOptions, options);

View File

@ -144,6 +144,9 @@
},
"recommendedCredit": {
"type": "number"
},
"hasDailyInvoice": {
"type": "boolean"
}
},