Date Material Policy and Movement Attributes

The purpose of this post is to discuss the Date Material Policy field as it relates to storage (M_Storage and M_StorageOnHand). The concept of Date Material Policy was introduced in the early days of iDempiere. The ticket does a good job of explaining the problems they are trying to solve. As a result of Date Material Policy, reviewing storage becomes more interesting. Not only do you need to worry about Locators and Attribute Set Instances, you now need to worry about dates. Specifically, the date the material was added (MR, Phy Inv, etc...) to the system. If you do not want to see these dates, simply create a custom view that sums qty by Product, Locator and Attribute Set Instance. How does iDempiere use the Date Material Policy field?
  1. When product quantity is added to the system via a document (Material Receipt, Physical Inventory, Production for finished products, etc...), the system makes note of the date.
  2. When product is consumed or removed (Shipment, Physical Inventory, Production for raw goods, etc..) the system looks for a record in M_StorageOnHand with a date that best matches the Material Policy specified in your Product Category or Client.
  3. To review or audit the system, perform the following test
    1. Log into iDempiere is a default date of 1 month ago (any previous date)
    2. Create a new product
    3. Create and complete a new Purchase Order with your new product
    4. Create and complete a Material Receipt
    5. Review the Material Receipt => Line sub-tab => Attribute sub-tab
    6. Zoom to the Product window => Located At sub-tab to confirm the results
    7. Log out to change the default date to today's date
    8. Create and complete a Sales Order with your new product
    9. Create and complete a Shipment
    10. Review the Shipment window => Line sub-tab => Attribute sub-tab
    11. Confirm the system chose the same date at the original Material Receipt.
    12. Zoom to the Product window => Located At sub-tab to confirm the results
  4. A more comprehensive test would involve multiple Material Receipts spread over different dates.
The only time I have seen iDempiere lose its accuracy in regards to Date Material Policy is with the Libero manufacturing plugin. It does not seem to correctly consume storage records. As a result, you end up with hundreds of records with erroneous quantities; however, when you sum the quantity, the total is accurate.