# 08 – Invoices (customer invoices, carrier invoices, payments)

Tested in the QA company (company admin), using ORDER-001 · Pages: Customer Invoice (Not Sent, Receivable, Payment Received, All), Carrier Invoice (Not Received, Received, Paid), Receivable / Payable Age, Claim/Dispute lists, Bank Master

## Works fine

- All 16 invoice pages open without an error page.
- **Customer side:** the delivered order shows under *Invoice Not Sent*. *Create / Review & Send Invoice* asks for the invoice number ("Enter the invoice number." when empty), then shows a preview of the merged invoice + POD with the customer's email. The *Invoice* PDF and *Merged PDF* open as valid PDFs.
- Ticking the order and using the top **Send Invoice** button moves it to *Accounts Receivable* ("Invoice Sent").
- **Receive Payment** (mode, reference, bank, date, amount, currency): required fields are checked. Editing a payment (2,000 → 400) moves the invoice back to Receivable as **Partially Paid** with 600 remaining; paying the 600 moves it to *Payment Received* as **Paid** ("Invoice paid successfully."). The **Deposite Slip** opens as a PDF.
- **Carrier side:** *Receive Invoice* (invoice no., amount, discount, Regular/Quick Pay) → "Invoice created successfully." → *Invoice Received*; *Make Payment* (amount limited to the invoice) → "Invoice paid successfully." → *Paid Invoice*.

## Issues

| # | Sev | What the user experiences | Steps | Evidence |
|---|-----|---------------------------|-------|----------|
| I1 | **High** – *fixed locally, awaiting upload* | **A customer payment bigger than the invoice is accepted.** Receiving 2,000 on a 1,000 invoice was saved: the invoice shows *Paid* with "Remaining −1000". The carrier payment form blocks this in the browser, the customer form and the server do not. | Accounts Receivable → Action → Receive Payment → amount 2000 | `screens/inv_overpay.png` |
| I2 | Medium – *fixed locally, awaiting upload* | **"Send Invoice" in a row's Action menu does nothing.** It asks "Do you want move Invoice to Receivable?", lands on the Receivable page with a success message, but the invoice is not there (still *Invoice Not Sent*). Only the tick-box + top "Send Invoice" button works. | Invoice Not Sent → Action → Send Invoice | `screens/inv_cust_action.png` |
| I3 | Medium | **Sending the invoice email fails after about 1 minute** with "Invoice was not sent successfully. Please review the recipients and try again." – the recipient is fine; this is the live mail-server problem (see the login report). The invoice number is still saved. | Review & Send Invoice → Generate PDF & Review → Send Invoice | `screens/inv_cust_sent.png` |
| I4 | Medium | **Technical message when the POD cannot be merged:** "Could not build the merged PDF: Unable to find pointer to xref table" – the user cannot continue. It happened with a plain/odd PDF as POD. A friendly message (or sending the invoice without POD) is needed. | Upload a non-standard PDF as POD → Create Invoice → Generate PDF & Review | `screens/inv_cust_create_modal.png` |
| I5 | Medium | **Payments cannot be received until a Bank exists, and the form gives no hint** – *Bank* is required but the list only says "Select" for a new company (same gap as CRM C1 / Carriers K1). | New company → Receive Payment | `screens/inv_receive_payment.png` |
| I6 | Medium – *fixed locally, awaiting upload* | **Bank Master: an account number that another company already uses cannot be saved, and the refusal is unclear.** A small red "The account number has already been taken." appears under the box only when you leave it; if you press *Create* anyway the page reloads with **no message** and nothing is saved. The number must be unique across **all companies** (so it also tells you another company has it). | Master → Bank → add a bank with an account number another company already has | `screens/bank_dup_after_create.png` |
| I7 | Low | The **Edit Payment** window's button is called "Create". | View Payments → Edit | `screens/inv_edit_payment.png` |
| I8 | Low | A same-day invoice already shows "**1 days**" pending. | Accounts Receivable | – |
| I9 | Low | Every invoice page asks for a script (`bootstrap-multiselect.min.js`) that the browser gets as "404", plus script errors (`addEventListener` of null, `classList`, a syntax error on All Invoice). | Open any invoice page, look at the console | – |

## Not tested (and why)

- Claim/Dispute on an invoice, Delete invoice, Quick Notes, *Send Mail* from the lists, grouped / multi-invoice payment, Cheque payments, Receivable / Payable Age with data, the invoice PDF contents.
- Customer / carrier portal invoice pages (Portals module).

## Test data left in the QA company

- **ORDER-001:** customer invoice **QA-INV-001** (INR 1,000, *Paid* – two wire payments, 400 and 600) and carrier invoice **CARR-QA-1** (INR 700, *Paid*). A proper PDF POD replaced my first, broken one.
- Master: Bank **QA Bank** (account 998877665544).
