Developing GST/VAT Worksheet: Step 7 Testing the calculation worksheet
This is most rapidly done by printing out all input and intermediate values.
A rough way of printing the input data is
{% for objectRow in objects %}
{{ objectRow.TaxCode.name }}
{{ objectRow }}
{% endfor %}
This displays the tax code name then the tax code information lubos has provided to the localisation. Most of which is readable except the UUID (the array entry showing as [taxCode, DotLiquid.Hash])
Intermediate values common to most Tax Summary localisations can be displayed as follows (but you will probably find this unnecessary as the above rough listing is relativity easy to read when see what it is displaying)
{% for objectRow in objects %}
{{ objectRow.TaxCode.name }}
{{ netSales[objectRow.TaxCode.Key] }}
{{ taxOnSales[objectRow.TaxCode.Key] }}
{{ totalSales[objectRow.TaxCode.Key] }}
{{ netPurchases[objectRow.TaxCode.Key] }}
{{ taxOnPurchases[objectRow.TaxCode.Key] }}
{{ totalPurchases[objectRow.TaxCode.Key] }}
{{ taxOnSalesMinusTaxOnPurchases[objectRow.TaxCode.Key] }}
{% endfor %}
Which can be entered into the layout section
Other intermediate calculation variables will vary for each countries worksheet. Displaying them would be useful if the results are not as you expect.
Then enter a single transaction and check the worksheet results, comparing it to what you manually calculate. Test cases should be for legitimate transaction covering the use of each of the tax codes for
- Sale
- Purchase
- Sale return (ie negative value)
- Purchase return (ie negative value)