Bug 478386 - The "priceFormatted" column does not populate with 1, or any value when I save
Summary: The "priceFormatted" column does not populate with 1, or any value when I save
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: database (show other bugs)
Version: 5.1.3
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-11 03:58 UTC by rami.g.matar
Modified: 2023-12-28 16:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.2
Sentry Crash Report:


Attachments
KmmSplits table with blank values. (126.64 KB, image/png)
2023-12-11 03:58 UTC, rami.g.matar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rami.g.matar 2023-12-11 03:58:54 UTC
Created attachment 164082 [details]
KmmSplits table with blank values.

Hi, 

I'm using Excel to report on my KmyMoney data. I linked the SQLLite database as a live ODBC link to an Access database with Excel as a front end.

The Reporting query gets the amount value from [valueFormatted]/[priceFormatted], because I have foreign currency amounts and I need to convert everything to AUD on my reports.

I noticed that for some reason, the "priceFormatted" value is not always updated to "1" unless I exit KmyMoney, and re-open KmyMoney again. This prevents me from using SQLLite as a database all the time.  So I use XML, open and close, and re-update the SQLLite by a "Save As".

Is this issue something that can be fixed?

***


STEPS TO REPRODUCE
1. Open KmyMoney and create a few transactions. Do not close the file
2. Query the underlying kmmSplies table and check the priceFormatted column
3. it will be empty

OBSERVED RESULT
priceFormatted is blank

EXPECTED RESULT
priceFormatted should be 1 for local currency or the exchange value for foreign currency.

SOFTWARE/OS VERSIONS
Windows: 


ADDITIONAL INFORMATION
For your information, my Access Query is:

SELECT kmmAccounts.institutionId, [Parent Table].accountName, kmmAccounts.parentId, kmmInstitutions.name, kmmTransactions.entryDate, kmmSplits.postDate, kmmSplits.transactionId, kmmSplits.accountId, kmmAccounts.accountType, kmmAccounts.accountTypeString, kmmSplits.txType, kmmSplits.payeeId, kmmPayees.name, kmmAccounts.accountName, kmmSplits.memo, kmmSplits.valueFormatted, kmmSplits.value, kmmSplits.sharesFormatted, kmmSplits.priceFormatted, CCur([valueFormatted])/CCur([kmmSplits]![priceFormatted]) AS Amount
FROM [Parent Table] RIGHT JOIN ((((kmmSplits LEFT JOIN kmmPayees ON kmmSplits.payeeId = kmmPayees.id) LEFT JOIN kmmAccounts ON kmmSplits.accountId = kmmAccounts.id) LEFT JOIN kmmTransactions ON kmmSplits.transactionId = kmmTransactions.id) LEFT JOIN kmmInstitutions ON kmmAccounts.institutionId = kmmInstitutions.id) ON [Parent Table].id = kmmAccounts.parentId
WHERE (((kmmSplits.postDate)=Now()) AND ((Left([transactionId],1))="T")) OR (((kmmSplits.postDate)<Now()));
Comment 1 Thomas Baumgart 2023-12-28 16:47:42 UTC
Git commit 025b6c3851e3f10e46e612c19315451a2fda334b by Thomas Baumgart.
Committed on 28/12/2023 at 17:33.
Pushed by tbaumgart into branch 'master'.

Always fill price and priceFormatted column in database

MyMoneySplit::price() guarantees to return a price that is never zero.
FIXED-IN: 5.2

M  +6    -11   kmymoney/plugins/sql/mymoneystoragesql_p.h

https://invent.kde.org/office/kmymoney/-/commit/025b6c3851e3f10e46e612c19315451a2fda334b