mirror of
https://gitlab.com/flectra-community/account-financial-reporting.git
synced 2024-11-25 15:12:05 +00:00
[FIX] account_financial_report: vat report net calculation
This commit is contained in:
parent
5df317368c
commit
c371167660
@ -149,7 +149,7 @@ WITH
|
|||||||
(SELECT coalesce(regexp_replace(tag.name,
|
(SELECT coalesce(regexp_replace(tag.name,
|
||||||
'[^0-9\\.]+', '', 'g'), ' ') AS code,
|
'[^0-9\\.]+', '', 'g'), ' ') AS code,
|
||||||
tag.name, tag.id,
|
tag.name, tag.id,
|
||||||
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
|
coalesce(sum(CASE WHEN movetax.balance >= 0 THEN movetax.tax_base_amount ELSE movetax.tax_base_amount * -1 END), 0.00) AS net,
|
||||||
coalesce(sum(movetax.balance), 0.00) AS tax
|
coalesce(sum(movetax.balance), 0.00) AS tax
|
||||||
FROM
|
FROM
|
||||||
account_account_tag AS tag
|
account_account_tag AS tag
|
||||||
@ -201,7 +201,7 @@ WITH
|
|||||||
taxgroups AS
|
taxgroups AS
|
||||||
(SELECT coalesce(taxgroup.sequence, 0) AS code,
|
(SELECT coalesce(taxgroup.sequence, 0) AS code,
|
||||||
taxgroup.name, taxgroup.id,
|
taxgroup.name, taxgroup.id,
|
||||||
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
|
coalesce(sum(CASE WHEN movetax.balance >= 0 THEN movetax.tax_base_amount ELSE movetax.tax_base_amount * -1 END), 0.00) AS net,
|
||||||
coalesce(sum(movetax.balance), 0.00) AS tax
|
coalesce(sum(movetax.balance), 0.00) AS tax
|
||||||
FROM
|
FROM
|
||||||
account_tax_group AS taxgroup
|
account_tax_group AS taxgroup
|
||||||
@ -255,7 +255,7 @@ WITH
|
|||||||
SELECT
|
SELECT
|
||||||
tag.id AS report_tax_id, ' ' AS code,
|
tag.id AS report_tax_id, ' ' AS code,
|
||||||
tax.name, tax.id,
|
tax.name, tax.id,
|
||||||
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
|
coalesce(sum(CASE WHEN movetax.balance >= 0 THEN movetax.tax_base_amount ELSE movetax.tax_base_amount * -1 END), 0.00) AS net,
|
||||||
coalesce(sum(movetax.balance), 0.00) AS tax
|
coalesce(sum(movetax.balance), 0.00) AS tax
|
||||||
FROM
|
FROM
|
||||||
report_vat_report_taxtag AS tag
|
report_vat_report_taxtag AS tag
|
||||||
@ -310,7 +310,7 @@ WITH
|
|||||||
SELECT
|
SELECT
|
||||||
taxtag.id AS report_tax_id, ' ' AS code,
|
taxtag.id AS report_tax_id, ' ' AS code,
|
||||||
tax.name, tax.id,
|
tax.name, tax.id,
|
||||||
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
|
coalesce(sum(CASE WHEN movetax.balance >= 0 THEN movetax.tax_base_amount ELSE movetax.tax_base_amount * -1 END), 0.00) AS net,
|
||||||
coalesce(sum(movetax.balance), 0.00) AS tax
|
coalesce(sum(movetax.balance), 0.00) AS tax
|
||||||
FROM
|
FROM
|
||||||
report_vat_report_taxtag AS taxtag
|
report_vat_report_taxtag AS taxtag
|
||||||
|
Loading…
Reference in New Issue
Block a user