mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat: retrieve all due invoices and bills or for specific customer/vendor.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Model } from 'objection';
|
||||
import { Model, raw } from 'objection';
|
||||
import { difference } from 'lodash';
|
||||
import TenantModel from 'models/TenantModel';
|
||||
|
||||
@@ -21,6 +21,14 @@ export default class Bill extends TenantModel {
|
||||
return true;
|
||||
}
|
||||
|
||||
static get modifiers() {
|
||||
return {
|
||||
dueBills(query) {
|
||||
query.where(raw('AMOUNT - PAYMENT_AMOUNT > 0'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Timestamps columns.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user