8032-devToTest_2440 #3009
|
@ -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();
|
||||||
|
|
|
@ -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]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue