fix(Customers|Vendors): sorting customers and vendors list.

This commit is contained in:
a.bouhuolia
2021-03-21 14:05:26 +02:00
parent 0f1c88cba3
commit 54958eb18b
5 changed files with 82 additions and 19 deletions

View File

@@ -74,12 +74,7 @@ export function AvatarCell(row) {
* Phone number accessor.
*/
export function PhoneNumberAccessor(row) {
return (
<div>
<div className={'work_phone'}>{row.work_phone}</div>
<div className={'personal_phone'}>{row.personal_phone}</div>
</div>
);
return <div className={'work_phone'}>{row.work_phone}</div>;
}
/**
@@ -121,14 +116,14 @@ export function useCustomersTableColumns() {
width: 150,
},
{
id: 'phone_number',
Header: formatMessage({ id: 'phone_number' }),
id: 'work_phone',
Header: formatMessage({ id: 'work_phone' }),
accessor: PhoneNumberAccessor,
className: 'phone_number',
width: 100,
},
{
id: 'receivable_balance',
id: 'balance',
Header: formatMessage({ id: 'receivable_balance' }),
accessor: BalanceAccessor,
className: 'receivable_balance',

View File

@@ -73,12 +73,7 @@ export function AvatarAccessor(row) {
* Phone number accessor.
*/
export function PhoneNumberAccessor(row) {
return (
<div>
<div className={'work_phone'}>{row.work_phone}</div>
<div className={'personal_phone'}>{row.personal_phone}</div>
</div>
);
return <div className={'work_phone'}>{row.work_phone}</div>;
}
/**
@@ -120,14 +115,14 @@ export function useVendorsTableColumns() {
width: 150,
},
{
id: 'phone_number',
Header: formatMessage({ id: 'phone_number' }),
id: 'work_phone',
Header: formatMessage({ id: 'work_phone' }),
accessor: PhoneNumberAccessor,
className: 'phone_number',
className: 'work_phone',
width: 100,
},
{
id: 'receivable_balance',
id: 'balance',
Header: formatMessage({ id: 'receivable_balance' }),
accessor: BalanceAccessor,
className: 'receivable_balance',

View File

@@ -1019,4 +1019,5 @@ export default {
'Cannot delete bill that has associated payment transactions.',
cannot_change_item_type_to_inventory_with_item_has_associated_transactions:
'Cannot change item type to inventory with item has associated transactions.',
work_phone: 'Work Phone',
};

View File

@@ -129,6 +129,42 @@ export default class Customer extends TenantModel {
static get fields() {
return {
contact_service: {
column: 'contact_service',
},
display_name: {
column: 'display_name',
},
email: {
column: 'email',
},
work_phone: {
column: 'work_phone',
},
personal_phone: {
column: 'personal_phone',
},
company_name: {
column: 'company_name',
},
website: {
column: 'website'
},
created_at: {
column: 'created_at',
},
balance: {
column: 'balance',
},
opening_balance: {
column: 'opening_balance',
},
opening_balance_at: {
column: 'opening_balance_at',
},
currency_code: {
column: 'currency_code',
},
status: {
label: 'Status',
options: [

View File

@@ -127,6 +127,42 @@ export default class Vendor extends TenantModel {
static get fields() {
return {
contact_service: {
column: 'contact_service',
},
display_name: {
column: 'display_name',
},
email: {
column: 'email',
},
work_phone: {
column: 'work_phone',
},
personal_phone: {
column: 'personal_phone',
},
company_name: {
column: 'company_name',
},
website: {
column: 'website'
},
created_at: {
column: 'created_at',
},
balance: {
column: 'balance',
},
opening_balance: {
column: 'opening_balance',
},
opening_balance_at: {
column: 'opening_balance_at',
},
currency_code: {
column: 'currency_code',
},
status: {
label: 'Status',
options: [