mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #108 from whitebook/master
fixed invoice payment calculations
This commit is contained in:
commit
a4a66cba63
@ -1133,7 +1133,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.totals.rawPaidToDate = ko.computed(function() {
|
this.totals.rawPaidToDate = ko.computed(function() {
|
||||||
return self.amount() - self.balance();
|
return accounting.toFixed(self.amount(),2) - accounting.toFixed(self.balance(),2);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.totals.paidToDate = ko.computed(function() {
|
this.totals.paidToDate = ko.computed(function() {
|
||||||
@ -1142,7 +1142,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.totals.total = ko.computed(function() {
|
this.totals.total = ko.computed(function() {
|
||||||
var total = self.totals.rawSubtotal();
|
var total = accounting.toFixed(self.totals.rawSubtotal(),2);
|
||||||
|
|
||||||
var discount = parseFloat(self.discount());
|
var discount = parseFloat(self.discount());
|
||||||
if (discount > 0) {
|
if (discount > 0) {
|
||||||
@ -1517,4 +1517,4 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
@ -36967,7 +36967,7 @@ function calculateAmounts(invoice) {
|
|||||||
total = parseFloat(total) + parseFloat(tax);
|
total = parseFloat(total) + parseFloat(tax);
|
||||||
}
|
}
|
||||||
|
|
||||||
invoice.balance_amount = total - (invoice.amount - invoice.balance);
|
invoice.balance_amount = total.toFixed(4) - (accounting.toFixed(invoice.amount, 2) - accounting.toFixed(invoice.balance, 2));
|
||||||
invoice.tax_amount = tax;
|
invoice.tax_amount = tax;
|
||||||
invoice.discount_amount = discount;
|
invoice.discount_amount = discount;
|
||||||
invoice.has_taxes = hasTaxes;
|
invoice.has_taxes = hasTaxes;
|
||||||
|
@ -1500,7 +1500,7 @@ function calculateAmounts(invoice) {
|
|||||||
total = parseFloat(total) + parseFloat(tax);
|
total = parseFloat(total) + parseFloat(tax);
|
||||||
}
|
}
|
||||||
|
|
||||||
invoice.balance_amount = total - (invoice.amount - invoice.balance);
|
invoice.balance_amount = total.toFixed(4) - (accounting.toFixed(invoice.amount, 2) - accounting.toFixed(invoice.balance, 2));
|
||||||
invoice.tax_amount = tax;
|
invoice.tax_amount = tax;
|
||||||
invoice.discount_amount = discount;
|
invoice.discount_amount = discount;
|
||||||
invoice.has_taxes = hasTaxes;
|
invoice.has_taxes = hasTaxes;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user