QAD 2017 Enterprise Edition > User Guides > Sales > Container and Line Charges > Sample Programs
  
Sample Programs
Using the Container and Line Charges module, you can create and use custom Progress programs to customize charge calculation programs to calculate container and line charges. This is specified in the Run Program field of Charge Type Maintenance.
The following includes a portion of a sample charge type program. Use this sample to determine the input and output parameters that you need to include in your custom programs.
Sample Charge Type Program
/* PARAMETERS:
* ip_price - unit price to be used in calculations. When pricing
* containers this value is from Item Master (pt_mstr)
* or Ship-To Container Price List (cclscd_det). When
* doing a Line Charge calculation, this value is from
* the Sales Order Line Charge (sodlc_det) or Shipment
* Detail Line Charge (absl_det).
*
* ip_so_recid - recid of the Sales Order Master (so_mstr).
* Valid recid at Sales Order Maintenance and
* Sales Order Print. All other times "?".
* ip_sod_recid - recid of the Sales Order Detail (sod_det)
* Valid recid at Sales Order Maintenance and
* Sales Order Print. All other times "?".
* ip_sodlc_recid - recid of the sales order Line Charge (sodlc_det)
* Valid recid at Sales Order Maintenance and
* Sales Order Print when calculating line charges.
* All other times "?".
* ip_abs_recid - recid of the ASN/BOL Shipper Master (abs_mstr)
* Valid recid when calculating container charges
* during shipper and invoice functions.
* All other times "?".
* ip_absl_recid - recid of the Shipment Det Line Charge (absl_det)
* Valid recid when calculating line charges for
* shipper. All other times "?".
* op_price - extended price of the container or line charge,
* returned to the calling program.
*/
/* THIS PROGRAM RETURNS THE UNIT PRICE TO THE CALLING PROGRAM WITHOUT
* ANY ADDITIONAL CALCULATIONS THUS REPRESENTING A "FLAT" CHARGE
*/
define input-output parameter ip_price like pt_price no-undo.
define input parameter ip_so_recid as recid no-undo.
define input parameter ip_sod_recid as recid no-undo.
define input parameter ip_sodlc_recid as recid no-undo.
define input parameter ip_abs_recid as recid no-undo.
define input parameter ip_absl_recid as recid no-undo.
define output parameter op_price like pt_price no-undo.
op_price = ip_price.