Better layout. Copyright notes. Mailto links, outer table routines. (3. run)
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 7 Dec 2008 16:58:13 +0000 (16:58 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 7 Dec 2008 16:58:13 +0000 (16:58 +0000)
16 files changed:
CHANGELOG.txt
gl/includes/ui/gl_bank_ui.inc
gl/includes/ui/gl_journal_ui.inc
includes/ui/ui_controls.inc
inventory/adjustments.php
inventory/includes/item_adjustments_ui.inc
inventory/includes/stock_transfers_ui.inc
inventory/transfers.php
purchasing/includes/ui/invoice_ui.inc
purchasing/includes/ui/po_ui.inc
purchasing/supplier_credit.php
purchasing/supplier_invoice.php
purchasing/supplier_payment.php
sales/customer_payments.php
sales/includes/ui/sales_credit_ui.inc
sales/includes/ui/sales_order_ui.inc

index b8aecd5d5d9b7dec2ec15ba09fde93de0d678410..fa29eb013738f467c7bc06a592abc7f3dbfbec3d 100644 (file)
@@ -20,18 +20,32 @@ Legend:
 $ -> Affected files
 
 07-Dec-2008 Joe Hunt
-! Better layout. Copyright notes. Mailto links.
+! Better layout. Copyright notes. Mailto links, outer table routines.
 $ /admin/company_preferences.php
   /admin/display_prefs.php
-  /gl_setup.php
+  /admin/gl_setup.php
   /admin/users.php
+  /gl/includes/ui/gl_bank_ui.inc
+  /gl/includes/ui/gl_journal_ui.inc
   /includes/ui_controls.inc
   /includes/ui_input.inc
+  /inventory/adjustments.php
+  /inventory/transfers.php
+  /inventory/includes/item_adjustments_ui.inc
+  /inventory/includes/stock_transfers_ui.inc
   /inventory/manage/locations.php
+  /purchasing/includes/ui/invoice_ui.inc
+  /purchasing/includes/ui/po_ui.inc
   /purchasing/manage/suppliers.php
+  /purchasing/supplier_credit.php
+  /purchasing/supplier_invoice.php
+  /purchasing/supplier_payment.php
+  /sales/includes/ui/sales_credit_ui.inc
+  /sales/includes/ui/sales_order_ui.inc
   /sales/manage/customer_branches.php
   /sales/manage/customers.php
   /sales/manage/sales_people.php
+  /sales/customer_payments.php
   
 05-Dec-2008 Joe Hunt
 + New fields in suppliers, phone, fax, vat no, contact and credit limit
index 1626657694b0abcba8edacb2f3a764e7a1e4e891..cf44945ea6226cdf0e12e6a7026871575e8ee84a 100644 (file)
@@ -15,20 +15,16 @@ function display_bank_header(&$order)
        $payment = $order->trans_type == systypes::bank_payment();
 
        div_start('pmt_header');
-       start_table("width=90% $table_style2"); // outer table
-       echo "<tr><td valign=top width=33%>";
 
-       echo "<table>"; // inner table
+       start_outer_table("width=90% $table_style2"); // outer table
 
+       table_section(1);
+       
     bank_accounts_list_row( $payment ? _("From:") : _("To:"), 'bank_account', null, true);
 
     date_row(_("Date:"), 'date_', '', null, 0, 0, 0, null, true);
 
-       echo "</table>"; // inner table
-
-       echo "</td><td width=33%>";
-
-       echo "<table>"; // inner table
+       table_section(2, "33%");
 
        if (!isset($_POST['PayType']))
        {
@@ -90,22 +86,15 @@ function display_bank_header(&$order)
 
        exchange_rate_display($bank_currency, $person_currency, $_POST['date_']);
 
-       echo "</table>"; // inner table
-
-       echo "</td><td>";
-
-       echo "<table>"; // inner table
+       table_section(3, "33%");
 
        if (isset($_GET['NewPayment']))
        ref_row(_("Reference:"), 'ref', '', references::get_next(systypes::bank_payment()));
     else
        ref_row(_("Reference:"), 'ref', '', references::get_next(systypes::bank_deposit()));
 
-       echo "</table>"; // inner table
-
-       echo "</td></tr>";
+       end_outer_table(1); // outer table
 
-       end_table(1); // outer table
        div_end();
 }
 //---------------------------------------------------------------------------------
index c5b5eb15a0c079169f0443bb02d19599eaea057e..0f39203bd9708157ceca236ba78b239229ccd8a4 100644 (file)
@@ -19,44 +19,33 @@ function display_order_header(&$Order)
        global $table_style2;
 
        $qes = has_quick_entries(-1, 0);
-       start_table("$table_style2 width=90%");
-       if ($qes)
-               echo "<tr><td valign=top width=30%>"; // outer table
-       else    
-               echo "<tr><td valign=top width=50%>"; // outer table
 
-       echo "<table>";
+       start_outer_table("$table_style2 width=90%");
+       table_section(1);
+
        start_row();
     date_cells(_("Date:"), 'date_');
        ref_cells(_("Reference:"), 'ref', '', references::get_next(0));
        end_row();
 
-       echo "</table>";
-
        if ($qes)
-               echo "</td><td width=20%>"; // outer table
+               table_section(2, "20%");
        else    
-               echo "</td><td width=50%>"; // outer table
+               table_section(2, "50%");
 
-       echo "<table>";
        start_row();
        check_cells(_("Reverse Transaction:"), 'Reverse', null);
        end_row();
-       echo "</table>";
        if ($qes !== false)
        {
-               echo "</td><td width=50%>"; // outer table
-               echo "<table>";
+               table_section(3, "50%");
                start_row();
                quick_entries_list_cells(_("Quick Entry:"), 'person_id', null, -1, 0);
                amount_cells(_("Total Amount"), 'totamount', null, null, "&nbsp;&nbsp;".submit('go', _("Go"), false, false, true));                     
                end_row();
-               echo "</table>";
        }
                
-
-       echo "</td></tr>"; // outer table
-       end_table(1);
+       end_outer_table(1);
 }
 
 //---------------------------------------------------------------------------------
