AP296 Summary¶
Function Requirements: Post A/P Voucher Status Code Changes¶
Overview¶
The PostAPVoucherStatus function updates the hold status (hold code and description) of Accounts Payable (A/P) vouchers in the open A/P file and generates a report summarizing the changes. It processes input from a work file, validates data against company and vendor records, and ensures accurate updates and reporting for the A/P Voucher Status Code Change Process.
Inputs¶
- Work File (
APVCTR): Contains voucher records with: - Company Number (
ATCONO, 2 bytes) - Vendor Number (
ATVEND, 5 bytes) - Voucher Number (
ATVOUC, 5 bytes) - Hold Code (
ATHOLD, 1 byte) - Hold Description (
ATHLDS, 25 bytes) - Prior Hold Code (
ATOHLD, 1 byte) - Prior Hold Description (
ATOHDS, 25 bytes) - Transaction Key (
ATNKEY, 12 bytes) - Control File (
APCONT): Contains company details (e.g.,ACNAME, company name, 30 bytes). - Vendor File (
APVEND): Contains vendor details (e.g.,VNVEND, vendor number;VNNAME, vendor name). - Open A/P File (
APOPNH): Contains open A/P transactions (updated with new hold codes and descriptions). - Printer File (
LIST): Output file for the A/P Voucher Status Code Change Process report.
Outputs¶
- Updated Open A/P File (
APOPNH): Records updated with new hold codes and descriptions. - Report (
LIST): A printer file containing the A/P Voucher Status Code Change Process report with: - Company name (
ACNAME) - Page number (
PAGE) - Date (
SYSDAT) and time (SYSTIM) - Voucher details (
ATVEND,VNNAME,ATVOUC,ATHOLD,ATHLDS,ATOHLD,ATOHDS) - Indicator for no prior hold code (
50on)
Process Steps¶
- Validate Input Data:
- Check if
APVCTRcontains any records. - If no records exist, pause with message: "THERE ARE NO RECORDS TO POST. PRESS 0 TO CANCEL."
-
Cancel the process if the user presses
ATTN,2,ENTER. -
Load RPG Program:
-
Load the
AP296RPG program. -
Validate Company:
- Chain
ATCONOtoAPCONTto verify the company number. -
Set indicator
92if the company number is invalid. -
Validate Vendor:
- Chain
VENDKY(built fromATCONOandATVEND) toAPVENDto verify the vendor number. -
Set indicator
31if the vendor number is invalid. -
Check Prior Hold Status:
- If
ATOHLDandATOHDSare blank, set indicator50on. -
Otherwise, no prior hold code exists.
-
Update Open A/P Records:
- For each valid voucher in
APVCTR, chainOPNKEY(built fromATNKEYand1001) toAPOPNH. - If found (indicator
90off), updateATHOLD(position 126) andATHLDS(positions 127–151) inAPOPNH. -
Execute exception output (
EXCPT). -
Generate Report:
-
For each processed voucher, output to
LIST:- Vendor number (
ATVEND) - Vendor name (
VNNAME) - Voucher number (
ATVOUC) - New hold code (
ATHOLD) - New hold description (
ATHLDS) - Prior hold code (
ATOHLD) - Prior hold description (
ATOHDS) - Indicator for no prior hold code (
50on)
- Vendor number (
-
Clean Up:
- Delete the processed work file (
APVCTR) after successful posting.
Business Rules¶
- Data Validation:
- The company number (
ATCONO) must exist inAPCONT. - The vendor number (
ATVEND) must exist inAPVEND. -
The voucher must exist in
APOPNHwith matching vendor and company records. -
Hold Code Updates:
- Update the hold code (
ATHOLD) and hold description (ATHLDS) inAPOPNHonly for valid vouchers. -
Check for prior hold codes (
ATOHLD,ATOHDS) and update only if they are not blank. -
Reporting:
-
Generate a report (
LIST) summarizing the A/P Voucher Status Code Change Process:- Company name (
ACNAME) - Page number (
PAGE) - Date (
SYSDAT) and time (SYSTIM) - Voucher details (
ATVEND,VNNAME,ATVOUC,ATHOLD,ATHLDS,ATOHLD,ATOHDS) - Indicator for no prior hold code (
50on)
- Company name (
-
Error Handling:
- If the company number is invalid (
92on), skip processing for that company. - If the vendor number is invalid (
31on), skip processing for that vendor. -
If no open A/P record is found (
90on), skip the update but generate report output. -
Data Cleanup:
- Delete the processed
APVCTRwork file after successful posting.
Calculations¶
- No calculations are explicitly performed in this function. It updates hold codes and descriptions based on input data and validation results.
External Programs Called¶
- AP296: The main RPG program that processes the A/P Voucher Status Code Change Process.
Notes¶
- The function assumes that the input data in
APVCTRis accurate and complete. - The output report (
LIST) is formatted for printing and includes all relevant voucher details. - The
SFACOPYsystem utility is used to manage the report output in the output queue.