From: <dai...@us...> - 2011-04-10 10:41:28
|
Revision: 4545 http://web-erp.svn.sourceforge.net/web-erp/?rev=4545&view=rev Author: daintree Date: 2011-04-10 10:41:20 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim launchpad stuff Modified Paths: -------------- trunk/GLAccountInquiry.php trunk/GLAccounts.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPShortages.php trunk/PDFPrintLabel.php trunk/PDFStockTransfer.php trunk/SelectProduct.php trunk/StockTransferControlled.php trunk/StockTransfers.php trunk/SupplierInvoice.php trunk/doc/Change.log.html trunk/includes/DefineLabelClass.php trunk/includes/DefineStockTransfers.php trunk/includes/OutputSerialItems.php trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/ReprintGRN.php Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccountInquiry.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -268,7 +268,9 @@ $tagsql="SELECT tagdescription FROM tags WHERE tagref='".$myrow['tag'] . "'"; $tagresult=DB_query($tagsql,$db); $tagrow = DB_fetch_array($tagresult); - + if ($tagrow['tagdescription']=='') { + $tagrow['tagdescription']=_('None'); + } printf("<td>%s</td> <td class=number><a href='%s'>%s</a></td> <td>%s</td> Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccounts.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.21 $ */ /* $Id$*/ -//$PageSecurity = 10; include('includes/session.inc'); $title = _('Chart of Accounts Maintenance'); @@ -58,19 +56,6 @@ )"; $result = DB_query($sql,$db,$ErrMsg); - /*Add the new chart details records for existing periods first */ -/*Maybe not required since these will be created from GLPostings.inc with correct B/fwd balances - $ErrMsg = _('Could not add the chart details for the new account'); - - $sql = 'INSERT INTO chartdetails (accountcode, period) - SELECT chartmaster.accountcode, periods.periodno - FROM chartmaster - CROSS JOIN periods - WHERE ( chartmaster.accountcode, periods.periodno ) NOT - IN ( SELECT chartdetails.accountcode, chartdetails.period FROM chartdetails )'; - - $result = DB_query($sql,$db,$ErrMsg); -*/ prnMsg(_('The new general ledger account has been added'),'success'); } @@ -218,7 +203,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' name='GLAccounts' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" name="GLAccounts" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedAccount)) { @@ -233,12 +218,16 @@ $_POST['AccountName'] = $myrow['accountname']; $_POST['Group'] = $myrow['group_']; - echo "<input type=hidden name='SelectedAccount' VALUE=$SelectedAccount>"; - echo "<input type=hidden name='AccountCode' VALUE=" . $_POST['AccountCode'] .">"; - echo "<table class=selection><tr><td>" . _('Account Code') . ":</td><td>" . $_POST['AccountCode'] . "</td></tr>"; + echo '<input type="hidden" name="SelectedAccount" value="' . $SelectedAccount . '">'; + echo '<input type="hidden" name="AccountCode" VALUE="' . $_POST['AccountCode'] .'">'; + echo '<table class=selection> + <tr><td>' . _('Account Code') . ':</td> + <td>' . $_POST['AccountCode'] . '</td></tr>'; } else { echo "<table class=selection>"; - echo "<tr><td>" . _('Account Code') . ":</td><td><input type=TEXT name='AccountCode' size=11 class=number maxlength=10></td></tr>"; + echo '<tr><td>' . _('Account Code') . ':</td> + <td><input type="text" name="AccountCode" size="11" class="number" maxlength="10" /></td> + </tr>'; } if (!isset($_POST['AccountName'])) {$_POST['AccountName']='';} @@ -251,17 +240,17 @@ while ($myrow = DB_fetch_array($result)){ if (isset($_POST['Group']) and $myrow[0]==$_POST['Group']){ - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow[0] . "'>" . $myrow[0]; + echo $myrow[0] . '">' . $myrow[0] . '</option>'; } if (!isset($_GET['SelectedAccount']) or $_GET['SelectedAccount']=='') { - echo "<script>defaultControl(document.GLAccounts.AccountCode);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountCode);</script>'; } else { - echo "<script>defaultControl(document.GLAccounts.AccountName);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountName);</script>'; } echo '</select></td></tr></table>'; @@ -293,12 +282,12 @@ $result = DB_query($sql,$db,$ErrMsg); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Account Code') . "</th> - <th>" . _('Account Name') . "</th> - <th>" . _('Account Group') . "</th> - <th>" . _('P/L or B/S') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Account Code') . '</th> + <th>' . _('Account Name') . '</th> + <th>' . _('Account Group') . '</th> + <th>' . _('P/L or B/S') . '</th> + </tr>'; $k=0; //row colour counter @@ -323,9 +312,9 @@ $myrow[1], $myrow[2], $myrow[3], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -338,10 +327,10 @@ echo '<p>'; if (isset($SelectedAccount)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Show All Accounts') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Accounts') . '</a></div>'; } -echo '<p>'; +echo '<p />'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRP.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.7 $ */ + /* $Id$*/ -//$PageSecurity=9; - include('includes/session.inc'); $title = _('Run MRP Calculation'); include('includes/header.inc'); @@ -18,21 +16,21 @@ echo '</br>' ._('Start time') . ': ' . date('h:i:s') . '</br>'; echo '</br>' . _('Initialising tables .....') . '</br>'; flush(); - $result = DB_query('DROP TABLE IF EXISTS tempbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS bomlevels',$db); - $result = DB_query('DROP TABLE IF EXISTS levels',$db); + $result = DB_query("DROP TABLE IF EXISTS tempbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS bomlevels",$db); + $result = DB_query("DROP TABLE IF EXISTS levels",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom (parent char(20), + $sql = "CREATE TEMPORARY TABLE tempbom (parent char(20), component char(20), sortpart text, - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -45,10 +43,10 @@ flush(); // This finds the top level $sql = "INSERT INTO passbom (part, sortpart) - SELECT bom.component AS part, - CONCAT(bom.parent,'%',bom.component) AS sortpart - FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component - WHERE bom2.component IS NULL"; + SELECT bom.component AS part, + CONCAT(bom.parent,'%',bom.component) AS sortpart + FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component + WHERE bom2.component IS NULL"; $result = DB_query($sql,$db); $lctr = 2; @@ -76,12 +74,12 @@ FROM bom,passbom WHERE bom.parent = passbom.part"; $result = DB_query($sql,$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('ALTER TABLE passbom RENAME AS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("ALTER TABLE passbom RENAME AS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); $sql = "INSERT INTO passbom (part, sortpart) @@ -92,9 +90,9 @@ $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom + $sql = "SELECT COUNT(*) FROM bom INNER JOIN passbom ON bom.parent = passbom.part - GROUP BY bom.parent'; + GROUP BY bom.parent"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -104,9 +102,9 @@ prnMsg(_('Creating bomlevels table'),'info'); flush(); - $sql = 'CREATE TEMPORARY TABLE bomlevels ( + $sql = "CREATE TEMPORARY TABLE bomlevels ( part char(20), - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); // Read tempbom and split sortpart into separate parts. For each separate part, calculate level as @@ -114,7 +112,7 @@ // part in the array for a level 4 sortpart would be created as a level 3 in levels, the fourth // and last part in sortpart would have a level code of zero, meaning it has no components - $sql = 'SELECT * FROM tempbom'; + $sql = "SELECT * FROM tempbom"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)) { $parts = explode('%',$myrow['sortpart']); @@ -140,7 +138,7 @@ shrinkfactor double NOT NULL default '0', eoq double NOT NULL default '0') DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -157,15 +155,15 @@ GROUP BY bomlevels.part, pansize, shrinkfactor, - stockmaster.eoq'; + stockmaster.eoq"; $result = DB_query($sql,$db); - $sql = 'ALTER TABLE levels ADD INDEX part(part)'; + $sql = "ALTER TABLE levels ADD INDEX part(part)"; $result = DB_query($sql,$db); // Create levels records with level of zero for all parts in stockmaster that // are not in bom - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -179,53 +177,53 @@ stockmaster.eoq FROM stockmaster LEFT JOIN levels ON stockmaster.stockid = levels.part - WHERE levels.part IS NULL'; + WHERE levels.part IS NULL"; $result = DB_query($sql,$db); // Update leadtime in levels from purchdata. Do it twice so can make sure leadtime from preferred // vendor is used - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid AND purchdata.preferred = 1 - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); prnMsg(_('Levels table has been created'),'info'); flush(); // Get rid if temporary tables - $sql = 'DROP TABLE IF EXISTS tempbom'; + $sql = "DROP TABLE IF EXISTS tempbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS bomlevels'; + $sql = "DROP TABLE IF EXISTS bomlevels"; //$result = DB_query($sql,$db); // In the following section, create mrprequirements from open sales orders and // mrpdemands prnMsg(_('Creating requirements table'),'info'); flush(); - $result = DB_query('DROP TABLE IF EXISTS mrprequirements',$db); + $result = DB_query("DROP TABLE IF EXISTS mrprequirements",$db); // directdemand is 1 if demand is directly for this part, is 0 if created because have netted // out supply and demands for a top level part and determined there is still a net // requirement left and have to pass that down to the BOM parts using the // CreateLowerLevelRequirement() function. Mostly do this so can distinguish the type // of requirements for the MRPShortageReport so don't show double requirements. - $sql = 'CREATE TABLE mrprequirements ( part char(20), + $sql = "CREATE TABLE mrprequirements ( part char(20), daterequired date, quantity double, mrpdemandtype varchar(6), orderno int(11), directdemand smallint, - whererequired char(20)) DEFAULT CHARSET=utf8'; + whererequired char(20)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPCalendar.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,12 +1,10 @@ <?php /* $Id$ */ -/* $Revision: 1.6 $ */ + // MRPCalendar.php // Maintains the calendar of valid manufacturing dates for MRP -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Calendar'); include('includes/header.inc'); @@ -75,15 +73,15 @@ return; } - $sql = 'DROP TABLE IF EXISTS mrpcalendar'; + $sql = "DROP TABLE IF EXISTS mrpcalendar"; $result = DB_query($sql,$db); - $sql = 'CREATE TABLE mrpcalendar ( + $sql = "CREATE TABLE mrpcalendar ( calendardate date NOT NULL, daynumber int(6) NOT NULL, - manufacturingflag smallint(6) NOT NULL default "1", + manufacturingflag smallint(6) NOT NULL default '1', INDEX (daynumber), - PRIMARY KEY (calendardate))'; + PRIMARY KEY (calendardate)) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -95,9 +93,9 @@ $ExcludeDays = array($_POST['Sunday'],$_POST['Monday'],$_POST['Tuesday'],$_POST['Wednesday'], $_POST['Thursday'],$_POST['Friday'],$_POST['Saturday']); - $caldate = $convertfromdate; + $CalDate = $convertfromdate; for ($i = 0; $i <= $datediff; $i++) { - $dateadd = FormatDateForSQL(DateAdd($caldate,"d",$i)); + $dateadd = FormatDateForSQL(DateAdd($CalDate,"d",$i)); // If the check box for the calendar date's day of week was clicked, set the manufacturing flag to 0 $dayofweek = DayOfWeekFromSQLDate($dateadd); @@ -121,16 +119,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '$CalDate'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } prnMsg(_("The MRP Calendar has been created"),'succes'); @@ -145,9 +143,9 @@ // After change the flag, re-calculate the daynumber for all dates. $InputError = 0; - $caldate = FormatDateForSQL($ChangeDate); + $CalDate = FormatDateForSQL($ChangeDate); $sql="SELECT COUNT(*) FROM mrpcalendar - WHERE calendardate='$caldate' + WHERE calendardate='$CalDate' GROUP BY calendardate"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -161,7 +159,7 @@ return; } - $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$caldate'"; + $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$CalDate'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $newmanufacturingflag = 0; @@ -169,7 +167,7 @@ $newmanufacturingflag = 1; } $sql = "UPDATE mrpcalendar SET manufacturingflag = '".$newmanufacturingflag."' - WHERE calendardate = '".$caldate."'"; + WHERE calendardate = '".$CalDate."'"; $ErrMsg = _('Cannot update the MRP Calendar'); $resultupdate = DB_query($sql,$db,$ErrMsg); prnMsg(_("The MRP calendar record for $ChangeDate has been updated"),'success'); @@ -180,16 +178,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { - if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + if ($myrow['manufacturingflag'] == '1') { + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '" . $CalDate . "'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } // End of while @@ -199,24 +197,24 @@ function listall(&$db) //####LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_#### { // List all records in date range - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT calendardate, daynumber, manufacturingflag, DAYNAME(calendardate) as dayname FROM mrpcalendar - WHERE calendardate >='$fromdate' - AND calendardate <='$todate'"; + WHERE calendardate >='" . $FromDate . "' + AND calendardate <='" . $ToDate . "'"; $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo "</br><table class=selection> - <tr BGCOLOR =#800000> - <th>" . _('Date') . "</th> - <th>" . _('Manufacturing Date') . "</th> - </tr></font>"; + echo '</br><table class="selection"> + <tr bgcolor ="#800000"> + <th>' . _('Date') . '</th> + <th>' . _('Manufacturing Date') . '</th> + </tr>'; $ctr = 0; while ($myrow = DB_fetch_array($result)) { $flag = _('Yes'); @@ -251,51 +249,51 @@ $_POST['FromDate']=date($_SESSION['DefaultDateFormat']); $_POST['ToDate']=date($_SESSION['DefaultDateFormat']); } - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post></br></br>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><br /><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br><table class=selection>'; + echo '<br><table class="selection">'; echo '<tr> - <td>' . _('From Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='FromDate' size=10 maxlength=10 value=" . $_POST['FromDate'] . '></td></tr> - <tr></tr><td>' . _('To Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='ToDate' size=10 maxlength=10 value=" . $_POST['ToDate'] . '></td> + <td>' . _('From Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '"></td></tr> + <tr></tr><td>' . _('To Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td>'._('Exclude The Following Days').'</td></tr> <tr> - <td>' . _('Saturday') . ":</td> - <td><input type='checkbox' name='Saturday' value='Saturday'></td> + <td>' . _('Saturday') . ':</td> + <td><input type="checkbox" name="Saturday" value="Saturday"></td> </tr> <tr> - <td>" . _('Sunday') . ":</td> - <td><input type='checkbox' name='Sunday' value='Sunday'></td> + <td>' . _('Sunday') . ':</td> + <td><input type="checkbox" name="Sunday" value="Sunday"></td> </tr> <tr> - <td>" . _('Monday') . ":</td> - <td><input type='checkbox' name='Monday' value='Monday'></td> + <td>' . _('Monday') . ':</td> + <td><input type="checkbox" name="Monday" value="Monday"></td> </tr> <tr> - <td>" . _('Tuesday') . ":</td> - <td><input type='checkbox' name='Tuesday' value='Tuesday'></td> + <td>' . _('Tuesday') . ':</td> + <td><input type="checkbox" name="Tuesday" value="Tuesday"></td> </tr> <tr> - <td>" . _('Wednesday') . ":</td> - <td><input type='checkbox' name='Wednesday' value='Wednesday'></td> + <td>' . _('Wednesday') . ':</td> + <td><input type="checkbox" name="Wednesday" value="Wednesday"></td> </tr> <tr> - <td>" . _('Thursday') . ":</td> - <td><input type='checkbox' name='Thursday' value='Thursday'></td> + <td>' . _('Thursday') . ':</td> + <td><input type="checkbox" name="Thursday" value="Thursday"></td> </tr> <tr> - <td>" . _('Friday') . ":</td> - <td><input type='checkbox' name='Friday' value='Friday'></td> + <td>' . _('Friday') . ':</td> + <td><input type="checkbox" name="Friday" value="Friday"></td> </tr> </table><br> - <div class=centre><input type='submit' name='submit' value='" . _('Create Calendar') . "'> - <input type='submit' name='listall' value='" . _('List Date Range') . "'></div>"; + <div class=centre><input type="submit" name="submit" value="' . _('Create Calendar') . '"> + <input type="submit" name="listall" value="' . _('List Date Range') . '"></div>'; if (!isset($_POST['ChangeDate'])) { $_POST['ChangeDate']=date($_SESSION['DefaultDateFormat']); @@ -303,15 +301,14 @@ echo '<br><table class=selection>'; echo '<tr> - <td>' . _('Change Date Status') . ":</td> - <td><input type='Text' name='ChangeDate' class=date alt='".$_SESSION['DefaultDateFormat'] . - "' size=12 maxlength=12 value=" . $_POST['ChangeDate'] . '></td> + <td>' . _('Change Date Status') . ':</td> + <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . + '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '"></td> <td><input type="submit" name="update" value="' . _('Update') . '"></td></tr></table>'; -echo "</br></br><div class='centre'></div>"; +echo '<br /><br /><div class="centre"></div>'; echo '</form>'; } // End of function display() - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPShortages.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -6,7 +6,7 @@ include('includes/session.inc'); //ANSI SQL??? -$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName']."='mrprequirements'"; +$sql="SHOW TABLES WHERE Tables_in_" . $_SESSION['DatabaseName'] . "='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { @@ -32,48 +32,47 @@ // total for either supply or demand. Did this to simplify main sql where used // several subqueries. - $sql = 'CREATE TEMPORARY TABLE demandtotal ( + $sql = "CREATE TEMPORARY TABLE demandtotal ( part char(20), demand double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of demandtotal failed because')); - $sql = 'INSERT INTO demandtotal + $sql = "INSERT INTO demandtotal (part, demand) SELECT part, SUM(quantity) as demand FROM mrprequirements - GROUP BY part'; + GROUP BY part"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE supplytotal ( + $sql = "CREATE TEMPORARY TABLE supplytotal ( part char(20), supply double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of supplytotal failed because')); /* 21/03/2010: Ricard modification to allow items with total supply = 0 be included in the report */ - $sql = 'INSERT INTO supplytotal + $sql = "INSERT INTO supplytotal (part, supply) SELECT stockid, 0 - FROM stockmaster'; + FROM stockmaster"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal + $sql = "UPDATE supplytotal SET supply = (SELECT SUM(mrpsupplies.supplyquantity) FROM mrpsupplies WHERE supplytotal.part = mrpsupplies.part - AND mrpsupplies.supplyquantity > 0)'; + AND mrpsupplies.supplyquantity > 0)"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal SET supply = 0 WHERE supply IS NULL '; + $sql = "UPDATE supplytotal SET supply = 0 WHERE supply IS NULL"; $result = DB_query($sql,$db); -/* End Ricard modification */ // Only include directdemand mrprequirements so don't have demand for top level parts and also // show demand for the lower level parts that the upper level part generates. See MRP.php for Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFPrintLabel.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -118,15 +118,15 @@ <input type="submit" name="PDFTest" value="'. _('Print labels with borders') .'"></div>'; $iTxt=0; - echo '<script type="text/javascript"> - function setAll(all) { - var x=document.getElementById("form1"); - for (var i=0;i<x.length;i++) { - if (x.elements[i].id==\'item\'); - x.elements[i].checked=all.checked; - } - } - </script>'; + echo "<script type=\"text/javascript\"> + function setAll(all) { + var x=document.getElementById('form1'); + for (var i=0;i<x.length;i++) { + if (x.elements[i].id=='item'); + x.elements[i].checked=all.checked; + } + } + </script>"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' .$txt[$iTxt++].'</p>'; echo '<form name ="form1" action="'.$_SERVER['PHP_SELF'].'" method="POST" id="form1">'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFStockTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -74,7 +74,7 @@ //get the next row which will be the quantity received in the receiving location $myNextRow=DB_fetch_array($result); $ToCode=$myNextRow['loccode']; -$To = $myrow['locationname']; +$To = $myNextRow['locationname']; $Quantity=$myNextRow['qty']; $Description=$myNextRow['description']; Added: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php (rev 0) +++ trunk/ReprintGRN.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -0,0 +1,100 @@ +<?php +/* $Id: ReprintGrn.php 4486 2011-02-08 09:20:50Z daintree $*/ + +include('includes/session.inc'); +$title=_('Reprint a GRN'); +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + $title . '" alt="" />' . ' ' . $title . '</p>'; + +if (!isset($_POST['PONumber'])) { + $_POST['PONumber']=''; +} + +echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<table class="selection">'; +echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>'; +echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>'; +echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>'; +echo '<tr><td colspan=2 style="text-align: center">' . '<input type="submit" name="Show" value="Show GRNs" /></td></tr>'; + +echo '</table>'; +echo '</form>'; + +if (isset($_POST['Show'])) { + if ($_POST['PONumber']=='') { + echo '<br />'; + prnMsg( _('You must enter a purchase order number in the box above'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT count(orderno) + FROM purchorders + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($myrow[0]==0) { + echo '<br />'; + prnMsg( _('This purchase order does not exist on the system. Please try again.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT grnbatch, + grnno, + grns.podetailitem, + grns.itemcode, + grns.itemdescription, + grns.deliverydate, + grns.qtyrecd, + suppliers.suppname, + stockmaster.decimalplaces + FROM grns INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + if (DB_num_rows($result)==0) { + echo '<br />'; + prnMsg( _('There are no GRNs for this purchase order that can be reprinted.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $k=0; + echo '<br /><table class="selection">'; + echo '<tr><th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; + echo '<tr><th>' . _('Supplier') . '</th>'; + echo '<th>' . _('PO Order line') . '</th>'; + echo '<th>' . _('GRN Number') . '</th>'; + echo '<th>' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Delivery Date') . '</th>'; + echo '<th>' . _('Quantity Received') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>' . $myrow['suppname'] . '</td>'; + echo '<td class="number">' . $myrow['podetailitem'] . '</td>'; + echo '<td class="number">' . $myrow['grnbatch'] . '</td>'; + echo '<td>' . $myrow['itemcode'] . '</td>'; + echo '<td>' . $myrow['itemdescription'] . '</td>'; + echo '<td>' . $myrow['deliverydate'] . '</td>'; + echo '<td class="number">' . number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; + echo '<td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>'; + echo '</tr>'; + } + echo '</table>'; +} + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SelectProduct.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -28,10 +28,10 @@ $_POST['StockCode'] = trim(strtoupper($_POST['StockCode'])); } // Always show the search facilities -$SQL = 'SELECT categoryid, +$SQL = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL, $db); if (DB_num_rows($result1) == 0) { echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; @@ -671,7 +671,7 @@ $_POST['PageOffset'] = $ListPageMax; } if ($ListPageMax > 1) { - echo "<div class='centre'><p> " . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<div class="centre"><p> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset">'; $ListPage = 1; while ($ListPage <= $ListPageMax) { Modified: trunk/StockTransferControlled.php =================================================================== --- trunk/StockTransferControlled.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransferControlled.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -72,14 +72,19 @@ $StockID = $LineItem->StockID; $InOutModifier=1; //seems odd, but it's correct $ShowExisting = true; -include ('includes/InputSerialItems.php'); +if (isset($TransferItem)){ + $LineNo=$TransferItem; +} else { + $LineNo=0; +} +include ('includes/OutputSerialItems.php'); /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for adjusting */ -$LineItem->Quantity = $TotalQuantity; +$LineItem->Quantity = $TransferQuantity; /*Also a multi select box for adding bundles to the Transfer without keying */ include('includes/footer.inc'); exit; -?> +?> \ No newline at end of file Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -11,15 +11,19 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +if (isset($_GET['New'])) { + unset($_SESSION['Transfer']); +} + if (isset($_POST['CheckCode'])) { -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Transfer') . '</p>'; if (strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description from stockmaster where description like '%" . $_POST['StockText'] . "%'"; + $sql="SELECT stockid, description from stockmaster where description " . LIKE . " '%" . $_POST['StockText'] . "%'"; } else { - $sql="SELECT stockid, description from stockmaster where stockid like '%" . $_POST['StockCode']."%'"; + $sql="SELECT stockid, description from stockmaster where stockid " . LIKE . " '%" . $_POST['StockCode']."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); @@ -30,7 +34,7 @@ while ($myrow = DB_fetch_row($result)) { echo '<tr><td>'.$myrow[0].'</td> <td>'.$myrow[1].'</td> - <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">Transfer</a></td> + <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">' . _('Transfer') . '</a></td> </tr>'; } echo '</table>'; @@ -43,6 +47,7 @@ if (isset($_GET['NewTransfer'])){ unset($_SESSION['Transfer']); unset($_SESSION['TransferItem']); /*this is defined in bulk transfers but needs to be unset for individual trsnsfers */ + $NewTransfer=$_GET['NewTransfer']; } @@ -73,22 +78,24 @@ materialcost+labourcost+overheadcost as standardcost, controlled, serialised, + perishable, decimalplaces FROM stockmaster WHERE stockid='" . trim(strtoupper($_POST['StockID'])) . "'", $db); - $myrow = DB_fetch_row($result); + if (DB_num_rows($result) == 0){ prnMsg( _('Unable to locate Stock Code').' '.strtoupper($_POST['StockID']), 'error' ); } elseif (DB_num_rows($result)>0){ - - $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), - $myrow[0], - $_POST['Quantity'], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6]); + $myrow = DB_fetch_row($result); + $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), + $myrow['description'], + $_POST['Quantity'], + $myrow['units'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['perishable'], + $myrow['decimalplaces']); $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; @@ -222,7 +229,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity - '" . $Item->BundleQty . "' + SET quantity= quantity - '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' AND serialno='" . $Item->BundleRef . "'"; @@ -235,10 +243,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -334,7 +344,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity + '" . $Item->BundleQty . "' + SET quantity= quantity + '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' AND serialno='" . $Item->BundleRef . "'"; @@ -347,10 +358,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -398,7 +411,7 @@ $Result = DB_Txn_Commit($db); prnMsg(_('An inventory transfer of').' ' . $_SESSION['Transfer']->TransferItem[0]->StockID . ' - ' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFrom . ' '. _('to') . ' ' . $_SESSION['Transfer']->StockLocationTo . ' '._('for a quantity of').' ' . $_SESSION['Transfer']->TransferItem[0]->Quantity,'success'); - echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">Print Transfer Note</a>'; + echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; @@ -406,28 +419,13 @@ } -if (!isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { - $_SESSION['Transfer']->TransferItem[0]->StockID = ' '; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription)) { - $_SESSION['Transfer']->TransferItem[0]->ItemDescription = ''; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->Controlled)) { - $_SESSION['Transfer']->TransferItem[0]->Controlled = ''; -} - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . '</p>'; echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -//echo '<table> -// <tr> -// <td>'. _('Stock Code').':</td> -// <td><input type=text name="StockID" size=21 value="' . $_SESSION['Transfer']->TransferItem[0]->StockID . '" maxlength=20></td> -// <td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td> -// </tr>'; + if (!isset($_GET['Description'])) { $_GET['Description']=''; } @@ -446,13 +444,13 @@ } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; -if (strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ +if (isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription) and strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Transfer']->TransferItem[0]->PartUnit . ' )</font></td></tr>'; } echo '<tr><td>' . _('From Stock Location').':</td><td><select name="StockLocationFrom">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Transfer']->StockLocationFrom)){ @@ -476,13 +474,13 @@ DB_data_seek($resultStkLocs,0); while ($myrow=DB_fetch_array($resultStkLocs)){ - if (isset($_SESSION['Transfer']->StockLocationTo)){ + if (isset($_SESSION['Transfer']) AND isset($_SESSION['Transfer']->StockLocationTo)){ if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationTo){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation'] AND isset($_SESSION['Transfer'])){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_SESSION['Transfer']->StockLocationTo=$myrow['loccode'] . '</option>'; } else { @@ -495,18 +493,18 @@ echo '<tr><td>'._('Transfer Quantity').':</td>'; -if (!isset($_SESSION['Transfer']->TransferItem[0]->Quantity)) { - $_SESSION['Transfer']->TransferItem[0]->Quantity=0; -} - -if ($_SESSION['Transfer']->TransferItem[0]->Controlled==1){ - echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; -} else { +if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled) and $_SESSION['Transfer']->TransferItem[0]->Controlled==1){ + echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . + '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; +} else if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; +} else { + echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; } echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; + if (empty($_SESSION['Transfer']->TransferItem[0]->StockID) and isset($_POST['StockID'])) { $StockID=$_POST['StockID']; } else if (isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { @@ -514,13 +512,13 @@ } else { $StockID=''; } - -echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; - +if (isset($_SESSION['Transfer'])) { + echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; +} echo '</div></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SupplierInvoice.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -510,7 +510,7 @@ echo '<br /><table class=selection> <tr> <td>' . _('Comments') . '</td> - <td><TEXTAREA name=Comments COLS=40 ROWS=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td> + <td><textarea name="Comments" cols="40" rows="2">' . $_SESSION['SuppTrans']->Comments . '</textarea></td> </tr> </table>'; @@ -550,8 +550,8 @@ $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the total amount of the invoice is less than 0') . '. ' . _('Invoices are expected to have a positive charge'),'error'); - echo '<p> The tax total is : ' . $TaxTotal; - echo '<p> The ovamount is : ' . $_SESSION['SuppTrans']->OvAmount; + echo '<p>' . _('The tax total is') . ' : ' . $TaxTotal; + echo '<p>' . _('The ovamount is') . ' : ' . $_SESSION['SuppTrans']->OvAmount; } elseif ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount == 0){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p> +<p>10/4/11 Tim: +<p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> +<p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> +<p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> <p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> <p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> <p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> Modified: trunk/includes/DefineLabelClass.php =================================================================== --- trunk/includes/DefineLabelClass.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineLabelClass.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,25 +1,25 @@ <?php define('MAX_LINES_PER_LABEL', 5); -define('LABELS_FILE', $_SESSION['reports_dir'] . "/labels.xml"); +define('LABELS_FILE', $_SESSION['reports_dir'] . '/labels.xml'); /** * These tags contains the more general data of the labels */ $GlobalTags = array('id'=>array('desc'=> _('Label id'), - 'type'=>'t', - 'sz'=>8, - 'maxsz'=>12), // text - 'description'=>array('desc'=>_('Description'), - 'type'=>'t', - 'sz'=>15, - 'maxsz'=>30) // text -); + 'type'=>'t', + 'sz'=>8, + 'maxsz'=>12), // text + 'description'=>array('desc'=>_('Description'), + 'type'=>'t', + 'sz'=>15, + 'maxsz'=>30) // text + ); /** * These tags specifies the dimension of individual label */ $DimensionTags = array( 'Unit'=>array('desc'=>_('Units'),'type'=>'s', - 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select + 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select 'Rows'=>array('desc'=>_('Rows per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), // integer numeric 'Cols'=>array('desc'=>_('Cols per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), 'Sh'=>array('desc'=>_('Sheet height'),'type'=>'n','sz'=>5,'maxsz'=>8), // float numeric @@ -164,8 +164,10 @@ * @return nothing */ function abortMsg($msg) { - global $rootpath, $DefaultClock, $Version; + global $rootpath, $DefaultClock, $Version, $theme; + $title=_('No label templates exist'); include ('includes/header.inc'); + echo '<br />'; prnMsg( $msg, 'error'); include ('includes/footer.inc'); exit; Modified: trunk/includes/DefineStockTransfers.php =================================================================== --- trunk/includes/DefineStockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineStockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -33,13 +33,14 @@ class LineItem { var $StockID; var $ItemDescription; - Var $ShipQty; - Var $PrevRecvQty; - Var $Quantity; - Var $PartUnit; + var $ShipQty; + var $PrevRecvQty; + var $Quantity; + var $PartUnit; var $Controlled; var $Serialised; - Var $DecimalPlaces; + var $DecimalPlaces; + var $Perishable; var $SerialItems; /*array to hold controlled items*/ //Constructor function LineItem($StockID, @@ -48,6 +49,7 @@ $PartUnit, $Controlled, $Serialised, + $Perishable, $DecimalPlaces){ $this->StockID = $StockID; @@ -56,6 +58,7 @@ $this->Controlled = $Controlled; $this->Serialised = $Serialised; $this->DecimalPlaces = $DecimalPlaces; + $this->Perishable = $Perishable; $this->ShipQty = $Quantity; if ($this->Controlled==1){ $this->Quantity = 0; Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/OutputSerialItems.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -17,9 +17,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; $sql="SELECT perishable FROM stockmaster @@ -95,8 +95,9 @@ echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + + $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } @@ -114,13 +115,13 @@ /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; - +$TransferQuantity=$TotalQuantity; /*in the first column add a table for the input of newies */ echo '<table class=selection>'; echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name=LineNo value="' . $LineNo . '"> <input type=hidden name=StockID value="' . $StockID . '"> <input type=hidden name=EntryType value="KEYED">'; @@ -161,12 +162,18 @@ } } +if (isset($_SESSION['Transfer']->StockLocationFrom)) { + $Location=$_SESSION['Transfer']->StockLocationFrom; +} else if (isset($_SESSION['Items']->Location)) { + $Location=$_SESSION['Items']->Location; +} + $sql="SELECT serialno, quantity, expirationdate FROM stockserialitems WHERE stockid='".$StockID."' - AND loccode='".$_SESSION['Items']->Location."'"; + AND loccode='" . $Location . "'"; $result=DB_query($sql, $db); $RowNumber=0; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/index.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 1; now comes from DB scripts table - include('includes/session.inc'); $title=_('Main Menu'); @@ -581,12 +579,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes' . SID . '">' . _('Inventory Adjustments') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 10:41:20 UTC (rev 4545) @@ -841,4 +841,4 @@ ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; DELETE FROM scripts WHERE script='PDFStockTransListing.php'; INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); -IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; +UPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |