feat: refs #7346 #2864

Merged
jgallego merged 10 commits from 7346 into dev 2024-08-22 09:30:28 +00:00
6 changed files with 17 additions and 5 deletions
Showing only changes of commit 618baaf604 - Show all commits

View File

@ -97,7 +97,7 @@ BEGIN
AND (vCorrectingSerial = vSerial OR NOT hasAnyNegativeBase())
THEN
-- el trigger añade el siguiente Id_Factura correspondiente a la vSerial
-- el trigger añade el siguiente ref correspondiente a la vSerial
INSERT INTO invoiceOut(
ref,
serial,

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.invoiceOutSerial
MODIFY COLUMN `type` enum('global','quick','multiple') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL;

View File

@ -0,0 +1,3 @@
UPDATE vn.invoiceOutSerial
SET `type`='multiple'
WHERE `description` LIKE '%multiple%';

View File

@ -75,7 +75,7 @@ module.exports = Self => {
AND c.isTaxDataChecked
AND c.isActive
AND NOT t.isDeleted
GROUP BY c.id, IF(c.hasToInvoiceByAddress, a.id, TRUE)
GROUP BY IF(c.hasToInvoiceByAddress, a.id, c.id)
HAVING SUM(t.totalWithVat) > 0;`;
const addresses = await Self.rawSql(query, [

View File

@ -28,6 +28,11 @@ module.exports = Self => {
type: 'number',
description: 'The company id to invoice',
required: true
}, {
arg: 'serialType',
type: 'string',
description: 'Type of serial',
required: true
}
],
returns: {
@ -74,10 +79,9 @@ module.exports = Self => {
], options);
}
const invoiceType = 'G';
const invoiceId = await models.Ticket.makeInvoice(
ctx,
invoiceType,
serialType,
args.companyFk,
args.invoiceDate,
null,

View File

@ -20,6 +20,9 @@
},
"isCEE": {
"type": "boolean"
},
"type": {
"type": "string"
}
},
"relations": {