Documentation >
MAC-PAC Technical Library >
Distribution >
Order Processing >
Programs >
Consolidated Invoicing Selection - Purpose >
Consolidated Invoicing Selection - Calculations
Consolidated Invoicing Selection - Calculations
OP290E
A. Housekeeping
1. A parameter list is set up for the fast path, help screen, and valid values parameters.
2. Key lists are defined for each file retrieved by the program.
3. Workfields are defined and program constants are initialized.
4. The following records are retrieved from the Reference file (REFERP):
a. CPF File Access Status Codes are retrieved from Reference File category 015.
b. The date format record is retrieved from Reference File category 049. If flag is Y, format date as DDMMYY. If flag is N, format date as MMDDYY. If flag is A, format date as YYMMDD. If a record is not found, the date format defaults to MMDDYY.
c. The number of decimals for quantity fields is retrieved from Reference File category 446.
d. Valid Company/Warehouse combinations are retrieved from Reference File category 409. The default is taken from Reference File category 428.
e. System default values are retrieved from Reference File category 133 to determine if the system is operating in a book code and/or multi-currency environment and the currency level.
f. Home/Export codes are retrieved from Reference File category 406.
g. Invoice Release codes are retrieved from Reference File category 444.
h. Document format codes are retrieved from Reference File category G61.
5. The system processing parameter, company name (COMNAM), is retrieved from the System Control file (CT100M).
6. The program previous status (PRVSTS) is loaded with housekeeping (HSKPGS) and the program status (PGMSTS) is loaded with the next step value (NXTPRC).
B. Mainline
1. The Consolidated Billing Selection - Function Select screen (OP290S01) is displayed. This screen allows the user to enter criteria for selecting order shipments on to one invoice.
a. The screen is initialized and validated. For detailed validation rules, see the Screens Section of the Common Features User Manual. If any fields are invalid, the screen is redisplayed with the invalid fields highlighted and an appropriate error message displayed. Validation includes:
(1) The Company/Location combination (CZCCO/CZCLOC) is validated against Reference File category 132, Location Defaults. If the currency level in Reference File category 133 is defined at the company level then the company code is required and must be valid. If the environment specifies that the currency is defined at the company/location level then both company and location codes are required and must be valid. Company and location will be non-displayed if currency level is global.
(2) The customer file status is validated against the Customer Master file (ARCUSTL1). To be valid a customer, the record must be active and the transactions allowed flag must be set to Y. If the customer is not active or transactions are not allowed for the customer, invoices can still be generated but a warning message will be displayed on the screen.
(3) If the company/location and customer are valid, the other selection criteria: Currency code, A/R code, VAT included flag, Ship-to Country, and the Home/Export flag are defaulted from the Customer Master file (ARCUSTP)
(4) If other selection criteria fields are entered, their value overrides the default information. Each field that has been entered is validated. These values format the key fields that set limitations on the shipments that are eligible for consolidation.
|
|
Currency Code
|
Currency Rate Master File (CF240M)
|
A/R Code
|
Reference File category 333 - A/R Codes (REFERP)
|
Book Code
|
Reference File category 135 - Default Book Code (REFERP)
Reference File category 136 - Next Journal Number
|
VAT Included Flag
|
Must be Y or N, but must be N if operating in a non-VAT environment.
|
Home/Export Flag
|
Reference File category 406 - Home/Export (REFERP)
|
Ship Reason Code
|
Reference File category 413 - OP Systems Defaults Continuation, in Order Processing mode only.
Reference File category D05 - Transfer Control Default, in Transfer Control mode only.
|
Document Type
|
Reference File category 328 - Document Type Defaults,
|
b. If no errors have occurred, set the status indicators to perform the next step processing (PRVSTS = PGMSTS, PGMSTS = NXTPRC, and FMTSTS = FMTEND). If errors have occurred, the system retrieves the default values for the header screen. The Function Select screen is redisplayed with all fields in error highlighted.
c. Once the request is valid, all pending shipments that meet the specified criteria are retrieved from the Pending Invoice Header file (either ARPNDOL1 if the customer suffix is entered, or ARPNDOL2 if the customer suffix is not entered in OP mode; or ARPNDOL4 if the customer suffix is entered, or ARPNDOL5 if not entered, in TC mode.)
2. The Consolidated Billing - Detail screen (OP290S03) is displayed. This screen allows the user to select shipments to be consolidated on the invoice.
a. The screen is initialized and validated. For detailed validation rules, see the Screens Section of the Common Features User Manual. The only maintainable field on the screen is the select field for each order shipment. At least one of these fields must contain an 'X' to be processed.
b. If no errors have occurred, the detail screen will still be displayed warning the user to press F22-End Transaction to process the invoice. If errors have occurred, redisplay the Detail screen and highlight all fields in error.
c. Once pending shipments are selected and F22-End Transaction is pressed without validation errors, the next invoice number is retrieved from Reference File category 440 (this Reference file is also incremented and updated at this time), the Invoice Request Header file (OP290AP1) and Invoice Request Detail file (OP290AP2) are written for all the selected orders.
(i) Before the files are updated, warning messages will be sent to the user if records with payment terms or VAT declaration points are different from those specified for the header screen of the consolidated invoice.
d. The Invoice Request Header file triggers the Consolidated Billing Update Monitor.
3. The Consolidated Billing - Header screen (OP290S02) is displayed. This screen allows you to view the header information for the consolidated invoice being generated through this conversation.
a. The screen is initialized and validated. For detailed validation rules, see the Screens Section of the Common Features User Manual. If any fields are invalid, the screen is redisplayed with the invalid fields highlighted and an appropriate error message displayed. Validation includes several date calculations, including:
Date
|
|
Calculations
|
|
Due Date
|
|
If the End-Of-Month flag is N (no),
|
|
|
Due Date
|
equals
|
Due Days
(from RFC 323)
|
plus
|
Document Date
|
|
|
|
|
|
|
|
|
|
|
If the End-Of-Month flag is Y (yes),
|
|
|
Due Date
|
equals
|
Due Days
(from Payment Terms)
|
plus
|
Last day of month in Document Date
|
|
|
|
|
|
|
|
|
Discount Date
|
|
If the customer is allowed to receive discounts,
|
|
|
Discount Date
|
equals
|
Discount Days
(from RFC 323)
|
plus
|
Document Date
|
|
|
|
|
|
|
|
|
Amongst other validations the document format code is validated too. The Document format field has a Valid Values program and the user can select document format codes by processing F4 key on the field.
b. If no errors have occurred, set the status indicators to perform the next step processing (PRVSTS = PGMSTS, PGMSTS = NXTPRC, and FMTSTS = FMTEND). If errors have occurred, redisplay the Function Select screen and highlight all fields in error.