Reports
This commit is contained in:
parent
31faa435a2
commit
bcf7f296c7
|
|
@ -41,6 +41,7 @@ enum ClientReportFields {
|
||||||
balance,
|
balance,
|
||||||
credit_balance,
|
credit_balance,
|
||||||
paid_to_date,
|
paid_to_date,
|
||||||
|
total,
|
||||||
id_number,
|
id_number,
|
||||||
vat_number,
|
vat_number,
|
||||||
contact_full_name,
|
contact_full_name,
|
||||||
|
|
@ -231,6 +232,9 @@ ReportResult clientReport(
|
||||||
case ClientReportFields.contact_last_login:
|
case ClientReportFields.contact_last_login:
|
||||||
value = convertTimestampToDateString(contact.lastLogin);
|
value = convertTimestampToDateString(contact.lastLogin);
|
||||||
break;
|
break;
|
||||||
|
case ClientReportFields.total:
|
||||||
|
value = client.balance + client.paidToDate;
|
||||||
|
break;
|
||||||
case ClientReportFields.balance:
|
case ClientReportFields.balance:
|
||||||
value = client.balance;
|
value = client.balance;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -526,8 +526,15 @@ ReportColumnType getReportColumnType(String column, BuildContext context) {
|
||||||
return ReportColumnType.dateTime;
|
return ReportColumnType.dateTime;
|
||||||
} else if (['date', 'due_date'].contains(column)) {
|
} else if (['date', 'due_date'].contains(column)) {
|
||||||
return ReportColumnType.date;
|
return ReportColumnType.date;
|
||||||
} else if (['balance', 'paid_to_date', 'amount', 'quantity', 'pridce', 'cost']
|
} else if ([
|
||||||
.contains(column)) {
|
'balance',
|
||||||
|
'paid_to_date',
|
||||||
|
'amount',
|
||||||
|
'quantity',
|
||||||
|
'pridce',
|
||||||
|
'cost',
|
||||||
|
'total',
|
||||||
|
].contains(column)) {
|
||||||
return ReportColumnType.number;
|
return ReportColumnType.number;
|
||||||
} else if (['is_active'].contains(column)) {
|
} else if (['is_active'].contains(column)) {
|
||||||
return ReportColumnType.bool;
|
return ReportColumnType.bool;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue