- foreach ($_SESSION['alloc']->allocs as $alloc_item)
- {
- alt_table_row_color($k);
- label_cell(systypes::name($alloc_item->type));
- label_cell(get_trans_view_str($alloc_item->type, $alloc_item->type_no));
- label_cell($alloc_item->date_, "align=right");
- label_cell($alloc_item->due_date, "align=right");
- amount_cell($alloc_item->amount);
- amount_cell($alloc_item->amount_allocated);
-
- $_POST['amount' . $counter] = price_format($alloc_item->current_allocated);
- amount_cells(null, "amount" . $counter, price_format('amount' . $counter));
-
- $un_allocated = round($alloc_item->amount - $alloc_item->amount_allocated, 6);
- amount_cell($un_allocated);
- label_cell("<a href='#' name=Alloc$counter onclick='allocate_all(this.name.substr(5));return true;'>"
- . _("All") . "</a>");
- label_cell("<a href='#' name=DeAll$counter onclick='allocate_none(this.name.substr(5));return true;'>"
- . _("None") . "</a>".hidden("un_allocated" . $counter,
- price_format($un_allocated), false));
- end_row();
-
- $total_allocated += input_num('amount' . $counter);
- $counter++;
- }
+ foreach ($cart->allocs as $id => $alloc_item)
+ {
+ if (floatcmp(abs($alloc_item->amount), $alloc_item->amount_allocated))
+ {
+ alt_table_row_color($k);
+ label_cell($systypes_array[$alloc_item->type]);
+ label_cell(get_trans_view_str($alloc_item->type, $alloc_item->type_no), "nowrap align='right'");
+ label_cell($alloc_item->ref);
+ label_cell($alloc_item->date_, "align=right");
+ label_cell($alloc_item->due_date, "align=right");
+ amount_cell(abs($alloc_item->amount));
+ amount_cell($alloc_item->amount_allocated);
+
+ $_POST['amount' . $id] = price_format($alloc_item->current_allocated);
+
+ $un_allocated = round((abs($alloc_item->amount) - $alloc_item->amount_allocated), 6);
+ amount_cell($un_allocated, false,'', 'maxval'.$id);
+ amount_cells(null, "amount" . $id);//, input_num('amount' . $id));
+ label_cell("<a href='#' name=Alloc$id onclick='allocate_all(this.name.substr(5));return true;'>"
+ . _("All") . "</a>");
+ label_cell("<a href='#' name=DeAll$id onclick='allocate_none(this.name.substr(5));return true;'>"
+ . _("None") . "</a>".hidden("un_allocated" . $id,
+ price_format($un_allocated), false));
+ end_row();
+
+ $total_allocated += input_num('amount' . $id);
+ }
+ }