Report changes
This commit is contained in:
parent
d3e0e7c531
commit
ec2ceb2d05
|
|
@ -29,7 +29,7 @@ InvoiceItemEntity convertTaskToInvoiceItem(
|
||||||
final start =
|
final start =
|
||||||
formatDate(time.startDate.toIso8601String(), context, showTime: true);
|
formatDate(time.startDate.toIso8601String(), context, showTime: true);
|
||||||
final end = formatDate(time.endDate.toIso8601String(), context,
|
final end = formatDate(time.endDate.toIso8601String(), context,
|
||||||
showTime: true, showDate: false, showSeconds: false);
|
showTime: true, showDate: false, showSeconds: true);
|
||||||
notes += '\n$start - $end';
|
notes += '\n$start - $end';
|
||||||
});
|
});
|
||||||
notes += '\n</span>';
|
notes += '\n</span>';
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ class _ExpenseViewState extends State<ExpenseView>
|
||||||
action1: EntityAction.clone,
|
action1: EntityAction.clone,
|
||||||
action2: expense.isInvoiced
|
action2: expense.isInvoiced
|
||||||
? EntityAction.archive
|
? EntityAction.archive
|
||||||
: EntityAction.newInvoice,
|
: EntityAction.invoiceExpense,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -23,21 +23,32 @@ enum ProfitAndLossReportFields {
|
||||||
vendor_country,
|
vendor_country,
|
||||||
type,
|
type,
|
||||||
amount,
|
amount,
|
||||||
date
|
date,
|
||||||
|
category,
|
||||||
}
|
}
|
||||||
|
|
||||||
var memoizedProfitAndLossReport = memo8((
|
var memoizedProfitAndLossReport = memo9((
|
||||||
UserCompanyEntity userCompany,
|
UserCompanyEntity userCompany,
|
||||||
ReportsUIState reportsUIState,
|
ReportsUIState reportsUIState,
|
||||||
BuiltMap<String, ClientEntity> clientMap,
|
BuiltMap<String, ClientEntity> clientMap,
|
||||||
BuiltMap<String, PaymentEntity> paymentMap,
|
BuiltMap<String, PaymentEntity> paymentMap,
|
||||||
BuiltMap<String, ExpenseEntity> expenseMap,
|
BuiltMap<String, ExpenseEntity> expenseMap,
|
||||||
|
BuiltMap<String, ExpenseCategoryEntity> expenseCategoryMap,
|
||||||
BuiltMap<String, VendorEntity> vendorMap,
|
BuiltMap<String, VendorEntity> vendorMap,
|
||||||
BuiltMap<String, UserEntity> userMap,
|
BuiltMap<String, UserEntity> userMap,
|
||||||
StaticState staticState,
|
StaticState staticState,
|
||||||
) =>
|
) =>
|
||||||
profitAndLossReport(userCompany, reportsUIState, clientMap, paymentMap,
|
profitAndLossReport(
|
||||||
expenseMap, vendorMap, userMap, staticState));
|
userCompany,
|
||||||
|
reportsUIState,
|
||||||
|
clientMap,
|
||||||
|
paymentMap,
|
||||||
|
expenseMap,
|
||||||
|
expenseCategoryMap,
|
||||||
|
vendorMap,
|
||||||
|
userMap,
|
||||||
|
staticState,
|
||||||
|
));
|
||||||
|
|
||||||
ReportResult profitAndLossReport(
|
ReportResult profitAndLossReport(
|
||||||
UserCompanyEntity userCompany,
|
UserCompanyEntity userCompany,
|
||||||
|
|
@ -45,6 +56,7 @@ ReportResult profitAndLossReport(
|
||||||
BuiltMap<String, ClientEntity> clientMap,
|
BuiltMap<String, ClientEntity> clientMap,
|
||||||
BuiltMap<String, PaymentEntity> paymentMap,
|
BuiltMap<String, PaymentEntity> paymentMap,
|
||||||
BuiltMap<String, ExpenseEntity> expenseMap,
|
BuiltMap<String, ExpenseEntity> expenseMap,
|
||||||
|
BuiltMap<String, ExpenseCategoryEntity> expenseCategoryMap,
|
||||||
BuiltMap<String, VendorEntity> vendorMap,
|
BuiltMap<String, VendorEntity> vendorMap,
|
||||||
BuiltMap<String, UserEntity> userMap,
|
BuiltMap<String, UserEntity> userMap,
|
||||||
StaticState staticState,
|
StaticState staticState,
|
||||||
|
|
@ -132,6 +144,9 @@ ReportResult profitAndLossReport(
|
||||||
case ProfitAndLossReportFields.date:
|
case ProfitAndLossReportFields.date:
|
||||||
value = payment?.date;
|
value = payment?.date;
|
||||||
break;
|
break;
|
||||||
|
case ProfitAndLossReportFields.category:
|
||||||
|
value = '';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ReportResult.matchField(
|
if (!ReportResult.matchField(
|
||||||
|
|
@ -217,6 +232,9 @@ ReportResult profitAndLossReport(
|
||||||
case ProfitAndLossReportFields.date:
|
case ProfitAndLossReportFields.date:
|
||||||
value = expense.date;
|
value = expense.date;
|
||||||
break;
|
break;
|
||||||
|
case ProfitAndLossReportFields.category:
|
||||||
|
value = expenseCategoryMap[expense.categoryId]?.name ?? '';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ReportResult.matchField(
|
if (!ReportResult.matchField(
|
||||||
|
|
|
||||||
|
|
@ -226,6 +226,7 @@ class ReportsScreenVM {
|
||||||
state.clientState.map,
|
state.clientState.map,
|
||||||
state.paymentState.map,
|
state.paymentState.map,
|
||||||
state.expenseState.map,
|
state.expenseState.map,
|
||||||
|
state.expenseCategoryState.map,
|
||||||
state.vendorState.map,
|
state.vendorState.map,
|
||||||
state.userState.map,
|
state.userState.map,
|
||||||
state.staticState,
|
state.staticState,
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ class _TaskViewState extends State<TaskView>
|
||||||
: EntityAction.resume,
|
: EntityAction.resume,
|
||||||
action2: task.isInvoiced
|
action2: task.isInvoiced
|
||||||
? EntityAction.archive
|
? EntityAction.archive
|
||||||
: EntityAction.newInvoice,
|
: EntityAction.invoiceTask,
|
||||||
action1Enabled: !task.isInvoiced,
|
action1Enabled: !task.isInvoiced,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue