Invoices, payments and instalments are managed here. Every amount you receive against an invoice is a row in that invoice's payment ledger.
The amount decides the status
"Paid" is not a label you pick. Each time a payment is recorded or deleted, the total received is compared against the invoice total and the status is recalculated:
- nothing received → sent
- some received → partially paid
- fully received → paid
So when the status is not what you expect, the answer is in that invoice's list of payments.
A down payment is not a separate thing
A down payment is simply the first payment. It is recorded in the same place and the same way as any other; what makes it a "down payment" is the title you give it.
After a payment, there is no going back to draft
While no payment exists you can change the status freely. As soon as any money is recorded, moving the invoice back to draft is refused.
The reason is that draft unlocks the line items, and editing lines that have already been paid against would leave the payment ledger disagreeing with reality.
Instalments are a plan, not a payment
An instalment table only says how the amount is to be divided. The instalments must sum to exactly the invoice total or the plan will not save.
While no payment is allocated to an instalment the whole plan can be changed; after that it is locked.
Each instalment's paid and remaining amounts are worked out as they are displayed and never stored, so they can never drift from the payment ledger.
Gateway payments settle the whole balance
When a customer pays through the portal, the gateway records the entire remaining balance as a single payment — not the amount of one instalment.
The portal's Pay button stays available for partially paid invoices, not only for those with nothing received.
One thing to watch on the amount field
On sites whose currency is Rial, the amount field treats what you type as Toman and stores it ×10. Typing an exact Rial balance records ten times the intended amount.
The behaviour is deliberate — operators think in Toman — but it is easy to trip over when matching an exact figure.
Numbers run in sequence
The invoice number is generated automatically, in order, and carries the year. A number is never reused — not even when an invoice is cancelled.