Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
add start date to list of workorders + fix
04-22-2012, 11:43 PM,
#1
add start date to list of workorders + fix
For our operation, I find it important for the list of all workorders to show required date and start date.
So we can see if we are overdue (requireddate), and we can also see whether the wo should already have been started. (start date).

I include selectworkorder.php with this fix and would be glad if it could go into the code core.

Klaus


Attached Files
.php   SelectWorkOrder.php (Size: 13.1 KB / Downloads: 1)
Reply
04-26-2012, 07:03 AM,
#2
RE: add start date to list of workorders + fix
I will try to remember to get this file later from my development machine.

In future, please could I ask that you send submissions to submissions@weberp.org that way I will know to include them in future.

Many thanks
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply
04-26-2012, 07:58 AM,
#3
RE: add start date to list of workorders + fix
I didn't know (or may be knew long ago but forgot). Will do so in the future.
best regards,

Klaus
Reply
04-29-2012, 02:07 PM, (This post was last modified: 04-29-2012, 02:20 PM by phil.)
#4
RE: add start date to list of workorders + fix
The diff between your modified script and the current svn shows:

Code:
-- /root/Downloads/SelectWorkOrder.php    2012-04-29 16:10:46.000000000 +1200
+++ SelectWorkOrder.php    2012-04-28 16:51:41.000000000 +1200
@@ -1,14 +1,14 @@
<?php

-/* $Id: SelectWorkOrder.php 4837 2012-01-24 23:41:46Z vvs2012 $*/
-//add display of workorder start date by opto , at 2012-04-22
+/* $Id: SelectWorkOrder.php 5239 2012-04-12 07:43:22Z vvs2012 $*/

include('includes/session.inc');
$title = _('Search Work Orders');
include('includes/header.inc');

echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>';
-echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">';
+echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">';
+echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';


@@ -113,7 +113,7 @@
        if (isset($_REQUEST['SelectedStockItem'])) {
            echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . ' <input type="hidden" name="SelectedStockItem" value="' . $_REQUEST['SelectedStockItem'] . '" />';
        }
-        echo _('Work Order number') . ': <input type="text" name="WO" maxlength="8" size="9" />&nbsp ' . _('Processing at') . ':<select name="StockLocation"> ';
+        echo _('Work Order number') . ': <input type="text" name="WO" maxlength="8" size="9" />&nbsp; ' . _('Processing at') . ':<select name="StockLocation"> ';

        $sql = "SELECT loccode, locationname FROM locations";

@@ -129,11 +129,11 @@
            } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){
                 echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
            } else {
-                 echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
+                 echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
            }
        }

-        echo '</select> &nbsp&nbsp';
+        echo '</select> &nbsp;&nbsp;';
        echo '<select name="ClosedOrOpen">';

        if ($_GET['ClosedOrOpen']=='Closed_Only'){
@@ -148,7 +148,7 @@
            echo '<option selected="selected" value="Open_Only">' . _('Open Work Orders Only')  . '</option>';
        }

-        echo '</select> &nbsp&nbsp';
+        echo '</select> &nbsp;&nbsp;';
        echo '<input type="submit" name="SearchOrders" value="' . _('Search') . '" />';
        echo '&nbsp;&nbsp;<a href="' . $rootpath . '/WorkOrderEntry.php">' . _('New Work Order') . '</a></td></tr></table><br />';
    }
@@ -162,22 +162,22 @@

    echo '<table class="selection">
            <tr>
-                <th colspan="6"><font size="3" color="navy">' . _('To search for work orders for a specific item use the item selection facilities below') . '</font></th>
+                <th colspan="6"><h3>' . _('To search for work orders for a specific item use the item selection facilities below') . '</h3></th>
            </tr>
            <tr>
-                <td><font size="1">' . _('Select a stock category') . ':</font>
+                <td>' . _('Select a stock category') . ':
                  <select name="StockCat">';

    while ($myrow1 = DB_fetch_array($result1)) {
        echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>';
    }

-      echo '</select>
-              <td><font size="1">' . _('Enter text extract(s) in the description') . ':</font></td>
+      echo '</select></td>
+              <td>' . _('Enter text extract(s) in the description') . ':</td>
              <td><input type="text" name="Keywords" size="20" maxlength="25" /></td>
        </tr>
          <tr><td></td>
-              <td><font size="3"><b>' . _('OR') . ' </b></font><font size="1">' . _('Enter extract of the Stock Code') . '</b>:</font></td>
+              <td><b>' . _('OR') . ' </b>' . _('Enter extract of the Stock Code') . ':</td>
              <td><input type="text" name="StockCode" size="15" maxlength="18" /></td>
          </tr>
      </table><br />';
@@ -187,7 +187,7 @@
    if (isset($StockItemsResult)) {
    
        echo '<br />
-            <table cellpadding="2" colspan="7" class="selection">';
+            <table cellpadding="2" class="selection">';
        $TableHeader = '<tr>
                            <th>' . _('Code') . '</th>
                            <th>' . _('Description') . '</th>
@@ -244,15 +244,14 @@
        } else {
            $ClosedOrOpen = 1;
        }
