When a new customer migrates to Dynamics 365, they often need to add their available stock to the D365 environment. Typically, customers use movement or counting journals to add on-hand inventory, which is still considered for rebate deals.
After setting up a rebate deal and running the rebate workbench, an error occurs for items added using the movement journal. The error message states: "The inventory quantity or item %1 is zero, so the rebate amount will be zero."
This error originates from the TAMRebateJournalTransSalesInvoice class, specifically in the calcAmoutPurchLastest method. A code review indicates that the rebate calculation only validates amounts from the VendInvoiceTrans table, which is based on the latest vendor invoice transaction from the purchase order invoice journal. Since the customer uses the movement journal to add on-hand inventory, no vendor invoice journal is created.
This issue occurs only for new customers migrating to Dynamics 365. Therefore, we seek new development to calculate rebates that consider movement journals or counting journals as well.
Thank you!