feat: refs #7404 format date before select
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Pablo Natek 2024-09-11 07:56:08 +02:00
parent e20ef7c699
commit 8607a60ca7
2 changed files with 8 additions and 6 deletions

View File

@ -3,9 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`stockBought_calcula
BEGIN
/**
* Inserts the purchase volume per buyer
* into stockBought according to the date.
*
* @param vDated Purchase date
* into stockBought according to the current date.
*/
DECLARE vDated DATE;
SET vDated = util.VN_CURDATE();

View File

@ -23,7 +23,11 @@ module.exports = Self => {
}
});
Self.getStockBoughtDetail = async(workerFk, dated = Date.vnNew()) => {
Self.getStockBoughtDetail = async(workerFk, dated) => {
if (!dated) {
dated = Date.vnNew();
dated.setHours(0, 0, 0, 0);
}
return Self.rawSql(
`SELECT e.id entryFk,
i.id itemFk,
@ -47,8 +51,8 @@ module.exports = Self => {
JOIN volumeConfig vc
WHERE t.warehouseInFk = ac.warehouseFk
AND it.workerFk = ?
AND t.shipped = ?`,
[workerFk, new Date(dated)]
AND t.shipped = util.VN_CURDATE()`,
[workerFk]
);
};
};