mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
fix: display adjustment in minues
This commit is contained in:
@@ -136,7 +136,7 @@ export default class Bill extends mixin(TenantModel, [
|
||||
|
||||
return R.compose(
|
||||
R.add(adjustmentAmount),
|
||||
R.subtract(this.discountAmount),
|
||||
R.subtract(R.__, this.discountAmount),
|
||||
R.when(R.always(this.isInclusiveTax), R.add(this.taxAmountWithheld))
|
||||
)(this.subtotal);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@ export default class SaleReceipt extends mixin(TenantModel, [
|
||||
'total',
|
||||
'totalLocal',
|
||||
|
||||
'adjustment',
|
||||
'adjustmentLocal',
|
||||
|
||||
'discountAmount',
|
||||
'discountPercentage',
|
||||
|
||||
@@ -119,6 +122,14 @@ export default class SaleReceipt extends mixin(TenantModel, [
|
||||
return this.total * this.exchangeRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjustment amount in local currency.
|
||||
* @returns {number}
|
||||
*/
|
||||
get adjustmentLocal() {
|
||||
return this.adjustment * this.exchangeRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detarmine whether the sale receipt closed.
|
||||
* @return {boolean}
|
||||
|
||||
@@ -20,6 +20,7 @@ export class VendorCreditTransformer extends Transformer {
|
||||
'discountAmountFormatted',
|
||||
'discountPercentageFormatted',
|
||||
'adjustmentFormatted',
|
||||
'totalFormatted',
|
||||
'entries',
|
||||
'attachments',
|
||||
];
|
||||
@@ -118,6 +119,15 @@ export class VendorCreditTransformer extends Transformer {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the formatted total.
|
||||
* @param {IVendorCredit} credit
|
||||
* @returns {string}
|
||||
*/
|
||||
protected totalFormatted = (credit) => {
|
||||
return formatNumber(credit.total, { currencyCode: credit.currencyCode });
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the entries of the bill.
|
||||
* @param {IVendorCredit} vendorCredit
|
||||
|
||||
Reference in New Issue
Block a user