Add status/category to task/expense reports
This commit is contained in:
parent
8091c61f5a
commit
20981497d0
|
|
@ -33,25 +33,37 @@ enum ExpenseReportFields {
|
|||
custom_value2,
|
||||
custom_value3,
|
||||
custom_value4,
|
||||
category,
|
||||
}
|
||||
|
||||
var memoizedExpenseReport = memo8((
|
||||
var memoizedExpenseReport = memo9((
|
||||
UserCompanyEntity userCompany,
|
||||
ReportsUIState reportsUIState,
|
||||
BuiltMap<String, ExpenseEntity> expenseMap,
|
||||
BuiltMap<String, ExpenseCategoryEntity> expenseCategoryMap,
|
||||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||
BuiltMap<String, ClientEntity> clientMap,
|
||||
BuiltMap<String, VendorEntity> vendorMap,
|
||||
BuiltMap<String, UserEntity> userMap,
|
||||
StaticState staticState,
|
||||
) =>
|
||||
expenseReport(userCompany, reportsUIState, expenseMap, invoiceMap,
|
||||
clientMap, vendorMap, userMap, staticState));
|
||||
expenseReport(
|
||||
userCompany,
|
||||
reportsUIState,
|
||||
expenseMap,
|
||||
expenseCategoryMap,
|
||||
invoiceMap,
|
||||
clientMap,
|
||||
vendorMap,
|
||||
userMap,
|
||||
staticState,
|
||||
));
|
||||
|
||||
ReportResult expenseReport(
|
||||
UserCompanyEntity userCompany,
|
||||
ReportsUIState reportsUIState,
|
||||
BuiltMap<String, ExpenseEntity> expenseMap,
|
||||
BuiltMap<String, ExpenseCategoryEntity> expenseCategoryMap,
|
||||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||
BuiltMap<String, ClientEntity> clientMap,
|
||||
BuiltMap<String, VendorEntity> vendorMap,
|
||||
|
|
@ -73,6 +85,7 @@ ReportResult expenseReport(
|
|||
ExpenseReportFields.client,
|
||||
ExpenseReportFields.invoice,
|
||||
ExpenseReportFields.vendor,
|
||||
ExpenseReportFields.category,
|
||||
];
|
||||
|
||||
if (expenseReportSettings.columns.isNotEmpty) {
|
||||
|
|
@ -171,6 +184,9 @@ ReportResult expenseReport(
|
|||
case ExpenseReportFields.custom_value4:
|
||||
value = expense.customValue4;
|
||||
break;
|
||||
case ExpenseReportFields.category:
|
||||
value = expenseCategoryMap[expense.categoryId]?.name ?? '';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ReportResult.matchField(
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ class ReportsScreenVM {
|
|||
state.userCompany,
|
||||
state.uiState.reportsUIState,
|
||||
state.expenseState.map,
|
||||
state.expenseCategoryState.map,
|
||||
state.invoiceState.map,
|
||||
state.clientState.map,
|
||||
state.vendorState.map,
|
||||
|
|
@ -165,7 +166,7 @@ class ReportsScreenVM {
|
|||
state.invoiceState.map,
|
||||
state.groupState.map,
|
||||
state.clientState.map,
|
||||
state.vendorState.map,
|
||||
state.taskStatusState.map,
|
||||
state.userState.map,
|
||||
state.projectState.map,
|
||||
state.staticState,
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ enum TaskReportFields {
|
|||
custom_value2,
|
||||
custom_value3,
|
||||
custom_value4,
|
||||
status,
|
||||
}
|
||||
|
||||
var memoizedTaskReport = memo10((
|
||||
|
|
@ -43,13 +44,23 @@ var memoizedTaskReport = memo10((
|
|||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||
BuiltMap<String, GroupEntity> groupMap,
|
||||
BuiltMap<String, ClientEntity> clientMap,
|
||||
BuiltMap<String, VendorEntity> vendorMap,
|
||||
BuiltMap<String, TaskStatusEntity> taskStatusMap,
|
||||
BuiltMap<String, UserEntity> userMap,
|
||||
BuiltMap<String, ProjectEntity> projectMap,
|
||||
StaticState staticState,
|
||||
) =>
|
||||
taskReport(userCompany, reportsUIState, taskMap, invoiceMap, groupMap,
|
||||
clientMap, vendorMap, userMap, projectMap, staticState));
|
||||
taskReport(
|
||||
userCompany,
|
||||
reportsUIState,
|
||||
taskMap,
|
||||
invoiceMap,
|
||||
groupMap,
|
||||
clientMap,
|
||||
taskStatusMap,
|
||||
userMap,
|
||||
projectMap,
|
||||
staticState,
|
||||
));
|
||||
|
||||
ReportResult taskReport(
|
||||
UserCompanyEntity userCompany,
|
||||
|
|
@ -58,7 +69,7 @@ ReportResult taskReport(
|
|||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||
BuiltMap<String, GroupEntity> groupMap,
|
||||
BuiltMap<String, ClientEntity> clientMap,
|
||||
BuiltMap<String, VendorEntity> vendorMap,
|
||||
BuiltMap<String, TaskStatusEntity> taskStatusMap,
|
||||
BuiltMap<String, UserEntity> userMap,
|
||||
BuiltMap<String, ProjectEntity> projectMap,
|
||||
StaticState staticState,
|
||||
|
|
@ -80,6 +91,7 @@ ReportResult taskReport(
|
|||
TaskReportFields.client,
|
||||
TaskReportFields.project,
|
||||
TaskReportFields.invoice,
|
||||
TaskReportFields.status,
|
||||
];
|
||||
|
||||
if (taskReportSettings.columns.isNotEmpty) {
|
||||
|
|
@ -184,6 +196,9 @@ ReportResult taskReport(
|
|||
case TaskReportFields.custom_value4:
|
||||
value = task.customValue4;
|
||||
break;
|
||||
case TaskReportFields.status:
|
||||
value = taskStatusMap[task.statusId]?.name ?? '';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ReportResult.matchField(
|
||||
|
|
|
|||
Loading…
Reference in New Issue