Transaction table/reports
This commit is contained in:
parent
59d2124d52
commit
0e03cce3b6
|
|
@ -54,6 +54,7 @@ class TransactionFields {
|
|||
static const String currency = 'currency';
|
||||
static const String vendor = 'vendor';
|
||||
static const String category = 'category';
|
||||
static const String payment = 'payment';
|
||||
static const String bankAccountId = 'bank_account_id';
|
||||
static const String bankAccount = 'bank_account';
|
||||
static const String invoiceIds = 'invoice_ids';
|
||||
|
|
|
|||
|
|
@ -359,6 +359,7 @@ class ReportsScreenVM {
|
|||
state.expenseCategoryState.map,
|
||||
state.invoiceState.map,
|
||||
state.bankAccountState.map,
|
||||
state.paymentState.map,
|
||||
state.staticState,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ enum TransactionReportFields {
|
|||
withdrawal,
|
||||
vendor,
|
||||
category,
|
||||
payment,
|
||||
bankAccount,
|
||||
invoices,
|
||||
expenseNumber,
|
||||
|
|
@ -31,7 +32,7 @@ enum TransactionReportFields {
|
|||
updated_at,
|
||||
}
|
||||
|
||||
var memoizedTransactionReport = memo9((
|
||||
var memoizedTransactionReport = memo10((
|
||||
UserCompanyEntity userCompany,
|
||||
ReportsUIState reportsUIState,
|
||||
BuiltMap<String, TransactionEntity> transactionMap,
|
||||
|
|
@ -40,6 +41,7 @@ var memoizedTransactionReport = memo9((
|
|||
BuiltMap<String, ExpenseCategoryEntity> categoryMap,
|
||||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||
BuiltMap<String, BankAccountEntity> bankAccountMap,
|
||||
BuiltMap<String, PaymentEntity> paymentMap,
|
||||
StaticState staticState,
|
||||
) =>
|
||||
transactionReport(
|
||||
|
|
@ -51,6 +53,7 @@ var memoizedTransactionReport = memo9((
|
|||
categoryMap,
|
||||
invoiceMap,
|
||||
bankAccountMap,
|
||||
paymentMap,
|
||||
staticState,
|
||||
));
|
||||
|
||||
|
|
@ -63,6 +66,7 @@ ReportResult transactionReport(
|
|||
BuiltMap<String, ExpenseCategoryEntity> categoryMap,
|
||||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||
BuiltMap<String, BankAccountEntity> bankAccountMap,
|
||||
BuiltMap<String, PaymentEntity> paymentMap,
|
||||
StaticState staticState,
|
||||
) {
|
||||
final List<List<ReportElement>> data = [];
|
||||
|
|
@ -142,6 +146,9 @@ ReportResult transactionReport(
|
|||
case TransactionReportFields.bankAccount:
|
||||
value = bankAccountMap[transaction.bankAccountId]?.name ?? '';
|
||||
break;
|
||||
case TransactionReportFields.payment:
|
||||
value = paymentMap[transaction.paymentId]?.number ?? '';
|
||||
break;
|
||||
case TransactionReportFields.defaultCategory:
|
||||
value = transaction.category;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ class TransactionPresenter extends EntityPresenter {
|
|||
TransactionFields.amount,
|
||||
TransactionFields.vendor,
|
||||
TransactionFields.category,
|
||||
TransactionFields.payment,
|
||||
TransactionFields.defaultCategory,
|
||||
];
|
||||
}
|
||||
|
|
@ -83,6 +84,9 @@ class TransactionPresenter extends EntityPresenter {
|
|||
state.bankAccountState.get(transaction.bankAccountId);
|
||||
return LinkTextRelatedEntity(
|
||||
entity: bankAccount, relation: transaction);
|
||||
case TransactionFields.payment:
|
||||
final payment = state.paymentState.get(transaction.paymentId);
|
||||
return LinkTextRelatedEntity(entity: payment, relation: transaction);
|
||||
case TransactionFields.invoices:
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: kTableColumnWidthMax),
|
||||
|
|
|
|||
Loading…
Reference in New Issue