Replaced tuples with lists in the arguments for reverse() in the accounting application.
This commit is contained in:
parent
d1cb5cb0d0
commit
6ff9d0d4ff
@ -100,28 +100,28 @@ class ReportUrl:
|
|||||||
if ledger is None else ledger
|
if ledger is None else ledger
|
||||||
|
|
||||||
def cash(self) -> str:
|
def cash(self) -> str:
|
||||||
return reverse("accounting:cash", args=(self._cash, self._period))
|
return reverse("accounting:cash", args=[self._cash, self._period])
|
||||||
|
|
||||||
def cash_summary(self) -> str:
|
def cash_summary(self) -> str:
|
||||||
return reverse("accounting:cash-summary", args=(self._cash,))
|
return reverse("accounting:cash-summary", args=[self._cash])
|
||||||
|
|
||||||
def ledger(self) -> str:
|
def ledger(self) -> str:
|
||||||
return reverse("accounting:ledger", args=(self._ledger, self._period))
|
return reverse("accounting:ledger", args=[self._ledger, self._period])
|
||||||
|
|
||||||
def ledger_summary(self) -> str:
|
def ledger_summary(self) -> str:
|
||||||
return reverse("accounting:ledger-summary", args=(self._ledger,))
|
return reverse("accounting:ledger-summary", args=[self._ledger])
|
||||||
|
|
||||||
def journal(self) -> str:
|
def journal(self) -> str:
|
||||||
return reverse("accounting:journal", args=(self._period,))
|
return reverse("accounting:journal", args=[self._period])
|
||||||
|
|
||||||
def trial_balance(self) -> str:
|
def trial_balance(self) -> str:
|
||||||
return reverse("accounting:trial-balance", args=(self._period,))
|
return reverse("accounting:trial-balance", args=[self._period])
|
||||||
|
|
||||||
def income_statement(self) -> str:
|
def income_statement(self) -> str:
|
||||||
return reverse("accounting:income-statement", args=(self._period,))
|
return reverse("accounting:income-statement", args=[self._period])
|
||||||
|
|
||||||
def balance_sheet(self) -> str:
|
def balance_sheet(self) -> str:
|
||||||
return reverse("accounting:balance-sheet", args=(self._period,))
|
return reverse("accounting:balance-sheet", args=[self._period])
|
||||||
|
|
||||||
|
|
||||||
class Populator:
|
class Populator:
|
||||||
|
@ -705,7 +705,7 @@ def balance_sheet(request: HttpRequest, period: Period) -> HttpResponse:
|
|||||||
.filter(Q(amount__isnull=False), ~Q(amount=0))
|
.filter(Q(amount__isnull=False), ~Q(amount=0))
|
||||||
.order_by("code"))
|
.order_by("code"))
|
||||||
for account in accounts:
|
for account in accounts:
|
||||||
account.url = reverse("accounting:ledger", args=(account, period))
|
account.url = reverse("accounting:ledger", args=[account, period])
|
||||||
balance = Record.objects \
|
balance = Record.objects \
|
||||||
.filter(
|
.filter(
|
||||||
Q(transaction__date__lt=period.start)
|
Q(transaction__date__lt=period.start)
|
||||||
@ -722,7 +722,7 @@ def balance_sheet(request: HttpRequest, period: Period) -> HttpResponse:
|
|||||||
code=Account.ACCUMULATED_BALANCE)
|
code=Account.ACCUMULATED_BALANCE)
|
||||||
brought_forward.amount = balance
|
brought_forward.amount = balance
|
||||||
brought_forward.url = reverse(
|
brought_forward.url = reverse(
|
||||||
"accounting:income-statement", args=(period.period_before(),))
|
"accounting:income-statement", args=[period.period_before()])
|
||||||
accounts.append(brought_forward)
|
accounts.append(brought_forward)
|
||||||
balance = Record.objects \
|
balance = Record.objects \
|
||||||
.filter(
|
.filter(
|
||||||
@ -740,7 +740,7 @@ def balance_sheet(request: HttpRequest, period: Period) -> HttpResponse:
|
|||||||
net_change = Account.objects.get(code=Account.NET_CHANGE)
|
net_change = Account.objects.get(code=Account.NET_CHANGE)
|
||||||
net_change.amount = balance
|
net_change.amount = balance
|
||||||
net_change.url = reverse(
|
net_change.url = reverse(
|
||||||
"accounting:income-statement", args=(period,))
|
"accounting:income-statement", args=[period])
|
||||||
accounts.append(net_change)
|
accounts.append(net_change)
|
||||||
for account in [x for x in accounts if x.code[0] in "23"]:
|
for account in [x for x in accounts if x.code[0] in "23"]:
|
||||||
account.amount = -account.amount
|
account.amount = -account.amount
|
||||||
@ -863,7 +863,7 @@ class TransactionFormView(FormView):
|
|||||||
def get_success_url(self) -> str:
|
def get_success_url(self) -> str:
|
||||||
"""Returns the URL on success."""
|
"""Returns the URL on success."""
|
||||||
return reverse("accounting:transactions.detail",
|
return reverse("accounting:transactions.detail",
|
||||||
args=(self.txn_type, self.get_object()),
|
args=[self.txn_type, self.get_object()],
|
||||||
current_app=self.request.resolver_match.namespace)
|
current_app=self.request.resolver_match.namespace)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -986,7 +986,7 @@ class AccountFormView(FormView):
|
|||||||
|
|
||||||
def get_success_url(self) -> str:
|
def get_success_url(self) -> str:
|
||||||
"""Returns the URL on success."""
|
"""Returns the URL on success."""
|
||||||
return reverse("accounting:accounts.detail", args=(self.get_object(),),
|
return reverse("accounting:accounts.detail", args=[self.get_object()],
|
||||||
current_app=self.request.resolver_match.namespace)
|
current_app=self.request.resolver_match.namespace)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user