Do not calculate a multiple-rate invoice with an average VAT rate. Calculate every line after its discount, group net bases by rate, then add net, VAT and gross. Article 58 of Law 104-12 requires reductions quantifiable at sale to be shown, while the Tax Code requires VAT separately when applicable.

The formula in six lines
- Line gross = quantity × unit price excluding VAT.
- Line discount = gross × discount rate.
- Line net = gross − discount.
- Line VAT = net × validated rate.
- Group bases and VAT by rate.
- Gross = net total + VAT total.
- Use one documented rounding policy.
- Never apply an average rate to the total.
1. Full two-rate example
Teaching example: 20% and 10% demonstrate the arithmetic only. They do not determine the rate for your items.
| Line | Gross net | Discount | Net | Rate | VAT | Gross |
|---|---|---|---|---|---|---|
| 2 × MAD 500 | 1,000.00 | 10% = 100.00 | 900.00 | 20% | 180.00 | 1,080.00 |
| 3 × MAD 200 | 600.00 | 5% = 30.00 | 570.00 | 10% | 57.00 | 627.00 |
| Total | 1,600.00 | 130.00 | 1,470.00 | By rate | 237.00 | 1,707.00 |
Recomposition is 1,470 + 237 = MAD 1,707. A discount first reduces the line base; it is neither a payment nor a standalone credit.
2. Break VAT down instead of merely showing it
A MAD 237 VAT total is not enough to check a mixed-rate invoice. Retain the base and VAT subtotal of each rate group.
| Group | Net base | VAT | Check |
|---|---|---|---|
| Illustrative 20% | MAD 900.00 | MAD 180.00 | 900 × 20% |
| Illustrative 10% | MAD 570.00 | MAD 57.00 | 570 × 10% |
| All rates | MAD 1,470.00 | MAD 237.00 | Gross MAD 1,707.00 |
Validate nature, rate, any exemption and wording before issue. The invoice without VAT guide covers transactions outside this calculation.
3. Rounding without phantom cents
Choose a consistent calculation level in software and the accounting export. Mixing line VAT rounding with a fresh global calculation can create a small difference.
- Retain enough calculation precision.
- Display money to two decimals.
- Apply one rule to every line.
- Add rounded values under the selected policy.
- Handle permitted differences traceably.
- Test fractional discounts and quantities.
- Compare PDF, sales journal and accounting export.
- Never hand-edit gross after issue.
If the PDF is issued, follow correcting an invoice instead of silently changing its total.

A configured rate is not tax advice
BelloPOS applies the rate configured on the product and produces the breakdown. It does not legally classify your product or replace accountant validation.
4. Line discount or global discount
A line discount belongs to its item and reduces that base. A global discount on a mixed-rate invoice must be allocated under a defined method; putting all of it against the highest rate distorts the breakdown.
Displaying the reduction on affected lines is often clearest. For a global commercial discount, validate allocation and retain the reason.
Do not confuse discount, deposit and settlement. A discount changes price; a payment reduces customer balance. The deposit and balance guide shows the difference.
5. What BelloPOS covers
BelloPOS reads product price, discount and VAT rate, calculates the basket and prints the breakdown. Go issues the A4 invoice from the sale; Pro retains quote→order→delivery→invoice lineage and feeds the accounting bridge.
| Control | BelloPOS | Owner |
|---|---|---|
| Rate by product | Configurable | Business/accountant |
| Discount and net | Calculated | Authorised user |
| VAT by rate | Broken down | Reviewer |
| Invoice PDF | Go/Pro | Issue authority |
| Journal/VAT | Pro | Accountant |
| Tax classification | Not decided | Professional adviser |
Test a basket mixing rates, discounts and quantities before going live. Compare PDF with the accounting export.
Mistakes to avoid
- Calculating VAT before discount.
- Applying an average rate.
- Hiding reduction in unit price.
- Confusing discount and payment.
- Rounding differently in PDF and journal.
- Hand-editing gross.
- Copying a rate without classifying the item.
- Omitting rate subtotals.
Frequently asked questions
Is a discount calculated before VAT?
In this example, a quantifiable reduction lowers the line net before VAT. Validate special cases.
Can I use an average rate?
Not to recompose a mixed-rate invoice. Calculate and total each rate group separately.
Do 10% and 20% apply to my products?
Not necessarily. They demonstrate arithmetic; each item or service must be classified.
How do I handle a global discount?
Allocate it across affected bases under a validated method and retain the reason.
What should I do with a one-cent difference?
Check line-versus-global rounding and keep one policy from PDF through accounting.
Does BelloPOS break VAT down?
Yes, from the rates configured per product. The tax setup remains yours to validate.
What to take away
Calculate gross, discount, net and VAT line by line, then group by rate. A visible breakdown and stable rounding policy make gross recomposable.
Sources
The figures and rules quoted above come from these pages, read on the date given in the article.
- Moroccan General Tax Code 2026, DGI, read 29 August 2026
- Ministry of Justice, Law 104-12 on freedom of prices and competition, Article 58
- BelloPOS numbered PDF invoices and fields, read 29 August 2026
- BelloPOS quotes, orders, deliveries, invoices and credit notes, read 29 August 2026
- BelloPOS Lite, Go and Pro pricing, read 29 August 2026
Test the two-rate invoice
Create two demonstration products, apply the example discounts and reconcile basket, PDF and journal.
Read next
Other practical guides on the same subject: