Movements producting negative qtyStorageOnHand set date material policy to movement date

Description

When allowing negative inventory we run into an issue making a movement resulting in a negative quantity as the date material policy on the negative storage on hand entry is set to the movement date. The issue comes up when trying to consolidate the negative inventory from another warehouse with an existing date material policy not equal to the movement date as we are getting multiple storage on hand entries (one negative the other positive).

Being my first patch I'm not sure the attached one solves the issue with all side effects. If thats preferred I can also move the code to an own function (or extend the existing MStorageOnHand.getDateMaterialPolicy with additional query criteria)?

What I'm trying to do is to set the date material policy of the StorageMA to the oldest or newest date material policy with sufficient qtyOnHand. For my scenario that fixes the duplicate storage on hand issue (testing with FIFO).

Environment

not using ASIs

Attachments

1
  • 27 Mar 2016, 02:46 PM

Activity

Heng Sin Low 
September 13, 2017 at 7:27 AM

The patch is outdated. Please reopen with a new patch and test case if the problem is still there in current 4.1 code.

Won't Fix

Details

Assignee

Reporter

Components

Affects versions

Priority

Created March 27, 2016 at 2:40 PM
Updated November 1, 2017 at 11:51 AM
Resolved September 13, 2017 at 7:27 AM