Edit Report:Customer Taxes
Menu Anchors
'customers', 'orders', 'sales', 'payables', 'warehouse', 'dispatching', 'receivables', 'payables-dash', 'inventory', 'purchases', 'generallendger', 'users',-- Customer Taxes
-- VARIABLE: {
-- name: "range",
-- display: "Report Range",
-- type: "daterange",
-- default: { start: "first day of this month", end: "last day of this month" }
-- }
-- VARIABLE: {
-- name: "customer",
-- display: "Customer Number",
-- type: "text",
-- }
-- VARIABLE: {
-- name: "branch",
-- display: "Branch Code",
-- type: "text",
-- }
SELECT
t.description AS TAXAUTH,
CAST(
sum( taxamount ) AS DECIMAL ( 10, 2 )) AS AMOUNT
FROM
debtortranstaxes d
JOIN taxauthorities t ON d.taxauthid = t.taxid
WHERE
debtortransid IN (
SELECT
id
FROM
debtortrans
WHERE
debtorno = '{{ customer }}'
{% if branch != '' %}
AND branchcode = '{{ branch }}'
{% endif %}
AND trandate BETWEEN '{{ range.start }}' AND '{{ range.end }}'
)
GROUP BY
taxid