Skip to content

Commit

Permalink
fix the bug of wrong affected scope of bom changing in BOMs.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ExsonQu2018 committed Apr 26, 2018
1 parent 74ac6b4 commit 9e8585e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BOMs.php
Expand Up @@ -367,7 +367,7 @@ function DisplayBOMItems($UltimateParent, $Parent, $Component,$Level) {
$result = DB_query($sql,$ErrMsg,$DbgMsg);
$msg = _('Details for') . ' - ' . $SelectedComponent . ' ' . _('have been updated') . '.';
if ($_SESSION['WeightedAverageCosting'] != 1) {
UpdateCost($SelectedComponent);
UpdateCost($SelectedParent);
}

} elseif ($InputError !=1 AND ! isset($SelectedComponent) AND isset($SelectedParent)) {
Expand Down Expand Up @@ -425,7 +425,7 @@ function DisplayBOMItems($UltimateParent, $Parent, $Component,$Level) {
$result = DB_query($sql,$ErrMsg,$DbgMsg);

if ($_SESSION['WeightedAverageCosting'] != 1) {
UpdateCost($_POST['Component']);
UpdateCost($SelectedParent);
}
$msg = _('A new component part') . ' ' . $_POST['Component'] . ' ' . _('has been added to the bill of material for part') . ' - ' . $SelectedParent . '.';

Expand Down Expand Up @@ -465,7 +465,7 @@ function DisplayBOMItems($UltimateParent, $Parent, $Component,$Level) {
$ComponentArray = DB_fetch_row($ComponentResult);

if ($_SESSION['WeightedAverageCosting'] != 1) {//only update the cost for standard cost
UpdateCost($ComponentArray[0]);
UpdateCost($SelectedParent);
}

prnMsg(_('The component part') . ' - ' . $SelectedComponent . ' - ' . _('has been deleted from this BOM'),'success');
Expand Down

0 comments on commit 9e8585e

Please sign in to comment.