index 6b8f02d6ebd38b464e85ee30877973505bef9634..7da7e2bcca61c61d98732a8b83c6dd3f79663186 100644 (file)
@@ -63,23 +63,29 @@ function start_outer_table($extra="", $padding='2', $spacing='0')
        echo "<tr valign=top><td>\n"; // outer table
 }
 
-function table_section($number=1)
+function table_section($number=1, $width=false)
 {
-       if ($number == 2)
+       if ($number > 1)
        {
                echo "</table>\n";
-               echo "</td><td  class='tableseparator'>\n"; // outer table
+               $width = ($width ? "width=$width" : "");
+               echo "</td><td class='tableseparator' $width>\n"; // outer table
        }
        echo "<table>\n";
 }      
 
-function end_outer_table($breaks=0)
+function end_outer_table($breaks=0, $close_table=true)
 {
-       echo "</table>\n";
+       if ($close_table)
+               echo "</table>\n";
        echo "</td></tr>\n";
        end_table($breaks);
 }
 
+function vertical_space()
+{
+       echo "</td></tr><tr><td valign=center>"; // outer table
+}
 function meta_forward($forward_to, $params="")
 {
     global $Ajax;
index 45bf4e92d5f5d47d47daeffce3f5b5c01d9b2ff2..a500eebce410064758ec3d4befdf55f73c82494b 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 $page_security = 3;
 $path_to_root="..";
 include_once($path_to_root . "/includes/ui/items_cart.inc");
@@ -212,14 +221,12 @@ start_form(false, true);
 
 display_order_header($_SESSION['adj_items']);
 
-start_table("$table_style width=70%", 10);
-start_row();
-echo "<TD>";
+start_outer_table("$table_style width=70%", 10);
+
 display_adjustment_items(_("Adjustment Items"), $_SESSION['adj_items']);
 adjustment_options_controls();
-echo "</TD>";
-end_row();
-end_table(1);
+
+end_outer_table(1, false);
 
 submit_center_first('Update', _("Update"), '', null);
 submit_center_last('Process', _("Process Adjustment"), '', true);
index b132bf3568df02f63a18a04d870472cb91076367..5740eec07d3e928a7e8d7bf15908ee98402e6fe4 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/ui/items_cart.inc");
 
@@ -19,26 +28,18 @@ function display_order_header(&$order)
 {
        global $table_style2;
 
-       start_table("width=70% $table_style2"); // outer table
-       echo "<tr><td valign=top width=33%>";
-       echo "<table>"; // inner table
+       start_outer_table("width=70% $table_style2"); // outer table
+       table_section(1);
 
        locations_list_row(_("Location:"), 'StockLocation', null);
        ref_row(_("Reference:"), 'ref', '', references::get_next(systypes::inventory_adjustment()));
 
-       echo "</table>"; // inner table
-
-       echo "</td><td width=33%>";
-
-       echo "<table>"; // inner table
+       table_section(2, "33%");
 
     date_row(_("Date:"), 'AdjDate');
 
-       echo "</table>"; // inner table
+       table_section(3, "33%");
 
-       echo "</td><td width=33%>";
-
-       echo "<table>"; // inner table
     movement_types_list_row(_("Detail:"), 'type', null);
 
     if (!isset($_POST['Increase']))
@@ -46,10 +47,7 @@ function display_order_header(&$order)
     yesno_list_row(_("Type:"), 'Increase', $_POST['Increase'],
        _("Positive Adjustment"), _("Negative Adjustment"));
 
-       echo "</table>"; // inner table
-
-       echo "</td></tr>";
-       end_table(1); // outer table
+       end_outer_table(1); // outer table
 }
 
 //---------------------------------------------------------------------------------
@@ -62,7 +60,7 @@ function display_adjustment_items($title, &$order)
     div_start('items_table');
        start_table("$table_style width=80%");
        $th = array(_("Item Code"), _("Item Description"), _("Quantity"),
-               _("Unit"), _("Unit Cost"), _("Total"));
+               _("Unit"), _("Unit Cost"), _("Total"), "");
        if ( count($order->line_items)) $th[] = '';
 
        table_header($th);
