🌐 Language: English | Français | العربية
Level 4 — Advanced / Tunisian Tax, Treasury, P&L & Accountant Close#
Level 4 is written for company owners, finance controllers, and Tunisian accountants (Experts-Comptables). Here you will master the exact arithmetic of ProdyPanda's Tunisian calculation engine, manage Client & Supplier Withholding Tax (Retenue à la Source), reconcile multi-account Treasury balances, read the Profit & Loss (Compte de Résultat) and profitability analytics, enforce category budgets, and execute a clean 1-click month-end and year-end accountant close.
1. The Tunisian Calculation Engine Deep Dive#
Tunisian accounting works to 3 decimal places (millimes, 0.001 DT), where a single millime discrepancy can cause an invoice total to disagree with your ERP or tax declaration.
A. Truncation (truncate) vs Rounding (round) — Why Facture 20260300001 Equals 6 571.989 DT#
In public/js/calculator.js, every monetary step passes through applyPrecision(value, decimals, mode):
roundingMode: 'truncate'(default for ProdyPanda. Sarl): strips digits beyond the 3rd decimal place (with a1e-7floating-point epsilon guard so exact binary fractions like0.1 + 0.2never underflow).roundingMode: 'round': applies standard half-up rounding at the 3rd decimal place (configurable inParamètres & Taxesor per document).
Look at how this affects ProdyPanda's real reference invoice Facture N° 20260300001 (Pulire Tunisie, 06-03-2026):
| Step | Formula | Exact Raw Value | truncate (Default) | round |
|---|---|---|---|---|
| Gross Services Subtotal | 3×1378 + 1×1378 + 110 + 380 | 6 002.0000 | 6 002.000 DT | 6 002.000 DT |
Loyalty Discount WD-R26 (-8%) | -6 002.000 × 0.08 | -480.1600 | -480.160 DT | -480.160 DT |
| Net Total H.T. | 6 002.000 − 480.160 | 5 521.8400 | 5 521.840 DT | 5 521.840 DT |
| TVA (19%) | 5 521.840 × 0.19 | 1 049.1496 | 1 049.149 DT | 1 049.150 DT |
| Timbre fiscal | Fixed Tunisian stamp duty | 1.0000 | 1.000 DT | 1.000 DT |
| Net à payer (T.T.C.) | 5 521.840 + 1 049.149 + 1.000 | 6 571.9890 | 6 571.989 DT | 6 571.990 DT |
Because 1 049.1496 truncates cleanly to 1 049.149 DT, ProdyPanda matches official Tunisian billing software down to the last millime!
B. Multi-Rate Per-Line TVA (19% / 13% / 7% / 0%) & Custom Fees#
In Studio Facture's Configuration Fiscale : TVA, Timbre & Frais panel:
- 1-Click Fiscal Presets:
Standard (TVA 19% + Timbre 1 DT)— standard domestic Tunisian B2B/B2C invoicingSuspension TVA (0% + Timbre)— for clients holding a Tunisian Attestation d'achat en suspension de TVA (add the attestation number & date in thetvaExemptNotebox!)Export / Hors Taxe (0% sans Timbre)— international export invoices exempt from both TVA and Timbre fiscal+ FODEC (1%)— adds the 1% Tunisian industrial development tax before TVA+ Retenue Source (-1%)— applies a-1%withholding line after TVA
- Per-Line TVA (
perLineTva): Enable this when one invoice mixes items at different Tunisian VAT rates (19%services,13%professional/IT-adjacent rates,7%qualifying goods/services, or0%exempt lines). Both the A4 PDF and branded email summary automatically render a grouped TVA breakdown table by rate! - Custom Fees Order (
+ Ajouter un frais / taxe):Avant TVA(applyBeforeTva: true) — e.g.,FODEC 1%orFrais de dossier 50.000 DT: added to theTaxable Base H.T.before TVA is computed (so TVA is calculated onNet H.T. + FODEC, per Tunisian fiscal law!).Après TVA(applyBeforeTva: false) — e.g.,Retenue à la source -1%: applied after TVA on the post-tax total.
C. Reverse Calculator (+ Calculateur TTC → H.T.)#
When a client says "My total budget is strictly 5 000.000 DT all taxes included":
- In Studio Facture (A4), click
+ Calculateur TTC → H.T.(Calculateur Inversé : T.T.C. → H.T.). - Enter the target
T.T.C.(5 000.000), and toggle your active discount %, pre-TVA fee %, TVA rate, and Timbre. BillingCalculator.reverseCalculateHT()solves backward to millime precision (±0.001 DT).- Click
Appliquer à une nouvelle ligneto drop the exact calculatedH.T.amount straight into your invoice!
D. Legal Amount-in-Words (FR & EN)#
- French (
amountToFrenchLegalSentence): Adapts dynamically to document type (la présente facture,le présent devis,la présente facture proforma,le présent avoir,le présent bon de commande,le présent bon de livraison) and optionally spells millimes in words (millimesInWords: true). - English (
amountToEnglishLegalSentence): Handles Dinars/millimes, Euros/cents, US Dollars/cents, and Pounds/pence with proper singular/plural grammar.
2. Retenue à la Source (RS) — Clients & Suppliers#
In Tunisia, B2B payments of ≥ 1 000 DT T.T.C. (as well as rents, professional fees, and foreign services) are subject to statutory Withholding Tax (Retenue à la Source) payable to the Recette des Finances. ProdyPanda handles both directions cleanly.
Built-In Tunisian RS Rate Reference#
| RS Rate | Common Tunisian Fiscal Application |
|---|---|
1% | Standard commercial markets, goods & services ≥ 1 000 DT T.T.C. (when supplier is subject to corporate tax IS) |
1.5% | Specific services / non-corporate or sector-specific regimes |
3% | Professional fees (Honoraires) / commissions paid to entities taxed under the real regime |
10% | Office rent (Loyer) & specific non-resident / professional payments |
15% | General professional fees (Honoraires), royalties, or non-resident foreign tech/cloud services (e.g., OVHcloud when applicable) |
A. Client-Side RS (Withheld by Your Customers)#
When a Tunisian corporate client pays your 6 571.989 DT invoice and withholds 1% (65.709 DT on H.T. + TVA, excluding Timbre):
- Open
Suivi des Paiements & Retenue à la Sourceon the invoice (or clickCertificat RSin Studio Facture). - Click
Imprimer Certificat RS (1%)(/print-rs/:idor/api/documents/:id/rs-pdf) to view or print a pre-filled A4 Certificat de Retenue à la Source containing ProdyPanda'sMF(1618295T), the client'sMF, gross base, RS amount, and net amount paid (Net servi). - You can also attach the client's RS certificate directly when emailing the invoice!
B. Supplier-Side RS (Withheld by YOU & Paid to Recette des Finances)#
When ProdyPanda. Sarl pays a Tunisian vendor bill ≥ 1 000 DT T.T.C. (or pays office rent):
- Inside
Nouvelle Dépense / Facture Fournisseur, as soon as aDTbill reaches≥ 1 000 DTT.T.C., ProdyPanda automatically suggests applying RS! - Tick Retenue à la Source and select the rate (
1%,1.5%,3%,10%,15%). - The live preview strip shows:
- Retenue à la source (amount you keep and remit to the
Recette des Finances) - Net à payer fournisseur (
Total T.T.C. − RS— exact amount you wire/check to the supplier!)
- Retenue à la source (amount you keep and remit to the
- Automatic Treasury Precision: When you mark that expense
Payée, Treasury automatically debits only theNet à payer fournisseurfrom your bank account (so your Banque Zitouna balance matches the exact bank transfer!), while the withheld RS is tracked separately in the Supplier RS Registry! - Open
Fournisseurs & BC→Retenues à la Source Fournisseurs(or clickVoir le registre RS Fournisseurs →insideFiscalité & TVA) to:- Filter by Year and Month and see the Total RS Due to Recette des Finances
- Print/Download an official A4
Certificat de Retenue à la SourcePDF for each supplier (/api/expenses/:id/rs-pdf) to hand over with their payment - Click
Exporter CSV Recette des Finances(/api/expenses/rs-csv) to downloadRS_Fournisseurs_Recette_Finances.csv!
3. Multi-Account Treasury (Trésorerie) & Bank Reconciliation#
Open Trésorerie in the left sidebar to manage real cash flow across every liquidity account.
The 3 Pre-Seeded Tunisian Accounts#
Out of the box, ProdyPanda seeds three accounts tailored to Tunisian business operations:
Banque Zitouna(BANK, default account, pre-filled with RIB25047000000140621604)Caisse Espèces(CASH— office petty cash box)Portefeuille Chèques & Traites(CHECKS— checks & bills of exchange awaiting bank deposit)
Click Comptes & Soldes initiaux anytime to set your Opening Balances (Solde initial) (for example, your actual bank balance on January 1st) or add additional banks (BIAT, Attijari, Amen Bank, etc.).
How Automatic Payment & Expense Sync Works#
flowchart TB
Pay["Client Payment Recorded<br/>(Factures & Documents)"] -->|"Auto CREDIT<br/>(sourceType: PAYMENT)"| Tr["Treasury Ledger<br/>(treasury_transactions)"]
Exp["Supplier Expense Marked PAID<br/>(Dépenses & Achats)"] -->|"Auto DEBIT of Net Paid<br/>(sourceType: EXPENSE)"| Tr
Man["Manual Operation<br/>(+ Opération manuelle)"] -->|"MANUAL CREDIT / DEBIT"| Tr
Xfer["Internal Transfer<br/>(⇄ Virement interne)"] -->|"Balanced Outflow + Inflow<br/>(e.g. Banque → Caisse)"| Tr
Tr --> Cards["Live Account Balance Cards<br/>(Book Balance + Reconciled Balance)"]- Zero Double Entry:
- Record a client payment via
Virement Bancaire→Banque Zitounais credited automatically. Delete that payment → the Treasury credit vanishes cleanly. - Mark a
STEGexpensePAID→Banque Zitouna(or chosen account) is debited automatically. Change its status back toUNPAIDor delete it → the Treasury debit is removed automatically.
- Record a client payment via
- Internal Transfers (
⇄ Virement interne / Retrait Caisse):- Moving
500.000 DTcash out ofBanque ZitounaintoCaisse Espèces(or depositing checks fromPortefeuille Chèques & TraitesintoBanque Zitouna) posts a matched transfer pair between the two accounts without inflating your P&L revenue or expenses!
- Moving
- Bank Reconciliation (
Rapproché ✓):- Click any account card at the top to filter the ledger to that single account.
- Compare rows against your monthly Banque Zitouna bank statement and tick the
Rapprochécheckbox on every cleared line. - Each account card displays both your Total Book Balance and your Reconciled Balance, making missing checks or unrecorded bank fees immediately obvious!
4. Fiscalité, P&L, SVG Analytics, Margins & Budgets#
Open Fiscalité & TVA and select your period (full year like 2026, specific month like 2026-11, or ALL).
A. Tunisian VAT (TVA) Position#
ProdyPanda computes your monthly or annual VAT declaration figures from active documents (Factures minus Avoirs, automatically excluding CANCELLED documents and non-fiscal Devis/Proforma) and recorded Dépenses:
$$\text{TVA Nette} = \text{TVA Collectée (Sales)} - \text{TVA Déductible (Purchases)}$$
- If positive (
> 0):TVA à Payer— amount owed on your monthly Tunisian tax declaration. - If negative (
< 0):Crédit de TVA— VAT credit carried forward to next month! - Also tracks total
Timbre Fiscalcollected on invoices and yourRetenues à la Source Fournisseursliability banner.
B. Compte de Résultat (P&L) & Year-over-Year (N / N-1) Comparison#
The Compte de Résultat (P&L) table groups all revenue and expenses automatically by accounting nature (comparing Current Period N vs Prior Year N-1 with % delta badges and a dual-series YoY SVG Bar Chart):
| P&L Line | Calculation / Category Group |
|---|---|
Chiffre d'Affaires H.T. | Net invoiced sales H.T. (Factures − Avoirs, converted to TND) |
− Achats Clients / Débours | Direct project costs (CLIENT group / CLIENT_PURCHASE scope) |
= Marge Brute | Gross project margin (CA H.T. − Achats Clients) |
− Utilitaires (STEG, SONEDE, Télécom) | UTILITY group bills |
− Charges Fixes (Loyer, Salaires, CNSS...) | FIXED group expenses (Rent, Payroll, CNSS, Insurance, Accounting, Bank fees) |
− Autres Frais d'Exploitation | OPERATING group expenses (Cloud, Software, Marketing, Fuel, Equipment, Supplies) |
= Résultat Net d'Exploitation H.T. | True operating profit + Operating Margin %! |
C. Interactive SVG Expense Donut & Per-Client Profitability#
- Expense Category Donut Chart: Hover any slice or legend item in
Répartition des Dépenses par Catégorieto inspect exactH.T.TND spend,%share of total costs, and receipt count per category. - Per-Client Real Profitability (
Rentabilité par Client & Projet): Compares each client's Invoiced Revenue H.T. against Direct Client Purchases H.T. (Ventes H.T. − Achats Clients = Marge Réelle DT & %), highlighting both your most profitable accounts and any client with unbilled purchases waiting to be rebilled.
D. Monthly Category Budgets & Spend Alerts#
Control overhead before it surprises you:
- Click
Gérer les budgets mensuels(orConfigureron the Budgets card). - For any expense category (e.g.,
Hébergement & Cloud,Marketing & Pub,Carburant & Déplacements), set a Monthly Cap inDT(monthlyCapTnd), an Alert Threshold%(default80%), and toggle Active. - Click
Enregistrer les budgets. - Live progress cards render immediately in
Budgets Mensuels & Alertes Dépenses:- Green: comfortably under threshold
- Amber (
≥ 80%): approaching monthly cap - Crimson (
> 100%): over budget — automatically fires a warning inside the global Alert Center!
5. Alert Center, Executive PDF & Accountant ZIP Close#
A. Unified Alert Center (Alertes)#
Click Alertes in the top utility bar anytime to open the priority action drawer organized into 6 tabs:
Toutes— consolidated feed sorted by priorityAchats à refacturer— unbilled client purchases (1-clickRefacturer →)Échéances & Factures à payer— upcoming recurring fixed bills (15-day window) & overdue supplier bills (1-click log/open)Impayés clients— overdue unpaid client invoices (1-click jump to invoice)Budgets— monthly categories exceeding alert threshold or cap (1-click jump to Fiscalité)Devis signés— Quotes recently e-signed on the Client Portal awaiting conversion to Invoice/Deposit!
B. 1-Click Executive Financial Report A4 PDF#
In Fiscalité & TVA, click Rapport de Gestion PDF (A4) (/api/reports/executive-pdf). In 2 seconds, ProdyPanda compiles a clean, branded, print-ready A4 management report containing:
- ProdyPanda. Sarl header, period covered, and executive KPIs
- Full Compte de Résultat (P&L) & TVA position
- Inline vector SVG Expense Category Chart
- Top Clients profitability & receivables table
- Consolidated Treasury snapshot across
Banque Zitouna,Caisse Espèces, andPortefeuille Chèques & Traites
C. 1-Click Accountant ZIP (Télécharger Dossier Comptable (ZIP))#
Stop spending Sunday evenings gathering folders and spreadsheets for your accountant! Select the target month (e.g., 2026-11) or full year (2026) in Fiscalité & TVA and click Télécharger Dossier Comptable (ZIP) (/api/reports/accountant-zip).
ProdyPanda builds a standard PKZIP archive (100% compatible with Windows Explorer, 7-Zip, and macOS) containing:
Dossier_Comptable_2026-11.zip
├── PDFs/
│ ├── Facture_20261100001_Pulire_Tunisie.pdf
│ └── Avoir_20261100001_...pdf
├── Justificatifs_Depenses/
│ ├── 2026-11-05_STEG_FA-2026-88412_facture_steg.pdf
│ └── 2026-11-12_OVHcloud_FR88210_receipt.pdf
├── Journal_Factures_2026-11.csv # UTF-8 BOM, semicolon-delimited (Excel / Sage ready)
├── Journal_Depenses_2026-11.csv # Full HT, TVA Déductible, Timbre & TTC ledger
├── RS_Fournisseurs_Recette_Finances.csv # Auto-included whenever Supplier RS applies!
└── Synthese_Fiscale_TVA_2026-11.txt # Complete TVA Collectée / Déductible / Timbre / RS summary✅ Tunisian Month-End & Year-End Accountant Close Checklist#
Monthly Close (Confirm the Applicable Filing Deadline with Your Accountant)#
- Open the Alert Center (
Alertes) and clear all Unbilled Client Purchases (Achats à refacturer) and Upcoming Fixed Bills - Verify every finalized invoice of the month is Locked (
Verrouiller) so numbers cannot drift after declaration - Record all incoming client bank wires/checks and attach any missing supplier PDFs/photos in
Dépenses & Achats - Open
Trésorerieand reconcileBanque Zitouna(Rapproché ✓) against your monthly bank statement - Open
Fournisseurs & BC→Retenues à la Source Fournisseurs, print all supplier Certificats RS PDF, and verify total RS owed to the Recette des Finances - Open
Fiscalité & TVA, select the closed month (e.g.,2026-11), verifyTVA Collectée − TVA Déductible(TVA à PayerorCrédit de TVA) andTimbre Fiscal - Click
Télécharger Dossier Comptable (ZIP)and send the single ZIP file to your Expert-Comptable - Click
Rapport de Gestion PDF (A4)to archive your monthly executive P&L summary
Year-End Close (Annual Financial Statements & Audit Archive)#
- Reconcile all 3 Treasury accounts (
Banque Zitouna,Caisse Espèces,Portefeuille Chèques & Traites) as of December 31 - Verify every Client's closing balance using
Clients & Relevés→Relevé de Compte - Export the Annual Accountant ZIP (period = full year, e.g.,
2026) and AnnualRS_Fournisseurs_Recette_Finances.csv(for Tunisia's annual Déclaration d'Employeur) - Go to
Paramètres & Taxes→Sauvegarde de Base de Donnéesand download a permanent annual JSON backup (ProdyPanda_Backup_2026-12-31.json) to external/cloud storage
🧭 Navigation#
For the monthly tax worksheet and confirmed bank CSV import, see the Agency operations guide. Worksheets are preparation aids, not official filings or tax advice.
← Level 3 — Intermediate | English Index | Level 5 — Expert (Admin, Security, OCR & API) →