- {
- 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));
- 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);
+ {
+ if ($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));
+ label_cell($alloc_item->ref);
+ 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, false,'', 'maxval'.$counter);
+ 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);
+ }