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