From: <Ex...@us...> - 2012-03-01 23:30:06
|
Revision: 4999 http://web-erp.svn.sourceforge.net/web-erp/?rev=4999&view=rev Author: ExsonQu Date: 2012-03-01 23:29:59 +0000 (Thu, 01 Mar 2012) Log Message: ----------- March 2, 2012 Add gettext function to string (New Component Details) at BOMs.php. Report and fixed by James Dupin Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2012-03-01 09:08:34 UTC (rev 4998) +++ trunk/BOMs.php 2012-03-01 23:29:59 UTC (rev 4999) @@ -610,7 +610,7 @@ */ echo '<table class="selection">'; echo '<tr> - <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . ('New Component Details') .'</font></b></th> + <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . _('New Component Details') .'</font></b></th> </tr>'; echo '<tr> <td>' . _('Component code') . ':</td> @@ -906,4 +906,4 @@ } //end StockID already selected include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-01 23:30:06
|
Revision: 4999 http://web-erp.svn.sourceforge.net/web-erp/?rev=4999&view=rev Author: ExsonQu Date: 2012-03-01 23:29:59 +0000 (Thu, 01 Mar 2012) Log Message: ----------- March 2, 2012 Add gettext function to string (New Component Details) at BOMs.php. Report and fixed by James Dupin Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2012-03-01 09:08:34 UTC (rev 4998) +++ trunk/BOMs.php 2012-03-01 23:29:59 UTC (rev 4999) @@ -610,7 +610,7 @@ */ echo '<table class="selection">'; echo '<tr> - <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . ('New Component Details') .'</font></b></th> + <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . _('New Component Details') .'</font></b></th> </tr>'; echo '<tr> <td>' . _('Component code') . ':</td> @@ -906,4 +906,4 @@ } //end StockID already selected include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-13 02:01:16
|
Revision: 5099 http://web-erp.svn.sourceforge.net/web-erp/?rev=5099&view=rev Author: ExsonQu Date: 2012-03-13 02:01:10 +0000 (Tue, 13 Mar 2012) Log Message: ----------- 13/3/2012 Exson: Fixed that same parent and component but added in different Work Centers and Locations will display twice in BOMs.php. And fixed that to delete one line of same parents and component will delete all lines with same parents and components. Add ArrayUnique function to get unique array for multi-dimensional array. Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2012-03-13 01:27:21 UTC (rev 5098) +++ trunk/BOMs.php 2012-03-13 02:01:10 UTC (rev 5099) @@ -73,7 +73,9 @@ $sql = "SELECT bom.component, stockmaster.description as itemdescription, locations.locationname, + locations.loccode, workcentres.description as workcentrename, + workcentres.code as workcentrecode, bom.quantity, bom.effectiveafter, bom.effectiveto, @@ -148,7 +150,7 @@ <td class="number">%s</td> <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> <td>'.$DrillText.'</td> - <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td> + <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s&Location=%s&WorkCentre=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td> </tr>', $Level1, $myrow['component'], @@ -168,7 +170,9 @@ htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', $Parent, $myrow['component'], - $UltimateParent); + $UltimateParent, + $myrow['loccode'], + $myrow['workcentrecode']); } //END WHILE LIST LOOP } //end of function DisplayBOMItems @@ -356,7 +360,9 @@ $sql="DELETE FROM bom WHERE parent='".$SelectedParent."' - AND component='".$SelectedComponent."'"; + AND component='".$SelectedComponent."' + AND loccode='".$Location."' + AND workcentreadded='".$WorkCentre."'"; $ErrMsg = _('Could not delete this BOM components because'); $DbgMsg = _('The SQL used to delete the BOM was'); @@ -548,7 +554,7 @@ $UltimateParent = $SelectedParent; $k = 0; $RowCounter = 1; - + $BOMTree = arrayUnique($BOMTree); foreach($BOMTree as $BOMItem){ $Level = $BOMItem['Level']; $Parent = $BOMItem['Parent']; @@ -909,7 +915,32 @@ echo '</div>'; echo '</form>'; -} //end StockID already selected + } //end StockID already selected +// This function created by Dominik Jungowski on PHP developer blog +function arrayUnique($array, $preserveKeys = false) +{ + //Unique Array for return + $arrayRewrite = array(); + //Array with the md5 hashes + $arrayHashes = array(); + foreach($array as $key => $item) { + // Serialize the current element and create a md5 hash + $hash = md5(serialize($item)); + // If the md5 didn't come up yet, add the element to + // arrayRewrite, otherwise drop it + if (!isset($arrayHashes[$hash])) { + // Save the current element hash + $arrayHashes[$hash] = $hash; + //Add element to the unique Array + if ($preserveKeys) { + $arrayRewrite[$key] = $item; + } else { + $arrayRewrite[] = $item; + } + } + } + return $arrayRewrite; +} include('includes/footer.inc'); ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-13 02:01:16
|
Revision: 5099 http://web-erp.svn.sourceforge.net/web-erp/?rev=5099&view=rev Author: ExsonQu Date: 2012-03-13 02:01:10 +0000 (Tue, 13 Mar 2012) Log Message: ----------- 13/3/2012 Exson: Fixed that same parent and component but added in different Work Centers and Locations will display twice in BOMs.php. And fixed that to delete one line of same parents and component will delete all lines with same parents and components. Add ArrayUnique function to get unique array for multi-dimensional array. Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2012-03-13 01:27:21 UTC (rev 5098) +++ trunk/BOMs.php 2012-03-13 02:01:10 UTC (rev 5099) @@ -73,7 +73,9 @@ $sql = "SELECT bom.component, stockmaster.description as itemdescription, locations.locationname, + locations.loccode, workcentres.description as workcentrename, + workcentres.code as workcentrecode, bom.quantity, bom.effectiveafter, bom.effectiveto, @@ -148,7 +150,7 @@ <td class="number">%s</td> <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> <td>'.$DrillText.'</td> - <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td> + <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s&Location=%s&WorkCentre=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td> </tr>', $Level1, $myrow['component'], @@ -168,7 +170,9 @@ htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', $Parent, $myrow['component'], - $UltimateParent); + $UltimateParent, + $myrow['loccode'], + $myrow['workcentrecode']); } //END WHILE LIST LOOP } //end of function DisplayBOMItems @@ -356,7 +360,9 @@ $sql="DELETE FROM bom WHERE parent='".$SelectedParent."' - AND component='".$SelectedComponent."'"; + AND component='".$SelectedComponent."' + AND loccode='".$Location."' + AND workcentreadded='".$WorkCentre."'"; $ErrMsg = _('Could not delete this BOM components because'); $DbgMsg = _('The SQL used to delete the BOM was'); @@ -548,7 +554,7 @@ $UltimateParent = $SelectedParent; $k = 0; $RowCounter = 1; - + $BOMTree = arrayUnique($BOMTree); foreach($BOMTree as $BOMItem){ $Level = $BOMItem['Level']; $Parent = $BOMItem['Parent']; @@ -909,7 +915,32 @@ echo '</div>'; echo '</form>'; -} //end StockID already selected + } //end StockID already selected +// This function created by Dominik Jungowski on PHP developer blog +function arrayUnique($array, $preserveKeys = false) +{ + //Unique Array for return + $arrayRewrite = array(); + //Array with the md5 hashes + $arrayHashes = array(); + foreach($array as $key => $item) { + // Serialize the current element and create a md5 hash + $hash = md5(serialize($item)); + // If the md5 didn't come up yet, add the element to + // arrayRewrite, otherwise drop it + if (!isset($arrayHashes[$hash])) { + // Save the current element hash + $arrayHashes[$hash] = $hash; + //Add element to the unique Array + if ($preserveKeys) { + $arrayRewrite[$key] = $item; + } else { + $arrayRewrite[] = $item; + } + } + } + return $arrayRewrite; +} include('includes/footer.inc'); ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Tu...@us...> - 2012-06-10 03:44:55
|
Revision: 5435 http://web-erp.svn.sourceforge.net/web-erp/?rev=5435&view=rev Author: TurboPT Date: 2012-06-10 03:44:49 +0000 (Sun, 10 Jun 2012) Log Message: ----------- Fix a two part problem relative to a select-tag handling for work centres: 1. The error message about not having any work centres set up was not being displayed. 2. The handing for that message caused the footer to be displayed with [inside] the "New Component Details" table. Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2012-06-10 03:40:00 UTC (rev 5434) +++ trunk/BOMs.php 2012-06-10 03:44:49 UTC (rev 5435) @@ -704,19 +704,20 @@ echo '</select></td> </tr> <tr> - <td>' . _('Work Centre Added') . ': </td> - <td><select tabindex="3" name="WorkCentreAdded">'; + <td>' . _('Work Centre Added') . ': </td><td>'; $sql = "SELECT code, description FROM workcentres"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ - prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres'),'warn'); - echo '<br /><a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre Maintenance') . '</a>'; + prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres') . '.','warn'); + echo '<a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre Maintenance') . '</a></td></tr></table><br />'; include('includes/footer.inc'); exit; } + echo '<select tabindex="3" name="WorkCentreAdded">'; + while ($myrow = DB_fetch_array($result)) { if (isset($_POST['WorkCentreAdded']) and $myrow['code']==$_POST['WorkCentreAdded']) { echo '<option selected="selected" value="'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Tu...@us...> - 2012-06-10 03:44:55
|
Revision: 5435 http://web-erp.svn.sourceforge.net/web-erp/?rev=5435&view=rev Author: TurboPT Date: 2012-06-10 03:44:49 +0000 (Sun, 10 Jun 2012) Log Message: ----------- Fix a two part problem relative to a select-tag handling for work centres: 1. The error message about not having any work centres set up was not being displayed. 2. The handing for that message caused the footer to be displayed with [inside] the "New Component Details" table. Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2012-06-10 03:40:00 UTC (rev 5434) +++ trunk/BOMs.php 2012-06-10 03:44:49 UTC (rev 5435) @@ -704,19 +704,20 @@ echo '</select></td> </tr> <tr> - <td>' . _('Work Centre Added') . ': </td> - <td><select tabindex="3" name="WorkCentreAdded">'; + <td>' . _('Work Centre Added') . ': </td><td>'; $sql = "SELECT code, description FROM workcentres"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ - prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres'),'warn'); - echo '<br /><a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre Maintenance') . '</a>'; + prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres') . '.','warn'); + echo '<a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre Maintenance') . '</a></td></tr></table><br />'; include('includes/footer.inc'); exit; } + echo '<select tabindex="3" name="WorkCentreAdded">'; + while ($myrow = DB_fetch_array($result)) { if (isset($_POST['WorkCentreAdded']) and $myrow['code']==$_POST['WorkCentreAdded']) { echo '<option selected="selected" value="'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ice...@us...> - 2013-08-27 01:53:45
|
Revision: 6295 http://sourceforge.net/p/web-erp/reponame/6295 Author: icedlava Date: 2013-08-27 01:53:41 +0000 (Tue, 27 Aug 2013) Log Message: ----------- Allow display of new component form after deletion of BOM component - else too much work to get back to item to add one. Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2013-08-27 01:44:57 UTC (rev 6294) +++ trunk/BOMs.php 2013-08-27 01:53:41 UTC (rev 6295) @@ -390,8 +390,8 @@ UpdateCost($db, $ComponentArray[0]); prnMsg(_('The component part') . ' - ' . $SelectedComponent . ' - ' . _('has been deleted from this BOM'),'success'); - // Now reselect - + // Now reset to enable New Component Details to display after delete + unset($_GET['SelectedComponent']); } elseif (isset($SelectedParent) AND !isset($SelectedComponent) AND ! isset($_POST['submit'])) { @@ -586,9 +586,8 @@ } echo '</table> <br />'; + /* We do want to show the new component entry form in any case - it is a lot of work to get back to it otherwise if we need to add */ - if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select=' . $SelectedParent .'">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -793,7 +792,6 @@ </div> </form>'; - } //end if record deleted no point displaying form to add record // end of BOM maintenance code - look at the parent selection form if not relevant // ---------------------------------------------------------------------------------- |
From: <te...@us...> - 2014-09-05 00:55:12
|
Revision: 6862 http://sourceforge.net/p/web-erp/reponame/6862 Author: tehonu Date: 2014-09-05 00:55:09 +0000 (Fri, 05 Sep 2014) Log Message: ----------- Added UOM field Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2014-09-01 09:47:13 UTC (rev 6861) +++ trunk/BOMs.php 2014-09-05 00:55:09 UTC (rev 6862) @@ -72,6 +72,7 @@ $sql = "SELECT bom.sequence, bom.component, stockmaster.description as itemdescription, + stockmaster.units, locations.locationname, locations.loccode, workcentres.description as workcentrename, @@ -149,6 +150,7 @@ <td>%s</td> <td>%s</td> <td>%s</td> + <td>%s</td> <td class="number">%s</td> <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> <td>' . $DrillText . '</td> @@ -161,6 +163,7 @@ $myrow['locationname'], $myrow['workcentrename'], locale_number_format($myrow['quantity'],'Variable'), + $myrow['units'], ConvertSQLDate($myrow['effectiveafter']), ConvertSQLDate($myrow['effectiveto']), $AutoIssue, @@ -563,6 +566,7 @@ <th>' . _('Location') . '</th> <th>' . _('Work Centre') . '</th> <th>' . _('Quantity') . '</th> + <th>' . _('UOM') . '</th> <th>' . _('Effective After') . '</th> <th>' . _('Effective To') . '</th> <th>' . _('Auto Issue') . '</th> |
From: <te...@us...> - 2014-09-16 00:12:29
|
Revision: 6890 http://sourceforge.net/p/web-erp/reponame/6890 Author: tehonu Date: 2014-09-16 00:12:22 +0000 (Tue, 16 Sep 2014) Log Message: ----------- Use of usedforwo location flag in BOM Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2014-09-15 05:11:09 UTC (rev 6889) +++ trunk/BOMs.php 2014-09-16 00:12:22 UTC (rev 6890) @@ -706,7 +706,14 @@ <td><select tabindex="2" name="LocCode">'; DB_free_result($result); - $sql = "SELECT locationname, locations.loccode FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; + $sql = "SELECT locationname, + locations.loccode + FROM locations + INNER JOIN locationusers + ON locationusers.loccode=locations.loccode + AND locationusers.userid='" . $_SESSION['UserID'] . "' + AND locationusers.canupd=1 + WHERE locations.usedforwo = 1"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { |
From: <ex...@us...> - 2016-09-10 09:08:01
|
Revision: 7617 http://sourceforge.net/p/web-erp/reponame/7617 Author: exsonqu Date: 2016-09-10 09:07:58 +0000 (Sat, 10 Sep 2016) Log Message: ----------- 10/09/16 Exson: Add error proof to avoid the component and the parent is the same while preparing a bom and display those wrong bom created in BOMs.php. Modified Paths: -------------- trunk/BOMs.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2016-09-04 10:27:23 UTC (rev 7616) +++ trunk/BOMs.php 2016-09-10 09:07:58 UTC (rev 7617) @@ -39,6 +39,11 @@ // child's children $i++; display_children($row['component'], $Level + 1, $BOMTree); + } else { + prnMsg(_('The component and the parent is the same'),'error'); + echo $row['component'] . '<br/>'; + include('includes/footer.inc'); + exit; } } } @@ -329,6 +334,11 @@ $_POST['AutoIssue']=0; } } + if ($_POST['Component'] == $SelectedParent) { + $InputError = 1; + prnMsg(_('The component selected is the same with the parent, it is not allowed'),'error'); + $Errors[$i] = 'Component'; + } if (!in_array('EffectiveAfter', $Errors)) { $EffectiveAfterSQL = FormatDateForSQL($_POST['EffectiveAfter']); |