changeset fef002013c63 in modules/account_es:default
details:
https://hg.tryton.org/modules/account_es?cmd=changeset;node=fef002013c63
description:
Exclude refunds from cancelled invoices on ES VAT List
issue9097
review289441002
diffstat:
reporting_tax.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diffs (21 lines):
diff -r ad1f105e5c87 -r fef002013c63 reporting_tax.py
--- a/reporting_tax.py Mon Mar 30 09:54:29 2020 +0200
+++ b/reporting_tax.py Mon Apr 06 13:05:05 2020 +0200
@@ -429,6 +429,7 @@
Date = pool.get('ir.date')
context = Transaction().context
invoice = Invoice.__table__()
+ cancel_invoice = Invoice.__table__()
invoice_tax = InvoiceTax.__table__()
tax = Tax.__table__()
tax_code = TaxCode.__table__()
@@ -450,6 +451,9 @@
& (tax.es_vat_list_code != Null)
& (Extract('year', invoice.invoice_date)
== context.get('date', Date.today()).year)
+ & ~Exists(cancel_invoice.select(
+ cancel_invoice.cancel_move, distinct=True,
+ where=(cancel_invoice.cancel_move == invoice.move)))
# Use exists to exclude the full invoice when it has multiple taxes
& ~Exists(exclude_invoice_tax.select(
exclude_invoice_tax.invoice,