Skip to content

Commit 2528564

Browse files
committed
Merge branch 'develop'
2 parents e0e34ae + 17a82c1 commit 2528564

17 files changed

+295
-111
lines changed

lib/constants.dart

+36
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'package:invoiceninja_flutter/data/models/import_model.dart';
2+
13
class Constants {
24
//static String get hostedApiUrl => kReleaseMode ? kAppProductionUrl : kAppStagingUrl;
35
static String get hostedApiUrl => kAppProductionUrl;
@@ -410,6 +412,10 @@ const String kGatewayTypeInstantBankPay = '21';
410412
const String kGatewayTypeFPX = '22';
411413
const String kGatewayTypeKlarna = '23';
412414
const String kGatewayTypeBacs = '24';
415+
const String kGatewayTypeVenmo = '25';
416+
const String kGatewayTypeMercadoPago = '26';
417+
const String kGatewayTypeMyBank = '27';
418+
const String kGatewayTypePayLater = '28';
413419

414420
const kGatewayTypes = {
415421
kGatewayTypeCreditCard: 'credit_card',
@@ -436,6 +442,10 @@ const kGatewayTypes = {
436442
kGatewayTypeFPX: 'fpx',
437443
kGatewayTypeKlarna: 'klarna',
438444
kGatewayTypeBacs: 'bacs',
445+
kGatewayTypeVenmo: 'venmo',
446+
kGatewayTypeMercadoPago: 'mercado_pago',
447+
kGatewayTypeMyBank: 'my_bank',
448+
kGatewayTypePayLater: 'pay_later',
439449
};
440450

441451
const String kNotificationChannelEmail = 'email';
@@ -674,6 +684,32 @@ const String kReportPurchaseOrderItem = 'purchase_order_item';
674684
const String kReportVendor = 'vendor';
675685
const String kReportTransaction = 'transaction';
676686

687+
final kReportMap = {
688+
kReportClient: ExportType.clients,
689+
kReportClientContact: ExportType.client_contacts,
690+
kReportCredit: ExportType.credits,
691+
kReportCreditItem: null,
692+
kReportDocument: ExportType.documents,
693+
kReportExpense: ExportType.expenses,
694+
kReportInvoice: ExportType.invoices,
695+
kReportPayment: ExportType.payments,
696+
kReportProduct: ExportType.products,
697+
kReportProfitAndLoss: ExportType.profitloss,
698+
kReportTask: ExportType.tasks,
699+
kReportTaskItem: null,
700+
kReportInvoiceTax: ExportType.tax_summary,
701+
kReportPaymentTax: null,
702+
kReportQuote: ExportType.quotes,
703+
kReportInvoiceItem: ExportType.invoice_items,
704+
kReportQuoteItem: ExportType.quote_items,
705+
kReportRecurringExpense: null,
706+
kReportRecurringInvoice: ExportType.recurring_invoices,
707+
kReportPurchaseOrder: null,
708+
kReportPurchaseOrderItem: null,
709+
kReportVendor: null,
710+
kReportTransaction: null,
711+
};
712+
677713
const String kPdfFieldsClientDetails = 'client_details';
678714
const String kPdfFieldsCompanyDetails = 'company_details';
679715
const String kPdfFieldsCompanyAddress = 'company_address';

lib/data/models/import_model.dart

+6-8
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,12 @@ class ExportType extends EnumClass {
202202
static const ExportType products = _$products;
203203
static const ExportType tasks = _$tasks;
204204
static const ExportType profitloss = _$profitloss;
205-
static const ExportType aged_receivable_detailed_report =
206-
_$aged_receivable_detailed_report;
207-
static const ExportType aged_receivable_summary_report =
208-
_$aged_receivable_summary_report;
209-
static const ExportType client_balance_report = _$client_balance_report;
210-
static const ExportType client_sales_report = _$client_sales_report;
211-
static const ExportType tax_summary_report = _$tax_summary_report;
212-
static const ExportType user_sales_report = _$user_sales_report;
205+
static const ExportType ar_detailed = _$ar_detailed;
206+
static const ExportType ar_summary = _$ar_summary;
207+
static const ExportType client_balance = _$client_balance;
208+
static const ExportType client_sales = _$client_sales;
209+
static const ExportType tax_summary = _$tax_summary;
210+
static const ExportType user_sales = _$user_sales;
213211

214212
static BuiltSet<ExportType> get values => _$exportValues;
215213

lib/data/models/import_model.g.dart

+24-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/data/models/schedule_model.dart

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:built_collection/built_collection.dart';
33
import 'package:built_value/serializer.dart';
44
import 'package:invoiceninja_flutter/constants.dart';
55
import 'package:invoiceninja_flutter/data/models/dashboard_model.dart';
6+
import 'package:invoiceninja_flutter/data/models/import_model.dart';
67
import 'package:invoiceninja_flutter/main_app.dart';
78
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
89
import 'package:invoiceninja_flutter/data/models/models.dart';
@@ -80,9 +81,11 @@ abstract class ScheduleEntity extends Object
8081

8182
static const TEMPLATE_EMAIL_STATEMENT = 'email_statement';
8283
static const TEMPLATE_EMAIL_RECORD = 'email_record';
84+
static const TEMPLATE_EMAIL_REPORT = 'email_report';
8385

8486
static const TEMPLATES = [
8587
TEMPLATE_EMAIL_STATEMENT,
88+
TEMPLATE_EMAIL_REPORT,
8689
TEMPLATE_EMAIL_RECORD,
8790
];
8891

@@ -216,6 +219,9 @@ abstract class ScheduleParameters
216219
? EntityType.invoice.toString()
217220
: null,
218221
entityId: action == ScheduleEntity.TEMPLATE_EMAIL_RECORD ? '' : null,
222+
reportName: action == ScheduleEntity.TEMPLATE_EMAIL_REPORT
223+
? ExportType.invoices.name
224+
: null,
219225
);
220226
}
221227

@@ -250,6 +256,9 @@ abstract class ScheduleParameters
250256
@BuiltValueField(wireName: 'entity_id')
251257
String? get entityId;
252258

259+
@BuiltValueField(wireName: 'report_name')
260+
String? get reportName;
261+
253262
static Serializer<ScheduleParameters> get serializer =>
254263
_$scheduleParametersSerializer;
255264
}

