"; // outer table
@@ -225,15 +250,14 @@ function display_credit_items()
start_row();
// if (!isset($_POST['ref']))
-// $_POST['ref'] = references::get_next(11);
+// $_POST['ref'] = $Refs->get_next(11);
if ($_SESSION['Items']->trans_no==0) {
- ref_cells(_("Reference"), 'ref', '', $_SESSION['Items']->reference, "class='tableheader2'");
+ ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");
} else {
label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}
-// label_cells(_("Crediting Invoice"), get_customer_trans_view_str(10, $_SESSION['InvoiceToCredit']), "class='tableheader2'");
- label_cells(_("Crediting Invoice"), get_customer_trans_view_str(10, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'");
+ label_cells(_("Crediting Invoice"), get_customer_trans_view_str(ST_SALESINVOICE, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'");
if (!isset($_POST['ShipperID'])) {
$_POST['ShipperID'] = $_SESSION['Items']->ship_via;
@@ -254,7 +278,7 @@ function display_credit_items()
label_row(_("Invoice Date"), $_SESSION['Items']->src_date, "class='tableheader2'");
- date_row(_("Credit Note Date"), 'CreditDate', '', null, 0, 0, 0, "class='tableheader2'");
+ date_row(_("Credit Note Date"), 'CreditDate', '', $_SESSION['Items']->trans_no==0, 0, 0, 0, "class='tableheader2'");
end_table();
@@ -262,6 +286,7 @@ function display_credit_items()
end_table(1); // outer table
+ div_start('credit_items');
start_table("$table_style width=80%");
$th = array(_("Item Code"), _("Item Description"), _("Invoiced Quantity"), _("Units"),
_("Credit Quantity"), _("Price"), _("Discount %"), _("Total"));
@@ -270,8 +295,8 @@ function display_credit_items()
$k = 0; //row colour counter
foreach ($_SESSION['Items']->line_items as $line_no=>$ln_itm) {
- if ($ln_itm->quantity==$ln_itm->qty_done) {
- continue; // this line was fully credited
+ if ($ln_itm->quantity == $ln_itm->qty_done) {
+ continue; // this line was fully credited/removed
}
alt_table_row_color($k);
@@ -279,13 +304,12 @@ function display_credit_items()
// view_stock_status_cell($ln_itm->stock_id); alternative view
label_cell($ln_itm->stock_id);
- text_cells(null, 'Line'.$line_no.'Desc', $ln_itm->item_description, 30, 50);
-
- qty_cell($ln_itm->quantity, false, get_qty_dec($ln_itm->stock_id));
+ text_cells(null, 'Line'.$line_no.'Desc', $ln_itm->item_description, 30, 50);
+ $dec = get_qty_dec($ln_itm->stock_id);
+ qty_cell($ln_itm->quantity, false, $dec);
label_cell($ln_itm->units);
-
- amount_cells(null, 'Line'.$line_no, qty_format($ln_itm->qty_dispatched, $ln_itm->stock_id));
-
+ amount_cells(null, 'Line'.$line_no, number_format2($ln_itm->qty_dispatched, $dec),
+ null, null, $dec);
$line_total =($ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent));
amount_cell($ln_itm->price);
@@ -300,7 +324,7 @@ function display_credit_items()
start_row();
label_cell(_("Credit Shipping Cost"), "colspan=7 align=right");
- amount_cells(null, "ChargeFreightCost", $_POST['ChargeFreightCost'], 6, 6);
+ amount_cells_ex(null, "ChargeFreightCost", 6, 8, $_POST['ChargeFreightCost']);
end_row();
$inv_items_total = $_SESSION['Items']->get_items_total_dispatch();
@@ -317,53 +341,56 @@ function display_credit_items()
label_row(_("Credit Note Total"), $display_total, "colspan=7 align=right", "align=right");
end_table();
+ div_end();
}
//-----------------------------------------------------------------------------
-
function display_credit_options()
{
- global $table_style2;
-
- echo " ";
- start_table($table_style2);
-
- echo " |