mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Accounting report: Split gift card transactions in credit and debit
This commit is contained in:
@@ -762,17 +762,27 @@ class ReportExporter(ReportlabExportMixin, BaseExporter):
|
|||||||
else:
|
else:
|
||||||
tx_before = Decimal("0.00")
|
tx_before = Decimal("0.00")
|
||||||
|
|
||||||
tx_during = self._giftcard_transaction_qs(form_data, currency).aggregate(s=Sum("value"))[
|
tx_during_pos = self._giftcard_transaction_qs(form_data, currency).filter(value__gte=Decimal("0.00")).aggregate(s=Sum("value"))[
|
||||||
"s"
|
"s"
|
||||||
] or Decimal("0.00")
|
] or Decimal("0.00")
|
||||||
tdata.append(
|
tdata.append(
|
||||||
[
|
[
|
||||||
Paragraph(_("Gift card transactions"), tstyle),
|
Paragraph(_("Gift card transactions (credit)"), tstyle),
|
||||||
Paragraph(money_filter(tx_during, currency), tstyle_right),
|
Paragraph(money_filter(tx_during_pos, currency), tstyle_right),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
open_after = tx_before + tx_during
|
tx_during_neg = self._giftcard_transaction_qs(form_data, currency).filter(value__lt=Decimal("0.00")).aggregate(s=Sum("value"))[
|
||||||
|
"s"
|
||||||
|
] or Decimal("0.00")
|
||||||
|
tdata.append(
|
||||||
|
[
|
||||||
|
Paragraph(_("Gift card transactions (debit)"), tstyle),
|
||||||
|
Paragraph(money_filter(tx_during_neg, currency), tstyle_right),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
open_after = tx_before + tx_during_pos + tx_during_neg
|
||||||
tdata.append(
|
tdata.append(
|
||||||
[
|
[
|
||||||
Paragraph(
|
Paragraph(
|
||||||
|
|||||||
Reference in New Issue
Block a user