@@ -88,7 +86,7 @@ function display_adjustment_items($title, &$order)
 
                        edit_button_cell("Edit$line_no", _("Edit"),
                                _('Edit document line'));
-                       edit_button_cell("Delete$line_no", _("Delete"),
+                       delete_button_cell("Delete$line_no", _("Delete"),
                                _('Remove line from document'));
                        end_row();
                }
@@ -152,10 +150,10 @@ function adjustment_edit_item_controls(&$order, $line_no=-1)
 
        if ($id != -1)
        {
-               edit_button_cell('UpdateItem', _("Update"),
-                               _('Confirm changes'));
-               edit_button_cell('CancelItemChanges', _("Cancel"),
-                               _('Cancel changes'));
+               button_cell('UpdateItem', _("Update"),
+                               _('Confirm changes'), ICON_UPDATE);
+               button_cell('CancelItemChanges', _("Cancel"),
+                               _('Cancel changes'), ICON_CANCEL);
                hidden('LineNo', $line_no);
                set_focus('qty');
        }
index b65f5beec10281685a4117b5c979c863d6f0761e..6012afb67114ffd62edbc25d2edcd8148eeaf79b 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/ui/items_cart.inc");
 
@@ -19,33 +28,24 @@ function display_order_header(&$order)
 {
        global $table_style;
 
-       start_table("width=70% $table_style");
-       echo "<tr><td width=33% valign=top>"; // outer table
-       echo "<table>";
+       start_outer_table("width=70% $table_style");
 
+       table_section(1);
+       
        locations_list_row(_("From Location:"), 'FromStockLocation', null);
        locations_list_row(_("To Location:"), 'ToStockLocation', null);
 
-       echo "</table>";
-
-       echo "</td><td width=33%>"; // outer table
-
-       echo "<table>";
+       table_section(2, "33%");
 
        ref_row(_("Reference:"), 'ref', '', references::get_next(systypes::location_transfer()));
 
     date_row(_("Date:"), 'AdjDate');
 
-       echo "</table>";
-
-       echo "</td><td width=33%>"; // outer table
+       table_section(3, "33%");
 
-       echo "<table>";
     movement_types_list_row(_("Transfer Type:"), 'type', null);
-       echo "</table>";
 
-       echo "</td></tr>";
-       end_table(1); // outer table
+       end_outer_table(1); // outer table
 }
 
 //---------------------------------------------------------------------------------
@@ -58,6 +58,7 @@ function display_transfer_items($title, &$order)
     div_start('items_table');
        start_table("$table_style width=80%");
        $th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), '');
+       if ( count($order->line_items)) $th[] = '';
        table_header($th);
        $subtotal = 0;
        $k = 0;  //row colour counter
@@ -77,7 +78,7 @@ function display_transfer_items($title, &$order)
 
                        edit_button_cell("Edit$line_no", _("Edit"),
                                _('Edit document line'));
-                       edit_button_cell("Delete$line_no", _("Delete"),
+                       delete_button_cell("Delete$line_no", _("Delete"),
                                _('Remove line from document'));
                end_row();
                }
@@ -133,10 +134,10 @@ function transfer_edit_item_controls(&$order, $line_no=-1)
 
        if ($id != -1)
        {
-               edit_button_cell('UpdateItem', _("Update"),
-                               _('Confirm changes'));
-               edit_button_cell('CancelItemChanges', _("Cancel"),
-                               _('Cancel changes'));
+               button_cell('UpdateItem', _("Update"),
+                               _('Confirm changes'), ICON_UPDATE);
+               button_cell('CancelItemChanges', _("Cancel"),
+                               _('Cancel changes'), ICON_CANCEL);
                hidden('LineNo', $line_no);
                set_focus('qty');
        }
index 541791a873ec721a3cd06752d83ad9b3caf89f5e..5407c696c96d000ff659ca6ef6826d4cf4cbc728 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 $page_security = 3;
 $path_to_root="..";
 include_once($path_to_root . "/includes/ui/items_cart.inc");
index d72b0dcb95ec4d6697b325dab191bab0dc7a6ebf..86b2f72ce701d414aacc66071c57c68387ec479c 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 //--------------------------------------------------------------------------------------------------
 
 function copy_from_trans(&$supp_trans)
@@ -44,17 +53,15 @@ function copy_to_trans(&$supp_trans)
 
 function invoice_header(&$supp_trans)
 {
-       global $Ajax;
+       global $Ajax, $table_style;
        
        // if vars have been lost, recopy
        if (!isset($_POST['tran_date']))
                copy_from_trans($supp_trans);
 
-       start_table("width=100%", 5);
-       start_row();
-       echo"<td>"; // outer
+       start_outer_table("$table_style width=98%", 5);
 
-       echo "<table width=100%>";
+       table_section(1);
 
     if (!isset($_POST['supplier_id']) && (get_global_supplier() != reserved_words::get_all()))
        $_POST['supplier_id'] = get_global_supplier();
@@ -78,11 +85,7 @@ function invoice_header(&$supp_trans)
 
        text_row(_("Supplier's Ref.:"), 'supp_reference', $_POST['supp_reference'], 20, 20);
 
-       echo "</table>";
-
-       echo "</td><td class='tableseparator'>"; // outer
-
-       echo "<table width=100%>";
+       table_section(2, "33%");
 
        date_row(_("Date") . ":", 'tran_date', '', null, 0, 0, 0, "", true);
        if (isset($_POST['_tran_date_changed'])) {
@@ -97,11 +100,7 @@ function invoice_header(&$supp_trans)
 
     label_row(_("Terms:"), $supp_trans->terms_description);
 
-       echo "</table>";
-
-       echo "</td><td class='tableseparator'>"; // outer
-
-       echo "<table width=100%>";
+       table_section(3, "33%");
 
        $supplier_currency = get_supplier_currency($supp_trans->supplier_id);
 
@@ -113,12 +112,9 @@ function invoice_header(&$supp_trans)
                exchange_rate_display($supplier_currency, $company_currency, $_POST['tran_date']);
        }
 
-  label_row(_("Tax Group:"), $supp_trans->tax_description);
-       echo "</table>";
+       label_row(_("Tax Group:"), $supp_trans->tax_description);
 
-       echo "</td>";
-       end_row();
-       end_table(); // outer
+       end_outer_table();
 }
 
 //--------------------------------------------------------------------------------------------------
@@ -143,12 +139,10 @@ function invoice_totals(&$supp_trans)
                label_row(_("Credit Note Total"),
                        $display_total, "align=right style='font-weight:bold;color:red;'", "nowrap align=right style='font-weight:bold;color:red;'");
 
-    end_table();
-       br(1);
+    end_table(1);
     start_table($table_style2);
     textarea_row(_("Memo:"), "Comments", null, 50, 3);
-    end_table();
-    br(1);
+    end_table(1);
 }
 
 //--------------------------------------------------------------------------------------------------
@@ -193,24 +187,17 @@ function display_gl_items(&$supp_trans, $mode=0)
     if (($mode == 2 || $mode == 3) && count($supp_trans->gl_codes) == 0)
        return 0;
 
-       echo "<br>";
-
-       start_table("width=95%");
-       echo "<tr><td>"; // outertable
+       start_outer_table("width=95%");
 
        if ($supp_trans->is_invoice)
                $heading = _("GL Items for this Invoice");
        else
                $heading = _("GL Items for this Credit Note");
 
-       echo "<table width=100%>";
-       echo "<tr><td align=center><span class='headingtext'>$heading</span></td>";
-       echo "</tr></table>";
-
-       echo "</td></tr><tr><td>"; // ouer table
+       vertical_space(); // ouer table
 
        div_start('gl_items');
-       echo "<table width=100% $table_style>";
+       start_table("$table_style width=100%");
 
        $dim = get_company_pref('use_dimension');
        if ($dim == 2)
@@ -253,7 +240,7 @@ function display_gl_items(&$supp_trans, $mode=0)
 
                        if ($mode == 1)
                        {
-                               edit_button_cell("Delete2" . $entered_gl_code->Counter, _("Delete"),
+                               delete_button_cell("Delete2" . $entered_gl_code->Counter, _("Delete"),
                                          _('Remove line from document'));
                                label_cell("");
                        }       
@@ -276,12 +263,10 @@ function display_gl_items(&$supp_trans, $mode=0)
        label_row(_("Total"), price_format($total_gl_value),
                "colspan=".$colspan." align=right", "nowrap align=right");
 
-       echo "</table>";
+       end_table();
        div_end();
 
-    echo "</td></tr>";
-
-    end_table(); // outertable
+    end_outer_table(0, false); // outertable
        return $total_gl_value;
 }
 
@@ -374,9 +359,9 @@ function display_grn_items(&$supp_trans, $mode=0)
     // if displaying in form, and no items, exit
     if (($mode == 2  || $mode == 3) && count($supp_trans->grn_items) == 0)
        return 0;
