8062-testToMaster_2 #3059

Merged
alexm merged 293 commits from 8062-testToMaster_2 into master 2024-10-03 05:43:41 +00:00
2 changed files with 8 additions and 6 deletions
Showing only changes of commit 8607a60ca7 - Show all commits

View File

@ -3,9 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`stockBought_calcula
BEGIN BEGIN
/** /**
* Inserts the purchase volume per buyer * Inserts the purchase volume per buyer
* into stockBought according to the date. * into stockBought according to the current date.
*
* @param vDated Purchase date
*/ */
DECLARE vDated DATE; DECLARE vDated DATE;
SET vDated = util.VN_CURDATE(); 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( return Self.rawSql(
`SELECT e.id entryFk, `SELECT e.id entryFk,
i.id itemFk, i.id itemFk,
@ -47,8 +51,8 @@ module.exports = Self => {
JOIN volumeConfig vc JOIN volumeConfig vc
WHERE t.warehouseInFk = ac.warehouseFk WHERE t.warehouseInFk = ac.warehouseFk
AND it.workerFk = ? AND it.workerFk = ?
AND t.shipped = ?`, AND t.shipped = util.VN_CURDATE()`,
[workerFk, new Date(dated)] [workerFk]
); );
}; };
}; };