feat: refs #6942 add Insert
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-03-26 13:41:53 +01:00
parent 72baf1e80e
commit 94f6d20bb1
2 changed files with 38 additions and 10 deletions

View File

@ -3738,16 +3738,7 @@ INSERT INTO vn.parkingLog(originFk, userFk, `action`, creationDate, description,
INSERT INTO vn.ticketLog (originFk,userFk,`action`,creationDate,changedModel,newInstance,changedModelId,changedModelValue) INSERT INTO vn.ticketLog (originFk,userFk,`action`,creationDate,changedModel,newInstance,changedModelId,changedModelValue)
VALUES (18,9,'insert','2001-01-01 11:01:00.000','Ticket','{"isDeleted":true}',45,'Super Man'); VALUES (18,9,'insert','2001-01-01 11:01:00.000','Ticket','{"isDeleted":true}',45,'Super Man');
INSERT INTO `vn`.`accountReconciliation` ( INSERT INTO `vn`.`accountReconciliation` (supplierAccountFk,operationDated,valueDated,amount,concept,debitCredit,calculatedCode,created)
supplierAccountFk,
operationDated,
valueDated,
amount,
concept,
debitCredit,
calculatedCode,
created
)
VALUES VALUES
(241,'2023-12-13 00:00:00.000','2023-12-07 00:00:00.000',19.36,'BEL 1',1,'2','2023-12-14 08:39:53.000'), (241,'2023-12-13 00:00:00.000','2023-12-07 00:00:00.000',19.36,'BEL 1',1,'2','2023-12-14 08:39:53.000'),
(241,'2023-12-13 00:00:00.000','2023-12-07 00:00:00.000',30226.43,'BEL 2',1,'1','2023-12-14 08:39:53.000'), (241,'2023-12-13 00:00:00.000','2023-12-07 00:00:00.000',30226.43,'BEL 2',1,'1','2023-12-14 08:39:53.000'),

View File

@ -25,5 +25,42 @@ BEGIN
ORDER BY calculatedCode, id ORDER BY calculatedCode, id
) sub2 ON ar.id = sub2.id ) sub2 ON ar.id = sub2.id
SET ar.calculatedCode = sub2.newId; SET ar.calculatedCode = sub2.newId;
INSERT INTO till(
dated,
isAccountable,
serie,
concept,
`in`,
`out`,
bankFk,
companyFk,
warehouseFk,
supplierAccountFk,
calculatedCode,
InForeignValue,
OutForeignValue,
workerFk
)
SELECT ar.operationDated dated,
TRUE isAccountable,
'MB' serie,
ar.concept,
@totalIn := IF(ar.debitCredit = arc.debitCredit2 AND a.currencyFk = arc.currencyFk, ar.amount, NULL) `in`,
@totalOut := IF(ar.debitCredit = arc.debitCredit AND a.currencyFk = arc.currencyFk, ar.amount, NULL) `out`,
a.id bankFk,
sa.supplierFk companyFk,
arc.warehouseFk,
ar.supplierAccountFk,
ar.calculatedCode,
@totalIn InForeignValue,
@totalOut OutForeignValue,
account.myUser_getId() user
FROM accountReconciliation ar
JOIN supplierAccount sa ON sa.id = ar.supplierAccountFk
JOIN accounting a ON a.id = sa.accountingFk
LEFT JOIN till t ON t.calculatedCode = ar.calculatedCode
JOIN accountReconciliationConfig arc
WHERE t.id IS NULL;
END$$ END$$
DELIMITER ; DELIMITER ;