Clients
This commit is contained in:
parent
2408124f6d
commit
d030524329
|
|
@ -180,12 +180,10 @@ abstract class ClientEntity extends Object with BaseEntity implements Built<Clie
|
||||||
ClientEntity clientA = sortAscending ? this : client;
|
ClientEntity clientA = sortAscending ? this : client;
|
||||||
ClientEntity clientB = sortAscending ? client: this;
|
ClientEntity clientB = sortAscending ? client: this;
|
||||||
|
|
||||||
/*
|
|
||||||
switch (sortField) {
|
switch (sortField) {
|
||||||
case ClientFields.cost:
|
case ClientFields.balance:
|
||||||
response = clientA.cost.compareTo(clientB.cost);
|
response = clientA.balance.compareTo(clientB.balance);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
if (response == 0) {
|
if (response == 0) {
|
||||||
return clientA.name.compareTo(clientB.name);
|
return clientA.name.compareTo(clientB.name);
|
||||||
|
|
@ -199,7 +197,7 @@ abstract class ClientEntity extends Object with BaseEntity implements Built<Clie
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return name.contains(search);
|
return displayName.contains(search);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientEntity._();
|
ClientEntity._();
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class _ClientViewDetailsState extends State<ClientViewDetails> {
|
||||||
|
|
||||||
var contacts = client.contacts;
|
var contacts = client.contacts;
|
||||||
contacts.forEach((contact) {
|
contacts.forEach((contact) {
|
||||||
if (contact.email.isNotEmpty) {
|
if ((contact.email ?? '').isNotEmpty) {
|
||||||
listTiles.add(AppListTile(
|
listTiles.add(AppListTile(
|
||||||
icon: Icons.email,
|
icon: Icons.email,
|
||||||
title: contact.fullName() + '\n' + contact.email,
|
title: contact.fullName() + '\n' + contact.email,
|
||||||
|
|
@ -63,7 +63,7 @@ class _ClientViewDetailsState extends State<ClientViewDetails> {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contact.phone.isNotEmpty) {
|
if ((contact.phone ?? '').isNotEmpty) {
|
||||||
listTiles.add(AppListTile(
|
listTiles.add(AppListTile(
|
||||||
icon: Icons.phone,
|
icon: Icons.phone,
|
||||||
title: contact.fullName() + '\n' + contact.phone,
|
title: contact.fullName() + '\n' + contact.phone,
|
||||||
|
|
@ -78,7 +78,7 @@ class _ClientViewDetailsState extends State<ClientViewDetails> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (client.website.isNotEmpty) {
|
if ((client.website ?? '').isNotEmpty) {
|
||||||
listTiles.add(AppListTile(
|
listTiles.add(AppListTile(
|
||||||
icon: Icons.link,
|
icon: Icons.link,
|
||||||
title: client.website,
|
title: client.website,
|
||||||
|
|
@ -89,7 +89,7 @@ class _ClientViewDetailsState extends State<ClientViewDetails> {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.workPhone.isNotEmpty) {
|
if ((client.workPhone ?? '').isNotEmpty) {
|
||||||
listTiles.add(AppListTile(
|
listTiles.add(AppListTile(
|
||||||
icon: Icons.phone,
|
icon: Icons.phone,
|
||||||
title: client.workPhone,
|
title: client.workPhone,
|
||||||
|
|
@ -104,7 +104,7 @@ class _ClientViewDetailsState extends State<ClientViewDetails> {
|
||||||
|
|
||||||
listTiles.add(Divider());
|
listTiles.add(Divider());
|
||||||
|
|
||||||
if (client.vatNumber.isNotEmpty) {
|
if ((client.vatNumber ?? '').isNotEmpty) {
|
||||||
listTiles.add(AppListTile(
|
listTiles.add(AppListTile(
|
||||||
icon: Icons.location_city,
|
icon: Icons.location_city,
|
||||||
title: client.vatNumber,
|
title: client.vatNumber,
|
||||||
|
|
@ -112,7 +112,7 @@ class _ClientViewDetailsState extends State<ClientViewDetails> {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.idNumber.isNotEmpty) {
|
if ((client.idNumber ?? '').isNotEmpty) {
|
||||||
listTiles.add(AppListTile(
|
listTiles.add(AppListTile(
|
||||||
icon: Icons.business,
|
icon: Icons.business,
|
||||||
title: client.idNumber,
|
title: client.idNumber,
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@ String formatURL(String url) {
|
||||||
String formatAddress({dynamic object, bool isShipping = false, String delimiter = '\n'}) {
|
String formatAddress({dynamic object, bool isShipping = false, String delimiter = '\n'}) {
|
||||||
var str = '';
|
var str = '';
|
||||||
|
|
||||||
String address1 = isShipping ? object.shippingAddress1 : object.address1;
|
String address1 = (isShipping ? object.shippingAddress1 : object.address1) ?? '';
|
||||||
String address2 = isShipping ? object.shippingAddress2 : object.address2;
|
String address2 = (isShipping ? object.shippingAddress2 : object.address2) ?? '';
|
||||||
String city = isShipping ? object.city : object.city;
|
String city = (isShipping ? object.city : object.city) ?? '';
|
||||||
String state = isShipping ? object.state : object.state;
|
String state = (isShipping ? object.state : object.state) ?? '';
|
||||||
String postalCode = isShipping ? object.postalCode : object.postalCode;
|
String postalCode = (isShipping ? object.postalCode : object.postalCode) ?? '';
|
||||||
|
|
||||||
if (address1.isNotEmpty) {
|
if (address1.isNotEmpty) {
|
||||||
str += address1 + delimiter;
|
str += address1 + delimiter;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue