This commit is contained in:
parent
3c6920a094
commit
d10db686e5
|
@ -17,6 +17,7 @@ BEGIN
|
|||
DECLARE vHasDailyInvoice BOOL;
|
||||
DECLARE vWithPackage BOOL;
|
||||
DECLARE vHasToInvoice BOOL;
|
||||
DECLARE vSerial VARCHAR(2);
|
||||
|
||||
DECLARE cur CURSOR FOR
|
||||
SELECT ticketFk FROM tmp.ticket_close;
|
||||
|
@ -83,14 +84,17 @@ BEGIN
|
|||
GROUP BY e.freightItemFk);
|
||||
|
||||
IF(vHasDailyInvoice) AND vHasToInvoice THEN
|
||||
SELECT invoiceSerial(vClientFk, vCompanyFk, 'quick') INTO vSerial;
|
||||
IF NOT vSerial THEN
|
||||
CALL util.throw('Cannot booking without a serial');
|
||||
END IF;
|
||||
|
||||
-- Facturacion rapida
|
||||
CALL ticket_setState(vCurTicketFk, 'DELIVERED');
|
||||
-- Facturar si está contabilizado
|
||||
|
||||
IF vIsTaxDataChecked THEN
|
||||
CALL invoiceOut_newFromClient(
|
||||
vClientFk,
|
||||
(SELECT invoiceSerial(vClientFk, vCompanyFk, 'multiple')),
|
||||
vSerial,
|
||||
vShipped,
|
||||
vCompanyFk,
|
||||
NULL,
|
||||
|
|
Loading…
Reference in New Issue