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']); |