mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
fix: partially paid invoice transaction.
This commit is contained in:
@@ -5,13 +5,6 @@ import { defaultToTransform } from 'utils';
|
|||||||
import { QueryBuilder } from 'knex';
|
import { QueryBuilder } from 'knex';
|
||||||
|
|
||||||
export default class SaleInvoice extends TenantModel {
|
export default class SaleInvoice extends TenantModel {
|
||||||
/**
|
|
||||||
* Virtual attributes.
|
|
||||||
*/
|
|
||||||
static get virtualAttributes() {
|
|
||||||
return ['dueAmount'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table name
|
* Table name
|
||||||
*/
|
*/
|
||||||
@@ -60,10 +53,10 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the invoice due amount.
|
* Retrieve the invoice due amount.
|
||||||
* (Invoice amount - payment amount = Due amount)
|
* Equation (Invoice amount - payment amount = Due amount)
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
dueAmount() {
|
get dueAmount() {
|
||||||
return Math.max(this.balance - this.paymentAmount, 0);
|
return Math.max(this.balance - this.paymentAmount, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user