From 2fc77410bad647c6888a6f82ca4efaef41d9d95b Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 14 Jun 2010 13:25:07 +0000 Subject: [PATCH] Fixed credit note list display. --- sales/view/view_sales_order.php | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sales/view/view_sales_order.php b/sales/view/view_sales_order.php index 6f70b417..f9d0629c 100644 --- a/sales/view/view_sales_order.php +++ b/sales/view/view_sales_order.php @@ -162,32 +162,32 @@ if ($_GET['trans_type'] != ST_SALESQUOTE) start_table(TABLESTYLE); $th = array(_("#"), _("Ref"), _("Date"), _("Total")); table_header($th); + if(count($inv_numbers)) { + $result = get_related_credits($inv_numbers); - $result = get_related_credits($inv_numbers); + $credits_total = 0; + $k = 0; - $credits_total = 0; - $k = 0; + while ($credits_row = db_fetch($result)) + { - while ($credits_row = db_fetch($result)) - { + alt_table_row_color($k); - alt_table_row_color($k); + $this_total = $credits_row["ov_freight"] + $credits_row["ov_freight_tax"] + $credits_row["ov_gst"] + $credits_row["ov_amount"]; + $credits_total += $this_total; - $this_total = $credits_row["ov_freight"] + $credits_row["ov_freight_tax"] + $credits_row["ov_gst"] + $credits_row["ov_amount"]; - $credits_total += $this_total; + label_cell(get_customer_trans_view_str($credits_row["type"], $credits_row["trans_no"])); + label_cell($credits_row["reference"]); + label_cell(sql2date($credits_row["tran_date"])); + amount_cell(-$this_total); + end_row(); - label_cell(get_customer_trans_view_str($credits_row["type"], $credits_row["trans_no"])); - label_cell($credits_row["reference"]); - label_cell(sql2date($credits_row["tran_date"])); - amount_cell(-$this_total); - end_row(); + } + label_row(null, "" . price_format(-$credits_total) . "", + " ", "colspan=4 align=right"); } - label_row(null, "" . price_format(-$credits_total) . "", - " ", "colspan=4 align=right"); - - end_table(); echo ""; -- 2.30.2