-       br(1);
-       start_table("width=95%");
-       echo "<tr><td>"; // outertable
+
+       start_outer_table("width=95%");
+
        $heading2 = "";
        if ($mode == 1)
        {
@@ -410,10 +395,10 @@ function display_grn_items(&$supp_trans, $mode=0)
        }       
        echo "</tr></table>";
 
-       echo "</td></tr><tr><td>"; // outer table
+       vertical_space(); // outer table
 
        div_start('grn_items');
-       echo "<table width=100% $table_style>";
+       start_table("$table_style width=100%");
        if ($mode == 1)
        {
        $th = array(_("Delivery"), _("Sequence #"), _("P.O."), _("Item"), _("Description"),
@@ -464,7 +449,7 @@ function display_grn_items(&$supp_trans, $mode=0)
 
                        if ($mode == 1)
                        {
-                               edit_button_cell("Delete" . $entered_grn->id, _("Edit"), _('Edit document line'));
+                               delete_button_cell("Delete" . $entered_grn->id, _("Edit"), _('Edit document line'));
                                if ($supp_trans->is_invoice && $_SESSION["wa_current_user"]->access == 2)         
                                        label_cell("");
                        }       
@@ -490,7 +475,7 @@ function display_grn_items(&$supp_trans, $mode=0)
                $colspan = 5;
        label_row(_("Total"), price_format($total_grn_value),
                "colspan=$colspan align=right", "nowrap align=right");
-    echo "</table>";
+    end_table();
        if (!$ret)
        {
                if ($supp_trans->is_invoice)
@@ -502,9 +487,8 @@ function display_grn_items(&$supp_trans, $mode=0)
                }
        }       
     div_end();
-    echo "</td></tr>";
 
-    end_table(); // outertable
+    end_outer_table(0, false); // outertable
        return $total_grn_value;
 }
 
index 1484b91c142570cdd4cb748047647879a14b383b..74015b448a0787ada40dfc914790ad2899c2f6b0 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 include_once($path_to_root . "/purchasing/includes/purchasing_db.inc");
 
 // ------------------------------------------------------------------------------
@@ -45,10 +54,9 @@ function display_po_header(&$order)
 
        $editable = ($order->order_no == 0);
 
-       start_table("width=80% $table_style2");
-       echo "<tr><td valign=center>"; // outer table
-       echo "<table>";
+       start_outer_table("width=80% $table_style2");
 
+       table_section(1);
     if ($editable)
     {
         if (!isset($_POST['supplier_id']) && (get_global_supplier() != reserved_words::get_all()))
@@ -90,11 +98,8 @@ function display_po_header(&$order)
        label_row(_("Reference:"), $order->reference);
     }
 
-       echo "</table>";
-
-       echo "</td><td valign=center>"; // outer table
+       table_section(2);
 
-       echo "<table height='5'>";
        // check this out?????????
        //if (!isset($_POST['OrderDate']) || $_POST['OrderDate'] == "")
        //      $_POST['OrderDate'] = $order->orig_order_date;
@@ -111,17 +116,13 @@ function display_po_header(&$order)
 
        text_row(_("Supplier's Reference:"), 'Requisition', null, 16, 15);
 
-       echo "</table>";
-
-       echo "</td><td valign=center>"; // outer table
-
-       echo "<table height='5'>";
-
        echo "<tr><td>" . _("Receive Into:") . "</td>";
        echo "<td>";
     locations_list('StkLocation', null, false, true);
        echo "</td></tr>";
 
+       table_section(3);
+
     if (!isset($_POST['StkLocation']) || $_POST['StkLocation'] == "" ||
        isset($_POST['_StkLocation_update']) || !isset($_POST['delivery_address']) ||
        $_POST['delivery_address'] == "")
@@ -148,10 +149,8 @@ function display_po_header(&$order)
     }
 
        textarea_row(_("Deliver to:"), 'delivery_address', $_POST['delivery_address'], 35, 4);
-       echo "</table>";
 
-       echo "</td></tr>";
-       end_table(); // outer table
+       end_outer_table(); // outer table
 }
 
 //---------------------------------------------------------------------------------------------------
@@ -166,7 +165,7 @@ function display_po_items(&$order, $editable=true)
     start_table("$table_style width=80%");
 
        $th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"),
-               _("Required Delivery Date"), _("Price"), _("Line Total"));
+               _("Required Delivery Date"), _("Price"), _("Line Total"), "");
 
        if (count($order->line_items)) $th[] = '';
        table_header($th);
@@ -195,7 +194,7 @@ function display_po_items(&$order, $editable=true)
                 {
                                        edit_button_cell("Edit$line_no", _("Edit"),
                                          _('Edit document line'));
-                                       edit_button_cell("Delete$line_no", _("Delete"),
+                                       delete_button_cell("Delete$line_no", _("Delete"),
                                          _('Remove line from document'));
                 }
                        end_row();
@@ -328,10 +327,10 @@ function po_item_controls(&$order, $stock_id=null)
 
        if ($id!=-1)
        {
-               edit_button_cell('UpdateLine', _("Update"),
-                               _('Confirm changes'));
-               edit_button_cell('CancelUpdate', _("Cancel"),
-                               _('Cancel changes'));
+               button_cell('UpdateLine', _("Update"),
+                               _('Confirm changes'), ICON_UPDATE);
+               button_cell('CancelUpdate', _("Cancel"),
+                               _('Cancel changes'), ICON_CANCEL);
                set_focus('qty');
        }
        else
index 3854b5ae0ad14dde15840463e23d686c0c8bcb5b..c6d08a1f2d1bab40231803985c608cea57e7dc3f 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 $path_to_root="..";
 
 include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc");
@@ -292,29 +301,22 @@ if ($id4 != -1)
 
 start_form(false, true);
 
-start_table("$table_style width=98%", 8);
-echo "<tr><td valign=center>"; // outer table
-
-echo "<center>";
-
 invoice_header($_SESSION['supp_trans']);
 if ($_POST['supplier_id']=='') 
        display_error('No supplier found for entered search text');
 else {
-       echo "</td></tr><tr><td valign=center>"; // outer table
+       start_outer_table("$table_style2 width=98%", 5);
 
        $total_grn_value = display_grn_items($_SESSION['supp_trans'], 1);
 
        $total_gl_value = display_gl_items($_SESSION['supp_trans'], 1);
 
-       echo "</td></tr><tr><td align=center colspan=2>"; // outer table
        div_start('inv_tot');
        invoice_totals($_SESSION['supp_trans']);
        div_end();
-}
-echo "</td></tr>";
 
-end_table(1); // outer table
+       end_outer_table(0, false);
+}
 
 if ($id != -1)
 {
@@ -325,9 +327,9 @@ if ($id != -1)
 if (get_post('AddGLCodeToTrans'))
        $Ajax->activate('inv_tot');
 
-
+br();
 submit_center('PostCreditNote', _("Enter Credit Note"), true, '', true);
-echo "<br><br>";
+br();
 
 end_form();
 end_page();
index b78505180184a76b7ccdae60e3a6dd62299e5e64..534e55b3534813b3461c0c4817ba2b50352b1b08 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 $page_security=5;
 $path_to_root="..";
 
@@ -368,37 +377,26 @@ if ($_SESSION["wa_current_user"]->access == 2)
 
 start_form(false, true);
 
-start_table("$table_style2 width=98%", 8);
-echo "<tr><td valign=center>"; // outer table
-
-echo "<center>";
-
 invoice_header($_SESSION['supp_trans']);
+
 if ($_POST['supplier_id']=='') 
        display_error('No supplier found for entered search text');
 else {
-       echo "</td></tr><tr><td valign=center>"; // outer table
-
-       echo "<center>";
+       start_outer_table("$table_style2 width=98%", 5);
 
        display_grn_items($_SESSION['supp_trans'], 1);
-       //display_grn_items_for_selection();
+
        display_gl_items($_SESSION['supp_trans'], 1);
-       //display_gl_controls();
 
-       //echo "</td></tr><tr><td align=center colspan=2>"; // outer table
-       echo "<br>";
        div_start('inv_tot');
        invoice_totals($_SESSION['supp_trans']);
        div_end();
-}
-echo "</td></tr>";
 
-end_table(); // outer table
+       end_outer_table(0, false);
+}
 
 //-----------------------------------------------------------------------------------------
 
-
 if ($id != -1 || $id2 != -1)
 {
        $Ajax->activate('grn_items');
@@ -408,9 +406,9 @@ if ($id != -1 || $id2 != -1)
 if (get_post('AddGLCodeToTrans'))
        $Ajax->activate('inv_tot');
 
-echo "<br>";
+br();
 submit_center('PostInvoice', _("Enter Invoice"), true, '', true);
-echo "<br>";
+br();
 
 end_form();
 
index 8f997c8888cb92052b1356d297a6c167fe86b5d6..6ec57b01d0968e44e2e18d2a85249e2cc7c54d5f 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 $path_to_root="..";
 $page_security = 5;
 include_once($path_to_root . "/includes/session.inc");
@@ -74,11 +83,13 @@ function display_controls()
                if (!is_date_in_fiscalyear($_POST['DatePaid']))
                        $_POST['DatePaid'] = end_fiscalyear();
        }               
-       start_table($table_style2, 5, 7);
-       echo "<tr><td valign=top>"; // outer table
-
-       echo "<table>";
+       //start_table($table_style2, 5, 7);
+       //echo "<tr><td valign=top>"; // outer table
+       start_outer_table($table_style2, 5);
 
