fix issues in sales and purchases module.

This commit is contained in:
Ahmed Bouhuolia
2020-08-05 16:25:53 +02:00
parent ad772cf247
commit 57ec5bdfbe
12 changed files with 236 additions and 62 deletions

View File

@@ -299,4 +299,19 @@ export default class BillsService {
static getBill(billId) {
return Bill.tenant().query().where('id', billId).first();
}
/**
* Retrieve the given bill details with associated items entries.
* @param {Integer} billId -
* @returns {Promise}
*/
static getBillWithMetadata(billId) {
return Bill.tenant()
.query()
.where('id', billId)
.withGraphFetched('vendor')
.withGraphFetched('entries')
.first();
}
}