Packing Slip Posting on different date when compared to systemdateget()/today()

Hi,

I have created a batch job to post packing slip for the POs which have registered line items.

Once a work order is created, the batch job processes the PurchLines and posts the packing slip every hour.

My issue is with the transaction date on which the packing slip is being posted. it sometimes posts with the transdate as “today() - 1” or 'today() + 1".

Below is the code for the same:

pastedimage1497271356175v1.png

pastedimage1497271356175v2.png

Below is the example of the inconsistency we are facing:

pastedimage1497271356175v3.png

If you see the above fig, the work order was created on 6/8/2017 at 3:40 pm. My batch job ran at 4:00 pm. The product receipt journal should have been updated with the date 6/8/2017, instead it is updating with date 6/9/2017.

pastedimage1497271356175v4.png

This is causing data inconsistency issues during reporting.

Any insight would be helpful.

Thanks in advance!

S.

It could be an issue with the time zone. Are the time zones different for AOS and batch server?