feat: refs #7346 #2864
|
@ -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,
|
||||
|
|
|
@ -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;
|
|
@ -0,0 +1,3 @@
|
|||
UPDATE vn.invoiceOutSerial
|
||||
SET `type`='multiple'
|
||||
WHERE `description` LIKE '%multiple%';
|
|
@ -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, [
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
},
|
||||
"isCEE": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
@ -35,4 +38,4 @@
|
|||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue