WIP: Allocate landed cost.

This commit is contained in:
a.bouhuolia
2021-07-23 01:32:10 +02:00
parent 76c6cb3699
commit 70aea9bf2d
5 changed files with 91 additions and 54 deletions

View File

@@ -19,10 +19,19 @@ export default class BillLandedCost extends TenantModel {
/**
* Relationship mapping.
*/
static get relationMappings() {
static get relationMappings() {
const BillLandedCostEntry = require('models/BillLandedCostEntry');
const Bill = require('models/Bill');
return {
bill: {
relation: Model.BelongsToOneRelation,
modelClass: Bill.default,
join: {
from: 'bill_located_costs.billId',
to: 'bills.id',
},
},
allocateEntries: {
relation: Model.HasManyRelation,
modelClass: BillLandedCostEntry.default,