Fix [0000106] Error during direct invoice for non-ECB currencies.
[fa-stable.git] / sales / inquiry / sales_orders_view.php
index 6d3cfee586983d96ef05fd4ec3b808d382002a70..b174688deba3d91dbb64b41af46f7a2f4abfc9b6 100644 (file)
@@ -1,12 +1,21 @@
 <?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 = 2;
 $path_to_root="../..";
 
-include($path_to_root . "/sales/includes/sales_ui.inc");
 include($path_to_root . "/includes/db_pager.inc");
-include_once($path_to_root . "/reporting/includes/reporting.inc");
 include($path_to_root . "/includes/session.inc");
+include($path_to_root . "/sales/includes/sales_ui.inc");
+include_once($path_to_root . "/reporting/includes/reporting.inc");
 
 $js = "";
 if ($use_popup_windows)
@@ -76,31 +85,31 @@ function view_link($dummy, $order_no)
 
 function prt_link($row)
 {
-       return print_document_link($row['order_no'], _("Print"), true, 30);
+       return print_document_link($row['order_no'], _("Print"), true, 30, ICON_PRINT);
 }
 
 function edit_link($row) 
 {
   return pager_link( _("Edit"),
-    "/sales/sales_order_entry.php?" . SID . "ModifyOrderNumber=" . $row['order_no']);
+    "/sales/sales_order_entry.php?" . SID . "ModifyOrderNumber=" . $row['order_no'], ICON_EDIT);
 }
 
 function dispatch_link($row)
 {
   return pager_link( _("Dispatch"),
-       "/sales/customer_delivery.php?" . SID . "OrderNumber=" .$row['order_no']);
+       "/sales/customer_delivery.php?" . SID . "OrderNumber=" .$row['order_no'], ICON_DOC);
 }
 
 function invoice_link($row)
 {
   return pager_link( _("Invoice"),
-       "/sales/sales_order_entry.php?" . SID . "NewInvoice=" .$row["order_no"]);
+       "/sales/sales_order_entry.php?" . SID . "NewInvoice=" .$row["order_no"], ICON_DOC);
 }
 
 function delivery_link($row)
 {
   return pager_link( _("Delivery"),
-       "/sales/sales_order_entry.php?" . SID . "NewDelivery=" .$row['order_no']);
+       "/sales/sales_order_entry.php?" . SID . "NewDelivery=" .$row['order_no'], ICON_DOC);
 }
 
 function tmpl_checkbox($row)
@@ -185,7 +194,6 @@ end_row();
 
 end_table(1);
 end_form();
-
 //---------------------------------------------------------------------------------------------
 //     Orders inquiry table
 //
@@ -252,7 +260,7 @@ else        // ... or select inquiry constraints
 }
 
 $cols = array(
-       _("Order #") => array('type'=>'spec', 'fun'=>'view_link'),
+       _("Order #") => array('fun'=>'view_link'),
        _("Customer"),
        _("Branch"), 
        _("Comments"),
@@ -261,45 +269,43 @@ $cols = array(
        _("Delivery To"), 
        _("Order Total") => array('type'=>'amount', 'ord'=>''),
        'Type' => 'skip',
-       _("Currency")
+       _("Currency") => array('align'=>'center')
 );
 
 if ($_POST['order_view_mode'] == 'OutstandingOnly') {
        array_replace($cols, 3, 1, _("Cust Order Ref"));
-       array_append($cols, array(array('type'=>'insert', 'fun'=>'dispatch_link')));
+       array_append($cols, array(array('insert'=>true, 'fun'=>'dispatch_link')));
 
 } elseif ($_POST['order_view_mode'] == 'InvoiceTemplates') {
        array_replace($cols, 3, 1, _("Description"));
-       array_append($cols, array( array('type'=>'insert', 'fun'=>'invoice_link')));
+       array_append($cols, array( array('insert'=>true, 'fun'=>'invoice_link')));
 
 } else if ($_POST['order_view_mode'] == 'DeliveryTemplates') {
        array_replace($cols, 3, 1, _("Description"));
        array_append($cols, array(
-                       array('type'=>'insert', 'fun'=>'delivery_link'))
+                       array('insert'=>true, 'fun'=>'delivery_link'))
        );
 
 } else {
         array_append($cols,array(
-                       _("Tmpl") => array('type'=>'insert', 'fun'=>'tmpl_checkbox'),
-                                       array('type'=>'insert', 'fun'=>'edit_link'),
-                                       array('type'=>'insert', 'fun'=>'prt_link')));
+                       _("Tmpl") => array('insert'=>true, 'fun'=>'tmpl_checkbox'),
+                                       array('insert'=>true, 'fun'=>'edit_link'),
+                                       array('insert'=>true, 'fun'=>'prt_link')));
 };
 
 
 $table =& new_db_pager('orders_tbl', $sql, $cols);
 $table->set_marker('check_overdue', _("Marked items are overdue."));
 
-
-if (get_post('SearchOrders')) 
-{
+if (get_post('SearchOrders')) {
        $table->set_sql($sql);
        $table->set_columns($cols);
-       $Ajax->activate('orders_tbl');
-} 
-       start_form();
-       display_db_pager($table);
+}
+start_form();
+
+display_db_pager($table);
+submit_center('Update', _("Update"), true, '', null);
 
-       submit_center('Update', _("Update"), true, '', null);
-       end_form();
+end_form();
 end_page();
 ?>
\ No newline at end of file