Skip to content

List of Use Cases Implemented by the AP250 Call Stack

The AP250 call stack, comprising the OCL programs (AP250.ocl36.txt, AP251.ocl36.txt, AP256.ocl36.txt) and RPG programs (AP250.rpg36.txt, AP251.rpg36.txt, AP255.rpg36.txt, AP256A.rpg.txt, AP256.rpg36.txt), implements a single comprehensive use case within the IBM System/36 or AS/400 Accounts Payable (A/P) system. This use case is:

  1. Generate and Process A/P Check Register with Associated Updates and Reports:
  2. Description: This use case processes A/P transactions to generate a Check Register, update master files (vendor, open invoices, history, reconciliation), produce a Cash Disbursements Journal, and generate vendor payment detail reports for ACH transactions. It handles multiple payment types (checks, ACH, wire transfers, employee expenses) and ensures accurate financial tracking and reporting.
  3. Components:
    • AP250.ocl36.txt: Orchestrates the overall process, calling other programs and managing temporary files.
    • AP250.rpg36.txt: Generates the Check Register, updates master files, and produces Positive Pay and journal entries.
    • AP251.ocl36.txt and AP251.rpg36.txt: Updates the commission table (APTORCY) with payment data.
    • AP255.rpg36.txt: Produces the Cash Disbursements Journal and general ledger entries.
    • AP256.ocl36.txt, AP256A.rpg.txt, AP256.rpg36.txt: Generates vendor payment detail reports for ACH vendors, emailed to up to four recipients per vendor.

Function Requirement Document: Generate and Process A/P Check Register

Function Requirement: Generate and Process A/P Check Register

Overview

This function processes Accounts Payable (A/P) transactions to generate a Check Register, update master files (vendor, open invoices, history, reconciliation, commission), produce a Cash Disbursements Journal, and generate vendor payment detail reports for ACH transactions. It handles checks, ACH, wire transfers, and employee expenses, ensuring accurate financial tracking and reporting.

Inputs

  • Payment File (APPAY): Contains payment details (company number, vendor number, invoice number, gross amount, discount, payment amount, sales order number, check number, payment date).
  • Check File (APPYCK): Contains check details (check number, amount, date, vendor, payment type: check, ACH, wire, expense).
  • Transaction File (APPYTR): Contains check date and hold code (e.g., ACH, wire).
  • Vendor Files (APVEND, APVEND2, APVNFMX): Vendor details (name, address, balance, email addresses, ACH form type).
  • Control File (APCONT): Company details (name, next check/journal numbers).
  • Open Invoice Files (APOPEN, APOPENH, APOPEND, APOPENV): Invoice details (gross amount, partial paid, open amount).
  • Freight Files (FRCFBH, FRCINH): Freight invoice details (carrier ID, invoice number).
  • Commission File (APTORCY): Commission details (order number, invoice number, payment status).
  • System Date/Time: For report headers and date calculations.

Outputs

  • Check Register (APPRINT): Report listing checks with totals by payment type.
  • Positive Pay File (APPNCF): Bank reconciliation file with check details.
  • Cash Disbursements Journal (APCDJR, TEMGEN): Journal entries for cash, discounts, and A/P, including summarized A/P entries.
  • Updated Files: APVEND, APOPEN*, APHIST*, APCHKR, FRCFBH, FRCINH, APPYDS, APTORCY with updated payment data.
  • ACH Vendor Reports (REPORT1 to REPORT4): Payment detail reports emailed to up to four vendor email addresses, with vendor-specific messages.

Process Steps

  1. Initialize Data:
  2. Retrieve system date/time for reporting.
  3. Fetch company details from APCONT (e.g., name, next check/journal numbers).

  4. Process Payments and Checks:

  5. Read APPYCK, APPAY, and APPYTR to process payments by company and vendor.
  6. Identify payment type (check, ACH, wire, expense, void) using AXRECD and PTHOLD.
  7. Format check dates (e.g., 20YYMMDD) using century-aware logic (Y2KCEN).

  8. Update Master Files:

  9. Vendor (APVEND): Update last payment amount/date, discounts, balance, year-to-date paid.
  10. Open Invoices (APOPEN*): Update partial payments; mark fully paid invoices for deletion.
  11. History (APHISTH, APHISTD, APHISTV): Record payment history.
  12. Reconciliation (APCHKR): Update check status (open/void), amount, and clear date.
  13. Freight (FRCFBH, FRCINH): Update freight invoices if carrier ID exists.
  14. Discounts (APPYDS): Record missed discounts.
  15. Commission (APTORCY): Update with payment amount, status ('P'), and check number.

  16. Generate Check Register:

  17. Produce APPRINT with company name, payment method, check details (number, date, amount, vendor), and totals by payment type (check, ACH, wire, expense).

  18. Generate Positive Pay File:

  19. Output APPNCF with check number, date, amount, vendor name, and status (issued/void) for bank reconciliation.

  20. Generate Cash Disbursements Journal:

  21. Process APCDJR to produce TEMGEN with detailed and summarized A/P journal entries (company, G/L number, amount, debit/credit).
  22. Output APPRINT with journal headers, detail lines, and totals (debits/credits).

  23. Generate ACH Vendor Reports:

  24. Process APDTWS and APDTWSC to count ACH transactions per vendor.
  25. Retrieve vendor details (APVEND) and up to four email addresses (APVNFMX, AMFMTY = 'ACHE').
  26. Produce REPORT1 to REPORT4 with vendor details, payment details (invoice number, amount, discount, payment), totals, and messages (standard or crude-specific).
  27. Direct reports to spool files for emailing.

  28. Clean Up:

  29. Delete temporary files (APDTWS, APDTWSC) via main OCL program.

Business Rules

  1. Payment Types:
  2. Handle checks ('C'), ACH ('A'), wire transfers ('W'), employee expenses ('E'), and void checks ('F', 'V').
  3. Skip credit/no-pay records ('C' in AXRECD).
  4. ACH, wire, and expenses skip APCHKR updates.

  5. Vendor Updates:

  6. Update APVEND with last payment amount/date, month/year-to-date discounts/payments, and current balance (VNCBAL -= payment + discount).

  7. Invoice Management:

  8. Calculate open amount (OPOPEN = OPGRAM - OPPPTD - payment).
  9. Mark fully paid invoices (OPOPEN = 0) for deletion in APOPEN*.

  10. Freight Processing:

  11. Update FRCFBH or FRCINH for freight invoices with valid carrier IDs, setting status to 'P' (posted).

  12. Commission Updates:

  13. Match payments to APTORCY using company, vendor, and invoice description.
  14. Update with payment amount, status ('P'), and check number.

  15. Journal Entries:

  16. Generate detailed entries for non-A/P transactions and summarized entries for A/P (CDTYPE = 'AP ') in TEMGEN.
  17. Adjust negative amounts by reversing sign and switching debit/credit code.

  18. ACH Reporting:

  19. Count ACH transactions (AMFMTY = 'ACHE') per vendor in APDTWSC.
  20. Generate up to four reports per vendor, emailed to AMEMLA addresses.
  21. Use standard messages for non-crude vendors, crude-specific messages for VNCAID = 'CRUDE'.

  22. Date Handling:

  23. Use century-aware formatting (Y2KCEN) for all dates (e.g., check date, payment date).

  24. File Access:

  25. Support shared access (DISP-SHR) for concurrent processing.
  26. Delete temporary files after processing.

Calculations

  • Vendor Balance: VNCBAL = VNCBAL - (OPLPAM + OPDISC) (payment + discount).
  • Open Invoice Amount: OPOPEN = OPGRAM - OPPPTD - (OPLPAM + OPDISC).
  • Journal Amount: For negative amounts, reverse sign and switch debit ('D') to credit ('C') or vice versa.
  • ACH Count: Increment COUNT for each APVNFMX record where AMFMTY = 'ACHE' and AMCOVN matches ADCOVN.
  • Report Totals: Sum invoice (ADINV$), discount (ADDISC), and payment (ADLPAM) amounts at vendor level (L1INV$M, L1DIS$M, L1PYM$M).

Assumptions

  • Input files (APPAY, APPYCK, APPYTR, etc.) are populated by prior steps.
  • Vendor and control files (APVEND, APCONT, APVNFMX) contain valid data.
  • Reports are emailed via spool files using an external system (not handled by RPG).
  • No user interaction; process runs automatically.