Suppot tracking vendor on invoice
This commit is contained in:
parent
1478cf761d
commit
d12d16767d
|
|
@ -74,4 +74,6 @@ class CreditFields {
|
|||
static const String taxAmount = 'tax_amount';
|
||||
static const String exchangeRate = 'exchange_rate';
|
||||
static const String isViewed = 'is_viewed';
|
||||
static const String project = 'project';
|
||||
static const String vendor = 'vendor';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,4 +73,6 @@ class QuoteFields {
|
|||
static const String taxAmount = 'tax_amount';
|
||||
static const String exchangeRate = 'exchange_rate';
|
||||
static const String isViewed = 'is_viewed';
|
||||
static const String project = 'project';
|
||||
static const String vendor = 'vendor';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ class CreditPresenter extends EntityPresenter {
|
|||
CreditFields.exchangeRate,
|
||||
CreditFields.isViewed,
|
||||
CreditFields.lastSentDate,
|
||||
CreditFields.project,
|
||||
CreditFields.vendor,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -110,6 +112,10 @@ class CreditPresenter extends EntityPresenter {
|
|||
formatNumberType: FormatNumberType.double));
|
||||
case CreditFields.isViewed:
|
||||
return Text(credit.isViewed ? localization.yes : localization.no);
|
||||
case CreditFields.project:
|
||||
return Text(state.projectState.get(credit.projectId).listDisplayName);
|
||||
case CreditFields.vendor:
|
||||
return Text(state.vendorState.get(credit.vendorId).name);
|
||||
}
|
||||
|
||||
return super.getField(field: field, context: context);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class InvoicePresenter extends EntityPresenter {
|
|||
InvoiceFields.lastSentDate,
|
||||
InvoiceFields.nextSendDate,
|
||||
InvoiceFields.project,
|
||||
InvoiceFields.vendor,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -71,6 +72,8 @@ class InvoicePresenter extends EntityPresenter {
|
|||
.listDisplayName);
|
||||
case InvoiceFields.project:
|
||||
return Text(state.projectState.get(invoice.projectId).listDisplayName);
|
||||
case InvoiceFields.vendor:
|
||||
return Text(state.vendorState.get(invoice.vendorId).name);
|
||||
case InvoiceFields.date:
|
||||
return Text(formatDate(invoice.date, context));
|
||||
case InvoiceFields.lastSentDate:
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ class QuotePresenter extends EntityPresenter {
|
|||
QuoteFields.exchangeRate,
|
||||
QuoteFields.isViewed,
|
||||
QuoteFields.lastSentDate,
|
||||
QuoteFields.project,
|
||||
QuoteFields.vendor,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -104,6 +106,10 @@ class QuotePresenter extends EntityPresenter {
|
|||
formatNumberType: FormatNumberType.double));
|
||||
case QuoteFields.isViewed:
|
||||
return Text(quote.isViewed ? localization.yes : localization.no);
|
||||
case QuoteFields.project:
|
||||
return Text(state.projectState.get(quote.projectId).listDisplayName);
|
||||
case QuoteFields.vendor:
|
||||
return Text(state.vendorState.get(quote.vendorId).name);
|
||||
}
|
||||
|
||||
return super.getField(field: field, context: context);
|
||||
|
|
|
|||
|
|
@ -70,18 +70,30 @@ enum InvoiceReportFields {
|
|||
is_viewed,
|
||||
assigned_to,
|
||||
created_by,
|
||||
project,
|
||||
vendor,
|
||||
}
|
||||
|
||||
var memoizedInvoiceReport = memo6((
|
||||
var memoizedInvoiceReport = memo8((
|
||||
UserCompanyEntity userCompany,
|
||||
ReportsUIState reportsUIState,
|
||||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||
BuiltMap<String, ClientEntity> clientMap,
|
||||
BuiltMap<String, UserEntity> userMap,
|
||||
BuiltMap<String, VendorEntity> vendorMap,
|
||||
BuiltMap<String, ProjectEntity> projectMap,
|
||||
StaticState staticState,
|
||||
) =>
|
||||
invoiceReport(userCompany, reportsUIState, invoiceMap, clientMap, userMap,
|
||||
staticState));
|
||||
invoiceReport(
|
||||
userCompany,
|
||||
reportsUIState,
|
||||
invoiceMap,
|
||||
clientMap,
|
||||
userMap,
|
||||
vendorMap,
|
||||
projectMap,
|
||||
staticState,
|
||||
));
|
||||
|
||||
ReportResult invoiceReport(
|
||||
UserCompanyEntity userCompany,
|
||||
|
|
@ -89,6 +101,8 @@ ReportResult invoiceReport(
|
|||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||
BuiltMap<String, ClientEntity> clientMap,
|
||||
BuiltMap<String, UserEntity> userMap,
|
||||
BuiltMap<String, VendorEntity> vendorMap,
|
||||
BuiltMap<String, ProjectEntity> projectMap,
|
||||
StaticState staticState,
|
||||
) {
|
||||
final List<List<ReportElement>> data = [];
|
||||
|
|
@ -312,6 +326,12 @@ ReportResult invoiceReport(
|
|||
case InvoiceReportFields.created_by:
|
||||
value = userMap[invoice.createdUserId]?.listDisplayName ?? '';
|
||||
break;
|
||||
case InvoiceReportFields.project:
|
||||
value = (projectMap[invoice.projectId] ?? ProjectEntity()).name;
|
||||
break;
|
||||
case InvoiceReportFields.vendor:
|
||||
value = (vendorMap[invoice.vendorId] ?? VendorEntity()).name;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ReportResult.matchField(
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ ReportResult quoteReport(
|
|||
|
||||
switch (column) {
|
||||
case QuoteReportFields.id:
|
||||
value = quote.id;
|
||||
value = quote.amount;
|
||||
break;
|
||||
case QuoteReportFields.amount:
|
||||
value = quote.amount;
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ class ReportsScreenVM {
|
|||
state.invoiceState.map,
|
||||
state.clientState.map,
|
||||
state.userState.map,
|
||||
state.vendorState.map,
|
||||
state.projectState.map,
|
||||
state.staticState,
|
||||
);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue