mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: retrieve bills and bills payments list.
This commit is contained in:
@@ -17,6 +17,10 @@ export default class Bill extends TenantModel {
|
||||
return 'bills';
|
||||
}
|
||||
|
||||
static get resourceable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Timestamps columns.
|
||||
*/
|
||||
@@ -48,7 +52,7 @@ export default class Bill extends TenantModel {
|
||||
to: 'contacts.id',
|
||||
},
|
||||
filter(query) {
|
||||
query.where('contact_type', 'Vendor');
|
||||
query.where('contact_service', 'vendor');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -97,4 +101,14 @@ export default class Bill extends TenantModel {
|
||||
.where('id', billId)
|
||||
[changeMethod]('payment_amount', Math.abs(amount));
|
||||
}
|
||||
|
||||
static get fields() {
|
||||
return {
|
||||
created_at: {
|
||||
label: 'Created at',
|
||||
column: 'created_at',
|
||||
columnType: 'date',
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,10 @@ export default class BillPayment extends TenantModel {
|
||||
return ['createdAt', 'updatedAt'];
|
||||
}
|
||||
|
||||
static get resourceable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Relationship mapping.
|
||||
*/
|
||||
@@ -43,7 +47,7 @@ export default class BillPayment extends TenantModel {
|
||||
to: 'contacts.id',
|
||||
},
|
||||
filter(query) {
|
||||
query.where('contact_type', 'Vendor');
|
||||
query.where('contact_service', 'vendor');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -69,4 +73,15 @@ export default class BillPayment extends TenantModel {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
static get fields() {
|
||||
return {
|
||||
created_at: {
|
||||
label: 'Created at',
|
||||
column: 'created_at',
|
||||
columnType: 'date',
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user