Improved layout in the new tax info display. Also old ones.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 6 Nov 2009 11:01:43 +0000 (11:01 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 6 Nov 2009 11:01:43 +0000 (11:01 +0000)
CHANGELOG.txt
sales/customer_credit_invoice.php
sales/customer_delivery.php
sales/customer_invoice.php
sales/includes/ui/sales_credit_ui.inc
sales/includes/ui/sales_order_ui.inc

index af386e3606ab9465e1254e9133b80612f25b1171..9272435482d92c7d13b5d6206db4e604d601589e 100644 (file)
@@ -19,6 +19,14 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+06-Nov-2009 Joe Hunt
+! Improved layout in the new tax info display. Also old ones.
+$ /sales/credit_invoice.php
+  /sales/customer_delivery.php
+  /sales/customer_invoice.php
+  /sales/includes/ui/sales_credit_ui.inc
+  /sales/includes/ui/sales_order_ui.inc
+
 05-Nov-2009 Joe Hunt
 ! Display tax info in Sales Quotation, Order, Direct Delivery and Invoice.
 $ /sales/includes/ui/sales_order_ui.inc
index 77ef73366f72c89d39837f31628559227571af3d..5d6a3dbd820f47015ab3c0b2dbd2bb50105a9ecc 100644 (file)
@@ -321,24 +321,24 @@ function display_credit_items()
     if (!check_num('ChargeFreightCost')) {
        $_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost);
     }
-
+       $colspan = 7;
        start_row();
-       label_cell(_("Credit Shipping Cost"), "colspan=7 align=right");
-       amount_cells_ex(null, "ChargeFreightCost", 6, 8, $_POST['ChargeFreightCost']);
+       label_cell(_("Credit Shipping Cost"), "colspan=$colspan align=right");
+       small_amount_cells(null, "ChargeFreightCost", price_format(get_post('ChargeFreightCost',0)));
        end_row();
 
     $inv_items_total = $_SESSION['Items']->get_items_total_dispatch();
 
     $display_sub_total = price_format($inv_items_total + input_num($_POST['ChargeFreightCost']));
-    label_row(_("Sub-total"), $display_sub_total, "colspan=7 align=right", "align=right");
+    label_row(_("Sub-total"), $display_sub_total, "colspan=$colspan align=right", "align=right");
 
     $taxes = $_SESSION['Items']->get_taxes(input_num($_POST['ChargeFreightCost']));
 
-    $tax_total = display_edit_tax_items($taxes, 7, $_SESSION['Items']->tax_included);
+    $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included);
 
     $display_total = price_format(($inv_items_total + input_num('ChargeFreightCost') + $tax_total));
 
-    label_row(_("Credit Note Total"), $display_total, "colspan=7 align=right", "align=right");
+    label_row(_("Credit Note Total"), $display_total, "colspan=$colspan align=right", "align=right");
 
     end_table();
        div_end();
index f41b058d6233865cf00134e16ae2598701543a74..74595a99d34322c52d980c2d9d5b080e78718df7 100644 (file)
@@ -448,22 +448,25 @@ foreach ($_SESSION['Items']->line_items as $line=>$ln_itm) {
 $_POST['ChargeFreightCost'] =  get_post('ChargeFreightCost', 
        price_format($_SESSION['Items']->freight_cost));
 
-start_row();
+$colspan = 9;
 
-small_amount_cells(_("Shipping Cost"), 'ChargeFreightCost', $_SESSION['Items']->freight_cost, "colspan=9 align=right");
+start_row();
+label_cell(_("Shipping Cost"), "colspan=$colspan align=right");
+small_amount_cells(null, 'ChargeFreightCost', $_SESSION['Items']->freight_cost);
+end_row();
 
 $inv_items_total = $_SESSION['Items']->get_items_total_dispatch();
 
 $display_sub_total = price_format($inv_items_total + input_num('ChargeFreightCost'));
 
-label_row(_("Sub-total"), $display_sub_total, "colspan=9 align=right","align=right");
+label_row(_("Sub-total"), $display_sub_total, "colspan=$colspan align=right","align=right");
 
 $taxes = $_SESSION['Items']->get_taxes(input_num('ChargeFreightCost'));
-$tax_total = display_edit_tax_items($taxes, 9, $_SESSION['Items']->tax_included);
+$tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included);
 
 $display_total = price_format(($inv_items_total + input_num('ChargeFreightCost') + $tax_total));
 
-label_row(_("Amount Total"), $display_total, "colspan=9 align=right","align=right");
+label_row(_("Amount Total"), $display_total, "colspan=$colspan align=right","align=right");
 
 end_table(1);
 
index d9196b37e9d897fb5d66d02ee5ccdd243dfa4d54..10e9d7d77c0c893afbc647054a7f2aae8293c19d 100644 (file)
@@ -488,9 +488,10 @@ $accumulate_shipping = get_company_pref('accumulate_shipping');
 if ($is_batch_invoice && $accumulate_shipping)
        set_delivery_shipping_sum(array_keys($_SESSION['Items']->src_docs));
 
