diff --git a/lib/data/models/expense_model.dart b/lib/data/models/expense_model.dart index a124fdb10..f66f559d1 100644 --- a/lib/data/models/expense_model.dart +++ b/lib/data/models/expense_model.dart @@ -114,10 +114,15 @@ abstract class ExpenseEntity extends Object documents: BuiltList(), taxName1: '', taxName2: '', + taxName3: '', taxRate1: 0, taxRate2: 0, - taxName3: '', taxRate3: 0, + taxAmount1: 0, + taxAmount2: 0, + taxAmount3: 0, + usesInclusiveTaxes: company?.expenseInclusiveTaxes ?? false, + amountIsPretax: company?.expenseAmountIsPretax ?? true, clientId: client?.id, vendorId: vendor?.id, invoiceId: '', diff --git a/lib/ui/expense/edit/expense_edit.dart b/lib/ui/expense/edit/expense_edit.dart index c3e52664f..3fae4d4d4 100644 --- a/lib/ui/expense/edit/expense_edit.dart +++ b/lib/ui/expense/edit/expense_edit.dart @@ -1,11 +1,15 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:invoiceninja_flutter/constants.dart'; +import 'package:invoiceninja_flutter/ui/app/app_border.dart'; import 'package:invoiceninja_flutter/ui/expense/edit/expense_edit_details.dart'; import 'package:invoiceninja_flutter/ui/expense/edit/expense_edit_notes.dart'; import 'package:invoiceninja_flutter/ui/expense/edit/expense_edit_settings.dart'; import 'package:invoiceninja_flutter/ui/expense/edit/expense_edit_vm.dart'; import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart'; +import 'package:invoiceninja_flutter/utils/formatting.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; +import 'package:invoiceninja_flutter/utils/platforms.dart'; class ExpenseEdit extends StatefulWidget { const ExpenseEdit({ @@ -95,6 +99,61 @@ class _ExpenseEditState extends State ], ), ), + bottomNavigationBar: BottomAppBar( + elevation: 0, + color: Theme.of(context).cardColor, + shape: CircularNotchedRectangle(), + child: SizedBox( + height: kTopBottomBarHeight, + child: AppBorder( + isTop: true, + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + /* + if (isDesktop(context)) + Tooltip( + message: useSidebarEditor + ? localization.fullscreenEditor + : localization.sidebarEditor, + child: InkWell( + onTap: () => + store.dispatch(ToggleEditorLayout(EntityType.task)), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Icon(useSidebarEditor + ? Icons.chevron_left + : Icons.chevron_right), + ), + ), + ), + */ + AppBorder( + //isLeft: isDesktop(context), + isLeft: false, + child: Padding( + padding: const EdgeInsets.only(left: 16), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + localization.expenseTotal + + ': ' + + formatNumber(expense.amountWithTax, context, + currencyId: expense.currencyId), + style: TextStyle( + color: viewModel.state.prefState.enableDarkMode + ? Colors.white + : Colors.black, + fontSize: 20.0, + )), + ), + ), + ), + ], + ), + ), + ), + ), ); } } diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index 9430c1955..f5efde07a 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -15,6 +15,7 @@ mixin LocalizationsProvider on LocaleCodeAware { static final Map> _localizedValues = { 'en': { // STARTER: lang key - do not remove comment + 'expense_total': 'Expense Total', 'enter_taxes': 'Enter Taxes', 'by_rate': 'By Rate', 'by_amount': 'By Amount', @@ -51249,6 +51250,9 @@ mixin LocalizationsProvider on LocaleCodeAware { String get searchTaskStatus => _localizedValues[localeCode]['search_task_status']; + String get expenseTotal => + _localizedValues[localeCode]['expense_total']; + String get expenseCategory => _localizedValues[localeCode]['expense_category'];