diff --git a/db/routines/vn/triggers/accountReconciliation_beforeInsert.sql b/db/routines/vn/triggers/accountReconciliation_beforeInsert.sql index c586dc57e..4fedd62b8 100644 --- a/db/routines/vn/triggers/accountReconciliation_beforeInsert.sql +++ b/db/routines/vn/triggers/accountReconciliation_beforeInsert.sql @@ -3,13 +3,13 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`accountReconciliation BEFORE INSERT ON `accountReconciliation` FOR EACH ROW - SET NEW.calculatedCode = REPLACE( - REPLACE( - REPLACE( - REPLACE( - CONCAT(NEW.supplierAccountFk,NEW.operationDated,NEW.amount,NEW.concept,NEW.debitCredit) - ,' ','') - ,":",'') - ,'-','') - ,'.','')$$ -DELIMITER ; + SET NEW.calculatedCode = REGEXP_REPLACE( + CONCAT(NEW.supplierAccountFk, + NEW.operationDated, + NEW.amount, + NEW.concept, + CAST(NEW.debitCredit AS UNSIGNED) + ), + '[ :\\-.]', '' + )$$ +DELIMITER ; \ No newline at end of file diff --git a/db/routines/vn2008/views/gastos_resumen.sql b/db/routines/vn2008/views/gastos_resumen.sql index 02231bcbf..d40d6d229 100644 --- a/db/routines/vn2008/views/gastos_resumen.sql +++ b/db/routines/vn2008/views/gastos_resumen.sql @@ -2,6 +2,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vn2008`.`gastos_resumen` AS SELECT + `es`.`id` AS `id`, `es`.`expenseFk` AS `Id_Gasto`, `es`.`year` AS `year`, `es`.`month` AS `month`,