mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
WIP: Allocate landed cost.
This commit is contained in:
@@ -39,14 +39,18 @@ export default class Expense extends TenantModel {
|
||||
}
|
||||
|
||||
static get virtualAttributes() {
|
||||
return ['isPublished', 'unallocatedLandedCost'];
|
||||
return ['isPublished', 'unallocatedCostAmount'];
|
||||
}
|
||||
|
||||
isPublished() {
|
||||
return Boolean(this.publishedAt);
|
||||
}
|
||||
|
||||
unallocatedLandedCost() {
|
||||
/**
|
||||
* Retrieve the unallocated cost amount.
|
||||
* @return {number}
|
||||
*/
|
||||
get unallocatedCostAmount() {
|
||||
return Math.max(this.amount - this.allocatedCostAmount, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user