mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: discount and adjustment fields across financial forms
This commit is contained in:
@@ -23,6 +23,14 @@ export default class SaleEstimate extends mixin(TenantModel, [
|
||||
|
||||
public adjustment: number;
|
||||
|
||||
public expirationDate!: string;
|
||||
public deliveredAt!: string | null;
|
||||
public approvedAt!: string | null;
|
||||
public rejectedAt!: string | null;
|
||||
|
||||
public convertedToInvoiceId!: number | null;
|
||||
public convertedToInvoiceAt!: string | null;
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*/
|
||||
@@ -45,6 +53,10 @@ export default class SaleEstimate extends mixin(TenantModel, [
|
||||
'localAmount',
|
||||
'discountAmount',
|
||||
'discountPercentage',
|
||||
'total',
|
||||
'totalLocal',
|
||||
'subtotal',
|
||||
'subtotalLocal',
|
||||
'isDelivered',
|
||||
'isExpired',
|
||||
'isConvertedToInvoice',
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class SaleInvoice extends mixin(TenantModel, [
|
||||
public deliveredAt: Date;
|
||||
public discount: number;
|
||||
public discountType: DiscountType;
|
||||
public adjustments: number;
|
||||
public adjustment: number | null;
|
||||
|
||||
/**
|
||||
* Table name
|
||||
@@ -157,7 +157,7 @@ export default class SaleInvoice extends mixin(TenantModel, [
|
||||
* @returns {number}
|
||||
*/
|
||||
get total() {
|
||||
const adjustmentAmount = defaultTo(this.adjustments, 0);
|
||||
const adjustmentAmount = defaultTo(this.adjustment, 0);
|
||||
const differencies = this.discountAmount + adjustmentAmount;
|
||||
|
||||
return this.isInclusiveTax
|
||||
|
||||
Reference in New Issue
Block a user