Report changes

This commit is contained in:
Hillel Coren 2021-02-03 23:13:47 +02:00
parent d3e0e7c531
commit ec2ceb2d05
5 changed files with 26 additions and 7 deletions

View File

@ -29,7 +29,7 @@ InvoiceItemEntity convertTaskToInvoiceItem(
final start =
formatDate(time.startDate.toIso8601String(), context, showTime: true);
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</span>';

View File

@ -91,7 +91,7 @@ class _ExpenseViewState extends State<ExpenseView>
action1: EntityAction.clone,
action2: expense.isInvoiced
? EntityAction.archive
: EntityAction.newInvoice,
: EntityAction.invoiceExpense,
)
],
);

View File

@ -23,21 +23,32 @@ enum ProfitAndLossReportFields {
vendor_country,
type,
amount,
date
date,
category,
}
var memoizedProfitAndLossReport = memo8((
var memoizedProfitAndLossReport = memo9((
UserCompanyEntity userCompany,
ReportsUIState reportsUIState,
BuiltMap<String, ClientEntity> clientMap,
BuiltMap<String, PaymentEntity> paymentMap,
BuiltMap<String, ExpenseEntity> expenseMap,
BuiltMap<String, ExpenseCategoryEntity> expenseCategoryMap,
BuiltMap<String, VendorEntity> vendorMap,
BuiltMap<String, UserEntity> userMap,
StaticState staticState,
) =>
profitAndLossReport(userCompany, reportsUIState, clientMap, paymentMap,
expenseMap, vendorMap, userMap, staticState));
profitAndLossReport(
userCompany,
reportsUIState,
clientMap,
paymentMap,
expenseMap,
expenseCategoryMap,
vendorMap,
userMap,
staticState,
));
ReportResult profitAndLossReport(
UserCompanyEntity userCompany,
@ -45,6 +56,7 @@ ReportResult profitAndLossReport(
BuiltMap<String, ClientEntity> clientMap,
BuiltMap<String, PaymentEntity> paymentMap,
BuiltMap<String, ExpenseEntity> expenseMap,
BuiltMap<String, ExpenseCategoryEntity> expenseCategoryMap,
BuiltMap<String, VendorEntity> vendorMap,
BuiltMap<String, UserEntity> userMap,
StaticState staticState,
@ -132,6 +144,9 @@ ReportResult profitAndLossReport(
case ProfitAndLossReportFields.date:
value = payment?.date;
break;
case ProfitAndLossReportFields.category:
value = '';
break;
}
if (!ReportResult.matchField(
@ -217,6 +232,9 @@ ReportResult profitAndLossReport(
case ProfitAndLossReportFields.date:
value = expense.date;
break;
case ProfitAndLossReportFields.category:
value = expenseCategoryMap[expense.categoryId]?.name ?? '';
break;
}
if (!ReportResult.matchField(

View File

@ -226,6 +226,7 @@ class ReportsScreenVM {
state.clientState.map,
state.paymentState.map,
state.expenseState.map,
state.expenseCategoryState.map,
state.vendorState.map,
state.userState.map,
state.staticState,

View File

@ -95,7 +95,7 @@ class _TaskViewState extends State<TaskView>
: EntityAction.resume,
action2: task.isInvoiced
? EntityAction.archive
: EntityAction.newInvoice,
: EntityAction.invoiceTask,
action1Enabled: !task.isInvoiced,
),
],