X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_invoice.php;h=e6ded2d3a4e025315f2adc6241c7c53145d0cf6d;hb=0cbe5791fbc7f09ab9dda6b92d1ae27e61d26953;hp=e4ab5158322f95ef6fffea1a7f20fdf724a76317;hpb=f11b39846d81bd043490ba9596224b859e47467c;p=fa-stable.git diff --git a/sales/customer_invoice.php b/sales/customer_invoice.php index e4ab5158..e6ded2d3 100644 --- a/sales/customer_invoice.php +++ b/sales/customer_invoice.php @@ -204,7 +204,8 @@ function check_quantities() $max = $itm->quantity; } else { $min = 0; - $max = $itm->quantity - $itm->qty_done; + // Fixing floating point problem in PHP. + $max = round2($itm->quantity - $itm->qty_done, get_qty_dec($itm->stock_id)); } if (check_num('Line'.$line_no, $min, $max)) { $_SESSION['Items']->line_items[$line_no]->qty_dispatched = @@ -649,10 +650,10 @@ if ($prepaid) $allocs += $pmt['amt']; } } - label_row(_("Payments received:"), implode(',', $list)); label_row(_("Invoiced here:"), price_format($_SESSION['Items']->prep_amount), 'class=label'); - label_row(_("Left to be invoiced:"), price_format($_SESSION['Items']->get_trans_total()-max($_SESSION['Items']->prep_amount, $allocs)), 'class=label'); + label_row($_SESSION['Items']->payment_terms['days_before_due'] == -1 ? _("Left to be invoiced:") : _("Invoiced so far:"), + price_format($_SESSION['Items']->get_trans_total()-max($_SESSION['Items']->prep_amount, $allocs)), 'class=label'); } textarea_row(_("Memo:"), 'Comments', null, 50, 4);