lib/data/models/schedule_model.g.dart

+27-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ui/app/presenters/entity_presenter.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class EntityPresenter {
4949
isNarrow) {
5050
return name;
5151
} else {
52-
return '$type $name';
52+
return '$type: $name';
5353
}
5454
}
5555

lib/ui/app/system_log_viewer.dart

+12-7
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,18 @@ class _SystemLogViewerState extends State<SystemLogViewer> {
9090
},
9191
isExpanded: _isExpanded[systemLog.id] == true,
9292
body: _isExpanded[systemLog.id] == true
93-
? Container(
94-
color: Colors.white,
95-
child: Padding(
96-
padding: const EdgeInsets.symmetric(vertical: 8),
97-
child: JsonViewer(logs ?? <String, dynamic>{}),
98-
),
99-
)
93+
? logs == null
94+
? Padding(
95+
child: Text(systemLog.log),
96+
padding: EdgeInsets.symmetric(
97+
horizontal: 16, vertical: 10))
98+
: Container(
99+
color: Colors.white,
100+
child: Padding(
101+
padding: const EdgeInsets.symmetric(vertical: 8),
102+
child: JsonViewer(logs),
103+
),
104+
)
100105
: SizedBox(),
101106
);
102107
}).toList(),

lib/ui/reports/expense_report.dart

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ enum ExpenseReportFields {
5757
converted_amount,
5858
status,
5959
record_state,
60+
is_invoiced,
6061
}
6162

6263
var memoizedExpenseReport = memo10((
@@ -284,6 +285,9 @@ ReportResult expenseReport(
284285
value = AppLocalization.of(navigatorKey.currentContext!)!
285286
.lookup(expense.entityState);
286287
break;
288+
case ExpenseReportFields.is_invoiced:
289+
value = expense.isInvoiced;
290+
break;
287291
}
288292

289293
if (!ReportResult.matchField(

lib/ui/reports/reports_screen.dart

+16
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,13 @@ class ReportsScreen extends StatelessWidget {
385385
viewModel.onExportPressed(context);
386386
},
387387
),
388+
AppTextButton(
389+
label: localization.schedule,
390+
isInHeader: true,
391+
onPressed: () {
392+
viewModel.onSchedulePressed(context);
393+
},
394+
),
388395
],
389396
Padding(
390397
padding: const EdgeInsets.only(right: 8),
@@ -538,6 +545,15 @@ class ReportsScreen extends StatelessWidget {
538545
},
539546
),
540547
),
548+
SizedBox(width: kGutterWidth),
549+
Expanded(
550+
child: AppButton(
551+
label: localization.schedule,
552+
onPressed: () {
553+
viewModel.onSchedulePressed(context);
554+
},
555+
),
556+
),
541557
],
542558
),
543559
),

0 commit comments

Comments
 (0)