Client data table
This commit is contained in:
parent
1536dc57d1
commit
805fe56df0
|
|
@ -323,6 +323,9 @@ abstract class ClientEntity extends Object
|
|||
case ClientFields.balance:
|
||||
response = clientA.balance.compareTo(clientB.balance);
|
||||
break;
|
||||
case ClientFields.paidToDate:
|
||||
response = clientA.paidToDate.compareTo(clientB.paidToDate);
|
||||
break;
|
||||
case ClientFields.updatedAt:
|
||||
response = clientA.updatedAt.compareTo(clientB.updatedAt);
|
||||
break;
|
||||
|
|
@ -352,6 +355,9 @@ abstract class ClientEntity extends Object
|
|||
.toLowerCase()
|
||||
.compareTo(clientB.customValue4.toLowerCase());
|
||||
break;
|
||||
default:
|
||||
print('## ERROR: sort by $sortField not implemented');
|
||||
break;
|
||||
}
|
||||
|
||||
if (response == 0) {
|
||||
|
|
|
|||
|
|
@ -749,8 +749,8 @@ class AppDataTable extends StatelessWidget {
|
|||
: null,
|
||||
// IGNORE SORTING ON FIRST COLUMN
|
||||
sorted: displayCheckboxColumn
|
||||
? dataColumnIndex == sortColumnIndex
|
||||
: (dataColumnIndex - 1) == sortColumnIndex,
|
||||
? (dataColumnIndex + 1) == sortColumnIndex
|
||||
: dataColumnIndex == sortColumnIndex,
|
||||
ascending: sortAscending,
|
||||
);
|
||||
rowIndex = 1;
|
||||
|
|
|
|||
|
|
@ -171,8 +171,9 @@ class _EntityListState extends State<EntityList> {
|
|||
),
|
||||
),
|
||||
numeric: EntityPresenter.isFieldNumeric(field),
|
||||
onSort: (int columnIndex, bool ascending) =>
|
||||
widget.onSortColumn(field))),
|
||||
onSort: (int columnIndex, bool ascending) {
|
||||
widget.onSortColumn(field);
|
||||
})),
|
||||
],
|
||||
source: dataTableSource,
|
||||
header: DatatableHeader(
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@ import 'package:invoiceninja_flutter/utils/formatting.dart';
|
|||
class ClientPresenter extends EntityPresenter {
|
||||
static List<String> getTableFields(UserCompanyEntity userCompany) {
|
||||
return [
|
||||
ClientFields.idNumber,
|
||||
ClientFields.name,
|
||||
ClientFields.balance,
|
||||
ClientFields.paidToDate,
|
||||
ClientFields.contact,
|
||||
ClientFields.contactEmail,
|
||||
ClientFields.idNumber,
|
||||
EntityFields.createdAt,
|
||||
//ClientFields.contactLastLogin,
|
||||
ClientFields.balance,
|
||||
EntityFields.state,
|
||||
];
|
||||
}
|
||||
|
|
@ -34,6 +35,9 @@ class ClientPresenter extends EntityPresenter {
|
|||
return Text(client.idNumber);
|
||||
case ClientFields.balance:
|
||||
return Text(formatNumber(client.balance, context, clientId: client.id));
|
||||
case ClientFields.paidToDate:
|
||||
return Text(
|
||||
formatNumber(client.paidToDate, context, clientId: client.id));
|
||||
}
|
||||
|
||||
return super.getField(field: field, context: context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue