fix: refs #7382 invoiceIn_booking change
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-07-23 09:22:18 +02:00
parent 7c4032c859
commit bfd2b5aebb
1 changed files with 1 additions and 15 deletions

View File

@ -13,26 +13,12 @@ BEGIN
* @param vBookEntry Id de asiento, si es NULL se genera uno nuevo
*/
DECLARE vFiscalYear INT;
DECLARE vDistinctTransactions INT;
DECLARE vHasRepeatedTransactions BOOL;
SELECT COUNT(DISTINCT iit.transactionTypeSageFk) INTO vDistinctTransactions
FROM invoiceIn ii
JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
JOIN invoiceInSerial iis ON iis.code = ii.serial
WHERE iit.invoiceInFk = vSelf
AND iis.taxAreaFk = 'CEE'
AND iit.transactionTypeSageFk;
IF vDistinctTransactions > 1 THEN
CALL util.throw ('This invoice does not allow different types of transactions');
END IF;
SELECT TRUE INTO vHasRepeatedTransactions
FROM invoiceInTax
WHERE invoiceInFk = vSelf
GROUP BY transactionTypeSageFk
HAVING COUNT(transactionTypeSageFk) > 1
HAVING COUNT(DISTINCT transactionTypeSageFk) > 1
LIMIT 1;
IF vHasRepeatedTransactions THEN