+       //echo "<table>";
+       table_section(1);
+       
     bank_accounts_list_row(_("From Bank Account:"), 'bank_account', null, true);
 
        amount_row(_("Amount of Payment:"), 'amount');
@@ -86,9 +97,10 @@ function display_controls()
 
     date_row(_("Date Paid") . ":", 'DatePaid', '', null, 0, 0, 0, null, true);
 
-       echo "</table>";
-       echo "</td><td valign=top class='tableseparator'>"; // outer table
-       echo "<table>";
+       table_section(2);
+       //echo "</table>";
+       //echo "</td><td valign=top class='tableseparator'>"; // outer table
+       //echo "<table>";
 
     supplier_list_row(_("Payment To:"), 'supplier_id', null, false, true);
 
@@ -105,10 +117,10 @@ function display_controls()
 
     text_row(_("Memo:"), 'memo_', null, 52,50);
 
-       echo "</table>";
+       //echo "</table>";
 
-       echo "</td></tr>";
-       end_table(1); // outer table
+       //echo "</td></tr>";
+       end_outer_table(1); // outer table
 
        submit_center('ProcessSuppPayment',_("Enter Payment"), true, '', true);
 
index 9f8b79027a8ef4e6252d596914bfe32ec4bfa521..f4fdf794b5d3fab02dd0031157a7617c7de54c7a 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 $path_to_root="..";
 $page_security = 3;
 include_once($path_to_root . "/includes/session.inc");
@@ -169,10 +178,9 @@ function read_customer_data()
 function display_item_form()
 {
        global $table_style2;
-       start_table($table_style2, 5, 7);
-       echo "<tr><td valign=top>"; // outer table
 
-       echo "<table>";
+       start_outer_table($table_style2, 5);
+       table_section(1);
 
        if (!isset($_POST['customer_id']))
                $_POST['customer_id'] = get_global_customer(false);
@@ -193,8 +201,8 @@ function display_item_form()
 
        set_global_customer($_POST['customer_id']);
        if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) {
-               echo "</table></table>";
-               display_note(_("This customer account is on hold."), 0, 0, "class='redfb'");
+               end_outer_table();
+               display_error(_("This customer account is on hold."));
        } else {
                $display_discount_percent = percent_format($_POST['pymt_discount']*100) . "%";
 
@@ -206,9 +214,7 @@ function display_item_form()
 
                date_row(_("Date of Deposit:"), 'DateBanked','',null, 0, 0, 0, null, true);
 
-               echo "</table>";
-               echo "</td><td valign=top class='tableseparator'>"; // outer table
-               echo "<table>";
+               table_section(2);
 
                bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, true);
 
@@ -223,10 +229,7 @@ function display_item_form()
 
                textarea_row(_("Memo:"), 'memo_', null, 22, 4);
 
-               echo "</table>";
-
-               echo "</td></tr>";
-               end_table(); // outer table
+               end_outer_table(1);
 
                if ($cust_currency != $bank_currency)
                        display_note(_("Amount and discount are in customer's currency."));
