Skip to content

Commit 60d31e3

Browse files
committed
Merge remote-tracking branch 'codinguser/master' into hotfix/patches
2 parents badbe14 + 3c26b27 commit 60d31e3

File tree

20 files changed

+790
-728
lines changed

20 files changed

+790
-728
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
Change Log
22
===============================================================================
3+
Version 2.3.0 *(2017-09-xx)*
4+
----------------------------
5+
* Improved #696: QIF files are now always zipped regardless of the export destination
6+
7+
Version 2.2.1 *(2017-08-31)*
8+
----------------------------
9+
* Fixed #343: Transaction notes are not exported in QIF exports
10+
* Fixed #649: Commas in the account name cause errors in report generation
11+
* Fixed #689: Long press on the transaction amount brings up QWERTY keyboard
12+
* Fixed #695: Long list of splits not fully visible in transaction detail view
13+
* Fixed #699: Transaction detail screen footer disappears after editing transaction
14+
* Fixed #701: Split memos disappear after transaction edit
15+
* Fixed: Imported weekly scheduled actions no having the days of the week set
16+
* Updated translations - new language Turkish
17+
318
Version 2.2.0 *(2017-05-05)*
419
----------------------------
520
* Feature #646: Option to select backup file using Storage Access Framework

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ apply plugin: 'android-apt'
66

77
def versionMajor = 2
88
def versionMinor = 2
9-
def versionPatch = 0
10-
def versionBuild = 4
9+
def versionPatch = 1
10+
def versionBuild = 2
1111

