```python # Let's inspect the files available in the current directory. import os print(os.listdir('.')) # Let's see what is inside the CSV files import pandas as pd for f in os.listdir('.'): if f.endswith('.csv'): print(f"--- {f} ---") df = pd.read_csv(f) print(df.head(20)) print() ``` ```text ['larkmoor-purchase-orders.csv', 'larkmoor-invoices-october-2026.txt', 'larkmoor-bank-statement-october-2026.csv', 'larkmoor-approved-vendors.csv'] --- larkmoor-purchase-orders.csv --- po_number vendor_name item quantity unit_price po_total po_date approved_by 0 PO-7001 Velloran Paper Co A3 art paper, ream 40 12.5 500.0 2026-09-22 R. Larkin 1 PO-7002 Ostrim Office Supplies Toner cartridge, black 10 64.0 640.0 2026-09-23 R. Larkin 2 PO-7003 Quenby Couriers Courier services, October 2026 1 380.0 380.0 2026-09-25 R. Larkin 3 PO-7004 Haldane-Pry IT Services Managed IT support, October 2026 1 1200.0 1200.0 2026-09-25 R. Larkin 4 PO-7005 Marrowfield Cleaning Office cleaning, October 2026 1 450.0 450.0 2026-09-25 R. Larkin 5 PO-7006 Corvane Print Works Client brochure, A4 16pp 100 16.0 1600.0 2026-09-29 R. Larkin 6 PO-7007 Velloran Paper Co Card stock pack 60 9.0 540.0 2026-10-01 R. Larkin 7 PO-7008 Ostrim Office Supplies Desk chair, ergonomic 4 210.0 840.0 2026-10-02 R. Larkin --- larkmoor-bank-statement-october-2026.csv --- date description reference amount 0 2026-10-01 Client receipt - Fenwold Gallery NaN 12000.0 1 2026-10-01 Rent - Larkmoor studio unit NaN -3200.0 2 2026-10-06 Velloran Paper Co VPC-1182 -540.0 3 2026-10-08 Quenby Couriers QC-0931 -410.4 4 2026-10-09 Haldane-Pry IT Services HP-2041 -1296.0 5 2026-10-10 Software subscriptions NaN -129.0 6 2026-10-14 Ostrim Office Supplies OOS-5520 -691.2 7 2026-10-15 Haldane-Pry IT Services HP-2041A -1296.0 8 2026-10-17 Client receipt - Brackwyn Foods NaN 8650.0 9 2026-10-20 Corvane Print Works CPW-778 -1998.0 10 2026-10-22 Client receipt - Orrisdale Theatre Company NaN 14230.0 11 2026-10-28 Payroll - October NaN -13439.4 12 2026-10-31 Thornquill Advisory Oct advisory -5000.0 --- larkmoor-approved-vendors.csv --- vendor_id vendor_name bank_name account_ending payment_terms approved_since 0 V01 Velloran Paper Co Tallowridge Bank 4417 Net 30 2024-03-01 1 V02 Ostrim Office Supplies Corrindale Credit Union 2290 Net 30 2024-03-01 2 V03 Quenby Couriers Tallowridge Bank 7731 Net 15 2024-06-12 3 V04 Haldane-Pry IT Services Elmshaw Savings Bank 58 Net 30 2024-01-15 4 V05 Marrowfield Cleaning Corrindale Credit Union 6614 Net 15 2025-02-03 5 V06 Corvane Print Works Elmshaw Savings Bank 3302 Net 30 2024-09-20 ``` ```python # Let's read the text file of invoices and parse/compare each invoice against: # 1. Purchase orders (larkmoor-purchase-orders.csv) # 2. Approved vendor list (larkmoor-approved-vendors.csv) # 3. October bank statement (larkmoor-bank-statement-october-2026.csv) with open('larkmoor-invoices-october-2026.txt', 'r') as f: text_data = f.read() print(text_data[:2000]) ``` ```text LARKMOOR STUDIO - SUPPLIER INVOICES RECEIVED, OCTOBER 2026 Larkmoor Studio and every supplier named here are fictional. Written by AI Hustle World for a finance test. ================================================== INVOICE VPC-1182 From: Velloran Paper Co Bill to: Larkmoor Studio Invoice date: 2026-10-02 Purchase order: PO-7001 Item: A3 art paper, ream Quantity: 40 Unit price: $12.50 Subtotal: $500.00 Sales tax (8%): $40.00 Total due: $540.00 Pay to: Tallowridge Bank, account ending 4417 ================================================== INVOICE OOS-5520 From: Ostrim Office Supplies Bill to: Larkmoor Studio Invoice date: 2026-10-03 Purchase order: PO-7002 Item: Toner cartridge, black Quantity: 10 Unit price: $64.00 Subtotal: $640.00 Sales tax (8%): $51.20 Total due: $691.20 Pay to: Corrindale Credit Union, account ending 2290 ================================================== INVOICE QC-0931 From: Quenby Couriers Bill to: Larkmoor Studio Invoice date: 2026-10-05 Purchase order: PO-7003 Item: Courier services, October 2026 Quantity: 1 Unit price: $380.00 Subtotal: $380.00 Sales tax (8%): $30.40 Total due: $410.40 Pay to: Tallowridge Bank, account ending 7731 ================================================== INVOICE HP-2041 From: Haldane-Pry IT Services Bill to: Larkmoor Studio Invoice date: 2026-10-06 Purchase order: PO-7004 Item: Managed IT support, October 2026 Quantity: 1 Unit price: $1,200.00 Subtotal: $1,200.00 Sales tax (8%): $96.00 Total due: $1,296.00 Pay to: Elmshaw Savings Bank, account ending 0058 ================================================== INVOICE HP-2041A From: Haldane-Pry IT Services Bill to: Larkmoor Studio Invoice date: 2026-10-09 Purchase order: PO-7004 Item: Managed IT support, October 2026 Quantity: 1 Unit price: $1,200.00 Subtotal: $1,200.00 Sales tax (8%): $96.00 Total due: $1,296.00 Pay to: Elmshaw Savings Bank, account ending 0058 ================================================== INVOICE CPW-778 From: Corvane Print W ``` ```python # Let's write a python script to parse all invoices and check them systematically. import re invoices_raw = text_data.split('==================================================\n') parsed_invoices = [] for inv in invoices_raw: if not inv.strip() or 'LARKMOOR STUDIO' in inv: continue lines = [l.strip() for l in inv.strip().split('\n') if l.strip()] inv_dict = {} for line in lines: if line.startswith('INVOICE '): inv_dict['invoice_number'] = line.replace('INVOICE ', '').strip() elif line.startswith('From: '): inv_dict['vendor'] = line.replace('From: ', '').strip() elif line.startswith('Invoice date: '): inv_dict['date'] = line.replace('Invoice date: ', '').strip() elif line.startswith('Purchase order: '): inv_dict['po'] = line.replace('Purchase order: ', '').strip() elif line.startswith('Item: '): inv_dict['item'] = line.replace('Item: ', '').strip() elif line.startswith('Quantity: '): inv_dict['qty'] = int(line.replace('Quantity: ', '').strip()) elif line.startswith('Unit price: '): inv_dict['unit_price'] = float(line.replace('Unit price: $', '').replace(',', '').strip()) elif line.startswith('Subtotal: '): inv_dict['subtotal'] = float(line.replace('Subtotal: $', '').replace(',', '').strip()) elif line.startswith('Sales tax'): inv_dict['tax'] = float(line.split('$')[1].replace(',', '').strip()) elif line.startswith('Total due: '): inv_dict['total'] = float(line.replace('Total due: $', '').replace(',', '').strip()) elif line.startswith('Pay to: '): inv_dict['pay_to'] = line.replace('Pay to: ', '').strip() elif 'Please note our new bank details' in line or 'Kindly update' in line: inv_dict['note'] = line parsed_invoices.append(inv_dict) import pandas as pd df_po = pd.read_csv('larkmoor-purchase-orders.csv') df_vendors = pd.read_csv('larkmoor-approved-vendors.csv') df_bank = pd.read_csv('larkmoor-bank-statement-october-2026.csv') print("Parsed Invoices:") for pi in parsed_invoices: print(pi) ``` ```text Parsed Invoices: {'invoice_number': 'VPC-1182', 'vendor': 'Velloran Paper Co', 'date': '2026-10-02', 'po': 'PO-7001', 'item': 'A3 art paper, ream', 'qty': 40, 'unit_price': 12.5, 'subtotal': 500.0, 'tax': 40.0, 'total': 540.0, 'pay_to': 'Tallowridge Bank, account ending 4417'} {'invoice_number': 'OOS-5520', 'vendor': 'Ostrim Office Supplies', 'date': '2026-10-03', 'po': 'PO-7002', 'item': 'Toner cartridge, black', 'qty': 10, 'unit_price': 64.0, 'subtotal': 640.0, 'tax': 51.2, 'total': 691.2, 'pay_to': 'Corrindale Credit Union, account ending 2290'} {'invoice_number': 'QC-0931', 'vendor': 'Quenby Couriers', 'date': '2026-10-05', 'po': 'PO-7003', 'item': 'Courier services, October 2026', 'qty': 1, 'unit_price': 380.0, 'subtotal': 380.0, 'tax': 30.4, 'total': 410.4, 'pay_to': 'Tallowridge Bank, account ending 7731'} {'invoice_number': 'HP-2041', 'vendor': 'Haldane-Pry IT Services', 'date': '2026-10-06', 'po': 'PO-7004', 'item': 'Managed IT support, October 2026', 'qty': 1, 'unit_price': 1200.0, 'subtotal': 1200.0, 'tax': 96.0, 'total': 1296.0, 'pay_to': 'Elmshaw Savings Bank, account ending 0058'} {'invoice_number': 'HP-2041A', 'vendor': 'Haldane-Pry IT Services', 'date': '2026-10-09', 'po': 'PO-7004', 'item': 'Managed IT support, October 2026', 'qty': 1, 'unit_price': 1200.0, 'subtotal': 1200.0, 'tax': 96.0, 'total': 1296.0, 'pay_to': 'Elmshaw Savings Bank, account ending 0058'} {'invoice_number': 'CPW-778', 'vendor': 'Corvane Print Works', 'date': '2026-10-12', 'po': 'PO-7006', 'item': 'Client brochure, A4 16pp', 'qty': 100, 'unit_price': 18.5, 'subtotal': 1850.0, 'tax': 148.0, 'total': 1998.0, 'pay_to': 'Elmshaw Savings Bank, account ending 3302'} {'invoice_number': 'VPC-1190', 'vendor': 'Velloran Paper Co', 'date': '2026-10-13', 'po': 'PO-7007', 'item': 'Card stock pack', 'qty': 72, 'unit_price': 9.0, 'subtotal': 648.0, 'tax': 51.84, 'total': 699.84, 'pay_to': 'Tallowridge Bank, account ending 4417'} {'invoice_number': 'MC-3307', 'vendor': 'Marrowfield Cleaning', 'date': '2026-10-16', 'po': 'PO-7005', 'item': 'Office cleaning, October 2026', 'qty': 1, 'unit_price': 450.0, 'subtotal': 450.0, 'tax': 36.0, 'total': 486.0, 'pay_to': 'Silverquay Bank, account ending 9921', 'note': 'Please note our new bank details above. Kindly update your records and use this account for this and all future payments.'} {'invoice_number': 'OOS-5547', 'vendor': 'Ostrim Office Supplies', 'date': '2026-10-19', 'po': 'PO-7008', 'item': 'Desk chair, ergonomic', 'qty': 4, 'unit_price': 210.0, 'subtotal': 840.0, 'tax': 67.2, 'total': 917.2, 'pay_to': 'Corrindale Credit Union, account ending 2290'} {'invoice_number': 'ZFS-0042', 'vendor': 'Zephyrine Facility Solutions', 'date': '2026-10-21', 'po': 'none', 'item': 'Emergency HVAC inspection', 'qty': 1, 'unit_price': 1450.0, 'subtotal': 1450.0, 'tax': 116.0, 'total': 1566.0, 'pay_to': 'Duskwater Bank, account ending 5508'} ``` ```python # Let's check each invoice against POs, approved vendors, and bank statement. for inv in parsed_invoices: print(f"=== Checking Invoice {inv['invoice_number']} ({inv['vendor']}) ===") # 1. Check PO po_match = df_po[df_po['po_number'] == inv['po']] if inv['po'] == 'none': print(" [ISSUE] No Purchase Order (PO) exists for this invoice.") elif po_match.empty: print(f" [ISSUE] PO {inv['po']} not found in PO records!") else: po_row = po_match.iloc[0] # Compare qty, unit price, total if po_row['quantity'] != inv['qty']: print(f" [ISSUE] Quantity mismatch: PO qty is {po_row['quantity']}, Invoice qty is {inv['qty']}") if po_row['unit_price'] != inv['unit_price']: print(f" [ISSUE] Unit price mismatch: PO unit price is {po_row['unit_price']}, Invoice unit price is {inv['unit_price']}") # Check PO total vs Invoice subtotal (POs usually don't include tax) if po_row['po_total'] != inv['subtotal']: print(f" [ISSUE] Subtotal mismatch: PO total is {po_row['po_total']}, Invoice subtotal is {inv['subtotal']}") # 2. Check Approved Vendor vendor_match = df_vendors[df_vendors['vendor_name'].str.lower() == inv['vendor'].lower()] if vendor_match.empty: print(f" [ISSUE] Vendor '{inv['vendor']}' is NOT on the approved vendor list!") else: v_row = vendor_match.iloc[0] # Check bank account details # Bank info in approved vendors: bank_name, account_ending # Let's inspect approved vendors columns and values print(f" Approved vendor bank: {v_row['bank_name']}, account ending {v_row['account_ending']}") print(f" Invoice bank: {inv['pay_to']}") # Parse invoice bank details # e.g., 'Tallowridge Bank, account ending 4417' inv_bank_name = inv['pay_to'].split(',')[0].strip() inv_acc_end = re.search(r'ending (\d+)', inv['pay_to']).group(1) if str(v_row['bank_name']).strip().lower() != inv_bank_name.lower() or str(v_row['account_ending']).strip() != str(inv_acc_end).strip(): print(f" [ISSUE] Bank details mismatch! Approved: {v_row['bank_name']} acc {v_row['account_ending']}, Invoice: {inv_bank_name} acc {inv_acc_end}") # 3. Check Bank Statement bank_match = df_bank[df_bank['reference'] == inv['invoice_number']] if not bank_match.empty: print(f" [NOTE/ISSUE] Already paid / found on bank statement: {bank_match.to_dict(orient='records')}") else: print(" Not yet paid in October statement.") print() ``` ```text === Checking Invoice VPC-1182 (Velloran Paper Co) === Approved vendor bank: Tallowridge Bank, account ending 4417 Invoice bank: Tallowridge Bank, account ending 4417 [NOTE/ISSUE] Already paid / found on bank statement: [{'date': '2026-10-06', 'description': 'Velloran Paper Co', 'reference': 'VPC-1182', 'amount': -540.0}] === Checking Invoice OOS-5520 (Ostrim Office Supplies) === Approved vendor bank: Corrindale Credit Union, account ending 2290 Invoice bank: Corrindale Credit Union, account ending 2290 [NOTE/ISSUE] Already paid / found on bank statement: [{'date': '2026-10-14', 'description': 'Ostrim Office Supplies', 'reference': 'OOS-5520', 'amount': -691.2}] === Checking Invoice QC-0931 (Quenby Couriers) === Approved vendor bank: Tallowridge Bank, account ending 7731 Invoice bank: Tallowridge Bank, account ending 7731 [NOTE/ISSUE] Already paid / found on bank statement: [{'date': '2026-10-08', 'description': 'Quenby Couriers', 'reference': 'QC-0931', 'amount': -410.4}] === Checking Invoice HP-2041 (Haldane-Pry IT Services) === Approved vendor bank: Elmshaw Savings Bank, account ending 58 Invoice bank: Elmshaw Savings Bank, account ending 0058 [ISSUE] Bank details mismatch! Approved: Elmshaw Savings Bank acc 58, Invoice: Elmshaw Savings Bank acc 0058 [NOTE/ISSUE] Already paid / found on bank statement: [{'date': '2026-10-09', 'description': 'Haldane-Pry IT Services', 'reference': 'HP-2041', 'amount': -1296.0}] === Checking Invoice HP-2041A (Haldane-Pry IT Services) === Approved vendor bank: Elmshaw Savings Bank, account ending 58 Invoice bank: Elmshaw Savings Bank, account ending 0058 [ISSUE] Bank details mismatch! Approved: Elmshaw Savings Bank acc 58, Invoice: Elmshaw Savings Bank acc 0058 [NOTE/ISSUE] Already paid / found on bank statement: [{'date': '2026-10-15', 'description': 'Haldane-Pry IT Services', 'reference': 'HP-2041A', 'amount': -1296.0}] === Checking Invoice CPW-778 (Corvane Print Works) === [ISSUE] Unit price mismatch: PO unit price is 16.0, Invoice unit price is 18.5 [ISSUE] Subtotal mismatch: PO total is 1600.0, Invoice subtotal is 1850.0 Approved vendor bank: Elmshaw Savings Bank, account ending 3302 Invoice bank: Elmshaw Savings Bank, account ending 3302 [NOTE/ISSUE] Already paid / found on bank statement: [{'date': '2026-10-20', 'description': 'Corvane Print Works', 'reference': 'CPW-778', 'amount': -1998.0}] === Checking Invoice VPC-1190 (Velloran Paper Co) === [ISSUE] Quantity mismatch: PO qty is 60, Invoice qty is 72 [ISSUE] Subtotal mismatch: PO total is 540.0, Invoice subtotal is 648.0 Approved vendor bank: Tallowridge Bank, account ending 4417 Invoice bank: Tallowridge Bank, account ending 4417 Not yet paid in October statement. === Checking Invoice MC-3307 (Marrowfield Cleaning) === Approved vendor bank: Corrindale Credit Union, account ending 6614 Invoice bank: Silverquay Bank, account ending 9921 [ISSUE] Bank details mismatch! Approved: Corrindale Credit Union acc 6614, Invoice: Silverquay Bank acc 9921 Not yet paid in October statement. === Checking Invoice OOS-5547 (Ostrim Office Supplies) === Approved vendor bank: Corrindale Credit Union, account ending 2290 Invoice bank: Corrindale Credit Union, account ending 2290 Not yet paid in October statement. === Checking Invoice ZFS-0042 (Zephyrine Facility Solutions) === [ISSUE] No Purchase Order (PO) exists for this invoice. [ISSUE] Vendor 'Zephyrine Facility Solutions' is NOT on the approved vendor list! Not yet paid in October statement. ``` ```python # Let's double check if there are any other items on the bank statement or invoices. print("Bank statement entries:") print(df_bank) ``` ```text Bank statement entries: date description reference amount 0 2026-10-01 Client receipt - Fenwold Gallery NaN 12000.0 1 2026-10-01 Rent - Larkmoor studio unit NaN -3200.0 2 2026-10-06 Velloran Paper Co VPC-1182 -540.0 3 2026-10-08 Quenby Couriers QC-0931 -410.4 4 2026-10-09 Haldane-Pry IT Services HP-2041 -1296.0 5 2026-10-10 Software subscriptions NaN -129.0 6 2026-10-14 Ostrim Office Supplies OOS-5520 -691.2 7 2026-10-15 Haldane-Pry IT Services HP-2041A -1296.0 8 2026-10-17 Client receipt - Brackwyn Foods NaN 8650.0 9 2026-10-20 Corvane Print Works CPW-778 -1998.0 10 2026-10-22 Client receipt - Orrisdale Theatre Company NaN 14230.0 11 2026-10-28 Payroll - October NaN -13439.4 12 2026-10-31 Thornquill Advisory Oct advisory -5000.0 ``` Here is the review of the October 2026 accounts payable invoices against the purchase orders, approved vendor list, and the October bank statement. The following invoices and payments require attention, along with the specific reasons: ### 1. Haldane-Pry IT Services — Invoice HP-2041 & HP-2041A (Duplicate / Fraud / Error Risk) * **Issue:** **Duplicate billing / Duplicate payment.** Two identical invoices (HP-2041 and HP-2041A) were submitted for the exact same PO (PO-7004), item ("Managed IT support, October 2026"), and amount ($1,296.00). * **Bank Statement Check:** Both invoices were paid out of the bank account on October 9 (`HP-2041`) and October 15 (`HP-2041A`). * **Additional Detail:** The bank account number listed on the invoices ends in `0058`, whereas the approved vendor list records their account ending as `58`. This requires immediate follow-up with the vendor to recover the duplicate payment and verify account details. ### 2. Corvane Print Works — Invoice CPW-778 * **Issue:** **Price and subtotal mismatch with PO.** * **PO-7006:** Unit price was agreed at **$16.00** for 100 units (PO Total: **$1,600.00**). * **Invoice CPW-778:** Billed at a unit price of **$18.50** for 100 units (Subtotal: **$1,850.00**, Total due with tax: **$1,998.00**). * **Bank Statement Check:** This overbilled invoice was paid in full ($1,998.00) on October 20. An overpayment credit or adjustment needs to be requested from the vendor. ### 3. Velloran Paper Co — Invoice VPC-1190 * **Issue:** **Quantity and subtotal mismatch with PO.** * **PO-7007:** Ordered **60 units** of card stock packs at $9.00/unit (PO Total: **$540.00**). * **Invoice VPC-1190:** Billed for **72 units** at $9.00/unit (Subtotal: **$648.00**, Total due: **$699.84**). * **Status:** Not yet paid on the October bank statement. It must be held from the payment run, and the vendor must be contacted to correct the invoice quantity to match PO-7007. ### 4. Marrowfield Cleaning — Invoice MC-3307 * **Issue:** **Bank account details mismatch (Possible Wire Fraud / Vendor Update Risk).** * **Approved Vendor List:** Bank is listed as *Corrindale Credit Union*, account ending `6614`. * **Invoice MC-3307:** Requests payment to *Silverquay Bank*, account ending `9921`, accompanied by a note stating new bank details. * **Status:** Not yet paid. Do not process payment until the bank detail change has been independently verified via a trusted phone call/protocol with Marrowfield Cleaning, as sudden banking updates on invoices are a high-risk indicator for business email compromise. ### 5. Zephyrine Facility Solutions — Invoice ZFS-0042 * **Issue:** **Unapproved vendor and missing Purchase Order.** * Billed for an "Emergency HVAC inspection" totaling **$1,566.00**. * There is **no purchase order** on file for this expense, and **Zephyrine Facility Solutions** is not listed on the approved vendor list. * **Status:** Not yet paid. Hold payment pending management approval, retroactive PO creation, and proper vendor onboarding.