Skip to content

Commit

Permalink
Merge branch 'release/v1.5.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
codinguser committed Feb 14, 2015
2 parents 93e4354 + 0a134d1 commit 4ce198c
Show file tree
Hide file tree
Showing 320 changed files with 4,791 additions and 4,650 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
Change Log
===============================================================================
Version 1.5.4 *(2015-02-16)*
----------------------------
* Fixed: Crash when creating TRADING accounts
* Fixed: Crash when deleting scheduled transactions
* Fixed: Account parent can be set to self, creating a cyclic hierarchy
* Fixed: Transactions not saved when double-entry is enabled but no transfer account is specified
* Improved: Auto-select the device locale currency in the account-creation dialog
* Improved: Upgraded structure of repository to match latest Android conventions
* Improved: Updated instrumentation tests and enabled better test reporting with Spoon

Version 1.5.3 *(2015-02-02)*
----------------------------
* Fixed: Unable to edit double-entry transactions
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ Lei Xiao Bao <[email protected]>
Yongxin Wang <[email protected]>
Matthew Hague <[email protected]>
Spanti Nicola <[email protected]>
Jesse Shieh <[email protected]>
Jesse Shieh <[email protected]>
Àlex Magaz Graça <[email protected]>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ There are different ways to get the Gnucash app for Android; through the app sto
## Building

