From 902e63ca33432a8499a1f2d1c51e9620e975d668 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 12 Nov 2008 10:15:45 +0000 Subject: [PATCH] Fixed acording to latest db_pager api changes --- sales/inquiry/customer_allocation_inquiry.php | 24 +++++++------- sales/inquiry/customer_inquiry.php | 32 ++++++++----------- sales/inquiry/sales_deliveries_view.php | 14 ++++---- sales/inquiry/sales_orders_view.php | 16 +++++----- 4 files changed, 41 insertions(+), 45 deletions(-) diff --git a/sales/inquiry/customer_allocation_inquiry.php b/sales/inquiry/customer_allocation_inquiry.php index 6d6d656f..c6324d98 100644 --- a/sales/inquiry/customer_allocation_inquiry.php +++ b/sales/inquiry/customer_allocation_inquiry.php @@ -73,12 +73,12 @@ function view_link($trans) function due_date($row) { - return $row["type"] == 10 ? sql2date($row["due_date"]) : ''; + return $row["type"] == 10 ? $row["due_date"] : ''; } function fmt_balance($row) { - return price_format($row["TotalAmount"] - $row["Allocated"]); + return $row["TotalAmount"] - $row["Allocated"]; } function alloc_link($row) @@ -191,19 +191,19 @@ function fmt_credit($row) //------------------------------------------------------------------------------------------------ $cols = array( - _("Type") => array('type'=>'spec', 'fun'=>'systype_name'), - _("Number") => array('type'=>'spec', 'fun'=>'view_link'), + _("Type") => array('fun'=>'systype_name'), + _("Number") => array('fun'=>'view_link'), _("Reference"), - _("Order") => array('type'=>'spec', 'fun'=>'order_link'), + _("Order") => array('fun'=>'order_link'), _("Date") => array('type'=>'date', 'ord'=>'asc'), - _("Due Date") => array('type'=>'spec', 'fun'=>'due_date'), - _("Customer") => 'text', - _("Currency") => 'text', - _("Debit") => array('type'=>'spec', 'fun'=>'fmt_debit'), - _("Credit") => array('type'=>'insert', 'fun'=>'fmt_credit'), + _("Due Date") => array('type'=>'date', 'fun'=>'due_date'), + _("Customer"), + _("Currency") => array('align'=>'center'), + _("Debit") => array('align'=>'right','fun'=>'fmt_debit'), + _("Credit") => array('align'=>'right','insert'=>true, 'fun'=>'fmt_credit'), _("Allocated") => 'amount', - _("Balance") => array('type'=>'insert', 'fun'=>'fmt_balance'), - array('type'=>'insert', 'fun'=>'alloc_link') + _("Balance") => array('type'=>'amount', 'insert'=>true, 'fun'=>'fmt_balance'), + array('insert'=>true, 'fun'=>'alloc_link') ); if ($_POST['customer_id'] != reserved_words::get_all()) { diff --git a/sales/inquiry/customer_inquiry.php b/sales/inquiry/customer_inquiry.php index aa6dd6ce..c9d64bdc 100644 --- a/sales/inquiry/customer_inquiry.php +++ b/sales/inquiry/customer_inquiry.php @@ -116,12 +116,8 @@ function trans_view($trans) function due_date($row) { - return ($row["type"]==20 || $row["type"]==21)? sql2date($row["due_date"]) : ''; -} - -function fmt_balance($row) -{ - return price_format($row["TotalAmount"] - $row["Allocated"]); + return ($row["type"]==20 || $row["type"]==21) + ? $row["due_date"] : ''; } function gl_view($row) @@ -264,22 +260,22 @@ function check_overdue($row) //------------------------------------------------------------------------------------------------ $cols = array( - _("Type") => array('type'=>'spec', 'fun'=>'systype_name', 'ord'=>''), - _("#") => array('type'=>'spec', 'fun'=>'trans_view', 'ord'=>''), - _("Order") => array('type'=>'spec', 'fun'=>'order_view'), + _("Type") => array('fun'=>'systype_name', 'ord'=>''), + _("#") => array('fun'=>'trans_view', 'ord'=>''), + _("Order") => array('fun'=>'order_view'), _("Reference"), _("Date") => array('type'=>'date', 'ord'=>'desc'), - _("Due Date") => array('type'=>'spec', 'fun'=>'due_date'), + _("Due Date") => array('type=>date', 'fun'=>'due_date'), _("Customer") => array('ord'=>''), _("Branch") => array('ord'=>''), - _("Currency") => 'text', - _("Debit") => array('type'=>'spec', 'fun'=>'fmt_debit'), - _("Credit") => array('type'=>'insert', 'fun'=>'fmt_credit'), - array('type'=>'insert', 'fun'=>'gl_view'), - array('type'=>'insert', 'fun'=>'alloc_link'), - array('type'=>'insert', 'fun'=>'credit_link'), - array('type'=>'insert', 'fun'=>'edit_link'), - array('type'=>'insert', 'fun'=>'prt_link') + _("Currency") => array('align'=>'center'), + _("Debit") => array('align'=>'right', 'fun'=>'fmt_debit'), + _("Credit") => array('align'=>'right','insert'=>true, 'fun'=>'fmt_credit'), + array('insert'=>true, 'fun'=>'gl_view'), + array('insert'=>true, 'fun'=>'alloc_link'), + array('insert'=>true, 'fun'=>'credit_link'), + array('insert'=>true, 'fun'=>'edit_link'), + array('insert'=>true, 'fun'=>'prt_link') ); if ($_POST['customer_id'] != reserved_words::get_all()) { diff --git a/sales/inquiry/sales_deliveries_view.php b/sales/inquiry/sales_deliveries_view.php index 1d879a87..60a80bb9 100644 --- a/sales/inquiry/sales_deliveries_view.php +++ b/sales/inquiry/sales_deliveries_view.php @@ -129,7 +129,7 @@ function batch_checkbox($row) { $name = "Sel_" .$row['trans_no']; return $row['Done'] ? '' : - "
" + "" // add also trans_no => branch code for checking after 'Batch' submit ."\n"; @@ -217,7 +217,7 @@ else } //end no delivery number selected $cols = array( - _("Delivery #") => array('type'=>'spec', 'fun'=>'trans_view'), + _("Delivery #") => array('fun'=>'trans_view'), _("Customer"), 'branch_code' => 'skip', _("Branch") => array('ord'=>''), @@ -227,12 +227,12 @@ $cols = array( _("Delivery Date") => array('type'=>'date', 'ord'=>''), _("Due By") => 'date', _("Delivery Total") => array('type'=>'amount', 'ord'=>''), - _("Currency"), + _("Currency") => array('align'=>'center'), submit('BatchInvoice','Batch Inv', false) - => array('type'=>'insert', 'fun'=>'batch_checkbox'), - array('type'=>'insert', 'fun'=>'edit_link'), - array('type'=>'insert', 'fun'=>'invoice_link'), - array('type'=>'insert', 'fun'=>'prt_link') + => array('insert'=>true, 'fun'=>'batch_checkbox', 'align'=>'center'), + array('insert'=>true, 'fun'=>'edit_link'), + array('insert'=>true, 'fun'=>'invoice_link'), + array('insert'=>true, 'fun'=>'prt_link') ); //----------------------------------------------------------------------------------- diff --git a/sales/inquiry/sales_orders_view.php b/sales/inquiry/sales_orders_view.php index 6d3cfee5..2d4e5b31 100644 --- a/sales/inquiry/sales_orders_view.php +++ b/sales/inquiry/sales_orders_view.php @@ -252,7 +252,7 @@ else // ... or select inquiry constraints } $cols = array( - _("Order #") => array('type'=>'spec', 'fun'=>'view_link'), + _("Order #") => array('fun'=>'view_link'), _("Customer"), _("Branch"), _("Comments"), @@ -261,28 +261,28 @@ $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'))); }; -- 2.30.2