Finance
Page specs BO-44 to BO-48: invoices and credit notes, payments and declarations, credit accounts, and the V2 overdue-reminders and accounting-export pages.
The finance pages follow what resellers owe and pay (cahier §4.7): invoices generated from orders, payments recorded by HOCO or declared by resellers with a proof, partial payments allocated across invoices, basic credit control, and the V1 credit notes (avoirs) issued by returns and after-sales resolutions (FIN-08).
Financial data is strictly limited (cahier §4.7, ACL-04). Every page needs finance.view. With the default seed, only the finance manager, the super admin and direction (read-only) hold it. Amounts are TTC, as invoiced.
| ID | Screen | Section | Template | Release | Design | Build |
|---|---|---|---|---|---|---|
BO-44 | Invoices | Finance | template | V1 | Day 18 | DSH-07 |
BO-45 | Payments & declarations | Finance | template | V1 | Day 18 | DSH-07 |
BO-46 | Credit accounts | Finance | template | V1 | Day 18 | DSH-07 |
BO-47 | Overdue & reminders | Finance | template | V2 | DES-30 | DSH-20 |
BO-48 | Accounting exports | Finance | template | V2 | DES-30 | DSH-20 |
BO-44 — Invoices
| Field | Value |
|---|---|
| Template | List (with an invoice detail drawer) |
| Release | V1 |
| Design day | Day 18 — DES-18 |
| Build task | DSH-07 |
| Route | /finance/invoices (?drawer=<invoiceId>, ?view=) |
| Requirements | FIN-01 · FIN-08 · PRC-04 · ORD-12 |
| Permissions required | finance.view · finance.validate (cancel) · finance.create (record a payment from an invoice) · finance.export |
Purpose. List invoices with their status and balance, open their legal PDF, cancel an unpaid invoice, and see the credit notes issued for returns and after-sales.
Who uses it. Finance manager. Direction reads it.
Entry points. Finance › Factures, the finance cards of BO-04 and BO-08, BO-39 Documents, BO-11 Finance.
Layout.
- Tabs (
view): « Toutes », « Impayées » (UNPAID), « Partiellement payées », « En retard » (OVERDUE), « Payées », « Annulées », and « Avoirs » (credit notes).
| Column | Source field | Sortable | Default visible |
|---|---|---|---|
| N° facture | number (FAC-2026-000123) | Yes | Yes |
| Date | issuedAt | Yes (default descending) | Yes |
| Revendeur | Store name + REV | Yes | Yes |
| Commande | order.number | Yes | Yes |
| Total TTC | totalTtc | Yes | Yes |
| Payé | Σ confirmed allocations | Yes | Yes |
| Avoirs | Σ credit notes applied | No | No |
| Reste à payer | balance | Yes | Yes |
| Échéance | dueDate | Yes | Yes |
| Retard | Days past the due date (derived) | Yes | Yes |
| Statut | status (InvoiceStatus) | Yes | Yes |
| Mode de paiement | The order's paymentMethod | Yes | No |
| Délégué | Attributed delegate | Yes | No |
- Filters:
q(number, store name),status,reseller,from/to(issue date),dueFrom/dueTo,overdue=true,wilaya,delegate,paymentMethod. - « Avoirs » tab: N° avoir, Date, Revendeur, Origine (
RET-…orTKT-…), Facture d'origine, Montant TTC, Imputé (applied to invoices), PDF. - Invoice drawer:
- Legal header (HOCO's NIF, NIS, RC, AI; the reseller's identifiers).
- Lines with HT, VAT and TTC; totals.
- Allocations: payments and credit notes, with date and amount.
- History.
- Buttons: « Télécharger le PDF », « Enregistrer un paiement » (opens BO-45 prefilled), « Annuler la facture ».
Data.
admin.invoices.listandadmin.invoices.get.admin.invoices.cancel.- The PDF comes from
files.downloadUrl(GENERATED_DOCUMENT). - Credit notes: listed through
admin.invoices.listwithtype=CREDIT_NOTE. Assumption — the contract has no credit-note list yet; see contract notes.
Actions.
- « Annuler la facture » (
finance.validate): « Annuler la facture FAC-2026-000123 ? Elle restera dans l'historique avec le statut Annulée. »- A reason is required. Audited
STATUS_CHANGE; the reseller is notified. - Refused (
409) when payments or credit notes are allocated: they must be unallocated first.
- A reason is required. Audited
- « Exporter »: XLSX / CSV.
Rules.
- When invoices are created: from the order at the status set in billing settings (BO-64). They show HT, VAT and TTC per line and in total (PRC-04).
- Overdue:
OVERDUEis set by the daily job when the due date passes with a balance. - Credit notes: a credit note from a return is applied to the original invoice's balance first; any remainder stays as a credit on the reseller's account. Assumption — confirm the imputation rule.
- Corrections: an invoice is never edited. A correction is a credit note (return or after-sales) or a cancellation of an unpaid invoice.
Real-time. None. The list refreshes on focus.
States. First use: « Les factures apparaîtront après les premières commandes facturées ». A missing PDF (generation failed) shows « Document non généré — Régénérer » (link to BO-39 Documents).
Acceptance criteria.
- Each invoice PDF shows the legal mentions and the HT, VAT and TTC totals matching the order.
- A partially paid invoice shows Payé, Reste à payer and the status Partiellement payée.
- A return reception in BO-69 adds a credit note in « Avoirs » and lowers the original invoice's balance.
- An invoice with an allocated payment cannot be cancelled.
BO-45 — Payments & declarations
| Field | Value |
|---|---|
| Template | List (with drawers) |
| Release | V1 |
| Design day | Day 18 — DES-18 |
| Build task | DSH-07 |
| Route | /finance/payments (?view=to-verify, ?drawer=) |
| Requirements | FIN-03 · FIN-04 · FIN-02 · FIN-08 |
| Permissions required | finance.view · finance.create (record) · finance.validate (verify a declaration) · finance.update (allocate) |
Purpose.
- Record payments received: cash on delivery, transfer, CCP, BaridiMob.
- Verify the declarations resellers send with a proof (cahier §4.7).
- Allocate payments across invoices, including partial payments (FIN-04).
Who uses it. Finance manager.
Entry points. Finance › Paiements (badge = declarations to verify), BO-08, the invoice drawer, and the cash-on-delivery proof dialog of BO-42.
Layout.
- Tabs: « À vérifier » (
PENDING_VERIFICATION, oldest first), « Confirmés », « Rejetés », « Tous ».
| Column | Source field | Sortable | Default visible |
|---|---|---|---|
| N° | number (PAY-2026-000077) | Yes | Yes |
| Date de paiement | paidAt (declared or recorded) | Yes | Yes |
| Revendeur | Store name | Yes | Yes |
| Mode | method (PaymentMethod) | Yes | Yes |
| Montant | amount | Yes | Yes |
| Référence | Transfer, CCP or BaridiMob reference | No | Yes |
| Justificatif | Proof thumbnail (PAYMENT_PROOF) | No | Yes |
| Statut | status (PaymentStatus) | Yes | Yes |
| Affecté / non affecté | Allocated vs remaining | No | Yes |
| Saisi par | Reseller (declaration) or staff user | Yes | No |
| Reçu | Receipt PDF link | No | No |
- Filters:
status,method,reseller,from/to,unallocated=true,amountMin/amountMax. - Drawer « Vérifier la déclaration »:
- The proof viewer (image or PDF, zoom, rotate) next to the declared fields: amount, date, method, reference.
- The reseller's open invoices.
- A duplicate hint: « Une déclaration de 45 600,00 DA avec la même référence existe déjà (PAY-…) ».
- Drawer « Enregistrer un paiement »:
- Revendeur (required).
- Mode: the enabled methods (required).
- Montant (DA, above 0).
- Date de réception: not in the future.
- Référence.
- Justificatif (optional).
- Affectation: « Automatique (plus anciennes d'abord) » or « Manuelle », a grid of open invoices with an amount per invoice.
Data. admin.payments.list, admin.payments.record, admin.payments.verify, admin.payments.allocate, admin.invoices.list (open invoices), files.downloadUrl.
Actions.
| Action | Endpoint | Confirmation (FR) | Reason | Audit | Notifies |
|---|---|---|---|---|---|
| « Confirmer » (declaration) | admin.payments.verify (CONFIRMED) + allocations | « Confirmer le paiement de 45 600,00 DA de Boutique Nour et l'affecter à FAC-…-123 ? » | — | VALIDATE | Reseller (push, in-app: « Paiement confirmé ») |
| « Rejeter » (declaration) | admin.payments.verify (REJECTED) | « Rejeter cette déclaration ? Le revendeur verra le motif. » | PAYMENT_REJECT_REASON + comment | REJECT | Reseller |
| « Enregistrer » (new payment) | admin.payments.record | « Enregistrer un paiement de 120 000,00 DA (virement) ? » | — | CREATE | Reseller |
| « Affecter » | admin.payments.allocate | Allocation grid; « Affecter 30 000,00 DA à 2 factures ? » | — | UPDATE | — |
None of these is optimistic.
Rules.
- Allocation limits: total allocation ≤ payment amount, and per invoice ≤ its balance. An unallocated remainder stays as a credit balance on the reseller's account.
- Effect of confirmation: confirmed payments update invoice statuses (
PARTIALLY_PAID/PAID) and the available credit. - Duplicate check: same reseller, amount and reference within 30 days shows a warning before confirming.
- Receipts (FIN-08): a receipt PDF is generated when a payment is confirmed. Assumption — generation and URL to add to the contract.
Real-time. None in the admin stream. The « À vérifier » tab polls every 60 s while visible.
States.
- Empty « À vérifier »: « Aucune déclaration à vérifier » (success tone).
- Unreadable proof: « Justificatif illisible », with a rejection shortcut.
Acceptance criteria.
- A declaration sent from the reseller app appears in « À vérifier » with its proof (cahier §4.7, FIN-03).
- Confirming a 30 000 DA payment on a 45 600 DA invoice sets it to Partiellement payée with 15 600 DA remaining.
- Rejecting requires a reason from the list. The reseller sees it.
- Allocating more than the payment amount is refused.
BO-46 — Credit accounts
| Field | Value |
|---|---|
| Template | List (with drawer) |
| Release | V1 |
| Design day | Day 18 — DES-18 |
| Build task | DSH-07 |
| Route | /finance/credit (?drawer=<resellerId>) |
| Requirements | FIN-05 · ACL-04 · FIN-06 |
| Permissions required | finance.view · finance.administer (limit, block / unblock) |
Purpose. Basic credit control in V1 (cahier §4.7 « Plafond de crédit, crédit disponible, échéances et blocage »): set each reseller's ceiling, see used and available credit, and block credit use. Detailed terms and automatic policies are V2 (FIN-06).
Who uses it. Finance manager.
Entry points. Finance › Crédit revendeurs, the Crédit utilisé card (?usage=90), BO-11 Finance, and the BO-39 credit control.
Layout.
| Column | Source field | Sortable | Default visible |
|---|---|---|---|
| Revendeur | Store name + CustomerType pill | Yes | Yes |
| Plafond | limit | Yes | Yes |
| Utilisé | used (exposure) | Yes | Yes |
| Disponible | limit − used | Yes | Yes |
| Utilisation | % bar (amber from 80 %, danger from 100 %) | Yes | Yes |
| Impayés | Σ OVERDUE balances | Yes | Yes |
| Bloqué | Flag | Yes | Yes |
| Modifié le / par | Last CreditLimitChange | Yes | No |
- Filters:
usage(≥ 80 / 90 / 100 %),blocked,overdue=true,wilaya,delegate,customerType. - Drawer:
- Exposure breakdown: unpaid invoices paid on credit; confirmed orders on credit not yet invoiced.
- Limit history (
CreditLimitChange: before, after, user, reason). - Actions « Modifier le plafond », « Bloquer le crédit » / « Débloquer ».
Data.
admin.credit.getandadmin.credit.update.- List: missing operation. Assumption — a
GET /admin/credit-accounts(finance.view) is needed (see contract notes).
Actions.
- « Modifier le plafond » (
finance.administer, re-authentication): « Passer le plafond de Boutique Nour de 200 000,00 DA à 350 000,00 DA ? ». A reason is required. AuditedUPDATEwith aCreditLimitChangerow. - « Bloquer le crédit »: « Bloquer le crédit de Boutique Nour ? Le paiement à crédit ne sera plus proposé ; les autres modes restent disponibles. ». A reason is required. Audited.
Rules.
- Checkout: the credit check uses
usedandlimit(FIN-05). - Over the limit: a checkout above the limit is either refused or accepted as an order flagged for decision, according to the setting
credit.overLimitPolicy(BLOCK / REQUIRE_VALIDATION) (cahier §4.7 « Le dépassement du plafond peut bloquer la commande ou exiger une validation »). With REQUIRE_VALIDATION, the order waits in BO-41 with a blocking credit control. - Order already confirmed: raising the limit does not re-confirm anything. Every order still needs its explicit confirmation.
Real-time. None.
States. No credit account: « Aucun revendeur n'a de crédit » with « Définir un plafond » (from BO-11).
Acceptance criteria.
- Raising a limit records the change with its reason and makes the BO-39 credit control pass on the next read.
- Blocking removes « Crédit » from the reseller's checkout payment methods.
- The Utilisé value equals the exposure shown in the drawer's breakdown.
BO-47 — Overdue & reminders
| Field | Value |
|---|---|
| Template | List |
| Release | V2 — designed in DES-30 |
| Design day | DES-30 — V2 designs (during the build phase; no V1 design day) |
| Build task | DSH-20 |
| Route | /finance/overdue |
| Requirements | FIN-06 · FIN-07 |
| Permissions required | finance.view · finance.administer (reminder policy) |
V2 — designed in DES-30
This page ships with the V2 evolutions. Its detailed spec will be written with DES-30. In V1, overdue invoices are visible in BO-44 (« En retard ») and BO-08 (Balance âgée).
Purpose. An overdue board with automatic reminders and unpaid alerts (cahier §4.7 « Relances automatiques et alertes d'impayé »), plus the detailed credit policy: payment terms, due dates, automatic blocking or approval.
Who uses it. Finance manager.
Layout (outline).
- Aging buckets.
- Overdue invoices with the reminder history (
PaymentReminder: channel, date, template). - « Relancer maintenant ».
- A reminder-policy editor: J+3 SMS, J+10 call task, J+30 credit block.
Data. admin.finance.overdue, admin.credit.update (terms).
Acceptance criteria (draft).
- Each overdue invoice shows every reminder sent, with its channel and date.
- A manual reminder is logged and notifies the reseller.
BO-48 — Accounting exports
| Field | Value |
|---|---|
| Template | List |
| Release | V2 — designed in DES-30 |
| Design day | DES-30 — V2 designs (during the build phase; no V1 design day) |
| Build task | DSH-20 |
| Route | /finance/exports |
| Requirements | FIN-09 · INT-06 |
| Permissions required | finance.export |
V2 — designed in DES-30
Ships with V2 accounting integration. In V1, finance lists are exported from BO-44 and BO-45 and the reports in BO-59.
Purpose. Produce accounting exports (sales journal, payments, credit notes) in the format of HOCO's accounting system or ERP (cahier §4.7, §11).
Layout (outline).
- A form with period, journal type and format (CSV layout per accounting software).
- The history of exports with status and download.
Data. admin.finance.export, then the export centre jobs (BO-60).
Acceptance criteria (draft).
- An export over a month balances with BO-44 totals for that month.
- Each export is audited
EXPORT.
Orders and delivery
Page specs BO-38 to BO-43 and BO-69: orders list, order detail, order on behalf, the orders-to-confirm queue, delivery board, carriers, and returns and after-sales claims.
Promotions and loyalty
Page specs BO-49 to BO-54: promotions list, promotion editor with targeting, stacking and preview, banners and daily offers, and the V2 packs, loyalty and rewards pages.