-        if (isset($_REQUEST['WO']) && $_REQUEST['WO'] !='') {
+        if (isset($_REQUEST['WO']) AND $_REQUEST['WO'] !='') {
                $SQL = "SELECT workorders.wo,
                                woitems.stockid,
                                stockmaster.description,
                                stockmaster.decimalplaces,
                                woitems.qtyreqd,
                                woitems.qtyrecd,
-                                workorders.requiredby,
-                                                                workorders.startdate
+                                workorders.requiredby
                        FROM workorders
                        INNER JOIN woitems ON workorders.wo=woitems.wo
                        INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid
@@ -270,8 +269,7 @@
                                    stockmaster.decimalplaces,
                                    woitems.qtyreqd,
                                    woitems.qtyrecd,
-                                    workorders.requiredby,
-                                                                        workorders.startdate
+                                    workorders.requiredby
                            FROM workorders
                            INNER JOIN woitems ON workorders.wo=woitems.wo
                            INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid
@@ -287,8 +285,7 @@
                                    stockmaster.decimalplaces,
                                    woitems.qtyreqd,
                                    woitems.qtyrecd,
-                                    workorders.requiredby,
-                                                                        workorders.startdate
+                                    workorders.requiredby
                            FROM workorders
                            INNER JOIN woitems ON workorders.wo=woitems.wo
                            INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid
@@ -305,7 +302,7 @@
        /*show a table of the orders returned by the SQL */
        if (DB_num_rows($WorkOrdersResult)>0) {
            echo '<br />
-                <table cellpadding="2" colspan="7" width="95%" class="selection">';
+                <table cellpadding="2" width="95%" class="selection">';
    
    
            $tableheader = '<tr>
@@ -318,12 +315,11 @@
                                <th>' . _('Quantity Required') . '</th>
                                <th>' . _('Quantity Received') . '</th>
                                <th>' . _('Quantity Outstanding') . '</th>
-                                                                <th>' . _('Start Date')  . '</th>
                                <th>' . _('Required Date') . '</th>
                            </tr>';
    
            echo $tableheader;
-        }
+
        $j = 1;
        $k=0; //row colour counter
        while ($myrow=DB_fetch_array($WorkOrdersResult)) {
@@ -337,13 +333,12 @@
            }
    
            $ModifyPage = $rootpath . '/WorkOrderEntry.php?WO=' . $myrow['wo'];
-            $Status_WO = $rootpath . '/WorkOrderStatus.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid'];
-            $Receive_WO = $rootpath . '/WorkOrderReceive.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid'];
-            $Issue_WO = $rootpath . '/WorkOrderIssue.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid'];
+            $Status_WO = $rootpath . '/WorkOrderStatus.php?WO=' .$myrow['wo'] . '&amp;StockID=' . $myrow['stockid'];
+            $Receive_WO = $rootpath . '/WorkOrderReceive.php?WO=' .$myrow['wo'] . '&amp;StockID=' . $myrow['stockid'];
+            $Issue_WO = $rootpath . '/WorkOrderIssue.php?WO=' .$myrow['wo'] . '&amp;StockID=' . $myrow['stockid'];
            $Costing_WO =$rootpath . '/WorkOrderCosting.php?WO=' .$myrow['wo'];
    
            $FormatedRequiredByDate = ConvertSQLDate($myrow['requiredby']);
-            $FormatedStartDate = ConvertSQLDate($myrow['startdate']);
    
    
            printf('<td><a href="%s">%s</a></td>
@@ -356,7 +351,6 @@
                    <td class="number">%s</td>
                    <td class="number">%s</td>
                    <td>%s</td>
-                                        <td>%s</td>
                    </tr>',
                    $ModifyPage,
                    $myrow['wo'],
@@ -369,7 +363,6 @@
                    locale_number_format($myrow['qtyreqd'],$myrow['decimalplaces']),
                    locale_number_format($myrow['qtyrecd'],$myrow['decimalplaces']),
                    locale_number_format($myrow['qtyreqd']-$myrow['qtyrecd'],$myrow['decimalplaces']),
-                    $FormatedStartDate,
                                         $FormatedRequiredByDate);
    
            $j++;
@@ -383,10 +376,12 @@
    
        echo '</table>';
    }
+    }
    
-    echo '<script>defaultControl(document.forms[0].WO);</script>';
+    echo '<script  type="text/javascript">defaultControl(document.forms[0].WO);</script>';
    
-    echo '</form>';
+    echo '</div>
+          </form>';
}

include('includes/footer.inc');


Unfortunately, the code has moved on quite a bit from the script you modified here ...so it makes it very difficult to figure out what changes you made - I think I can figure it out though. If you could make your changes against the latest svn code that would be so much easier. But certainly appreciate the trouble you have taken to submit your changes.

Thanks
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)