include the shipping method "name" in the order record and use that to
authorTony Cook <tony@develop-help.com>
Fri, 31 Jul 2009 04:25:31 +0000 (04:25 +0000)
committertony <tony@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Fri, 31 Jul 2009 04:25:31 +0000 (04:25 +0000)
display the shipping type on the admin order detail page

schema/bse.sql
site/cgi-bin/modules/BSE/DB/Mysql.pm
site/cgi-bin/modules/BSE/TB/Order.pm
site/cgi-bin/modules/BSE/UI/Shop.pm
site/templates/admin/order_detail.tmpl
site/util/mysql.str

index 611dd043f34e9e3eb2e279d2e87a9748128f2019..4e17eee495f704743c5d925fcdc003a43b220335 100644 (file)
@@ -312,8 +312,12 @@ create table orders (
 
   purchase_order varchar(80) not null default '',
 
+  -- the description of the shipping method as per $courier->description
   shipping_method varchar(64) not null default '',
 
+  -- the name of the shipping method as per $courier->name
+  shipping_name varchar(40) not null default '',
+
   primary key (id),
   index order_cchash(ccNumberHash),
   index order_userId(userId, orderDate)
index e088d60f874e9d01f80c07e91b4616562d8d747a..8f22b6eb8705947478d836418c7f4e1c22eaaa1f 100644 (file)
@@ -150,8 +150,8 @@ SQL
    Orders => 'select * from orders',
    getOrderByPkey => 'select * from orders where id = ?',
    getOrderItemByOrderId => 'select * from order_item where orderId = ?',
-   addOrder => 'insert orders values(null,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
-   replaceOrder => 'replace orders values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+   addOrder => 'insert orders values(null,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+   replaceOrder => 'replace orders values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    addOrderItem => 'insert order_item values(null,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    replaceOrderItem => 'replace order_item values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    getOrderByUserId => 'select * from orders where userId = ?',
index d3dcd077139fd73bc23bb4a50e399da20b780150..cbcc77a6a6ab4c2f1a0359ea61f441fe4d1e44d1 100644 (file)
@@ -24,7 +24,8 @@ sub columns {
            delivMobile billMobile
            ccOnline ccSuccess ccReceipt ccStatus ccStatusText
            ccStatus2 ccTranId complete delivOrganization billOrganization
-           delivStreet2 billStreet2 purchase_order shipping_method/;
+           delivStreet2 billStreet2 purchase_order shipping_method
+           shipping_name/;
 }
 
 =item siteuser
index 2dd55aedf86afbde339f2be6d2362f9a42a73ddb..2981e914f43d937e9b84ed77fef93e9d6f2b7eac 100644 (file)
@@ -1439,6 +1439,7 @@ sub _fillout_order {
           return;
       }
       $values->{shipping_method} = $courier->description();
+      $values->{shipping_name} = $courier->name;
       $values->{shipping_cost} = $cost;
       $values->{delivery_in} = $courier->delivery_in();
       $values->{total} += $values->{shipping_cost};
index a905810f4a443b850ee4c33695faea14bed883bf..3465eaa0970373571404ef3f0916fed8d638ab6c 100644 (file)
 </table>
 
 <br>
-<table bgcolor="#000000" cellpadding="0" cellspacing="0" border="0" class="table">
-  <tr>
-<td>
-
-      <table border=0 cellpadding="6" cellspacing="1">
-        <tr bgcolor="#FFFFFF"> 
+      <table class="editform">
+        <tr> 
           <th width="100%">Description</th>
           <th nowrap>Units</th>
           <th nowrap>Unit Price</th>
@@ -76,7 +72,7 @@
           <th nowrap>Ext GST</th>
 </tr>
 <:iterator begin items:>
-        <tr bgcolor="#FFFFFF"
+        <tr> 
           <td width="100%"><a href="<:script:>?product_detail=1&amp;id=<:product id:>"><:product 
             title:></a> <:options:></td>
           <td align=center nowrap><:item units:></td>
           <td align=right nowrap><:extension gst:></td>
 </tr>
 <:iterator end items:>
+<:if Order shipping_name:>
+
+        <tr> 
+          <td colspan=3 align=right>
+<:if Eq [order shipping_name] "contact":>
+<b>Contact customer to make shipping arrangements</b>
+<:or Eq:>
+Shipping via <:order shipping_method:>:
+<:eif Eq:>
+</td>
+          <td align=right nowrap><:money order shipping_cost:></td>
+          <td>&nbsp;</td>
+          <td align=right nowrap></td>
+          <td>&nbsp;</td>
+          <td align=right nowrap></td>
+</tr>
+<:or Order:><:eif Order:>
         <tr bgcolor="#FFFFFF"> 
           <td colspan=3 align=right>Total:</td>
           <td align=right nowrap><:money order total:></td>
index 39cea79c00f623aedf1cd5eb95d76666a7a988b0..bee01d2cfa6e751e7e809bebb946df4f8e430790 100644 (file)
@@ -335,6 +335,7 @@ Column delivStreet2;varchar(127);NO;;
 Column billStreet2;varchar(127);NO;;
 Column purchase_order;varchar(80);NO;;
 Column shipping_method;varchar(64);NO;;
+Column shipping_name;varchar(40);NO;;
 Index PRIMARY;1;[id]
 Index order_cchash;0;[ccNumberHash]
 Index order_userId;0;[userId;orderDate]