mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix: Graph fetch relations with sales & purchases models.
feat: Inventory tracker algorithm lots with FIFO or LIFO cost method.
This commit is contained in:
@@ -415,6 +415,9 @@ export default class PaymentReceivesController extends BaseController {
|
||||
return res.status(400).send({ errors: errorReasons });
|
||||
}
|
||||
const paymentReceives = await PaymentReceive.query().onBuild((builder) => {
|
||||
builder.withGraphFetched('customer');
|
||||
builder.withGraphFetched('depositAccount');
|
||||
|
||||
dynamicListing.buildQuery()(builder);
|
||||
return builder;
|
||||
}).pagination(filter.page - 1, filter.page_size);
|
||||
|
||||
@@ -326,6 +326,7 @@ export default class SalesEstimatesController extends BaseController {
|
||||
|
||||
const salesEstimates = await SaleEstimate.query().onBuild((builder) => {
|
||||
dynamicListing.buildQuery()(builder);
|
||||
builder.withGraphFetched('customer');
|
||||
return builder;
|
||||
}).pagination(filter.page - 1, filter.page_size);
|
||||
|
||||
|
||||
@@ -262,6 +262,9 @@ export default class SaleInvoicesController {
|
||||
const storedSaleInvoice = await SaleInvoiceService.createSaleInvoice(
|
||||
saleInvoice
|
||||
);
|
||||
|
||||
// InventoryService.trackingInventoryLotsCost();
|
||||
|
||||
return res.status(200).send({ id: storedSaleInvoice.id });
|
||||
}
|
||||
|
||||
|
||||
@@ -313,6 +313,8 @@ export default class SalesReceiptsController {
|
||||
errorReasons.push(...errors);
|
||||
}
|
||||
const salesReceipts = await SaleReceipt.query().onBuild((builder) => {
|
||||
builder.withGraphFetched('customer');
|
||||
builder.withGraphFetched('depositAccount');
|
||||
builder.withGraphFetched('entries');
|
||||
dynamicListing.buildQuery()(builder);
|
||||
}).pagination(filter.page - 1, filter.page_size);
|
||||
|
||||
Reference in New Issue
Block a user