From: Janusz Dobrowolski Date: Mon, 14 Jun 2010 13:25:07 +0000 (+0000) Subject: Fixed credit note list display. X-Git-Tag: v2.4.2~19^2~852 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=2fc77410bad647c6888a6f82ca4efaef41d9d95b;p=fa-stable.git Fixed credit note list display. --- 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 "";