Merge branch 'develop' of github.com:invoiceninja/flutter-client into develop
This commit is contained in:
commit
17a82c1482
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:invoiceninja_flutter/data/models/import_model.dart';
|
||||||
|
|
||||||
class Constants {
|
class Constants {
|
||||||
//static String get hostedApiUrl => kReleaseMode ? kAppProductionUrl : kAppStagingUrl;
|
//static String get hostedApiUrl => kReleaseMode ? kAppProductionUrl : kAppStagingUrl;
|
||||||
static String get hostedApiUrl => kAppProductionUrl;
|
static String get hostedApiUrl => kAppProductionUrl;
|
||||||
|
|
@ -410,6 +412,10 @@ const String kGatewayTypeInstantBankPay = '21';
|
||||||
const String kGatewayTypeFPX = '22';
|
const String kGatewayTypeFPX = '22';
|
||||||
const String kGatewayTypeKlarna = '23';
|
const String kGatewayTypeKlarna = '23';
|
||||||
const String kGatewayTypeBacs = '24';
|
const String kGatewayTypeBacs = '24';
|
||||||
|
const String kGatewayTypeVenmo = '25';
|
||||||
|
const String kGatewayTypeMercadoPago = '26';
|
||||||
|
const String kGatewayTypeMyBank = '27';
|
||||||
|
const String kGatewayTypePayLater = '28';
|
||||||
|
|
||||||
const kGatewayTypes = {
|
const kGatewayTypes = {
|
||||||
kGatewayTypeCreditCard: 'credit_card',
|
kGatewayTypeCreditCard: 'credit_card',
|
||||||
|
|
@ -436,6 +442,10 @@ const kGatewayTypes = {
|
||||||
kGatewayTypeFPX: 'fpx',
|
kGatewayTypeFPX: 'fpx',
|
||||||
kGatewayTypeKlarna: 'klarna',
|
kGatewayTypeKlarna: 'klarna',
|
||||||
kGatewayTypeBacs: 'bacs',
|
kGatewayTypeBacs: 'bacs',
|
||||||
|
kGatewayTypeVenmo: 'venmo',
|
||||||
|
kGatewayTypeMercadoPago: 'mercado_pago',
|
||||||
|
kGatewayTypeMyBank: 'my_bank',
|
||||||
|
kGatewayTypePayLater: 'pay_later',
|
||||||
};
|
};
|
||||||
|
|
||||||
const String kNotificationChannelEmail = 'email';
|
const String kNotificationChannelEmail = 'email';
|
||||||
|
|
@ -674,6 +684,32 @@ const String kReportPurchaseOrderItem = 'purchase_order_item';
|
||||||
const String kReportVendor = 'vendor';
|
const String kReportVendor = 'vendor';
|
||||||
const String kReportTransaction = 'transaction';
|
const String kReportTransaction = 'transaction';
|
||||||
|
|
||||||
|
final kReportMap = {
|
||||||
|
kReportClient: ExportType.clients,
|
||||||
|
kReportClientContact: ExportType.client_contacts,
|
||||||
|
kReportCredit: ExportType.credits,
|
||||||
|
kReportCreditItem: null,
|
||||||
|
kReportDocument: ExportType.documents,
|
||||||
|
kReportExpense: ExportType.expenses,
|
||||||
|
kReportInvoice: ExportType.invoices,
|
||||||
|
kReportPayment: ExportType.payments,
|
||||||
|
kReportProduct: ExportType.products,
|
||||||
|
kReportProfitAndLoss: ExportType.profitloss,
|
||||||
|
kReportTask: ExportType.tasks,
|
||||||
|
kReportTaskItem: null,
|
||||||
|
kReportInvoiceTax: ExportType.tax_summary,
|
||||||
|
kReportPaymentTax: null,
|
||||||
|
kReportQuote: ExportType.quotes,
|
||||||
|
kReportInvoiceItem: ExportType.invoice_items,
|
||||||
|
kReportQuoteItem: ExportType.quote_items,
|
||||||
|
kReportRecurringExpense: null,
|
||||||
|
kReportRecurringInvoice: ExportType.recurring_invoices,
|
||||||
|
kReportPurchaseOrder: null,
|
||||||
|
kReportPurchaseOrderItem: null,
|
||||||
|
kReportVendor: null,
|
||||||
|
kReportTransaction: null,
|
||||||
|
};
|
||||||
|
|
||||||
const String kPdfFieldsClientDetails = 'client_details';
|
const String kPdfFieldsClientDetails = 'client_details';
|
||||||
const String kPdfFieldsCompanyDetails = 'company_details';
|
const String kPdfFieldsCompanyDetails = 'company_details';
|
||||||
const String kPdfFieldsCompanyAddress = 'company_address';
|
const String kPdfFieldsCompanyAddress = 'company_address';
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/dashboard_model.dart';
|
import 'package:invoiceninja_flutter/data/models/dashboard_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/import_model.dart';
|
||||||
import 'package:invoiceninja_flutter/main_app.dart';
|
import 'package:invoiceninja_flutter/main_app.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
|
@ -84,8 +85,8 @@ abstract class ScheduleEntity extends Object
|
||||||
|
|
||||||
static const TEMPLATES = [
|
static const TEMPLATES = [
|
||||||
TEMPLATE_EMAIL_STATEMENT,
|
TEMPLATE_EMAIL_STATEMENT,
|
||||||
TEMPLATE_EMAIL_RECORD,
|
|
||||||
TEMPLATE_EMAIL_REPORT,
|
TEMPLATE_EMAIL_REPORT,
|
||||||
|
TEMPLATE_EMAIL_RECORD,
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -218,6 +219,9 @@ abstract class ScheduleParameters
|
||||||
? EntityType.invoice.toString()
|
? EntityType.invoice.toString()
|
||||||
: null,
|
: null,
|
||||||
entityId: action == ScheduleEntity.TEMPLATE_EMAIL_RECORD ? '' : null,
|
entityId: action == ScheduleEntity.TEMPLATE_EMAIL_RECORD ? '' : null,
|
||||||
|
reportName: action == ScheduleEntity.TEMPLATE_EMAIL_REPORT
|
||||||
|
? ExportType.invoices.name
|
||||||
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -252,6 +256,9 @@ abstract class ScheduleParameters
|
||||||
@BuiltValueField(wireName: 'entity_id')
|
@BuiltValueField(wireName: 'entity_id')
|
||||||
String? get entityId;
|
String? get entityId;
|
||||||
|
|
||||||
|
@BuiltValueField(wireName: 'report_name')
|
||||||
|
String? get reportName;
|
||||||
|
|
||||||
static Serializer<ScheduleParameters> get serializer =>
|
static Serializer<ScheduleParameters> get serializer =>
|
||||||
_$scheduleParametersSerializer;
|
_$scheduleParametersSerializer;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -337,6 +337,13 @@ class _$ScheduleParametersSerializer
|
||||||
..add(serializers.serialize(value,
|
..add(serializers.serialize(value,
|
||||||
specifiedType: const FullType(String)));
|
specifiedType: const FullType(String)));
|
||||||
}
|
}
|
||||||
|
value = object.reportName;
|
||||||
|
if (value != null) {
|
||||||
|
result
|
||||||
|
..add('report_name')
|
||||||
|
..add(serializers.serialize(value,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -390,6 +397,10 @@ class _$ScheduleParametersSerializer
|
||||||
result.entityId = serializers.deserialize(value,
|
result.entityId = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(String)) as String?;
|
specifiedType: const FullType(String)) as String?;
|
||||||
break;
|
break;
|
||||||
|
case 'report_name':
|
||||||
|
result.reportName = serializers.deserialize(value,
|
||||||
|
specifiedType: const FullType(String)) as String?;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -904,6 +915,8 @@ class _$ScheduleParameters extends ScheduleParameters {
|
||||||
final String? entityType;
|
final String? entityType;
|
||||||
@override
|
@override
|
||||||
final String? entityId;
|
final String? entityId;
|
||||||
|
@override
|
||||||
|
final String? reportName;
|
||||||
|
|
||||||
factory _$ScheduleParameters(
|
factory _$ScheduleParameters(
|
||||||
[void Function(ScheduleParametersBuilder)? updates]) =>
|
[void Function(ScheduleParametersBuilder)? updates]) =>
|
||||||
|
|
@ -918,7 +931,8 @@ class _$ScheduleParameters extends ScheduleParameters {
|
||||||
this.status,
|
this.status,
|
||||||
this.clients,
|
this.clients,
|
||||||
this.entityType,
|
this.entityType,
|
||||||
this.entityId})
|
this.entityId,
|
||||||
|
this.reportName})
|
||||||
: super._();
|
: super._();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -942,7 +956,8 @@ class _$ScheduleParameters extends ScheduleParameters {
|
||||||
status == other.status &&
|
status == other.status &&
|
||||||
clients == other.clients &&
|
clients == other.clients &&
|
||||||
entityType == other.entityType &&
|
entityType == other.entityType &&
|
||||||
entityId == other.entityId;
|
entityId == other.entityId &&
|
||||||
|
reportName == other.reportName;
|
||||||
}
|
}
|
||||||
|
|
||||||
int? __hashCode;
|
int? __hashCode;
|
||||||
|
|
@ -959,6 +974,7 @@ class _$ScheduleParameters extends ScheduleParameters {
|
||||||
_$hash = $jc(_$hash, clients.hashCode);
|
_$hash = $jc(_$hash, clients.hashCode);
|
||||||
_$hash = $jc(_$hash, entityType.hashCode);
|
_$hash = $jc(_$hash, entityType.hashCode);
|
||||||
_$hash = $jc(_$hash, entityId.hashCode);
|
_$hash = $jc(_$hash, entityId.hashCode);
|
||||||
|
_$hash = $jc(_$hash, reportName.hashCode);
|
||||||
_$hash = $jf(_$hash);
|
_$hash = $jf(_$hash);
|
||||||
return __hashCode ??= _$hash;
|
return __hashCode ??= _$hash;
|
||||||
}
|
}
|
||||||
|
|
@ -974,7 +990,8 @@ class _$ScheduleParameters extends ScheduleParameters {
|
||||||
..add('status', status)
|
..add('status', status)
|
||||||
..add('clients', clients)
|
..add('clients', clients)
|
||||||
..add('entityType', entityType)
|
..add('entityType', entityType)
|
||||||
..add('entityId', entityId))
|
..add('entityId', entityId)
|
||||||
|
..add('reportName', reportName))
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1024,6 +1041,10 @@ class ScheduleParametersBuilder
|
||||||
String? get entityId => _$this._entityId;
|
String? get entityId => _$this._entityId;
|
||||||
set entityId(String? entityId) => _$this._entityId = entityId;
|
set entityId(String? entityId) => _$this._entityId = entityId;
|
||||||
|
|
||||||
|
String? _reportName;
|
||||||
|
String? get reportName => _$this._reportName;
|
||||||
|
set reportName(String? reportName) => _$this._reportName = reportName;
|
||||||
|
|
||||||
ScheduleParametersBuilder();
|
ScheduleParametersBuilder();
|
||||||
|
|
||||||
ScheduleParametersBuilder get _$this {
|
ScheduleParametersBuilder get _$this {
|
||||||
|
|
@ -1038,6 +1059,7 @@ class ScheduleParametersBuilder
|
||||||
_clients = $v.clients?.toBuilder();
|
_clients = $v.clients?.toBuilder();
|
||||||
_entityType = $v.entityType;
|
_entityType = $v.entityType;
|
||||||
_entityId = $v.entityId;
|
_entityId = $v.entityId;
|
||||||
|
_reportName = $v.reportName;
|
||||||
_$v = null;
|
_$v = null;
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -1070,7 +1092,8 @@ class ScheduleParametersBuilder
|
||||||
status: status,
|
status: status,
|
||||||
clients: _clients?.build(),
|
clients: _clients?.build(),
|
||||||
entityType: entityType,
|
entityType: entityType,
|
||||||
entityId: entityId);
|
entityId: entityId,
|
||||||
|
reportName: reportName);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
late String _$failedField;
|
late String _$failedField;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class EntityPresenter {
|
||||||
isNarrow) {
|
isNarrow) {
|
||||||
return name;
|
return name;
|
||||||
} else {
|
} else {
|
||||||
return '$type $name';
|
return '$type: $name';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ enum ExpenseReportFields {
|
||||||
converted_amount,
|
converted_amount,
|
||||||
status,
|
status,
|
||||||
record_state,
|
record_state,
|
||||||
|
is_invoiced,
|
||||||
}
|
}
|
||||||
|
|
||||||
var memoizedExpenseReport = memo10((
|
var memoizedExpenseReport = memo10((
|
||||||
|
|
@ -284,6 +285,9 @@ ReportResult expenseReport(
|
||||||
value = AppLocalization.of(navigatorKey.currentContext!)!
|
value = AppLocalization.of(navigatorKey.currentContext!)!
|
||||||
.lookup(expense.entityState);
|
.lookup(expense.entityState);
|
||||||
break;
|
break;
|
||||||
|
case ExpenseReportFields.is_invoiced:
|
||||||
|
value = expense.isInvoiced;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ReportResult.matchField(
|
if (!ReportResult.matchField(
|
||||||
|
|
|
||||||
|
|
@ -385,6 +385,13 @@ class ReportsScreen extends StatelessWidget {
|
||||||
viewModel.onExportPressed(context);
|
viewModel.onExportPressed(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
AppTextButton(
|
||||||
|
label: localization.schedule,
|
||||||
|
isInHeader: true,
|
||||||
|
onPressed: () {
|
||||||
|
viewModel.onSchedulePressed(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 8),
|
padding: const EdgeInsets.only(right: 8),
|
||||||
|
|
@ -538,6 +545,15 @@ class ReportsScreen extends StatelessWidget {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(width: kGutterWidth),
|
||||||
|
Expanded(
|
||||||
|
child: AppButton(
|
||||||
|
label: localization.schedule,
|
||||||
|
onPressed: () {
|
||||||
|
viewModel.onSchedulePressed(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ import 'package:flutter/widgets.dart';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
|
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/import_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/schedule_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/reports/credit_item_report.dart';
|
import 'package:invoiceninja_flutter/ui/reports/credit_item_report.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/reports/purchase_order_item_report.dart';
|
import 'package:invoiceninja_flutter/ui/reports/purchase_order_item_report.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/reports/purchase_order_report.dart';
|
import 'package:invoiceninja_flutter/ui/reports/purchase_order_report.dart';
|
||||||
|
|
@ -81,6 +84,7 @@ class ReportsScreenVM {
|
||||||
required this.onReportColumnsChanged,
|
required this.onReportColumnsChanged,
|
||||||
required this.onReportFiltersChanged,
|
required this.onReportFiltersChanged,
|
||||||
required this.onExportPressed,
|
required this.onExportPressed,
|
||||||
|
required this.onSchedulePressed,
|
||||||
required this.onReportSorted,
|
required this.onReportSorted,
|
||||||
required this.groupTotals,
|
required this.groupTotals,
|
||||||
required this.reportResult,
|
required this.reportResult,
|
||||||
|
|
@ -94,6 +98,7 @@ class ReportsScreenVM {
|
||||||
final GroupTotals groupTotals;
|
final GroupTotals groupTotals;
|
||||||
final Function(BuildContext, List<String>) onReportColumnsChanged;
|
final Function(BuildContext, List<String>) onReportColumnsChanged;
|
||||||
final Function(BuildContext) onExportPressed;
|
final Function(BuildContext) onExportPressed;
|
||||||
|
final Function(BuildContext) onSchedulePressed;
|
||||||
final Function(BuildContext, BuiltMap<String?, String?>)
|
final Function(BuildContext, BuiltMap<String?, String?>)
|
||||||
onReportFiltersChanged;
|
onReportFiltersChanged;
|
||||||
final Function(String?, bool) onReportSorted;
|
final Function(String?, bool) onReportSorted;
|
||||||
|
|
@ -457,6 +462,13 @@ class ReportsScreenVM {
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onSchedulePressed: (context) async {
|
||||||
|
createEntity(
|
||||||
|
entity: ScheduleEntity(ScheduleEntity.TEMPLATE_EMAIL_REPORT)
|
||||||
|
.rebuild((b) => b
|
||||||
|
..parameters.reportName =
|
||||||
|
kReportMap[report]?.name ?? ExportType.invoices.name));
|
||||||
|
},
|
||||||
onExportPressed: (context) async {
|
onExportPressed: (context) async {
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
final reportState = state.uiState.reportsUIState;
|
final reportState = state.uiState.reportsUIState;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/dashboard_model.dart';
|
import 'package:invoiceninja_flutter/data/models/dashboard_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/import_model.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/credit/credit_selectors.dart';
|
import 'package:invoiceninja_flutter/redux/credit/credit_selectors.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/invoice/invoice_selectors.dart';
|
import 'package:invoiceninja_flutter/redux/invoice/invoice_selectors.dart';
|
||||||
|
|
@ -232,7 +233,47 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
),
|
),
|
||||||
if (schedule.template ==
|
if (schedule.template ==
|
||||||
ScheduleEntity.TEMPLATE_EMAIL_REPORT) ...[
|
ScheduleEntity.TEMPLATE_EMAIL_REPORT) ...[
|
||||||
//
|
FormCard(
|
||||||
|
isLast: true,
|
||||||
|
children: [
|
||||||
|
AppDropdownButton<String>(
|
||||||
|
value: schedule.parameters.reportName,
|
||||||
|
labelText: localization.report,
|
||||||
|
onChanged: (dynamic value) {
|
||||||
|
setState(() {
|
||||||
|
viewModel.onChanged(schedule.rebuild(
|
||||||
|
(b) => b..parameters.reportName = value));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
items: ExportType.values
|
||||||
|
.map((importType) => DropdownMenuItem<String>(
|
||||||
|
value: importType.name,
|
||||||
|
child:
|
||||||
|
Text(localization.lookup('$importType'))))
|
||||||
|
.toList()),
|
||||||
|
AppDropdownButton<DateRange>(
|
||||||
|
labelText: localization.dateRange,
|
||||||
|
blankValue: null,
|
||||||
|
value: parameters.dateRange!.isNotEmpty
|
||||||
|
? DateRange.valueOf(
|
||||||
|
toCamelCase(parameters.dateRange!))
|
||||||
|
: null,
|
||||||
|
onChanged: (dynamic value) {
|
||||||
|
viewModel.onChanged(schedule.rebuild((b) => b
|
||||||
|
..parameters.dateRange =
|
||||||
|
(value as DateRange).snakeCase));
|
||||||
|
},
|
||||||
|
items: DateRange.values
|
||||||
|
.where((value) => value != DateRange.custom)
|
||||||
|
.map((dateRange) => DropdownMenuItem<DateRange>(
|
||||||
|
child: Text(localization
|
||||||
|
.lookup(dateRange.toString())),
|
||||||
|
value: dateRange,
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
] else if (schedule.template ==
|
] else if (schedule.template ==
|
||||||
ScheduleEntity.TEMPLATE_EMAIL_STATEMENT) ...[
|
ScheduleEntity.TEMPLATE_EMAIL_STATEMENT) ...[
|
||||||
FormCard(children: [
|
FormCard(children: [
|
||||||
|
|
@ -342,6 +383,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
] else if (schedule.template ==
|
] else if (schedule.template ==
|
||||||
ScheduleEntity.TEMPLATE_EMAIL_RECORD) ...[
|
ScheduleEntity.TEMPLATE_EMAIL_RECORD) ...[
|
||||||
FormCard(
|
FormCard(
|
||||||
|
isLast: true,
|
||||||
children: [
|
children: [
|
||||||
AppDropdownButton<String>(
|
AppDropdownButton<String>(
|
||||||
labelText: localization.type,
|
labelText: localization.type,
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,8 @@ class ScheduleListItem extends StatelessWidget {
|
||||||
}
|
}
|
||||||
subtitle +=
|
subtitle +=
|
||||||
' • ' + localization.lookup(kFrequencies[schedule.frequencyId]);
|
' • ' + localization.lookup(kFrequencies[schedule.frequencyId]);
|
||||||
|
} else if (schedule.template == ScheduleEntity.TEMPLATE_EMAIL_REPORT) {
|
||||||
|
title += ': ' + localization.lookup(schedule.parameters.reportName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return DismissibleEntity(
|
return DismissibleEntity(
|
||||||
|
|
|
||||||
|
|
@ -63,16 +63,13 @@ class _ScheduleViewState extends State<ScheduleView> {
|
||||||
localization.lookup(schedule.parameters.entityType):
|
localization.lookup(schedule.parameters.entityType):
|
||||||
entity!.listDisplayName
|
entity!.listDisplayName
|
||||||
})
|
})
|
||||||
else
|
else if (schedule.template == ScheduleEntity.TEMPLATE_EMAIL_STATEMENT)
|
||||||
FieldGrid({
|
FieldGrid({
|
||||||
localization.frequency:
|
localization.frequency:
|
||||||
localization.lookup(kFrequencies[schedule.frequencyId]),
|
localization.lookup(kFrequencies[schedule.frequencyId]),
|
||||||
localization.remainingCycles: schedule.remainingCycles == -1
|
localization.remainingCycles: schedule.remainingCycles == -1
|
||||||
? localization.endless
|
? localization.endless
|
||||||
: '${schedule.remainingCycles}',
|
: '${schedule.remainingCycles}',
|
||||||
}),
|
|
||||||
if (schedule.template == ScheduleEntity.TEMPLATE_EMAIL_STATEMENT)
|
|
||||||
FieldGrid({
|
|
||||||
localization.clients: parameters.clients!.isEmpty
|
localization.clients: parameters.clients!.isEmpty
|
||||||
? localization.allClients
|
? localization.allClients
|
||||||
: parameters.clients!.length == 1
|
: parameters.clients!.length == 1
|
||||||
|
|
@ -94,6 +91,17 @@ class _ScheduleViewState extends State<ScheduleView> {
|
||||||
: localization.no,
|
: localization.no,
|
||||||
localization.status: localization.lookup(parameters.status),
|
localization.status: localization.lookup(parameters.status),
|
||||||
})
|
})
|
||||||
|
else if (schedule.template == ScheduleEntity.TEMPLATE_EMAIL_REPORT)
|
||||||
|
FieldGrid({
|
||||||
|
localization.frequency:
|
||||||
|
localization.lookup(kFrequencies[schedule.frequencyId]),
|
||||||
|
localization.remainingCycles: schedule.remainingCycles == -1
|
||||||
|
? localization.endless
|
||||||
|
: '${schedule.remainingCycles}',
|
||||||
|
localization.report:
|
||||||
|
localization.lookup(schedule.parameters.reportName),
|
||||||
|
localization.dateRange: localization.lookup(parameters.dateRange),
|
||||||
|
})
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,9 @@ class _EmailSettingsState extends State<EmailSettings> {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
child: Text(localization.defaultWord),
|
child: Text(localization.defaultWord),
|
||||||
value: SettingsEntity.EMAIL_SENDING_METHOD_DEFAULT),
|
value: SettingsEntity.EMAIL_SENDING_METHOD_DEFAULT),
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text('SMTP'),
|
||||||
|
value: SettingsEntity.EMAIL_SENDING_METHOD_SMTP),
|
||||||
if (viewModel.state.isHosted) ...[
|
if (viewModel.state.isHosted) ...[
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
child: Text('Gmail'),
|
child: Text('Gmail'),
|
||||||
|
|
@ -243,9 +246,6 @@ class _EmailSettingsState extends State<EmailSettings> {
|
||||||
child: Text('Microsoft'),
|
child: Text('Microsoft'),
|
||||||
value: SettingsEntity.EMAIL_SENDING_METHOD_MICROSOFT),
|
value: SettingsEntity.EMAIL_SENDING_METHOD_MICROSOFT),
|
||||||
],
|
],
|
||||||
DropdownMenuItem(
|
|
||||||
child: Text('SMTP'),
|
|
||||||
value: SettingsEntity.EMAIL_SENDING_METHOD_SMTP),
|
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
child: Text('Postmark'),
|
child: Text('Postmark'),
|
||||||
value: SettingsEntity.EMAIL_SENDING_METHOD_POSTMARK),
|
value: SettingsEntity.EMAIL_SENDING_METHOD_POSTMARK),
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ import 'package:flutter_styled_toast/flutter_styled_toast.dart';
|
||||||
import 'package:http/http.dart';
|
import 'package:http/http.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/bank_account_model.dart';
|
import 'package:invoiceninja_flutter/data/models/bank_account_model.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/schedule_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_actions.dart';
|
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_selectors.dart';
|
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_selectors.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/entity_dropdown.dart';
|
import 'package:invoiceninja_flutter/ui/app/entity_dropdown.dart';
|
||||||
|
|
@ -304,12 +306,16 @@ class _ImportExportState extends State<ImportExport> {
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
AppButton(
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: AppButton(
|
||||||
iconData: MdiIcons.export,
|
iconData: MdiIcons.export,
|
||||||
label: localization.export.toUpperCase(),
|
label: localization.export.toUpperCase(),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final webClient = WebClient();
|
final webClient = WebClient();
|
||||||
final state = StoreProvider.of<AppState>(context).state;
|
final state =
|
||||||
|
StoreProvider.of<AppState>(context).state;
|
||||||
final credentials = state.credentials;
|
final credentials = state.credentials;
|
||||||
String? url = credentials.url;
|
String? url = credentials.url;
|
||||||
|
|
||||||
|
|
@ -337,15 +343,34 @@ class _ImportExportState extends State<ImportExport> {
|
||||||
}
|
}
|
||||||
|
|
||||||
webClient
|
webClient
|
||||||
.post(url, credentials.token, data: json.encode(data))
|
.post(url, credentials.token,
|
||||||
|
data: json.encode(data))
|
||||||
.then((dynamic result) {
|
.then((dynamic result) {
|
||||||
setState(() => _isExporting = false);
|
setState(() => _isExporting = false);
|
||||||
showMessageDialog(message: localization.exportedData);
|
showMessageDialog(
|
||||||
|
message: localization.exportedData);
|
||||||
}).catchError((dynamic error) {
|
}).catchError((dynamic error) {
|
||||||
setState(() => _isExporting = false);
|
setState(() => _isExporting = false);
|
||||||
showErrorDialog(message: '$error');
|
showErrorDialog(message: '$error');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: kGutterWidth),
|
||||||
|
Expanded(
|
||||||
|
child: AppButton(
|
||||||
|
label: localization.schedule,
|
||||||
|
iconData: Icons.schedule,
|
||||||
|
onPressed: () {
|
||||||
|
createEntity(
|
||||||
|
entity: ScheduleEntity(
|
||||||
|
ScheduleEntity.TEMPLATE_EMAIL_REPORT)
|
||||||
|
.rebuild((b) => b
|
||||||
|
..parameters.reportName =
|
||||||
|
_exportType.name));
|
||||||
|
},
|
||||||
|
))
|
||||||
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'venmo': 'Venmo',
|
||||||
|
'mercado_pago': 'Mercado Pago',
|
||||||
|
'my_bank': 'MyBank',
|
||||||
|
'pay_later': 'Pay Later',
|
||||||
'email_report': 'Email Report',
|
'email_report': 'Email Report',
|
||||||
'host': 'Host',
|
'host': 'Host',
|
||||||
'port': 'Port',
|
'port': 'Port',
|
||||||
|
|
|
||||||
|
|
@ -136,4 +136,4 @@ SPEC CHECKSUMS:
|
||||||
|
|
||||||
PODFILE CHECKSUM: 8d40c19d3cbdb380d870685c3a564c989f1efa52
|
PODFILE CHECKSUM: 8d40c19d3cbdb380d870685c3a564c989f1efa52
|
||||||
|
|
||||||
COCOAPODS: 1.14.3
|
COCOAPODS: 1.11.3
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue