mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 17:48:41 +02:00
more changes
This commit is contained in:
@@ -119,18 +119,18 @@ class Transaction(models.Model):
|
||||
|
||||
def exchanged_amount(self):
|
||||
if self.account.exchange_currency:
|
||||
converted_amount = convert(
|
||||
converted_amount, prefix, suffix, decimal_places = convert(
|
||||
self.amount,
|
||||
self.account.exchange_currency,
|
||||
self.account.currency,
|
||||
to_currency=self.account.exchange_currency,
|
||||
from_currency=self.account.currency,
|
||||
date=self.date,
|
||||
)
|
||||
if converted_amount:
|
||||
return {
|
||||
"amount": converted_amount,
|
||||
"suffix": self.account.exchange_currency.suffix,
|
||||
"prefix": self.account.exchange_currency.prefix,
|
||||
"decimal_places": self.account.exchange_currency.decimal_places,
|
||||
"prefix": prefix,
|
||||
"suffix": suffix,
|
||||
"decimal_places": decimal_places,
|
||||
}
|
||||
|
||||
return None
|
||||
|
||||
@@ -38,7 +38,7 @@ def transaction_add(request):
|
||||
|
||||
return HttpResponse(
|
||||
status=204,
|
||||
headers={"HX-Trigger": "transaction_updated, hide_offcanvas, toast"},
|
||||
headers={"HX-Trigger": "updated, hide_offcanvas, toast"},
|
||||
)
|
||||
else:
|
||||
form = TransactionForm(
|
||||
@@ -69,7 +69,7 @@ def transaction_edit(request, transaction_id, **kwargs):
|
||||
|
||||
return HttpResponse(
|
||||
status=204,
|
||||
headers={"HX-Trigger": "transaction_updated, hide_offcanvas, toast"},
|
||||
headers={"HX-Trigger": "updated, hide_offcanvas, toast"},
|
||||
)
|
||||
else:
|
||||
form = TransactionForm(instance=transaction)
|
||||
@@ -102,7 +102,7 @@ def transaction_delete(request, transaction_id, **kwargs):
|
||||
|
||||
return HttpResponse(
|
||||
status=204,
|
||||
headers={"HX-Trigger": "transaction_updated, toast"},
|
||||
headers={"HX-Trigger": "updated, toast"},
|
||||
)
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ def transactions_transfer(request):
|
||||
messages.success(request, _("Transfer added successfully"))
|
||||
return HttpResponse(
|
||||
status=204,
|
||||
headers={"HX-Trigger": "transaction_updated, toast, hide_offcanvas"},
|
||||
headers={"HX-Trigger": "updated, toast, hide_offcanvas"},
|
||||
)
|
||||
else:
|
||||
form = TransferForm(
|
||||
@@ -175,7 +175,7 @@ class AddInstallmentPlanView(View):
|
||||
|
||||
return HttpResponse(
|
||||
status=204,
|
||||
headers={"HX-Trigger": "transaction_updated, hide_offcanvas, toast"},
|
||||
headers={"HX-Trigger": "updated, hide_offcanvas, toast"},
|
||||
)
|
||||
|
||||
return render(request, self.template_name, {"form": form})
|
||||
|
||||
Reference in New Issue
Block a user