mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
fix(sorting): add the missing the resources columns.
This commit is contained in:
@@ -16,4 +16,29 @@ export default class ExchangeRate extends TenantModel {
|
||||
get timestamps() {
|
||||
return ['createdAt', 'updatedAt'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Model defined fields.
|
||||
*/
|
||||
static get fields(){
|
||||
return {
|
||||
currency_code: {
|
||||
label: 'Currency',
|
||||
column: 'currency_code'
|
||||
},
|
||||
exchange_rate: {
|
||||
label: 'Exchange rate',
|
||||
column: 'exchange_rate',
|
||||
},
|
||||
date: {
|
||||
label: 'Date',
|
||||
column: 'date',
|
||||
},
|
||||
created_at: {
|
||||
label: "Created at",
|
||||
column: "created_at",
|
||||
columnType: "date",
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ export default class Expense extends TenantModel {
|
||||
},
|
||||
published: {
|
||||
label: "Published",
|
||||
column: "published",
|
||||
column: "published_at",
|
||||
},
|
||||
created_at: {
|
||||
label: "Created at",
|
||||
|
||||
@@ -125,6 +125,12 @@ export default class SaleEstimate extends TenantModel {
|
||||
approved(query) {
|
||||
query.whereNot('approved_at', null)
|
||||
},
|
||||
/**
|
||||
* Sorting the estimates orders by delivery status.
|
||||
*/
|
||||
orderByDraft(query, order) {
|
||||
query.orderByRaw(`delivered_at is null ${order}`)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -238,6 +244,9 @@ export default class SaleEstimate extends TenantModel {
|
||||
query.modify('expired'); break;
|
||||
}
|
||||
},
|
||||
sortQuery: (query, role) => {
|
||||
query.modify('orderByDraft', role.order);
|
||||
}
|
||||
},
|
||||
created_at: {
|
||||
label: 'Created at',
|
||||
|
||||
@@ -60,6 +60,13 @@ export default class SaleReceipt extends TenantModel {
|
||||
draft(query) {
|
||||
query.where('closed_at', null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sorting the receipts order by status.
|
||||
*/
|
||||
sortByStatus(query, order) {
|
||||
query.orderByRaw(`CLOSED_AT IS NULL ${order}`);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -196,6 +203,9 @@ export default class SaleReceipt extends TenantModel {
|
||||
break;
|
||||
}
|
||||
},
|
||||
sortQuery(query, role) {
|
||||
query.modify('sortByStatus', role.order);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user