+$colspan = 9;
 start_row();
-
-small_amount_cells(_("Shipping Cost"), 'ChargeFreightCost', null, "colspan=9 align=right");
+label_cell(_("Shipping Cost"), "colspan=$colspan align=right");
+small_amount_cells(null, 'ChargeFreightCost', null);
 if ($is_batch_invoice) {
 label_cell('', 'colspan=2');
 }
@@ -500,14 +501,14 @@ $inv_items_total = $_SESSION['Items']->get_items_total_dispatch();
 
 $display_sub_total = price_format($inv_items_total + input_num('ChargeFreightCost'));
 
-label_row(_("Sub-total"), $display_sub_total, "colspan=9 align=right","align=right", $is_batch_invoice ? 2 : 0);
+label_row(_("Sub-total"), $display_sub_total, "colspan=$colspan align=right","align=right", $is_batch_invoice ? 2 : 0);
 
 $taxes = $_SESSION['Items']->get_taxes(input_num('ChargeFreightCost'));
-$tax_total = display_edit_tax_items($taxes, 9, $_SESSION['Items']->tax_included, $is_batch_invoice ? 2:0);
+$tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included, $is_batch_invoice ? 2:0);
 
 $display_total = price_format(($inv_items_total + input_num('ChargeFreightCost') + $tax_total));
 
-label_row(_("Invoice Total"), $display_total, "colspan=9 align=right","align=right", $is_batch_invoice ? 2 : 0);
+label_row(_("Invoice Total"), $display_total, "colspan=$colspan align=right","align=right", $is_batch_invoice ? 2 : 0);
 
 end_table(1);
 div_end();
index 73a5894f0da52d6713af96b1ac4b1418d887c7e4..6f281c6ff50711fc24434c8d9f0d7ac4fc69b1e6 100644 (file)
@@ -212,22 +212,25 @@ function display_credit_items($title, &$order)
     if ($id==-1)
         credit_edit_item_controls($order, $k);
 
+       $colspan = 6;
     $display_sub_total = price_format($subtotal);
-    label_row(_("Sub-total"), $display_sub_total, "colspan=6 align=right", "align=right", 2);
+    label_row(_("Sub-total"), $display_sub_total, "colspan=$colspan align=right", "align=right", 2);
 
     if (!isset($_POST['ChargeFreightCost']) OR ($_POST['ChargeFreightCost'] == ""))
-       $_POST['ChargeFreightCost'] = price_format(0);
-
-    amount_cells_ex(_("Shipping"), 'ChargeFreightCost', 8, 8, $_POST['ChargeFreightCost'], "colspan=6 align=right");
+               $_POST['ChargeFreightCost'] = 0;
+       start_row();
+       label_cell(_("Shipping"), "colspan=$colspan align=right");
+       small_amount_cells(null, 'ChargeFreightCost', price_format(get_post('ChargeFreightCost',0)));
     label_cell('', 'colspan=2');
+       end_row();
 
     $taxes = $order->get_taxes($_POST['ChargeFreightCost']);
 
-    $tax_total = display_edit_tax_items($taxes, 6, $order->tax_included);
+    $tax_total = display_edit_tax_items($taxes, $colspan, $order->tax_included, 2);
 
     $display_total = price_format(($subtotal + $_POST['ChargeFreightCost'] + $tax_total));
 
-    label_row(_("Credit Note Total"), $display_total, "colspan=6 align=right","class='amount'", 2);
+    label_row(_("Credit Note Total"), $display_total, "colspan=$colspan align=right","class='amount'", 2);
 
     end_table();
     div_end();
index acf06310dcf5edb66db962180aa5b69f6b4556bf..028ca8b76c4cfcbbe0b08d9c0628c59cca6a7da8 100644 (file)
@@ -220,13 +220,17 @@ function display_order_summary($title, &$order, $editable_items=false)
        $colspan = 6;
        if ($order->trans_no!=0)
                ++$colspan;
-       small_amount_row(_("Shipping Charge"), 'freight_cost', price_format(get_post('freight_cost',0)), "colspan=$colspan align=right");
+       start_row();
+       label_cell(_("Shipping Charge"), "colspan=$colspan align=right");
+       small_amount_cells(null, 'freight_cost', price_format(get_post('freight_cost',0)));
+       label_cell('', 'colspan=2');
+       end_row();
        $display_sub_total = price_format($total + input_num('freight_cost'));
 
-       label_row(_("Sub-total"), $display_sub_total, "colspan=$colspan align=right","align=right");
+       label_row(_("Sub-total"), $display_sub_total, "colspan=$colspan align=right","align=right", 2);
 
        $taxes = $order->get_taxes(input_num('freight_cost'));
-       $tax_total = display_edit_tax_items($taxes, $colspan, $order->tax_included);
+       $tax_total = display_edit_tax_items($taxes, $colspan, $order->tax_included, 2);
 
        $display_total = price_format(($total + input_num('freight_cost') + $tax_total));