Hi Everyone,
The purpose of this document is to share some of the ADempiere and iDempiere, open source ERP, credit management notes I have created in the past. Please be quick to ask questions. I will include your answers in this post.
New Business Partners (BP)
For strict assignment of credit, you can default a business partner’s Credit Status to ‘Credit Stop’. Doing so forces users to update the Credit Status according to the BP’s situation. It is not advised to leave the default credit status to No Credit.
Credit Status Details
- System typically sets Credit Hold – system will clear when the BP is back in good status.
- System typically sets Credit Watch – system calculates based on the BP Group’s credit watch ratio. System will clear when the BP is back in good status.
- Users sets Credit Stop – system will not clear when the BP is back in good status.
- Credit Limit – $0 sets to unlimited. This value is ignored when Payment Rule is Credit Stop or No Credit.
- No Credit – do not use the system credit management.
Sales Order Credit Check Description
The below offers some insight into how the code works.
- Checks if isSOTrx = ‘Y’ (Customer Quote, Sales Order, etc…)
- If BP CreditStatus = CreditStop or CreditHold ⇒ Return invalid thus do not let the order complete.
- Credit threshold is determined by adding the order’s total to the BP’s current open and checking credit status.
- Geek: MBPartner.getSOCreditStatus(orderAmt);
Shipment Credit Check Description
Shipment Credit Check Description:
- Shipment checks credit during PrepareIt(). It gets the sum of all not invoiced amts and adds the BP’s Open Balance and check status.
- Geek: MBPartner.getSOCreditStatus(notInvoicedAmt)
Notice that the shipment’s credit check is much stronger than the sales order. The sales order only adds itself to the current open balance; however, the shipment adds all ‘not invoiced amounts’ or all not invoiced sales orders to the current open balance. Most people ask me to change the code to reverse this behavior to ensure credit issues can be handled within a sales environment and not in a warehouse environment.
Get Not Invoiced Amount
Non-Geek: sum all not invoiced sales order lines and add to the BP Credit balance.
Geek:
SELECT COALESCE(SUM(COALESCE(currencyBase((ol.QtyDelivered-ol.QtyInvoiced)*ol.PriceActual,o.C_Currency_ID,o.DateOrdered, o.AD_Client_ID,o.AD_Org_ID) ,0)),0)
FROM C_OrderLine ol
INNER JOIN C_Order o ON (ol.C_Order_ID=o.C_Order_ID)
WHERE o.IsSOTrx=’Y’ AND Bill_BPartner_ID=?
I hope this helps!!
About Chuck Boecking: I am an ERP educator. I believe that open source ERP have achieved mainstream capabilities, and as a result, more companies can create greater efficiency across their organization. I started using the iDempiere code base in 2003. Back then, it was called Compiere. In 2006, I started my first multi-million dollar installation. Since then, ADempiere has helped me create great success with distribution and manufacturing companies all over the world. My vision of success is to find companies that can best use open source ERP to help them achieve a single, global instance that drives a discontinuous increase in profitability. I believe that organizations win when they own their technology.
If you have questions, comments or concerns, let me know. I definitely want your feedback.
You can contact me by phone using 512.850.6068.
My email is chuck@chuboe.com.
You can complete the form on this page.
Thank you for taking the time. I look forward to speaking with you.
Regards,
Chuck Boecking
http://www.linkedin.com/pub/chuck-boecking/10/970/17b