+ $doc_ids = array();
+ foreach ($cart->allocs as $id => $alloc_item)
+ {
+ $doc_ids[] = $id;
+ $early_discount = $alloc_item->early_discount != 0 && !date1_greater_date2($cart->date_, add_days($alloc_item->date_, $alloc_item->early_days));
+ 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);
+ if ($early_discount) {
+ $discount = price_format($alloc_item->early_discount*abs($alloc_item->amount));
+
+ if ($reallocation)
+ label_cell($discount, 'align=center');
+ else
+ check_cells(null, 'early_disc'.$id, $discount, false, false, 'align=center');
+ $total_discount += $discount;
+ } else {
+ label_cell(_("N/A"), 'align=center'); hidden('early_disc'.$id, 0);
+ }
+ amount_cells(null, "amount" . $id);
+ if (0) {
+ label_cells('', '', '', 'colspan=2');
+ } else {
+ 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();