#7896 - 24.36 Dev To Test #2884
|
@ -97,7 +97,7 @@ BEGIN
|
||||||
AND (vCorrectingSerial = vSerial OR NOT hasAnyNegativeBase())
|
AND (vCorrectingSerial = vSerial OR NOT hasAnyNegativeBase())
|
||||||
THEN
|
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(
|
INSERT INTO invoiceOut(
|
||||||
ref,
|
ref,
|
||||||
serial,
|
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.isTaxDataChecked
|
||||||
AND c.isActive
|
AND c.isActive
|
||||||
AND NOT t.isDeleted
|
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;`;
|
HAVING SUM(t.totalWithVat) > 0;`;
|
||||||
|
|
||||||
const addresses = await Self.rawSql(query, [
|
const addresses = await Self.rawSql(query, [
|
||||||
|
|
|
@ -28,6 +28,11 @@ module.exports = Self => {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
description: 'The company id to invoice',
|
description: 'The company id to invoice',
|
||||||
required: true
|
required: true
|
||||||
|
}, {
|
||||||
|
arg: 'serialType',
|
||||||
|
type: 'string',
|
||||||
|
description: 'Type of serial',
|
||||||
|
required: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -74,10 +79,9 @@ module.exports = Self => {
|
||||||
], options);
|
], options);
|
||||||
}
|
}
|
||||||
|
|
||||||
const invoiceType = 'G';
|
|
||||||
const invoiceId = await models.Ticket.makeInvoice(
|
const invoiceId = await models.Ticket.makeInvoice(
|
||||||
ctx,
|
ctx,
|
||||||
invoiceType,
|
serialType,
|
||||||
args.companyFk,
|
args.companyFk,
|
||||||
args.invoiceDate,
|
args.invoiceDate,
|
||||||
null,
|
null,
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
},
|
},
|
||||||
"isCEE": {
|
"isCEE": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
|
Loading…
Reference in New Issue