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 23, 2024
2 parents e0e34ae + 17a82c1 commit 2528564
Show file tree
Hide file tree
Showing 17 changed files with 295 additions and 111 deletions.
36 changes: 36 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:invoiceninja_flutter/data/models/import_model.dart';

class Constants {
//static String get hostedApiUrl => kReleaseMode ? kAppProductionUrl : kAppStagingUrl;
static String get hostedApiUrl => kAppProductionUrl;
Expand Down Expand Up @@ -410,6 +412,10 @@ const String kGatewayTypeInstantBankPay = '21';
const String kGatewayTypeFPX = '22';
const String kGatewayTypeKlarna = '23';
const String kGatewayTypeBacs = '24';
const String kGatewayTypeVenmo = '25';
const String kGatewayTypeMercadoPago = '26';
const String kGatewayTypeMyBank = '27';
const String kGatewayTypePayLater = '28';

const kGatewayTypes = {
kGatewayTypeCreditCard: 'credit_card',
Expand All @@ -436,6 +442,10 @@ const kGatewayTypes = {
kGatewayTypeFPX: 'fpx',
kGatewayTypeKlarna: 'klarna',
kGatewayTypeBacs: 'bacs',
kGatewayTypeVenmo: 'venmo',
kGatewayTypeMercadoPago: 'mercado_pago',
kGatewayTypeMyBank: 'my_bank',
kGatewayTypePayLater: 'pay_later',
};

const String kNotificationChannelEmail = 'email';
Expand Down Expand Up @@ -674,6 +684,32 @@ const String kReportPurchaseOrderItem = 'purchase_order_item';
const String kReportVendor = 'vendor';
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 kPdfFieldsCompanyDetails = 'company_details';
const String kPdfFieldsCompanyAddress = 'company_address';
Expand Down
14 changes: 6 additions & 8 deletions lib/data/models/import_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,12 @@ class ExportType extends EnumClass {
static const ExportType products = _$products;
static const ExportType tasks = _$tasks;
static const ExportType profitloss = _$profitloss;
static const ExportType aged_receivable_detailed_report =
_$aged_receivable_detailed_report;
static const ExportType aged_receivable_summary_report =
_$aged_receivable_summary_report;
static const ExportType client_balance_report = _$client_balance_report;
static const ExportType client_sales_report = _$client_sales_report;
static const ExportType tax_summary_report = _$tax_summary_report;
static const ExportType user_sales_report = _$user_sales_report;
static const ExportType ar_detailed = _$ar_detailed;
static const ExportType ar_summary = _$ar_summary;
static const ExportType client_balance = _$client_balance;
static const ExportType client_sales = _$client_sales;
static const ExportType tax_summary = _$tax_summary;
static const ExportType user_sales = _$user_sales;

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

Expand Down
53 changes: 24 additions & 29 deletions lib/data/models/import_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions lib/data/models/schedule_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:built_collection/built_collection.dart';
import 'package:built_value/serializer.dart';
import 'package:invoiceninja_flutter/constants.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/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
Expand Down Expand Up @@ -80,9 +81,11 @@ abstract class ScheduleEntity extends Object

static const TEMPLATE_EMAIL_STATEMENT = 'email_statement';
static const TEMPLATE_EMAIL_RECORD = 'email_record';
static const TEMPLATE_EMAIL_REPORT = 'email_report';

static const TEMPLATES = [
TEMPLATE_EMAIL_STATEMENT,
TEMPLATE_EMAIL_REPORT,
TEMPLATE_EMAIL_RECORD,
];

Expand Down Expand Up @@ -216,6 +219,9 @@ abstract class ScheduleParameters
? EntityType.invoice.toString()
: null,
entityId: action == ScheduleEntity.TEMPLATE_EMAIL_RECORD ? '' : null,
reportName: action == ScheduleEntity.TEMPLATE_EMAIL_REPORT
? ExportType.invoices.name
: null,
);
}

Expand Down Expand Up @@ -250,6 +256,9 @@ abstract class ScheduleParameters
@BuiltValueField(wireName: 'entity_id')
String? get entityId;

@BuiltValueField(wireName: 'report_name')
String? get reportName;

static Serializer<ScheduleParameters> get serializer =>
_$scheduleParametersSerializer;
}
31 changes: 27 additions & 4 deletions lib/data/models/schedule_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ui/app/presenters/entity_presenter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class EntityPresenter {
isNarrow) {
return name;
} else {
return '$type $name';
return '$type: $name';
}
}

Expand Down
19 changes: 12 additions & 7 deletions lib/ui/app/system_log_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,18 @@ class _SystemLogViewerState extends State<SystemLogViewer> {
},
isExpanded: _isExpanded[systemLog.id] == true,
body: _isExpanded[systemLog.id] == true
? Container(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: JsonViewer(logs ?? <String, dynamic>{}),
),
)
? logs == null
? Padding(
child: Text(systemLog.log),
padding: EdgeInsets.symmetric(
horizontal: 16, vertical: 10))
: Container(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: JsonViewer(logs),
),
)
: SizedBox(),
);
}).toList(),
Expand Down
4 changes: 4 additions & 0 deletions lib/ui/reports/expense_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ enum ExpenseReportFields {
converted_amount,
status,
record_state,
is_invoiced,
}

var memoizedExpenseReport = memo10((
Expand Down Expand Up @@ -284,6 +285,9 @@ ReportResult expenseReport(
value = AppLocalization.of(navigatorKey.currentContext!)!
.lookup(expense.entityState);
break;
case ExpenseReportFields.is_invoiced:
value = expense.isInvoiced;
break;
}

if (!ReportResult.matchField(
Expand Down
16 changes: 16 additions & 0 deletions lib/ui/reports/reports_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ class ReportsScreen extends StatelessWidget {
viewModel.onExportPressed(context);
},
),
AppTextButton(
label: localization.schedule,
isInHeader: true,
onPressed: () {
viewModel.onSchedulePressed(context);
},
),
],
Padding(
padding: const EdgeInsets.only(right: 8),
Expand Down Expand Up @@ -538,6 +545,15 @@ class ReportsScreen extends StatelessWidget {
},
),
),
SizedBox(width: kGutterWidth),
Expanded(
child: AppButton(
label: localization.schedule,
onPressed: () {
viewModel.onSchedulePressed(context);
},
),
),
],
),
),
Expand Down
Loading

0 comments on commit 2528564

Please sign in to comment.