Maintain Commission Script: Difference between revisions

From eStream Software
Line 12: Line 12:


==To Create New Commission Script==
==To Create New Commission Script==
:1. See the below screemshot.
:1. Click on '''NEW'''. See the below screemshot.
::[[File:Tools-Maintain Commission Script-02.jpg |500px]]
::[[File:Tools-Maintain Commission Script-02.jpg |500px]]
<br />
<br />

Revision as of 09:27, 19 January 2016

Menu: Tools | Maintain Commission Script...

Introduction

To execute a simple commission script to determine the commission rate based on the payment age (Payment Date - Invoice Date).
Sales Commission Script module is required.


Maintain Commission Script

Browse mode in Maintain Style. See the below screenshot.
Tools-Maintain Commission Script-01.jpg


To Create New Commission Script

1. Click on NEW. See the below screemshot.
Tools-Maintain Commission Script-02.jpg


Field Name Explanation
Code Input the new code.
Description Input the commission script description.
Script Load the commission script.


2. Example of the scripts:
a. Script 1
OnOpen Script
procedure CalculateCommission(AKODocAmt, AAge: variant; var Value: variant);
begin
  if AAge < 10 then
    Value := AKODocAmt * 0.05
  else if AAge < 20 then
    Value := AKODocAmt * 0.03
  else if AAge < 30 then
    Value := AKODocAmt * 0.02
  else
    Value := AKODocAmt * 0.005;
end;


b. Script 2
OnOpen Script
ObjectPascal
begin
  Amount:= Qty * UnitPrice * 0.5;
end;