feat: integrate multiple branches and warehouses with import

This commit is contained in:
Ahmed Bouhuolia
2024-09-02 14:42:05 +02:00
parent 266902026e
commit bfb3909d26
41 changed files with 392 additions and 11 deletions

View File

@@ -408,6 +408,7 @@ export default class SaleInvoice extends mixin(TenantModel, [
const InventoryCostLotTracker = require('models/InventoryCostLotTracker');
const PaymentReceiveEntry = require('models/PaymentReceiveEntry');
const Branch = require('models/Branch');
const Warehouse = require('models/Warehouse');
const Account = require('models/Account');
const TaxRateTransaction = require('models/TaxRateTransaction');
const Document = require('models/Document');
@@ -499,6 +500,18 @@ export default class SaleInvoice extends mixin(TenantModel, [
},
},
/**
* Invoice may has associated warehouse.
*/
warehouse: {
relation: Model.BelongsToOneRelation,
modelClass: Warehouse.default,
join: {
from: 'sales_invoices.warehouseId',
to: 'warehouses.id',
}
},
/**
* Invoice may has associated written-off expense account.
*/