Skip to content

Commit

Permalink
chore: update query
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaMunir123 committed Dec 4, 2023
1 parent a365a08 commit 22c4133
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/transactions/api/v1/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def debit_credit(transactions: List, pk: int) -> Dict:
def calculate_opening_closing(debit_credit: Dict, pk) -> None:
for key, value in debit_credit.items():
debit_credit[key]["closing"] = debit_credit[key]["debit"] - debit_credit[key]["credit"]
if CurrencyOpening.objects.filter(currency=key).exists():
if CurrencyOpening.objects.filter(currency=key, account=pk).exists():
obj = CurrencyOpening.objects.get(currency=key, account=pk)
debit_credit[key]["opening"] = obj.opening
else:
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
24 changes: 13 additions & 11 deletions transaction_management_api/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 22c4133

Please sign in to comment.