5020

Split a Posted Document's VAT by Product Group

Filtering
Easy
Pro
vat
ledger-entries
posting

Split a Posted Document's VAT by Product Group

The auditor reviewing your client's VAT return wants one number pair per rate: for a given posted sales document, how much taxable base and how much VAT was recorded under each VAT product posting group. The document printout is not good enough — mixed-rate invoices (reduced-rate books next to full-rate shipping on the same document) have to be split exactly the way the posting routine recorded them in the VAT ledger, because the ledger is what gets reported to the authorities.

Requirements

Create a codeunit named "VAT Entry Summary" with a public procedure:

procedure GetGroupTotals(DocumentNo: Code[20]; PostingDate: Date; VATProdPostingGroupCode: Code[20]; var TotalBase: Decimal; var TotalAmount: Decimal)

Rules:

  1. TotalBase and TotalAmount return the sums of the Base and Amount fields over every record in the "VAT Entry" table whose "Document No." equals DocumentNo, whose "Posting Date" equals PostingDate, and whose "VAT Prod. Posting Group" equals VATProdPostingGroupCode.
The rest of the statement and 3 hints Unlock with Pro
ALBusiness Central 28.5
Pro
Pro problem

Solve it with Pro

You’re reading the opening of the statement. Pro unlocks the whole problem:

  • The full statement
  • Starter code in the browser editor
  • 7 grading tests, run on Business Central 28.5
  • 3 hints
  • The reference solution

Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.

$10 / month
or $100 / year
Upgrade
This problem is part of Pro
Pro unlocks the full statement, tests, hints and solution. The code editor works on a computer.
Upgrade