I have a problem when shipping products with instance attributes from a warehouse that does not allow negative stock .
When creating a physical inventory, the record in M_StorageOnHand presents DateMaterialPolicy column , with the creation date attribute.
When created the movement of stock with different date the physical inventory , the Target Instance 'inherits' the DateMaterialPolicy column "from" Instance , but the creation date is still being standard.
When create the shipment with Target Instance, to complete is not found a record in the Storage for date Creation of Instance , giving exception of negative stock .
I believe the correct, should find an instance to date of policy and not by creation date.
looking at jira i saw some related issues about this:
Just for noting - MMovement is fine - the if and else there are different - ASI vs ASI_To - my mistake that I misread it first.
Hiep Lq June 25, 2017 at 4:24 AM
i saw you already remove duplicate code.
Hiep Lq June 25, 2017 at 4:01 AM
on investigate issue IDEMPIERE-3406, at first i think commit here is reason (assumption at my 2nd comment). finally i figure out reason and open
i still keep open because duplicated code mean mistake of logic when codding just not yet find out test case, so i ask for why have this logic.
as you find out reason and will fix also from MMovement please help me close this or let it open to tracking up to you.
Carlos Ruiz June 24, 2017 at 11:00 PM
Thanks for checking that code.
Seems like duplicated code was introduced by a copy/paste from MMovement into MInout
I'll fix the reversed code, but wondering if there is still and issue here as you reopened this ticket. Can you please describe the issue to review it?
Hiep Lq June 22, 2017 at 11:13 AM
Edited
block code below break logic description at
1. We always use Movement date on DareMaterialPolicy when adding new stock (On MR, Physical Inventory or production)
============== product with ASI treatment difference. so ignore this comment.
I have a problem when shipping products with instance attributes from a warehouse that does not allow negative stock .
When creating a physical inventory, the record in M_StorageOnHand presents DateMaterialPolicy column , with the creation date attribute.
When created the movement of stock with different date the physical inventory , the Target Instance 'inherits' the DateMaterialPolicy column "from" Instance , but the creation date is still being standard.
When create the shipment with Target Instance, to complete is not found a record in the Storage for date Creation of Instance , giving exception of negative stock .
I believe the correct, should find an instance to date of policy and not by creation date.
looking at jira i saw some related issues about this:
https://idempiere.atlassian.net/browse/IDEMPIERE-2615
https://idempiere.atlassian.net/browse/IDEMPIERE-2564