The build requires [Maven](http://maven.apache.org/download.html)
v3.0.3+ and the [Android SDK](http://developer.android.com/sdk/index.html)
v3.1.1+ and the [Android SDK](http://developer.android.com/sdk/index.html)
to be installed in your development environment. In addition you'll need to set
the `ANDROID_HOME` environment variable to the location of your SDK:

Expand Down Expand Up @@ -51,7 +51,7 @@ You could as well contribute code, fixing bugs, new features or automated tests.
Take a look at the [bug tracker](https://github.com/codinguser/gnucash-android/issues?state=open)
for ideas where to start.

For development, it is recommended to use the IntelliJ IDEA 13+ IDE for development which is available as free
For development, it is recommended to use the IntelliJ IDEA 14+ IDE for development which is available as free
community edition. Import the project into the IDE from an external (maven) model.The IDE will resolve dependencies automatically.

#Licence
Expand Down
5 changes: 2 additions & 3 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<description>Gnucash Android companion application</description>

<parent>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<groupId>org.gnucash.android</groupId>
<artifactId>gnucash-android-parent</artifactId>
</parent>
Expand Down Expand Up @@ -53,10 +53,9 @@
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
</plugin>
</plugins>
Expand Down
5 changes: 3 additions & 2 deletions app/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-15
android.library.reference.1=gen-external-apklibs/com.actionbarsherlock_actionbarsherlock_4.2.0
target=android-18
android.library.reference.1=gen-external-apklibs/com.actionbarsherlock_actionbarsherlock_4.4.0
android.library.reference.2=gen-external-apklibs/com.viewpagerindicator_library_2.4.1

208 changes: 104 additions & 104 deletions app/AndroidManifest.xml → app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,105 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2012 Ngewi Fet <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.gnucash.android"
android:versionCode="46"
android:versionName="@string/app_version_name" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/>

<permission-group
android:name="org.gnucash.android.permission.group.GNUCASH"
android:label="@string/label_permission_group"
android:description="@string/description_permission_group" />

<permission android:name="org.gnucash.android.permission.CREATE_ACCOUNT"
android:label="@string/label_permission_create_account"
android:permissionGroup="org.gnucash.android.permission.group.GNUCASH"
android:protectionLevel="dangerous" />
<permission android:name="org.gnucash.android.permission.RECORD_TRANSACTION"
android:label="@string/label_permission_record_transaction"
android:permissionGroup="org.gnucash.android.permission.group.GNUCASH"
android:protectionLevel="dangerous" />

<uses-permission android:label="@string/label_permission_record_transactions"
android:name="org.gnucash.android.permission.RECORD_TRANSACTION" />
<uses-permission android:label="@string/label_permission_create_accounts"
android:name="org.gnucash.android.permission.CREATE_ACCOUNT" />
<uses-permission android:label="@string/permission_access_sdcard"
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application android:name="org.gnucash.android.app.GnuCashApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock.Light.DarkActionBar">
<activity
android:name=".ui.account.AccountsActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.passcode.PasscodeLockScreenActivity"
android:noHistory="true"
android:windowSoftInputMode="stateAlwaysHidden">
</activity>
<activity android:name=".ui.settings.SettingsActivity"/>
<activity android:name=".ui.passcode.PasscodePreferenceActivity" />
<activity android:name=".ui.transaction.TransactionsActivity"
android:configChanges="orientation|screenSize">
</activity>
<activity android:name=".ui.widget.WidgetConfigurationActivity"
android:label="@string/label_widget_configuration"
android:theme="@style/Dialog.WidgetConfiguration"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
</activity>
<receiver android:name=".receivers.TransactionRecorder"
android:label="Records transactions received through intents"
android:permission="org.gnucash.android.permission.RECORD_TRANSACTION">
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.org.gnucash.android.transaction"/>
</intent-filter>
</receiver>
<receiver android:name=".receivers.AccountCreator"
android:label="Creates new accounts"
android:permission="org.gnucash.android.permission.CREATE_ACCOUNT"
android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.org.gnucash.android.account"/>
</intent-filter>
</receiver>
<receiver android:name=".receivers.TransactionAppWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/transaction_appwidget_info" />
</receiver>

</application>

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2012 Ngewi Fet <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.gnucash.android"
android:versionCode="47"
android:versionName="@string/app_version_name" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18"/>

<permission-group
android:name="org.gnucash.android.permission.group.GNUCASH"
android:label="@string/label_permission_group"
android:description="@string/description_permission_group" />

<permission android:name="org.gnucash.android.permission.CREATE_ACCOUNT"
android:label="@string/label_permission_create_account"
android:permissionGroup="org.gnucash.android.permission.group.GNUCASH"
android:protectionLevel="dangerous" />
<permission android:name="org.gnucash.android.permission.RECORD_TRANSACTION"
android:label="@string/label_permission_record_transaction"
android:permissionGroup="org.gnucash.android.permission.group.GNUCASH"
android:protectionLevel="dangerous" />

<uses-permission android:label="@string/label_permission_record_transactions"
android:name="org.gnucash.android.permission.RECORD_TRANSACTION" />
<uses-permission android:label="@string/label_permission_create_accounts"
android:name="org.gnucash.android.permission.CREATE_ACCOUNT" />
<uses-permission android:label="@string/permission_access_sdcard"
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application android:name="org.gnucash.android.app.GnuCashApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock.Light.DarkActionBar">
<activity
android:name=".ui.account.AccountsActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.passcode.PasscodeLockScreenActivity"
android:noHistory="true"
android:windowSoftInputMode="stateAlwaysHidden">
</activity>
<activity android:name=".ui.settings.SettingsActivity"/>
<activity android:name=".ui.passcode.PasscodePreferenceActivity" />
<activity android:name=".ui.transaction.TransactionsActivity"
android:configChanges="orientation|screenSize">
</activity>
<activity android:name=".ui.widget.WidgetConfigurationActivity"
android:label="@string/label_widget_configuration"
android:theme="@style/Dialog.WidgetConfiguration"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
</activity>
<receiver android:name=".receivers.TransactionRecorder"
android:label="Records transactions received through intents"
android:permission="org.gnucash.android.permission.RECORD_TRANSACTION">
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.org.gnucash.android.transaction"/>
</intent-filter>
</receiver>
<receiver android:name=".receivers.AccountCreator"
android:label="Creates new accounts"
android:permission="org.gnucash.android.permission.CREATE_ACCOUNT"
android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.org.gnucash.android.account"/>
</intent-filter>
</receiver>
<receiver android:name=".receivers.TransactionAppWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/transaction_appwidget_info" />
</receiver>

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,8 @@ public Transaction getTransaction(long rowId){
}

/**
* Returns a cursor to a set of all transactions for the account with UID <code>accountUID</code>
* or for which this account is the origin account (double entry)
* i.e <code>accountUID</code> is double entry account UID
* Returns a cursor to a set of all transactions which have a split belonging to the accound with unique ID
* <code>accountUID</code>.
* @param accountUID UID of the account whose transactions are to be retrieved
* @return Cursor holding set of transactions for particular account
* @throws java.lang.IllegalArgumentException if the accountUID is null
Expand Down Expand Up @@ -465,6 +464,7 @@ public String getUID(long transactionId){
@Override
public boolean deleteRecord(long rowId){
Log.d(TAG, "Delete transaction with record Id: " + rowId);
//the splits db adapter handles deletion of the transaction
return mSplitsDbAdapter.deleteSplitsForTransaction(rowId);
}

Expand Down Expand Up @@ -521,8 +521,25 @@ public int getTransactionsCount(long accountId){
}
return count;
}

/**

/**
* Returns the number of transactions belonging to an account
* @param accountUID GUID of the account
* @return Number of transactions with splits in the account
*/
public int getTransactionsCount(String accountUID){
Cursor cursor = fetchAllTransactionsForAccount(accountUID);
int count = 0;
if (cursor == null)
return count;
else {
count = cursor.getCount();
cursor.close();
}
return count;
}

/**
* Returns the total number of transactions in the database
* regardless of what account they belong to
* @return Number of transaction in the database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public Split(Money amount, String accountUID){
setAmount(amount);
setAccountUID(accountUID);
mUID = UUID.randomUUID().toString().replaceAll("-","");
mSplitType = amount.isNegative() ? TransactionType.DEBIT : TransactionType.CREDIT;
}

/**
Expand Down Expand Up @@ -163,7 +164,7 @@ public String toString() {
* @return
*/
public String toCsv(){
String splitString = mAmount.toString() + ";" + mAmount.getCurrency().getCurrencyCode() + ";"
String splitString = mAmount.asString() + ";" + mAmount.getCurrency().getCurrencyCode() + ";"
+ mAccountUID + ";" + mSplitType.name();
if (mMemo != null){
splitString = splitString + ";" + mMemo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,15 @@ public Transaction(Transaction transaction, boolean generateNewUID){
initDefaults();
setDescription(transaction.getDescription());
setNote(transaction.getNote());
setTime(transaction.getTimeMillis());
mCurrencyCode = transaction.mCurrencyCode;
mRecurrencePeriod = transaction.mRecurrencePeriod;
//exported flag is left at default value of false

for (Split split : transaction.mSplitList) {
addSplit(new Split(split, true));
}
setTime(transaction.getTimeMillis());

if (!generateNewUID){
setUID(transaction.getUID());
}
Expand Down
Loading

0 comments on commit 4ce198c

Please sign in to comment.