index a38c4aedc86731f20b4e088eb7c040283a765a65..f4725d3febdace0525b325f6cde00c173e2ab504 100644 (file)
@@ -16,9 +16,9 @@ include_once($path_to_root . "/includes/ui.inc");
 function display_credit_header(&$order)
 {
        global $table_style, $Ajax;
-       start_table("width=80% $table_style");
-       echo "<tr><td valign=top>"; // outer table
-       echo "<table>";
+
+       start_outer_table("width=80% $table_style");
+       table_section(1);
 
        $customer_error = "";
        $change_prices = 0;
@@ -87,24 +87,17 @@ function display_credit_header(&$order)
            label_row(_("Reference").':', $_POST['ref'] );
 
 
-
-       echo "</table>";
-
-       echo "</td><td>"; // outer table
-
        if (!is_company_currency($order->customer_currency))
        {
+               table_section(2);
+               
            div_start('currency');
-               echo "<table height='5'>";
                label_row(_("Customer Currency:"), $order->customer_currency);
                exchange_rate_display($order->customer_currency, get_company_currency(),
                        $_POST['OrderDate']);
-               echo "</table>";
-               echo "</td><td>"; // outer table
            div_end();
        }
-
-       echo "<table height='5'>";
+       table_section(3);
 
     if (!isset($_POST['sales_type_id']))
        $_POST['sales_type_id'] = $order->sales_type;
@@ -121,11 +114,8 @@ function display_credit_header(&$order)
     shippers_list_row(_("Shipping Company:"), 'ShipperID', $order->ship_via);
 
        label_row(_("Customer Discount:"), ($order->default_discount * 100) . "%");
-       echo "</table>";
-
-       echo "</td><td>"; // outer table
 
-       echo "<table height='5'>";
+       table_section(4);
 
        if (!isset($_POST['OrderDate']) || $_POST['OrderDate'] == "")
                $_POST['OrderDate'] = $order->document_date;
@@ -148,11 +138,7 @@ function display_credit_header(&$order)
        else
                hidden('dimension2_id', 0);
 
-       echo "</table>";
-
-       echo "</td></tr>";
-
-       end_table(1); // outer table
+       end_outer_table(1); // outer table
 
        if ($change_prices != 0) {
                foreach ($order->line_items as $line_no=>$item) {
index 56926b42a451e930747ec2d204ef29df8978849d..5657a497b325c1031e4e7b28911b2a32fb0b04f3 100644 (file)
@@ -214,10 +214,10 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
 {
        global $table_style, $Ajax;
 
-       start_table("width=80% $table_style");
-       echo "<tr><td valign=top>"; // outer table
-       echo "<table>";
+       start_outer_table("width=80% $table_style");
 
+       table_section(1);
+       
        $customer_error = "";
        $change_prices = 0;
 
@@ -312,24 +312,18 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
                ref_cells(_("Reference").':', 'ref', _('Reference number unique for this document type'), null, '');
        }
 
-       echo "</table>";
-
-       echo "</td><td>"; // outer table
-
        if (!is_company_currency($order->customer_currency))
        {
+           table_section(2);
+
            div_start('currency');
-               echo "<table height='5'>";
                label_row(_("Customer Currency:"), $order->customer_currency);
                exchange_rate_display($order->customer_currency, get_company_currency(),
                        ($editable ? $_POST['OrderDate'] : $order->document_date));
-               echo "</table>";
            div_end();
-               echo "</td><td>"; // outer table
        }
+       table_section(3);
 
-
-       echo "<table height='5'>";
        if ($order->trans_type == 10 && $order->pos != -1) {
                sale_payment_list_cells(_('Payment:'), 'cash', null, true);
                $cash_payment = get_post('cash', 0);
@@ -364,11 +358,8 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
        }
 
        label_row(_("Customer Discount:"), ($order->default_discount * 100) . "%");
-       echo "</table>";
-
-       echo "</td><td>"; // outer table
-
-       echo "<table height='5'>";
+       
+       table_section(4);
 
        if ($editable)
        {
@@ -412,11 +403,8 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
            label_row(_("Tax Group:"), $order->tax_group_name);
            hidden('tax_group_id', $_SESSION['Items']->tax_group_id);
        }
-       echo "</table>";
-
-       echo "</td></tr>";
 
-       end_table(1); // outer table
+       end_outer_table(1); // outer table
 
        if ($change_prices != 0) {
                foreach ($order->line_items as $line_no=>$item) {
@@ -515,17 +503,17 @@ function display_delivery_details(&$order)
 {
        global $table_style2, $Ajax;
 
-div_start('delivery'); 
+       div_start('delivery');  
 
        if (get_post('cash', 0)) {      // Direct payment sale
                display_heading(_('Cash payment'));
-               echo "<table $table_style2 width=60% align=center>";
+               start_table("$table_style2 width=60%");
                label_row(_("Deliver from Location:"), $order->location_name);
 
                hidden('Location', $order->Location);
                label_row(_("Cash account:"), $order->account_name);
                textarea_row(_("Comments:"), "Comments", $order->Comments, 31, 5);
-               echo "</table>";
+               end_table();
        } else {
 
                if ($order->trans_type==10)
@@ -544,10 +532,8 @@ div_start('delivery');
                        $delname = _("Required Delivery Date").':';
                }
                display_heading($title);
-               echo "<br>";
-               start_table("$table_style2 width=90%");
-               echo "<tr valign=top><td>"; // outer table
-               echo "<table>";
+               start_outer_table("$table_style2 width=90%");
+               table_section(1);
 
                locations_list_row(_("Deliver from Location:"), 'Location', null, 
                        false, true);
@@ -565,11 +551,7 @@ div_start('delivery');
                text_row(_("Contact Phone Number:"), 'phone', $order->phone, 25, 25,
                    _('Phone number of ordering person. Defaults to branch phone number'));
 
-               echo "</table>";
-
-               echo "</td><td>"; // outer table
-
-               echo "<table>";
+               table_section(2);
 
                text_row(_("Customer Reference:"), 'cust_ref', $order->cust_ref, 25, 25,
                  _('Customer reference number for this order (if any)'));
@@ -579,9 +561,8 @@ div_start('delivery');
                price_format(get_post('freight_cost',0)));
 
                shippers_list_row(_("Shipping Company:"), 'ship_via', $order->ship_via);
-               echo "</table>";
-               echo "</td></tr>";
-               end_table(1); // outer table
+
+               end_outer_table(1);
        }
        div_end();
 }