diff --git a/lib/constants.dart b/lib/constants.dart index 9248a870177..52018623e37 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -4,7 +4,7 @@ class Constants { } // TODO remove version once #46609 is fixed -const String kClientVersion = '5.0.116'; +const String kClientVersion = '5.0.117'; const String kMinServerVersion = '5.0.4'; const String kAppName = 'Invoice Ninja'; diff --git a/lib/data/models/invoice_model.dart b/lib/data/models/invoice_model.dart index 881e93c0de1..a3202065a42 100644 --- a/lib/data/models/invoice_model.dart +++ b/lib/data/models/invoice_model.dart @@ -828,8 +828,13 @@ abstract class InvoiceEntity extends Object response = invoiceA.dueDate.compareTo(invoiceB.dueDate); break; case InvoiceFields.nextSendDate: - response = - invoiceA.nextSendDatetime.compareTo(invoiceB.nextSendDatetime); + if (invoiceA.nextSendDatetime.isNotEmpty && + invoiceB.nextSendDatetime.isNotEmpty) { + response = + invoiceA.nextSendDatetime.compareTo(invoiceB.nextSendDatetime); + } else { + response = invoiceA.nextSendDate.compareTo(invoiceB.nextSendDate); + } break; case EntityFields.assignedTo: final userA = userMap[invoiceA.assignedUserId] ?? UserEntity(); @@ -1066,7 +1071,7 @@ abstract class InvoiceEntity extends Object if (!isRecurring) { actions.add(EntityAction.printPdf); actions.add(EntityAction.download); - if (isInvoice && state.company.settings.enableEInvoice) { + if (isInvoice && state.company.settings.enableEInvoice == true) { actions.add(EntityAction.eInvoice); } } diff --git a/lib/ui/invoice/invoice_presenter.dart b/lib/ui/invoice/invoice_presenter.dart index aa827c13660..e61566f6d30 100644 --- a/lib/ui/invoice/invoice_presenter.dart +++ b/lib/ui/invoice/invoice_presenter.dart @@ -97,8 +97,10 @@ class InvoicePresenter extends EntityPresenter { case InvoiceFields.nextSendDate: return Text(invoice.isPaid ? '' - : formatDate(invoice.nextSendDatetime, context, - showTime: true, showSeconds: false)); + : invoice.nextSendDatetime.isNotEmpty + ? formatDate(invoice.nextSendDatetime, context, + showTime: true, showSeconds: false) + : formatDate(invoice.nextSendDate, context)); case InvoiceFields.reminder1Sent: return Text(formatDate(invoice.reminder1Sent, context)); case InvoiceFields.reminder2Sent: diff --git a/lib/ui/invoice/view/invoice_view_overview.dart b/lib/ui/invoice/view/invoice_view_overview.dart index dc3c44a2555..9585c6392d8 100644 --- a/lib/ui/invoice/view/invoice_view_overview.dart +++ b/lib/ui/invoice/view/invoice_view_overview.dart @@ -182,9 +182,10 @@ class InvoiceOverview extends StatelessWidget { formatDate(invoice.lastSentDate, context), RecurringInvoiceFields.nextSendDate: formatDate(invoice.nextSendDate, context), - RecurringInvoiceFields.nextSendTime: formatDate( - invoice.nextSendDatetime, context, - showDate: false, showTime: true, showSeconds: false), + if (invoice.nextSendDatetime.isNotEmpty) + RecurringInvoiceFields.nextSendTime: formatDate( + invoice.nextSendDatetime, context, + showDate: false, showTime: true, showSeconds: false), RecurringInvoiceFields.remainingCycles: invoice.remainingCycles == -1 ? localization.endless : '${invoice.remainingCycles}', diff --git a/lib/ui/recurring_invoice/recurring_invoice_presenter.dart b/lib/ui/recurring_invoice/recurring_invoice_presenter.dart index 46c6c22face..5ab7e531a18 100644 --- a/lib/ui/recurring_invoice/recurring_invoice_presenter.dart +++ b/lib/ui/recurring_invoice/recurring_invoice_presenter.dart @@ -114,8 +114,10 @@ class RecurringInvoicePresenter extends EntityPresenter { ? localization.endless : '${invoice.remainingCycles}'); case RecurringInvoiceFields.nextSendDate: - return Text(formatDate(invoice.nextSendDatetime, context, - showTime: true, showSeconds: false)); + return Text(invoice.nextSendDatetime.isNotEmpty + ? formatDate(invoice.nextSendDatetime, context, + showTime: true, showSeconds: false) + : formatDate(invoice.nextSendDate, context)); case RecurringInvoiceFields.frequency: return Text(localization.lookup(kFrequencies[invoice.frequencyId])); case RecurringInvoiceFields.dueDateDays: diff --git a/pubspec.foss.yaml b/pubspec.foss.yaml index 4375f0f0be3..bce8165a310 100644 --- a/pubspec.foss.yaml +++ b/pubspec.foss.yaml @@ -1,6 +1,6 @@ name: invoiceninja_flutter description: Client for Invoice Ninja -version: 5.0.116+116 +version: 5.0.117+117 homepage: https://invoiceninja.com documentation: https://invoiceninja.github.io publish_to: none diff --git a/pubspec.yaml b/pubspec.yaml index 5b3ae065ad2..f39e1c00a40 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: invoiceninja_flutter description: Client for Invoice Ninja -version: 5.0.116+116 +version: 5.0.117+117 homepage: https://invoiceninja.com documentation: https://invoiceninja.github.io publish_to: none diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index c2164fff7cf..382f9547d68 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: invoiceninja -version: '5.0.116' +version: '5.0.117 summary: Create invoices, accept payments, track expenses & time-tasks description: "### Note: if the app fails to run using `snap run invoiceninja` it may help to run `/snap/invoiceninja/current/bin/invoiceninja` instead