7404-stockBuyed #2836
|
@ -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();
|
||||
|
|
|
@ -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]
|
||||
);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue