New · CMCG Online Academy — 10 free accounting lessons · 10 free lessonsTry it
Solved exercises

Account matching in Morocco: 8 solved accounting exercises

Work through eight solved customer and supplier account-matching exercises, including partial payments, credit notes, allocation errors and overpayments.

CMCG editorial illustration connecting invoices, payments and credit notes with matching codes and highlighting an open item
New · CMCG’s flagship program

Practise this topic in CMCG Online Academy

Short lessons and corrected exercises on Moroccan accounting. The introduction (10 lessons) is free: your first name and city are enough.

Start for free

Matching invoices to payments is straightforward until a transfer settles several invoices, a credit note changes the balance or a receipt lands in the wrong customer account. In French-language accounting systems, this work is called lettrage. It identifies which entries settle one another and explains the items still outstanding.

These eight exercises focus on that decision rather than on software buttons. For each case, select the relevant entries, compare total debits with total credits and calculate the remaining balance before reading the solution. Then explain the documentary evidence behind your choice. A matching code is useful only when someone reviewing the file can understand why the entries belong together.

Assumptions and the matching rule

All businesses and transactions below are fictional. Each exercise starts independently with no opening balance. Amounts are in Moroccan dirhams (DH) and are the invoice or settlement totals already posted to the relevant accounts. Purchases, sales and VAT have already been recorded; you do not need to calculate tax or post the original invoices again.

The Moroccan chart-of-accounts references used here are 3421 for customers, 4411 for suppliers and 5141 for bank. Each customer or supplier has an individual account record. In a customer account, invoices are debits while receipts and issued credit notes are credits. In a supplier account, invoices are credits while payments and received credit notes are debits.

A fully matched group requires equal debits and credits, supported by a verified allocation. Matching existing entries does not create a journal entry. Correcting a posting error is a separate operation that needs its own explanation. The letters used below are illustrative codes, not instructions for any particular accounting package. For a wider introduction, read the customer and supplier account-matching guide.

Exercise 1: one customer invoice, one receipt

Question. Customer Atlas has the following two entries. The bank remittance advice identifies invoice F11. Decide which entries to match and what remains receivable.

DocumentDebit DHCredit DH
F11, customer invoice7,2000
R11, bank receipt07,200

Solution. Give F11 and R11 code A. Debits of DH 7,200 equal credits of DH 7,200, so the balance is zero. Both the customer's identity and the invoice reference support this allocation. Neither entry remains open after complete matching.

The receipt has already been posted. Do not enter it again when assigning the code. Doing so would create a second bank receipt and a false credit balance. Matching records the connection between existing entries; it does not recognise another sale or another movement of money.

Exercise 2: one supplier transfer settles two invoices

Question. A payment to supplier Rif explicitly covers F21 and F22. Build the complete matching group from the entries below.

DocumentDebit DHCredit DH
F21, supplier invoice03,600
F22, supplier invoice02,400
P21, bank transfer sent6,0000

Solution. Assign code B to all three entries: debit 6,000 = credit 3,600 + credit 2,400. Nothing remains payable for this exercise. The bank statement still contains a single transfer, although that transfer settles two invoices.

An automatic search for pairs of identical amounts could miss this group. The payment advice establishes the intended combination. You do not need to replace the correctly posted bank transfer with two artificial entries merely to make matching easier. Check the group total and preserve the original payment reference.

Exercise 3: two receipts leave a customer balance

Question. Invoice F31 for customer Oasis totals DH 8,400. Two receipts explicitly refer to it. Calculate the amount still due and decide whether the group is fully settled.

DocumentDebit DHCredit DH
F31, customer invoice8,4000
R31, first receipt03,000
R32, second receipt04,000

Solution. The remaining receivable is 8,400 − 3,000 − 4,000 = DH 1,400 debit. The receipts are correctly identified, but they do not settle the invoice in full. Use your system's partial-allocation facility or leave the entries open with a clear note connecting the receipts to F31.

If a later receipt R33 brings the remaining DH 1,400 for this invoice, F31, R31, R32 and R33 can receive code C together. Until then, the outstanding amount must remain visible. Do not create an expense or an unexplained adjustment just to make the selected entries balance.

Exercise 4: a customer credit note reduces the invoice

Question. A goods return generated credit note AV41, already posted against F41. The customer paid the net amount. Show why the invoice, credit note and receipt belong in one group.

DocumentDebit DHCredit DH
F41, customer invoice6,0000
AV41, customer credit note01,200
R41, bank receipt04,800

Solution. Assign code D to F41, AV41 and R41. The group balances because 6,000 = 1,200 + 4,800. The customer owes nothing further. The DH 1,200 difference between invoice and payment represents a documented reduction, not a missing receipt.

Confirm that the credit note refers to F41 and is actually recorded in the ledger. A commercial message promising a future credit note does not supply a posted accounting entry. To review the underlying entries separately, use the solved invoice, credit-note and payment exercises.

Exercise 5: a supplier credit note leaves a small shortfall

Question. Supplier Nord confirms that AV51 and P51 both relate to F51. There are no other documents or agreed reductions explaining the difference.

DocumentDebit DHCredit DH
F51, supplier invoice09,600
AV51, supplier credit note2,4000
P51, bank payment7,0000

Solution. After the credit note, the payable is 9,600 − 2,400 = DH 7,200. After payment, DH 200 credit remains: 9,600 − 2,400 − 7,000. Selected debits total DH 9,400 against credits of DH 9,600, so the group cannot be marked fully settled.

Record an action such as “F51: DH 200 still payable or awaiting explanation.” The size of a difference does not establish its cause. It is not evidence of bank charges, a discount or rounding. Investigate the supporting documents before deciding whether any accounting adjustment is appropriate.

Exercise 6: equal amounts, different invoice references

Question. Customer Amal has two invoices for the same amount. Receipt R61 identifies only F62. Which invoice should remain outstanding?

DocumentDebit DHCredit DH
F61, first invoice4,8000
F62, second invoice4,8000
R61, receipt allocated to F6204,800

Solution. Give code E to F62 and R61. F61 remains open for DH 4,800 debit. Matching F61 instead would leave the same overall account balance but identify the wrong invoice for follow-up. A correct total can therefore hide an incorrect allocation.

An older invoice date does not override a verified payment reference. When the remittance advice gives no invoice reference at all, seek confirmation of the allocation before accepting an automatic suggestion. Equal values are a useful search clue, but they do not prove which transaction the payer intended to settle.

Exercise 7: a receipt posted to the wrong customer

Question. Customer Alpha has invoice F71 debited for DH 4,200. The business received payment R71 correctly in its bank account but credited customer Beta by mistake. Documents confirm that Alpha paid and Beta was not involved. Correct the allocation without duplicating the bank movement.

Solution. Following the file's correction procedure, prepare this transfer between the individual customer accounts:

Individual accountDebit DHCredit DH
3421, customer Beta4,2000
3421, customer Alpha04,200

Do not post another movement to bank account 5141. In Alpha's account, F71 and the corrective credit make balanced group G. In Beta's account, R71 and the corrective debit make separate balanced group H. Both individual accounts now have zero balances.

Do not create a single matching group across the two customers. Retain a correction description linking the reallocation to R71 and the supporting documents. That trail explains both the original error and how it was resolved without suggesting that Beta ever made the payment.

Exercise 8: review a supplier file with an overpayment

Question. Supplier Sud has the five entries below. AV81 and P81 explicitly concern F81; P82 concerns F82. Identify the balanced group and explain the closing balance.

DocumentDebit DHCredit DH
F81, supplier invoice07,200
F82, supplier invoice04,800
AV81, credit note against F811,2000
P81, payment after credit note6,0000
P82, payment allocated to F825,0000

Solution. F81, AV81 and P81 receive code I: credit 7,200 = debit 1,200 + debit 6,000. For F82 and P82, the difference is 5,000 − 4,800 = DH 200 debit, representing an overpayment. Those two entries do not form a completely balanced group.

The whole account confirms the result: debits total DH 12,200 and credits DH 12,000, leaving DH 200 debit. This is not an additional supplier liability. Keep the partial allocation visible and seek confirmation of a refund or a future application. Do not assume that a future invoice already exists in the ledger.

Review your answers through the open items

For each completed group, identify the documents, confirm equal debits and credits and name the individual account involved. For each remaining amount, write down its origin and the next action. Distinguish money still owed by a customer, money still payable to a supplier and money paid in excess to a supplier.

Finally, reconcile the net total of the open items to the ledger balance. Exercise 6 shows why checking only that balance cannot establish the correct allocation. Exercises 3, 5 and 8 show why a nonzero balance does not itself authorise an adjustment. A useful review explains both what has settled and what still needs evidence or action.

Continue with CMCG Online Academy

To build on the invoice, payment and balance-reading skills in these cases, CMCG Online Academy, CMCG's learning app, offers exercises corrected instantly and mock exams. It covers Moroccan accounting, including the CGNC and Moroccan chart of accounts, in short interactive lessons and includes an accounting entry simulator for the journal, general ledger and trial balance. A business-French course is also included, with an interface in French or Arabic. Start with the free first module, with no bank card needed.

Related training: practical accounting training in Tangier · online accounting course

Turn what you read into real practice.

Work on real accounting files with a certified accountant, in Tangier or online.

Message on WhatsApp
Message on WhatsAppOnline Academy