ExtensionExample

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Purpose

This tutorial works through a practical example of adding new functionality to Adempiere.

Business Requirement

The business requirement we will address with this customization is that of selling to customers and allowing a deferred settlment similar to a credit sale. The difference is that a third party may provide the credit and this creates a number of business requirements such as sending the invoice to the credit provider to request payment.

The requirement in detail is:

  • when a customer purchases something, they may request the purchase to be financed. When booking the sales order, we would like to select the credit provider when the "interest free credit" option is selected as the settlement method (as opposed to cash, cheque or credit card).
  • we want to know then a "interest free credit" order has been delivered so that we can send the invoice to the credit provider
  • we want to maintain a list of credit providers (to be selected by sales staff when the customer settles by this method)
  • we want to control the credit against the credit provider (not the end customer)
  • the customer may pay a deposit which is not financed
  • the credit provider will settle the invoice less a percentage which is a commission on the deal

Solution Overview

  • add a flag to business partner to mark the business parter as a credit provider
  • add a payment type credit provider (for interest free credit)
  • extend the payment type to allow for the selection of a credit provider business partner
  • create a report to show sales by credit provider and their status
  • modify print invoices to include option for credit provider
  • document receipting of credit provider payments including charge for commission as part settlement

Solution Detail

Add Credit Option

Part 1 - Create the tender type

- Log in as System Administrator
- Application Dictionary -> Reference
- Search for C_Payment 
- Select the _Payment Payment Rule

This reference list is where the different tender types are located. It is a list validation.

- Click on the List Validation Tab
- Add a new record and complete the following fields
    - Search Key: 3
    - Name: Third Party Credit

Part 2 - Create the credit provider table & screen

- Create an element IsCreditProvider
    - DBColumn Name: IsCreditProvider
    - Name: IsCreditProvider
    - Print Text: Credit Provider
    - Description: Flags whether a Business partner is a credit provider
- Create an element CreditProviderID
    - DBColumn Name: CreditProviderID
    - Name: CreditProviderID
    - Print Text: Credit Provider
    - Description: The Business Partner ID of the credit provider
- Create a new field on the C_BPartner Table
    - DBColumn Name: IsCreditProvider
- Create a new fields on the C_Order Table
    - DBColumn Name: CreditProviderID
- Add a new reference BPartner CreditProvider
- Add the field to the business partner screen
    - Is Credit Provider (on the vendor tab)
- Add the CreditProviderID field to the Sales Order Screen
- Add the logic to the Sales Order screen to display and select a credit provider (when the third party payment method is selected)



Part 3 - Extend the sales Order Window

- Add the field to the sales order screen