Skip to content

Commit

Permalink
Feature: implemented importing account structure from Gnucash desktop…
Browse files Browse the repository at this point in the history
…. Option offered on first run of app

Fixed: Crash when computing account balance for accounts with sub-accounts of different currency. Only consider sub-accounts of same currency when computing account balance
Improved: Added account preferences for deleting all accounts
Improved: Support for GnuCash ROOT account. Account will never be shown to user
  • Loading branch information
codinguser committed Apr 3, 2013
1 parent a052139 commit de24fa3
Show file tree
Hide file tree
Showing 25 changed files with 1,075 additions and 500 deletions.
2 changes: 1 addition & 1 deletion app/res/menu/account_actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
android:icon="@drawable/content_import_export_holo_light"
android:title="@string/menu_export_ofx"
android:showAsAction="never"
android:orderInCategory="3"/>
android:orderInCategory="3"/>
</menu>
2 changes: 1 addition & 1 deletion app/res/menu/global_actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
android:icon="@drawable/action_settings"
android:title="@string/title_settings"
android:showAsAction="never"
android:orderInCategory="4"/>
android:orderInCategory="4"/>
</menu>
15 changes: 15 additions & 0 deletions app/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,21 @@
</string>
<string name="label_dismiss">Schließen</string>
<string name="toast_transanction_amount_required">Geben Sie einen Betrag ein um die Buchung speichern zu können</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash Accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d Unterkonto</item>
<item quantity="other">%d Unterkonten</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,21 @@
</string>
<string name="label_dismiss">Απόρριψη</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-es-rMX/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,21 @@
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,21 @@
</string>
<string name="label_dismiss">Cerrar</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,21 @@
</string>
<string name="label_dismiss">Passer</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,21 @@
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,21 @@
</string>
<string name="label_dismiss">Chiudi</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-nb/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,21 @@ format og importeres i regnskapsprogrammet GnuCash for PC.</string>
</string>
<string name="label_dismiss">Ferdig</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,21 @@
</string>
<string name="label_dismiss">Wijs af</string>
<string name="toast_transanction_amount_required">Vul een bedrag in om de transactie op te slaan.</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,21 @@
</string>
<string name="label_dismiss">Descartar</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
15 changes: 15 additions & 0 deletions app/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,21 @@
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash accounts successfully imported</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
17 changes: 17 additions & 0 deletions app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,23 @@
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="menu_import_accounts">Import GnuCash Accounts</string>
<string name="btn_import_accounts">Import Accounts</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash Accounts successfully imported</string>
<string name="key_import_accounts">import_gnucash_accounts</string>
<string name="summary_import_accounts">Import account structure exported from GnuCash desktop</string>
<string name="title_import_accounts">Import GnuCash accounts</string>
<string name="key_delete_all_accounts">delete_all_accounts</string>
<string name="summary_delete_all_accounts">Delete all accounts in the database. All transactions will be deleted as
well.
</string>
<string name="title_delete_all_accounts">Delete all accounts</string>
<string name="header_account_settings">Accounts</string>
<string name="toast_all_accounts_deleted">All accounts have been successfully deleted</string>
<string name="confirm_delete_all_accounts">Are you sure you want to delete all accounts and transactions? \nThis
operation cannot be undone!
</string>
<plurals name="label_sub_accounts">
<item quantity="one">%d sub-account</item>
<item quantity="other">%d sub-accounts</item>
Expand Down
6 changes: 4 additions & 2 deletions app/res/xml/fragment_about_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<Preference android:key="@string/key_about" android:summary="@string/summary_about_gnucash" android:title="@string/title_about"/><Preference android:key="@string/key_build_version" android:title="@string/title_build_version"/>
<Preference android:key="@string/key_about" android:summary="@string/summary_about_gnucash"
android:title="@string/title_about"/>
<Preference android:key="@string/key_build_version" android:title="@string/title_build_version"/>
<Preference android:summary="@string/summary_licence_details"
android:title="@string/title_license"
android:key="@string/key_license">
<intent android:action="android.intent.action.VIEW"
android:data="http://www.apache.org/licenses/LICENSE-2.0.html" />
</Preference>
</Preference>


</PreferenceScreen>
10 changes: 10 additions & 0 deletions app/res/xml/fragment_account_preferences.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<Preference android:key="@string/key_import_accounts"
android:summary="@string/summary_import_accounts"
android:title="@string/title_import_accounts" />
<Preference android:key="@string/key_delete_all_accounts"
android:summary="@string/summary_delete_all_accounts"
android:title="@string/title_delete_all_accounts" />
</PreferenceScreen>
4 changes: 3 additions & 1 deletion app/res/xml/preference_headers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
-->
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<header android:fragment="org.gnucash.android.ui.settings.GeneralPreferenceFragment"
android:title="@string/header_general_settings" />
android:title="@string/header_general_settings" />
<header android:fragment="org.gnucash.android.ui.settings.AccountPreferencesFragment"
android:title="@string/header_account_settings" />
<header android:fragment="org.gnucash.android.ui.settings.TransactionsPreferenceFragment"
android:title="@string/header_transaction_settings" />
<header android:fragment="org.gnucash.android.ui.settings.AboutPreferenceFragment"
Expand Down

0 comments on commit de24fa3

Please sign in to comment.