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