Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Jan 15, 2024
2 parents 2b3e248 + c789723 commit 50f76f9
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 19 deletions.
3 changes: 1 addition & 2 deletions lib/data/models/client_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,7 @@ abstract class ClientEntity extends Object
response = clientA!.idNumber.compareTo(clientB!.idNumber);
break;
case ClientFields.number:
response = compareNatural(
clientA!.number.toLowerCase(), clientB!.number.toLowerCase());
response = compareNatural(clientA!.number, clientB!.number);
break;
case ClientFields.website:
response = clientA!.website
Expand Down
3 changes: 1 addition & 2 deletions lib/data/models/expense_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,7 @@ abstract class ExpenseEntity extends Object
expenseA!.documents.length.compareTo(expenseB!.documents.length);
break;
case ExpenseFields.number:
response = compareNatural(
expenseA!.number.toLowerCase(), expenseB!.number.toLowerCase());
response = compareNatural(expenseA!.number, expenseB!.number);
break;
case ExpenseFields.privateNotes:
response = expenseA!.privateNotes.compareTo(expenseB!.privateNotes);
Expand Down
3 changes: 1 addition & 2 deletions lib/data/models/invoice_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,7 @@ abstract class InvoiceEntity extends Object
invoiceBNumber.startsWith(recurringPrefix!)
? invoiceBNumber.replaceFirst(recurringPrefix, '')
: invoiceBNumber;
response = compareNatural(
invoiceANumber.toLowerCase(), invoiceBNumber.toLowerCase());
response = compareNatural(invoiceANumber, invoiceBNumber);
break;
case InvoiceFields.amount:
response = invoiceA.amount.compareTo(invoiceB.amount);
Expand Down
7 changes: 3 additions & 4 deletions lib/data/models/payment_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

// Project imports:
import 'package:collection/collection.dart' show IterableExtension;
import 'package:collection/collection.dart'
show IterableExtension, compareNatural;
import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/constants.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
Expand Down Expand Up @@ -267,9 +268,7 @@ abstract class PaymentEntity extends Object
response = paymentA!.refunded.compareTo(paymentB!.refunded);
break;
case PaymentFields.number:
response = paymentA!.number
.toLowerCase()
.compareTo(paymentB!.number.toLowerCase());
response = compareNatural(paymentA!.number, paymentB!.number);
break;
case PaymentFields.transactionReference:
response = paymentA!.transactionReference
Expand Down
3 changes: 2 additions & 1 deletion lib/data/models/project_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:collection/collection.dart';
import 'package:diacritic/diacritic.dart';
import 'package:flutter_redux/flutter_redux.dart';

Expand Down Expand Up @@ -307,7 +308,7 @@ abstract class ProjectEntity extends Object
projectA.documents.length.compareTo(projectB.documents.length);
break;
case ProjectFields.number:
response = projectA.number.compareTo(projectB.number);
response = compareNatural(projectA.number, projectB.number);
break;
case ProjectFields.customValue1:
response = projectA.customValue1.compareTo(projectB.customValue1);
Expand Down
3 changes: 1 addition & 2 deletions lib/data/models/task_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,7 @@ abstract class TaskEntity extends Object
response = taskA.documents.length.compareTo(taskB.documents.length);
break;
case TaskFields.number:
response = compareNatural(
taskA.number.toLowerCase(), taskB.number.toLowerCase());
response = compareNatural(taskA.number, taskB.number);
break;
case TaskFields.createdBy:
final userA = userMap[taskA.createdUserId] ?? UserEntity();
Expand Down
3 changes: 1 addition & 2 deletions lib/data/models/vendor_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ abstract class VendorEntity extends Object
vendorA!.documents.length.compareTo(vendorB!.documents.length);
break;
case VendorFields.number:
response = compareNatural(
vendorA!.number.toLowerCase(), vendorB!.number.toLowerCase());
response = compareNatural(vendorA!.number, vendorB!.number);
break;
case VendorFields.address1:
response = vendorA!.address1.compareTo(vendorB!.address1);
Expand Down
5 changes: 3 additions & 2 deletions lib/redux/dashboard/dashboard_middleware.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ Middleware<AppState> _createViewDashboard() {
store: store,
force: action.force,
callback: () {
if (!store.state.userCompany.canViewDashboard) {
final state = store.state;
if (state.isLoaded && !state.userCompany.canViewDashboard) {
store.dispatch(ViewClientList());
} else {
if (store.state.isStale) {
if (state.isStale) {
store.dispatch(RefreshData());
}

Expand Down
7 changes: 7 additions & 0 deletions lib/redux/transaction/transaction_selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ List<String> filteredTransactionsSelector(
return true;
}

final bankAccount =
bankAccountMap[transaction.bankAccountId] ?? BankAccountEntity();
if (!bankAccount.isActive &&
!bankAccount.matchesEntityFilter(filterEntityType, filterEntityId)) {
return false;
}

if (filterEntityType != null) {
if (filterEntityType == EntityType.expenseCategory &&
transaction.categoryId != filterEntityId) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/bank_account/view/bank_account_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class _BankAccountViewState extends State<BankAccountView> {
FieldGrid({
localization.type: toTitleCase(bankAccount.type),
localization.status: toTitleCase(bankAccount.status),
localization.provider: toTitleCase(bankAccount.provider),
localization.provider: bankAccount.provider,
if (bankAccount.isConnected)
localization.autoSync: bankAccount.autoSync
? localization.enabled
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/transaction/view/transaction_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,8 @@ class _MatchWithdrawalsState extends State<_MatchWithdrawals> {
)
: AppButton(
label: localization.createExpense,
onPressed: viewModel.state.isSaving
onPressed: viewModel.state.isSaving ||
(_selectedVendor == null && _selectedCategory == null)
? null
: () {
final viewModel = widget.viewModel;
Expand Down

0 comments on commit 50f76f9

Please sign in to comment.