------------------------------------------------------------- Retail Application (RA) Clean Receipt User Exit Documentation ------------------------------------------------------------- The purpose of this document is to provide user exit interface details for the clean receipt enhancement in RA V1.03.00 and later. This information should make it easier for user exit print modifications to be integrated with the clean receipt enhancement in RA. ------------------------------------------------------------------------------ There are 4 parts to a RA receipt: Header lines Items or other detail lines Tendering info lines Trailer lines The above information will be usefull as you read the rest of this document. ------------------------------------------------------------------------------ There is a new variable called G->clean which is available to the user exits. There are 3 possible values for this variable which can be found in regdef.h: CLEAN_OFF --> clean receipt is turned OFF in personalization CLEAN_ON --> clean receipt is turned ON in personalization CLEAN_ON_NOW --> clean receipt is turned ON in personalization and we are currently in the process of printing a clean receipt in the current transaction. When the clean receipt printing is complete the G->clean value will return to CLEAN_ON. ------------------------------------------------------------------------------ The second receipt linked list has been modified from previous releases of RA. The linked list is no longer just for second receipt info. The new layout for each node in the list is defined in regdef.h: // used for receipt linked list typedef struct { char second_receipt; char print_clean_items_here; char s[40]; } RECEIPT_BUFFER; The node now contains a second_receipt indicator which lets the application know that this is a line that should be printed on the second receipt. With clean receipt turned ON, the receipt linked list stores the header and trailer lines for the clean receipt that will print at the end of the transaction. Tender lines are always stored in the linked list. With clean receipt turned ON, item detail is not stored in the linked list. Instead, when the FIRST item line is encountered, a node is added to the list with the indicator for print_clean_items_here set to 1. No additional line items in the transaction will be added to the receipt linked list after the first line item. When the clean receipt is being printed at the end of the transaction, the print_clean_items_here indicator will tell the clean receipt logic to insert all item detail lines at this place in the receipt. ------------------------------------------------------------------------------ With the clean receipt turned OFF in RA, the user exit user_print_line() will be called in the same manner as on previous releases of RA. ------------------------------------------------------------------------------ With the clean receipt turned ON in RA, the user exit user_print_line() will be called as follows for each print line as the transaction progresses: Header lines, Tendering lines, and Trailer lines: These lines will be passed to user_print_line() with the correct print_state but with the "unmodified" print station. This means that the print station may be set to RECEIPT_JOURNAL even though this line is only printing to the JOURNAL at this time. This is the time for the user exit to do any modification to these lines because it will cause the line to be modified when it is printed to the journal/EJ and also when it is saved in the receipt linked list to be printed on the clean receipt later. Item/detail Lines: These lines will be passed to user_print_state() with the correct print_state and with the correct print station. This means that these lines will have print stations like JOURNAL_STATION or EJ_STATION. The user_print_line() user exit should modifiy these lines if a change is required to the journal or EJ. When the transaction is complete, the clean receipt function takes over and starts to print the clean receipt. At this point the G->clean value changes from CLEAN_ON to CLEAN_ON_NOW. The print lines are passed to the user_print_line() user exit during the clean receipt printing as well. The user_print_line() user exit will be called as follows: Header lines, Tendering lines, and Trailer lines: These lines are passed to user_print_line() with a print_state of PRT_CLEAN_RECEIPT_LINE instead of the true print_state for each line. This is why it is important to perform any modification to the line during the first call to user_print_line() when you will get the true print_state for each line. The print station will be set to RECEIPT_STATION for these lines. Item/detail Lines: These lines are passed to user_print_line() with the true print_state. If any modifications to the receipt are required for these line then it is done at this time. Remember that you made the same modifications to these lines when they were printed to the EJ and/or journal during the first call to user_print_line(). The print station for these lines will be RECEIPT_STATION. The G->clean value will be reset to CLEAN_ON when the clean receipt printing is complete. ------------------------------------------------------------------------------