[ADDED] Patch for bug and new feature
Moderator: Renato
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
[ADDED] Patch for bug and new feature
I have fixed a bug and added new feature to your program.
My changes based on svn revision 393.
1.Fixed bug, file mmhomepagepanel.cpp.
MMEX calculates "double tBalance" and shows "Total of Accounts:" value on its home page.
But this is a bug - you calculates sum of balances with different currencies.
For example, I have first account in US dollar, second in EURO, third in my national currency UAH,
and last in XAU (gold). The total sum of balalces of these accounts has no sense.
So, I have fixed this issue. Instead of double tBalance I use map and sum balances for each currency.
- double tBalance = 0.0;
+
+ typedef std::map<boost::shared_ptr<mmCurrency>, double> balances_t;
+ balances_t tBalances;
2.New feature - added new item in list of viewTrans (changes in mmcheckingpanel.cpp, optionsdialog.cpp).
So, the list will be like a
...
"View Today" <== new item
"View 30 days"
"View 90 days"
"View Last Month"
"View Current Month"
Often I want to see only entered today trunsactions. This changes makes it possible.
My changes based on svn revision 393.
1.Fixed bug, file mmhomepagepanel.cpp.
MMEX calculates "double tBalance" and shows "Total of Accounts:" value on its home page.
But this is a bug - you calculates sum of balances with different currencies.
For example, I have first account in US dollar, second in EURO, third in my national currency UAH,
and last in XAU (gold). The total sum of balalces of these accounts has no sense.
So, I have fixed this issue. Instead of double tBalance I use map and sum balances for each currency.
- double tBalance = 0.0;
+
+ typedef std::map<boost::shared_ptr<mmCurrency>, double> balances_t;
+ balances_t tBalances;
2.New feature - added new item in list of viewTrans (changes in mmcheckingpanel.cpp, optionsdialog.cpp).
So, the list will be like a
...
"View Today" <== new item
"View 30 days"
"View 90 days"
"View Last Month"
"View Current Month"
Often I want to see only entered today trunsactions. This changes makes it possible.
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 99
- Joined: Sun Nov 30, 2008 8:06 pm
Re: Patch for bug and new feature
Thanks Vadim, Patches checked in SVN Version 394.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: [ADDED] Patch for bug and new feature
Thanks, Vadim.
But new bugs was added
1. Now in homepage I have 65425,86$
Wow, but really only 2100
(2100*31,16=65425,86)
2. Income vc Expenses: Current month became in $ but amount in Roubles.
And additionally. I have a stock account in $, but on home page it appears in the rubles.
But new bugs was added
1. Now in homepage I have 65425,86$
Wow, but really only 2100
(2100*31,16=65425,86)
2. Income vc Expenses: Current month became in $ but amount in Roubles.
And additionally. I have a stock account in $, but on home page it appears in the rubles.
-
- Site Admin
- Posts: 99
- Joined: Sun Nov 30, 2008 8:06 pm
Re: [ADDED] Patch for bug and new feature
Ouch!
Vadim, can you please fix these issues? I will need to pull out the home page patch till this is resolved. Thanks!
Vadim, can you please fix these issues? I will need to pull out the home page patch till this is resolved. Thanks!
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: [ADDED] Patch for bug and new feature
I have six accounts and one Assets. My sums for four currencies are right. You can investigate this problem using your database.
P.S. By the way, I did not touch computing "Income vs Expenses: Current Month" values on home page.
P.S. By the way, I did not touch computing "Income vs Expenses: Current Month" values on home page.
Last edited by Vadim on Fri Aug 07, 2009 1:43 pm, edited 1 time in total.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
"View Today" <== new item
I can't translate it into russian
No a .po file is used.
I can't translate it into russian
No a .po file is used.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
I have already translated new strings in russian.po If you generate russian.mo, all will be OK.Nikolay wrote:"View Today" <== new item
I can't translate it into russian
No a .po file is used.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: [ADDED] Patch for bug and new feature
I'll try to analyze what can be wrong in my changesNikolay wrote:Thanks, Vadim.
But new bugs was added
1. Now in homepage I have 65425,86$
Wow, but really only 2100
(2100*31,16=65425,86)
2. Income vc Expenses: Current month became in $ but amount in Roubles.
And additionally. I have a stock account in $, but on home page it appears in the rubles.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
Sample DB uploaded.
And when I switch mmex language to English Income vc Expenses become $.
When interface language is russian - Income vc Expenses back to roubles.
And when I switch mmex language to English Income vc Expenses become $.
When interface language is russian - Income vc Expenses back to roubles.
You do not have the required permissions to view the files attached to this post.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
Thank you, I will investigate the problem. But I'm not shure that I fix this issue today.Nikolay wrote:Sample DB uploaded.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
I have found what is wrong. Your database has for US DOLLAR conversion to base rate = 31.653549 (Tools\Organize Currencies).
So, my changes are valid. But I think for all reports and " Income vs Expenses: Current Month" on home page we must calculate sums per each currency (or for database currency if we don't want to waste space on home page).
So, my changes are valid. But I think for all reports and " Income vs Expenses: Current Month" on home page we must calculate sums per each currency (or for database currency if we don't want to waste space on home page).
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
But it's nothing wrong!
I have Tools - Options - Others - Enable online currency update (Get data from European Central Bank)=Yes
Then "Tools - Online Update Currency Rate" has been done.
I have Tools - Options - Others - Enable online currency update (Get data from European Central Bank)=Yes
Then "Tools - Online Update Currency Rate" has been done.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
Ok, I need more time to resolve this situation.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
I have fixed this issue.
1.The program has default database currency. You can change one in Tools\Options\Generas Settings\Base currency.
2.Before my changes the program calculated "Total of Accounts:" as sum per every account
account.initialBalance + account.Balanse * account_currency."Conversion to base rate".
Thus, "Total of Accounts:" value always measured in default database currency.
In your case,
RUR -1p.
US_DOLLAR $ -1*31.65 (conversion to base rate of USD currency)
Expenses = 32.65p (1p + 31.65p)
Now I don't use conversion to base rate when calculates total sum per every currency.
3."Income vs Expenses: Current Month" values before my changes and now also use units of default currency.
When your default currency is RUR, these values will be XXX RUR.
When you switch default currency to USD, these values will be $XXX.
1.The program has default database currency. You can change one in Tools\Options\Generas Settings\Base currency.
2.Before my changes the program calculated "Total of Accounts:" as sum per every account
account.initialBalance + account.Balanse * account_currency."Conversion to base rate".
Thus, "Total of Accounts:" value always measured in default database currency.
In your case,
RUR -1p.
US_DOLLAR $ -1*31.65 (conversion to base rate of USD currency)
Expenses = 32.65p (1p + 31.65p)
Now I don't use conversion to base rate when calculates total sum per every currency.
3."Income vs Expenses: Current Month" values before my changes and now also use units of default currency.
When your default currency is RUR, these values will be XXX RUR.
When you switch default currency to USD, these values will be $XXX.
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
Hi,
It's more better.
(1 EUR= 45.45 EUR; 1 USD=31.65 RUB)
45.45+31.65+1=78.1
I have added one stock investment account. It has been created in USD but it has been recalculated to RUB.
And now lacks the Total in base currency (as was before).
Samples attached.
It's more better.
(1 EUR= 45.45 EUR; 1 USD=31.65 RUB)
45.45+31.65+1=78.1
I have added one stock investment account. It has been created in USD but it has been recalculated to RUB.
And now lacks the Total in base currency (as was before).
Samples attached.
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
Sample how it was before:
You do not have the required permissions to view the files attached to this post.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
Hi,
I reverted "Total". Now "Total" and "Total of Accounts" will be shown always.
Table "Currency - Summary" will be shown only when you have the same currency
in more than one account\asset\stock and balance for this account != 0.
I reverted "Total". Now "Total" and "Total of Accounts" will be shown always.
Table "Currency - Summary" will be shown only when you have the same currency
in more than one account\asset\stock and balance for this account != 0.
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
Hi,
Now this is an excellent and even better than I could wish for. Thank you very much.
A sample for the database in which the base currency is USD, and three accounts in RUB, EUR and USD.
Now this is an excellent and even better than I could wish for. Thank you very much.
A sample for the database in which the base currency is USD, and three accounts in RUB, EUR and USD.
You do not have the required permissions to view the files attached to this post.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
And thanks to you!
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
Hi,
It seems that when there are no Assets the Table "Currency - Summary" does not appears.
It seems that when there are no Assets the Table "Currency - Summary" does not appears.
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
Hi,
table "Currency - Summary" will be shown only when you have the same currency
in more than one account\asset\stock and balance for this line != 0. You can attach database that I can check if am I right.
table "Currency - Summary" will be shown only when you have the same currency
in more than one account\asset\stock and balance for this line != 0. You can attach database that I can check if am I right.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
Hm....
Something wrong...
Check, please this DB:
Something wrong...
Check, please this DB:
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
Sorry.
Has been updated!
Has been updated!
-
- Super User
- Posts: 142
- Joined: Mon Aug 03, 2009 7:35 am
- Are you a spam bot?: No
Re: Patch for bug and new feature
There is no need to show "Currency-Summary" table for this case.
You have
BillNo1 $-1.00
EUR 0,00€
RUB 00р.
Stocks - zero
Assets - zero
The "Currency-Summary" will duplicate information that you already see on screen.
But when Stocks or Assets will have non zero balance (in RUR), the table will be shown
because you do not see full RUR's sum. Or when you add new account in RUR or EUR or USD
with non zero balance.
You have
BillNo1 $-1.00
EUR 0,00€
RUB 00р.
Stocks - zero
Assets - zero
The "Currency-Summary" will duplicate information that you already see on screen.
But when Stocks or Assets will have non zero balance (in RUR), the table will be shown
because you do not see full RUR's sum. Or when you add new account in RUR or EUR or USD
with non zero balance.
Last edited by Vadim on Fri Aug 14, 2009 1:33 pm, edited 1 time in total.
-
- Developer
- Posts: 1535
- Joined: Sat Dec 06, 2008 2:27 pm
- Are you a spam bot?: No
- Location: Sankt-Petersburg, Russia
Re: Patch for bug and new feature
Could You, please, explain why? There are 3 accounts with 3 different currency in the DB.
And why it shown when I added Asset?
And why it shown when I added Asset?