Fixes in sales reports to use debtor_trans.tax_included field instead of trans_tax_de...
[fa-stable.git] / sales / view / view_sales_order.php
index a9e780e22e2331f70bba43a7010ef45578418073..712c5470981912b20319bbf9d06120b90a07db7c 100644 (file)
@@ -42,16 +42,17 @@ if (isset($_SESSION['View']))
 $_SESSION['View'] = new Cart($_GET['trans_type'], $_GET['trans_no'], true);
 
 start_table(TABLESTYLE2, "width=95%", 5);
-echo "<tr valign=top><td>";
-display_heading2(_("Order Information"));
+
 if ($_GET['trans_type'] != ST_SALESQUOTE)
 {
+       echo "<tr valign=top><td>";
+       display_heading2(_("Order Information"));
        echo "</td><td>";
        display_heading2(_("Deliveries"));
        echo "</td><td>";
        display_heading2(_("Invoices/Credits"));
+       echo "</td></tr>";
 }      
-echo "</td></tr>";
 
 echo "<tr valign=top><td>";
 
@@ -74,6 +75,7 @@ label_cells(_("Order Currency"), $_SESSION['View']->customer_currency, "class='t
 label_cells(_("Deliver From Location"), $_SESSION['View']->location_name, "class='tableheader2'");
 end_row();
 
+label_row(_("Payment Terms"), $_SESSION['View']->payment_terms['terms'], "class='tableheader2'", "colspan=3");
 label_row(_("Delivery Address"), nl2br($_SESSION['View']->delivery_address),
        "class='tableheader2'", "colspan=3");
 label_row(_("Reference"), $_SESSION['View']->reference, "class='tableheader2'", "colspan=3");
@@ -222,15 +224,26 @@ foreach ($_SESSION['View']->line_items as $stock_item) {
        end_row();
 }
 
-$items_total = $_SESSION['View']->get_items_total();
-
-$display_total = price_format($items_total + $_SESSION['View']->freight_cost);
-
 label_row(_("Shipping"), price_format($_SESSION['View']->freight_cost),
        "align=right colspan=6", "nowrap align=right", 1);
-label_row(_("Total Order Value"), $display_total, "align=right colspan=6",
+
+$sub_tot = $_SESSION['View']->get_items_total() + $_SESSION['View']->freight_cost;
+
+$display_sub_tot = price_format($sub_tot);
+
+label_row(_("Sub Total"), $display_sub_tot, "align=right colspan=6",
        "nowrap align=right", 1);
 
+$taxes = $_SESSION['View']->get_taxes();
+
+$tax_total = display_edit_tax_items($taxes, 6, $_SESSION['View']->tax_included,2);
+
+$display_total = price_format($sub_tot + $tax_total);
+
+start_row();
+label_cells(_("Amount Total"), $display_total, "colspan=6 align='right'","align='right'");
+label_cell('', "colspan=2");
+end_row();
 end_table(2);
 
 end_page(true, false, false, $_GET['trans_type'], $_GET['trans_no']);