WIP: Allocate landed cost.

This commit is contained in:
a.bouhuolia
2021-07-22 18:11:17 +02:00
parent 1eacc254d8
commit 76c6cb3699
33 changed files with 1577 additions and 163 deletions

View File

@@ -9,6 +9,21 @@ export default class ExpenseCategory extends TenantModel {
return 'expense_transaction_categories';
}
/**
* Virtual attributes.
*/
static get virtualAttributes() {
return ['unallocatedLandedCost'];
}
/**
* Remain unallocated landed cost.
* @return {number}
*/
get unallocatedLandedCost() {
return Math.max(this.amount - this.allocatedCostAmount, 0);
}
/**
* Relationship mapping.
*/