Merge pull request 'Hotfix: Fixed shipped date when it is null' (!3382) from Hotfix-PriceDifferenceShipped into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #3382
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Jon Elias 2025-01-28 07:21:58 +00:00
commit 6833dbe846
1 changed files with 4 additions and 1 deletions

View File

@ -108,7 +108,10 @@ module.exports = Self => {
// Get items movable
const ticketOrigin = await models.Ticket.findById(args.id, null, myOptions);
const differenceShipped = ticketOrigin.shipped.getTime() > args.shipped.getTime();
let shipped = ticketOrigin.shipped ?? ticketOrigin.updated;
const differenceShipped = shipped.getTime() > args.shipped.getTime();
const differenceWarehouse = ticketOrigin.warehouseFk != args.warehouseId;
salesObj.haveDifferences = differenceShipped || differenceWarehouse;