Skip to content

Commit

Permalink
v1.0.26 - Use currency from credit entry (#26)
Browse files Browse the repository at this point in the history
* v1.0.26 - Use currency from credit entry

* v1.0.26 - Version
  • Loading branch information
Donnie committed Jan 30, 2024
1 parent d219082 commit 255fbe6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<a href="https://flutter.dev/" style="text-decoration:none" area-label="flutter">
<img src="https://img.shields.io/badge/Platform-Flutter%203.16.5-blue">
</a>
<a href="https://github.com/Donnie/Finease/releases/tag/v1.0.25" style="text-decoration:none" area-label="flutter">
<img src="https://img.shields.io/badge/Version-1.0.25-orange">
<a href="https://github.com/Donnie/Finease/releases/tag/v1.0.26" style="text-decoration:none" area-label="flutter">
<img src="https://img.shields.io/badge/Version-1.0.26-orange">
</a>
<a href="https://github.com/Donnie/Finease/actions/workflows/android_release.yml" style="text-decoration:none" area-label="flutter">
<img src="https://github.com/Donnie/Finease/actions/workflows/android_release.yml/badge.svg">
Expand Down
24 changes: 9 additions & 15 deletions lib/db/months.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,28 @@ class MonthService {
e1.updated_at,
e1.debit_account_id,
e2.credit_account_id,
(CASE
WHEN f.debit_currency = ? THEN e1.amount
ELSE e2.amount
END) AS amount,
e2.amount,
e1.date,
e2.notes,
(CASE
WHEN f.debit_currency = ? THEN ?
ELSE f.credit_currency
END) AS currency
f.credit_currency AS currency
FROM
ForexPairs f
JOIN entries e1 ON f.debit_entry_id = e1.id
JOIN entries e2 ON f.credit_entry_id = e2.id
),
NonForexEntries AS (
SELECT *, ? AS currency
FROM entries
WHERE id NOT IN (SELECT debit_entry_id FROM ForexPairs)
AND id NOT IN (SELECT credit_entry_id FROM ForexPairs)
NormalEntries AS (
SELECT e.*, ac.currency AS currency
FROM entries e
JOIN accounts ac ON e.credit_account_id = ac.id
WHERE e.id NOT IN (SELECT debit_entry_id FROM ForexPairs)
AND e.id NOT IN (SELECT credit_entry_id FROM ForexPairs)
),
ConsolidatedEntries AS (
SELECT *
FROM ConsolidatedForex
UNION ALL
SELECT *
FROM NonForexEntries
FROM NormalEntries
),
MonthlyTotals AS (
SELECT
Expand Down Expand Up @@ -152,7 +147,6 @@ class MonthService {
prefCurrency,
prefCurrency,
prefCurrency,
prefCurrency,
prefCurrency
],
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: finease
description: "A full stack mobile app to keep track of financial transactions"
publish_to: 'none'
version: 1.0.25
version: 1.0.26

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down

0 comments on commit 255fbe6

Please sign in to comment.