Line Items in a Custom Module

  1. In a custom module in modules/modulename/vardefs.php file and localization file (/en-us.lang.php) define the fields and relationships (AOS_Products_Quotes and AOS_Line_Item_Groups):
    ā€˜LBL_IMPORT_LINE_ITEMS’
    ā€˜LBL_LINE_ITEMS’
    ā€˜LBL_GRAND_TOTAL’
    ā€˜LBL_TOTAL_AMT’
    ā€˜LBL_TAX_AMOUNT’
    ā€˜LBL_SUBTOTAL_AMOUNT’
    ā€˜LBL_SHIPPING_AMOUNT’
    ā€˜LBL_SHIPPING_TAX_AMT’
    ā€˜LBL_DISCOUNT_AMOUNT’
    ā€˜LBL_ADD_PRODUCT_LINE’
    ā€˜LBL_ADD_SERVICE_LINE’
    ā€˜LBL_REMOVE_PRODUCT_LINE’
    ā€˜LBL_SERVICE_NAME’
    ā€˜LBL_SERVICE_LIST_PRICE’
    ā€˜LBL_SERVICE_PRICE’
    ā€˜LBL_SERVICE_DISCOUNT’
    ā€˜LBL_VAT_AMT’
    ā€˜LBL_TOTAL_PRICE’
    ā€˜LBL_PRODUCT_QUANITY’
    ā€˜LBL_PRODUCT_NAME’
    ā€˜LBL_PART_NUMBER’
    ā€˜LBL_PRODUCT_NOTE’
    ā€˜LBL_PRODUCT_DESCRIPTION’
    ā€˜LBL_LIST_PRICE’
    ā€˜LBL_DISCOUNT_AMT’
    ā€˜LBL_UNIT_PRICE’
    ā€˜LNK_LIST’


My custom module name: acts_company_acts
This fields and relationships copy from AOS Invoices (vardefs.php) (By changing the name of the module to yours ).

  1. Copy from AOS_Invoices.php function ( public function save($check_notify = false)) to you custom module main class (my class ā€œacts_company_acts extends Basicā€)

  2. Copy PANNEL settings edit view, detail view and panel view from AOS_Invoices to (custom/modules/custommodules/metadata/editviewdefs.php, custom/modules/custommodules/metadata/detailviewdefs.php)

  3. Repair and Rebuild (with updating database fields)

Everything should work.

1 Like