From: <ex...@us...> - 2015-12-28 03:47:46
|
Revision: 7431 http://sourceforge.net/p/web-erp/reponame/7431 Author: exsonqu Date: 2015-12-28 03:47:44 +0000 (Mon, 28 Dec 2015) Log Message: ----------- 28/12/15 Exson: Fixed the bug that discount not modified for items whose discount is null in discount matrix in SelectOrderItems.php. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2015-12-28 02:56:23 UTC (rev 7430) +++ trunk/SelectOrderItems.php 2015-12-28 03:47:44 UTC (rev 7431) @@ -1131,7 +1131,7 @@ } else { $DiscountMatrixRate = $myrow[0]; } - if ($myrow[0]!=0){ /* need to update the lines affected */ + if ($DiscountMatrixRate!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; @@ -1270,9 +1270,11 @@ } else { $DiscountMatrixRate = $myrow[0]; } - foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { - if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ - $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; + if ($DiscountMatrixRate != 0) { + foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { + if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ + $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; + } } } } |