This commit is contained in:
Hillel Coren 2019-06-13 09:51:44 +03:00
parent 6c96cec2ed
commit 658a1a3a1a
3 changed files with 3 additions and 3 deletions

View File

@ -50,5 +50,3 @@ dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.5' implementation 'com.google.firebase:firebase-core:16.0.5'
} }
apply plugin: 'com.google.gms.google-services'

View File

@ -326,6 +326,8 @@ abstract class ExpenseEntity extends Object
} }
} }
double get convertedAmount => round(amount * exchangeRate, 2);
double get convertedAmountWithTax => round(amountWithTax * exchangeRate, 2); double get convertedAmountWithTax => round(amountWithTax * exchangeRate, 2);
bool get isInvoiced => invoiceId != null && invoiceId > 0; bool get isInvoiced => invoiceId != null && invoiceId > 0;

View File

@ -8,7 +8,7 @@ InvoiceItemEntity convertExpenseToInvoiceItem({ExpenseEntity expense}) {
..expenseId = expense.id ..expenseId = expense.id
..notes = expense.publicNotes ..notes = expense.publicNotes
..qty = 1 ..qty = 1
..cost = expense.amount ..cost = expense.convertedAmount
..taxName1 = expense.taxName1 ..taxName1 = expense.taxName1
..taxRate1 = expense.taxRate1 ..taxRate1 = expense.taxRate1
..taxName2 = expense.taxName2 ..taxName2 = expense.taxName2