1212
def buildTime() {
1313
def df = new SimpleDateFormat("yyyyMMdd HH:mm 'UTC'")

app/src/main/java/org/gnucash/android/export/qif/QifExporter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public List<String> generateExport() throws ExporterException {
8282
TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_UID + " AS trans_uid",
8383
TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_TIMESTAMP + " AS trans_time",
8484
TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_DESCRIPTION + " AS trans_desc",
85+
TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_NOTES + " AS trans_notes",
8586
SplitEntry.TABLE_NAME + "_" + SplitEntry.COLUMN_QUANTITY_NUM + " AS split_quantity_num",
8687
SplitEntry.TABLE_NAME + "_" + SplitEntry.COLUMN_QUANTITY_DENOM + " AS split_quantity_denom",
8788
SplitEntry.TABLE_NAME + "_" + SplitEntry.COLUMN_TYPE + " AS split_type",
@@ -151,9 +152,14 @@ public List<String> generateExport() throws ExporterException {
151152
writer.append(QifHelper.DATE_PREFIX)
152153
.append(QifHelper.formatDate(cursor.getLong(cursor.getColumnIndexOrThrow("trans_time"))))
153154
.append(newLine);
154-
writer.append(QifHelper.MEMO_PREFIX)
155+
// Payee / description
156+
writer.append(QifHelper.PAYEE_PREFIX)
155157
.append(cursor.getString(cursor.getColumnIndexOrThrow("trans_desc")))
156158
.append(newLine);
159+
// Notes, memo
160+
writer.append(QifHelper.MEMO_PREFIX)
161+
.append(cursor.getString(cursor.getColumnIndexOrThrow("trans_notes")))
162+
.append(newLine);
157163
// deal with imbalance first
158164
double imbalance = cursor.getDouble(cursor.getColumnIndexOrThrow("trans_acct_balance"));
159165
BigDecimal decimalImbalance = BigDecimal.valueOf(imbalance).setScale(2, BigDecimal.ROUND_HALF_UP);

app/src/main/java/org/gnucash/android/export/qif/QifHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class QifHelper {
2929
/*
3030
Prefixes for the QIF file
3131
*/
32+
public static final String PAYEE_PREFIX = "P";
3233
public static final String DATE_PREFIX = "D";
3334
public static final String AMOUNT_PREFIX = "T";
3435
public static final String MEMO_PREFIX = "M";

app/src/main/java/org/gnucash/android/ui/transaction/TransactionDetailActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class TransactionDetailActivity extends PasscodeLockActivity {
5454

5555
private String mTransactionUID;
5656
private String mAccountUID;
57+
private int mDetailTableRows;
5758

5859
public static final int REQUEST_EDIT_TRANSACTION = 0x10;
5960

@@ -126,6 +127,7 @@ private void bindViews(){
126127
TextView balanceTextView = accountBalance.isNegative() ? mDebitBalance : mCreditBalance;
127128
TransactionsActivity.displayBalance(balanceTextView, accountBalance);
128129

130+
mDetailTableRows = mDetailTableLayout.getChildCount();
129131
boolean useDoubleEntry = GnuCashApplication.isDoubleEntryEnabled();
130132
LayoutInflater inflater = LayoutInflater.from(this);
131133
int index = 0;
@@ -175,8 +177,8 @@ private void refresh(){
175177
* Remove the split item views from the transaction detail prior to refreshing them
176178
*/
177179
private void removeSplitItemViews(){
178-
long splitCount = TransactionsDbAdapter.getInstance().getSplitCount(mTransactionUID);
179-
mDetailTableLayout.removeViews(0, (int)splitCount);
180+
// Remove all rows that are not special.
181+
mDetailTableLayout.removeViews(0, mDetailTableLayout.getChildCount() - mDetailTableRows);
180182
mDebitBalance.setText("");
181183
mCreditBalance.setText("");
182184
}

app/src/main/java/org/gnucash/android/ui/transaction/TransactionFormFragment.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ private List<Split> extractSplitsFromView(){
698698

699699
BigDecimal amountBigd = mAmountEditText.getValue();
700700
String baseCurrencyCode = mTransactionsDbAdapter.getAccountCurrencyCode(mAccountUID);
701-
Money value = new Money(amountBigd, Commodity.getInstance(baseCurrencyCode)).abs();
701+
Money value = new Money(amountBigd, Commodity.getInstance(baseCurrencyCode));
702702
Money quantity = new Money(value);
703703

704704
String transferAcctUID = getTransferAccountUID();
@@ -719,9 +719,24 @@ private List<Split> extractSplitsFromView(){
719719
}
720720
}
721721

722-
Split split1 = new Split(value, mAccountUID);
722+
Split split1;
723+
Split split2;
724+
// Try to preserve the other split attributes.
725+
if (mSplitsList.size() >= 2) {
726+
split1 = mSplitsList.get(0);
727+
split1.setValue(value);
728+
split1.setQuantity(value);
729+
split1.setAccountUID(mAccountUID);
730+
731+
split2 = mSplitsList.get(1);
732+
split2.setValue(value);
733+
split2.setQuantity(quantity);
734+
split2.setAccountUID(transferAcctUID);
735+
} else {
736+
split1 = new Split(value, mAccountUID);
737+
split2 = new Split(value, quantity, transferAcctUID);
738+
}
723739
split1.setType(mTransactionTypeSwitch.getTransactionType());
724-
Split split2 = new Split(value, quantity, transferAcctUID);
725740
split2.setType(mTransactionTypeSwitch.getTransactionType().invert());
726741

727742
List<Split> splitList = new ArrayList<>();

app/src/main/java/org/gnucash/android/ui/util/widget/CalculatorEditText.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
package org.gnucash.android.ui.util.widget;
1717

18-
import android.app.Activity;
1918
import android.content.Context;
2019
import android.content.res.TypedArray;
2120
import android.inputmethodservice.KeyboardView;
21+
import android.os.Build;
2222
import android.support.annotation.Nullable;
2323
import android.support.annotation.XmlRes;
2424
import android.support.v7.widget.AppCompatEditText;
@@ -29,15 +29,13 @@
2929
import android.util.Log;
3030
import android.view.MotionEvent;
3131
import android.view.View;
32-
import android.view.inputmethod.InputMethodManager;
3332

3433
import com.crashlytics.android.Crashlytics;
3534

3635
import net.objecthunter.exp4j.Expression;
3736
import net.objecthunter.exp4j.ExpressionBuilder;
3837

3938
import org.gnucash.android.R;
40-
import org.gnucash.android.app.GnuCashApplication;
4139
import org.gnucash.android.model.Commodity;
4240
import org.gnucash.android.ui.common.FormActivity;
4341
import org.gnucash.android.util.AmountParser;
@@ -148,18 +146,12 @@ public void onClick(View v) {
148146
// Disable spell check (hex strings look like words to Android)
149147
setInputType(getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
150148

151-
// FIXME: for some reason, this prevents the text selection from working
152-
setOnLongClickListener(new View.OnLongClickListener() {
153-
@Override
154-
public boolean onLongClick(View v) {
155-
if (v != null && !isInEditMode())
156-
((InputMethodManager) GnuCashApplication.getAppContext()
157-
.getSystemService(Activity.INPUT_METHOD_SERVICE))
158-
.hideSoftInputFromWindow(v.getWindowToken(), 0);
159-
160-
return false;
161-
}
162-
});
149+
// Disable system keyboard appearing on long-press, but for some reason, this prevents the text selection from working.
150+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
151+
setShowSoftInputOnFocus(false);
152+
} else {
153+
setRawInputType(InputType.TYPE_CLASS_NUMBER);
154+
}
163155

164156
// Although this handler doesn't make sense, if removed, the standard keyboard
165157
// shows up in addition to the calculator one when the EditText gets a touch event.

app/src/main/res/layout/fragment_transaction_form.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
android:background="@android:color/transparent"
7373
android:textColor="@color/debit_red"
7474
android:textSize="20sp"
75+
android:textIsSelectable="true"
7576
gnucash:keyboardKeysLayout="@xml/calculator_keyboard"/>
7677

7778
<ImageView android:id="@+id/btn_split_editor"

app/src/main/res/values-af-rZA/strings.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
limitations under the License.
1717
-->
1818
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
19-
<string name="title_create_account">Create Account</string>
20-
<string name="title_edit_account">Edit Account</string>
21-
<string name="description_add_transaction_icon">Add a new transaction to an account</string>
22-
<string name="description_view_account_icon">View account details</string>
23-
<string name="label_no_accounts">No accounts to display</string>
24-
<string name="label_account_name">Account name</string>
25-
<string name="btn_cancel">Cancel</string>
26-
<string name="btn_save">Save</string>
27-
<string name="btn_test">Test</string>
28-
<string name="label_passcode">Enter Passcode</string>
29-
<string name="toast_wrong_passcode">Wrong passcode, please try again</string>
30-
<string name="toast_passcode_set">Passcode set</string>
31-
<string name="label_confirm_passcode">Please confirm your passcode</string>
19+
<string name="title_create_account">Skep Rekening</string>
20+
<string name="title_edit_account">Wysig Rekening</string>
21+
<string name="description_add_transaction_icon">Voeg \'n nuwe transaksie by \'n rekening</string>
22+
<string name="description_view_account_icon">Bekyk rekening besonderhede</string>
23+
<string name="label_no_accounts">Geen rekeninge om te wys</string>
24+
<string name="label_account_name">Rekeningnaam</string>
25+
<string name="btn_cancel">Kanselleer</string>
26+
<string name="btn_save">Stoor</string>
27+
<string name="btn_test">Toets</string>
28+
<string name="label_passcode">Voer Wagwoord in</string>
29+
<string name="toast_wrong_passcode">Verkeerde wagwoord, probeer asseblief weer</string>
30+
<string name="toast_passcode_set">Wagwoord ingestel</string>
31+
<string name="label_confirm_passcode">Bevestig asseblief jou wagwoord</string>
3232
<string name="toast_invalid_passcode_confirmation">Invalid passcode confirmation. Please try again</string>
3333
<string name="label_transaction_name">Description</string>
3434
<string name="label_transaction_amount">Amount</string>

app/src/main/res/values-de/strings.xml

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<string name="title_create_account">Neues Konto</string>
2020
<string name="title_edit_account">Konto bearbeiten</string>
2121
<string name="description_add_transaction_icon">Neue Buchung in ein Konto</string>
22-
<string name="description_view_account_icon">View account details</string>
22+
<string name="description_view_account_icon">Account-Details anzeigen</string>
2323
<string name="label_no_accounts">Keine Konten vorhanden</string>
2424
<string name="label_account_name">Kontoname</string>
2525
<string name="btn_cancel">Abbrechen</string>
@@ -56,10 +56,10 @@
5656
<string name="hint_delete_after_export">Alle exportierten Buchungen werden nach dem Export gelöscht.</string>
5757
<string name="title_settings">Einstellungen</string>
5858
<string-array name="export_destinations">
59-
<item>Save As&#8230;</item>
59+
<item>Speichern unter&#8230;</item>
6060
<item>Dropbox</item>
6161
<item>ownCloud</item>
62-
<item>Send to&#8230;</item>
62+
<item>Senden an&#8230;</item>
6363
</string-array>
6464
<string name="btn_move">Verschieben</string>
6565
<string name="title_move_transactions">%1$d Buchung(en) verschieben</string>
@@ -77,7 +77,7 @@
7777
<string name="label_permission_record_transaction">Buchungen speichern in GnuCash</string>
7878
<string name="label_permission_create_account">Konten in GnuCash erstellen</string>
7979
<string name="label_display_account">Konto anzeigen</string>
80-
<string name="label_hide_account_balance">Hide account balance in widget</string>
80+
<string name="label_hide_account_balance">Kontostand im Widget ausblenden</string>
8181
<string name="btn_create_accounts">Konten erstellen</string>
8282
<string name="error_no_accounts">Keine Konten vorhanden.\nErstellen Sie ein Konto um Widgets hinzuzufügen</string>
8383
<string name="title_license">Lizenz</string>
@@ -86,7 +86,7 @@
8686
<string name="label_widget_configuration">Konto auswählen</string>
8787
<string name="toast_no_transactions_to_export">Keine Buchungen zum Exportieren</string>
8888
<string name="title_passcode_preferences">Sicherheit</string>
89-
<string name="title_enable_passcode">Enable passcode</string>
89+
<string name="title_enable_passcode">Zugangscode aktivieren</string>
9090
<string name="title_change_passcode">PIN ändern</string>
9191
<string name="title_about_gnucash">Über GnuCash</string>
9292
<string name="title_export_email">GnuCash Android exportierte %1$s-Datei</string>
@@ -117,12 +117,11 @@
117117
<string name="summary_xml_ofx_header">Diese Option aktivieren, wenn Sie die OFX-Dateien für ein anderes Programm als GnuCash auf dem Desktop exportieren</string>
118118
<string name="title_whats_new">Neuigkeiten in dieser Version</string>
119119
<string name="whats_new">
120-
- Added ability to export to any service which supports the Storage Access Framework \n
121-
- Added option to set the location for regular automatic backups (See backup settings)\n
122-
- Added Bitcoin currency support\n
123-
- Added support for renaming books\n
124-
- Multiple bug fixes and improvements\n
125-
</string>
120+
- Export zu einem beliebigen Dienst mit Storage Access Framework Unterstützung möglich \n
121+
- Option, um Ort für regelmäßige automatische Backups, hinzugefügt (Siehe Backup Einstellungen)\n
122+
- Bitcoin-Unterstützung hinzugefügt\n
123+
- Bücher umbenennen ermöglicht\n
124+
- Mehrere Bugfixes and Verbesserungen\n</string>
126125
<string name="label_dismiss">Schließen</string>
127126
<string name="toast_transanction_amount_required">Geben Sie einen Betrag ein, um die Buchung speichern zu können</string>
128127
<string name="toast_error_importing_accounts">Beim Importieren der GnuCash-Konten ist ein Fehler aufgetreten!</string>
@@ -253,8 +252,8 @@
253252
<string name="summary_owncloud_sync">ownCload-Export aktivieren</string>
254253
<string name="title_backup_prefs">Sicherungs-Einstellungen</string>
255254
<string name="title_create_backup_pref">Sicherung erstellen</string>
256-
<string name="summary_create_backup_pref">Create a backup of the active book</string>
257-
<string name="summary_restore_backup_pref">Restore most recent backup of active book</string>
255+
<string name="summary_create_backup_pref">Erstelle eine Sicherungskopie des aktuellen Buches</string>
256+
<string name="summary_restore_backup_pref">Letzte Sicherung vom aktiven Buch wiederherstellen</string>
258257
<string name="toast_backup_successful">Sicherung erfolgreich</string>
259258
<string name="toast_backup_failed">Sicherung fehlgeschlagen</string>
260259
<string name="export_warning_xml">Alle Konten und Buchungen werden exportiert</string>
@@ -276,8 +275,8 @@
276275
<string name="owncloud_user_ok">OC Benutzername/Passwort OK</string>
277276
<string name="owncloud_dir_ok">Dir-Name OK</string>
278277
<plurals name="label_every_x_hours">
279-
<item quantity="one">Hourly</item>
280-
<item quantity="other">Every %d hours</item>
278+
<item quantity="one">Stündlich</item>
279+
<item quantity="other">Alle %d Stunden</item>
281280
</plurals>
282281
<plurals name="label_every_x_days">
283282
<item quantity="one">Täglich</item>
@@ -434,23 +433,23 @@ No user-identifiable information will be collected as part of this process!</str
434433
<string name="label_recommend_app">Im Play Store empfehlen</string>
435434
<string name="repeat_until_date">bis %1$s</string>
436435
<string name="repeat_on_weekday">am %1$s</string>
437-
<string name="repeat_x_times">for %1$d times</string>
436+
<string name="repeat_x_times">für %1$d Mal</string>
438437
<string name="menu_show_compact_view">Kompakte Ansicht</string>
439438
<string name="book_default_name">Buch %1$d</string>
440-
<string name="last_export_time_never">never</string>
441-
<string name="title_rename_book">Rename Book</string>
442-
<string name="btn_rename">Rename</string>
443-
<string name="menu_rename">Rename</string>
444-
<string name="title_select_backup_file">Select backup file</string>
445-
<string name="summary_select_backup_file">Select a file for automatic backups</string>
446-
<string name="title_confirm_restore_backup">Confirm restore from backup</string>
447-
<string name="msg_confirm_restore_backup_into_new_book">A new book will be opened with the contents of this backup. Do you wish to proceed?</string>
448-
<string name="btn_restore">Restore</string>
449-
<string name="title_no_backups_found">No backups found</string>
450-
<string name="msg_no_backups_to_restore_from">There are no existing backup files to restore from</string>
439+
<string name="last_export_time_never">nie</string>
440+
<string name="title_rename_book">Buch umbenennen</string>
441+
<string name="btn_rename">Umbenennen</string>
442+
<string name="menu_rename">Umbenennen</string>
443+
<string name="title_select_backup_file">Eine Sicherungsdatei auswählen</string>
444+
<string name="summary_select_backup_file">Wählen Sie eine Datei für die automatische Sicherungen</string>
445+
<string name="title_confirm_restore_backup">Wiederherstellung von einer Sicherung bestätigen</string>
446+
<string name="msg_confirm_restore_backup_into_new_book">Es wird ein neues Buch mit den Daten dieser Sicherungsdatei geöffnet.</string>
447+
<string name="btn_restore">Wiederherstellen</string>
448+
<string name="title_no_backups_found">Keine Sicherungen gefunden</string>
449+
<string name="msg_no_backups_to_restore_from">Es sind keine Sicherungsdateien vorhanden, die wiederhergestellt werden könnten</string>
451450
<!-- This is the filename for default backups. So use only simple characters and no spaces. Do not change the extension -->
452451
<string name="label_backup_filename">gnucash_android_backup.gnca</string>
453-
<string name="label_select_destination_after_export">Select the destination after export is complete</string>
454-
<string name="label_dropbox_export_destination">Export to \'/Apps/GnuCash Android/\' folder on Dropbox</string>
455-
<string name="title_section_preferences">Preferences</string>
452+
<string name="label_select_destination_after_export">Wähle den Zielort, wenn der Export abgeschlossen wurde</string>
453+
<string name="label_dropbox_export_destination">Exportiere in Dropbox-Ordner: \'/Apps/GnuCash Android/\'</string>
454+
<string name="title_section_preferences">Voreinstellungen</string>
456455
</resources>

0 commit comments

Comments
 (0)