Invoice Pre-saving Hook (R-ITOTAL.MAC)
The script file must be located in your CAPITAL program directory and must have the file name R-ITOTAL.MAC. It is executed just before an invoice system transaction is saved. (This may include adjustment notes, stock transfers, and other types of invoicing related transactions.)
Entry Values
|
Variable |
Purpose |
|
Mode |
0 = normal. 1 = bulk generation of invoices. E.g., when releasing multiple invoices via service manager global invoicing or back order release. |
|
Action |
This is a 4 element array with the following structure: 1st form name number of copies to print of 1st form 2nd form name number of copies to print of 2nd form |
Return Values
Return FALSE to cancel saving the transaction.
Comments
You may use this script to perform some action just before a transaction is saved. For example, the opening
of a cash draw or the update of the message that appears on a POS display terminal.
Example #1 - Open A Cash Draw
The following script "shells out" to a utility program that opens a cash draw.
* Open Cash Draw by Running Drawopen.exe program
RunApplication("Drawopen.exe", 0)
Return TRUE
Example # 2 Open a Cash Draw
The following script opens a cash draw by sending ASCII control codes to LPT1 if the first form to print is called docket.sty and the number of copies to print is greater than zero.
* Send control codes ASCII 27, 255 and 0 to LPT1
If Upper(Action[1]) == "DOCKET" .And. Action[2] > 0
SendDirect( { 27, 255, 0 }, "LPT1")
Endif
Return TRUE
Also
see the Invoice
Payment Prompt Hook.
____________________________
Related Topics:
Transaction Column Script Functions
![]() |