Add columns to invoice datatable
This commit is contained in:
parent
aec01ee231
commit
d93c3d3bf5
|
|
@ -776,6 +776,12 @@ abstract class InvoiceEntity extends Object
|
||||||
case InvoiceFields.clientCountry:
|
case InvoiceFields.clientCountry:
|
||||||
response = clientA.countryId.compareTo(clientB.countryId);
|
response = clientA.countryId.compareTo(clientB.countryId);
|
||||||
break;
|
break;
|
||||||
|
case InvoiceFields.partial:
|
||||||
|
response = invoiceA.partial.compareTo(invoiceB.partial);
|
||||||
|
break;
|
||||||
|
case InvoiceFields.partialDueDate:
|
||||||
|
response = invoiceA.partialDueDate.compareTo(invoiceB.partialDueDate);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
print('## ERROR: sort by invoice.$sortField is not implemented');
|
print('## ERROR: sort by invoice.$sortField is not implemented');
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ class CreditPresenter extends EntityPresenter {
|
||||||
CreditFields.clientCity,
|
CreditFields.clientCity,
|
||||||
CreditFields.clientPostalCode,
|
CreditFields.clientPostalCode,
|
||||||
CreditFields.clientCountry,
|
CreditFields.clientCountry,
|
||||||
|
CreditFields.partial,
|
||||||
|
CreditFields.partialDueDate,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -139,9 +141,12 @@ class CreditPresenter extends EntityPresenter {
|
||||||
credit, state.clientState.get(credit.clientId));
|
credit, state.clientState.get(credit.clientId));
|
||||||
if (field == CreditFields.contactName) {
|
if (field == CreditFields.contactName) {
|
||||||
return Text(contact?.fullName ?? '');
|
return Text(contact?.fullName ?? '');
|
||||||
} else {
|
|
||||||
return Text(contact?.email ?? '');
|
|
||||||
}
|
}
|
||||||
|
return Text(contact?.email ?? '');
|
||||||
|
case CreditFields.partial:
|
||||||
|
return Text(formatNumber(credit.partial, context));
|
||||||
|
case CreditFields.partialDueDate:
|
||||||
|
return Text(formatDate(credit.partialDueDate, context));
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getField(field: field, context: context);
|
return super.getField(field: field, context: context);
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,8 @@ class InvoicePresenter extends EntityPresenter {
|
||||||
InvoiceFields.clientCity,
|
InvoiceFields.clientCity,
|
||||||
InvoiceFields.clientPostalCode,
|
InvoiceFields.clientPostalCode,
|
||||||
InvoiceFields.clientCountry,
|
InvoiceFields.clientCountry,
|
||||||
|
InvoiceFields.partial,
|
||||||
|
InvoiceFields.partialDueDate,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,9 +160,12 @@ class InvoicePresenter extends EntityPresenter {
|
||||||
invoice, state.clientState.get(invoice.clientId));
|
invoice, state.clientState.get(invoice.clientId));
|
||||||
if (field == InvoiceFields.contactName) {
|
if (field == InvoiceFields.contactName) {
|
||||||
return Text(contact?.fullName ?? '');
|
return Text(contact?.fullName ?? '');
|
||||||
} else {
|
|
||||||
return Text(contact?.email ?? '');
|
|
||||||
}
|
}
|
||||||
|
return Text(contact?.email ?? '');
|
||||||
|
case InvoiceFields.partial:
|
||||||
|
return Text(formatNumber(invoice.partial, context));
|
||||||
|
case InvoiceFields.partialDueDate:
|
||||||
|
return Text(formatDate(invoice.partialDueDate, context));
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getField(field: field, context: context);
|
return super.getField(field: field, context: context);
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ class QuotePresenter extends EntityPresenter {
|
||||||
QuoteFields.clientCity,
|
QuoteFields.clientCity,
|
||||||
QuoteFields.clientPostalCode,
|
QuoteFields.clientPostalCode,
|
||||||
QuoteFields.clientCountry,
|
QuoteFields.clientCountry,
|
||||||
|
QuoteFields.partial,
|
||||||
|
QuoteFields.partialDueDate,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,9 +134,12 @@ class QuotePresenter extends EntityPresenter {
|
||||||
quoteContactSelector(quote, state.clientState.get(quote.clientId));
|
quoteContactSelector(quote, state.clientState.get(quote.clientId));
|
||||||
if (field == QuoteFields.contactName) {
|
if (field == QuoteFields.contactName) {
|
||||||
return Text(contact?.fullName ?? '');
|
return Text(contact?.fullName ?? '');
|
||||||
} else {
|
|
||||||
return Text(contact?.email ?? '');
|
|
||||||
}
|
}
|
||||||
|
return Text(contact?.email ?? '');
|
||||||
|
case QuoteFields.partial:
|
||||||
|
return Text(formatNumber(quote.partial, context));
|
||||||
|
case QuoteFields.partialDueDate:
|
||||||
|
return Text(formatDate(quote.partialDueDate, context));
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getField(field: field, context: context);
|
return super.getField(field: field, context: context);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue