hotFix(getBalance): date setHours to 0 #2390

Merged
alexm merged 4 commits from hotFix_getBalance into master 2024-05-02 06:27:56 +00:00
1 changed files with 4 additions and 1 deletions

View File

@ -27,8 +27,11 @@ module.exports = Self => {
const where = filter.where; const where = filter.where;
const query = 'CALL vn.item_getBalance(?, ?, ?)'; const query = 'CALL vn.item_getBalance(?, ?, ?)';
if (where?.date) {
where.date = new Date(where.date);
where.date.setHours(0, 0, 0, 0);
}
const [diary] = await Self.rawSql(query, [where.itemFk, where.warehouseFk, where.date], myOptions); const [diary] = await Self.rawSql(query, [where.itemFk, where.warehouseFk, where.date], myOptions);
for (const entry of diary) for (const entry of diary)
if (entry.clientType === 'loses') entry.highlighted = true; if (entry.clientType === 'loses') entry.highlighted = true;