Dont save payments with a zero alloc amount, delete payments with a zero alloc amount, fix javascript calculating payment balance

This commit is contained in:
Deon George
2022-10-18 10:23:11 +11:00
parent 6aa30f537b
commit 0b4e3a9341
3 changed files with 10 additions and 3 deletions

View File

@@ -12,6 +12,8 @@ A new invoice has been generated on your account. A summary of that invoice is b
||| Sub Total | ${{ number_format($invoice->sub_total,2) }} |
||| Tax | ${{ number_format($invoice->tax_total,2) }} |
||| Total | ${{ number_format($invoice->total,2) }} |
||| Payments | ${{ number_format($invoice->paid,2) }} |
||| Still Due | ${{ number_format($invoice->due,2) }} |
@endcomponent
If you would like a PDF copy of that invoice, please click on the link below:

View File

@@ -219,7 +219,7 @@
var alloc = 0;
$('.invoice').each(function() {
alloc += $(this).val();
alloc += parseFloat($(this).val());
})
$('#balance').val(($('#total_amt').val()-alloc).toFixed(2))