From: <rc...@us...> - 2013-08-31 14:49:23
|
Revision: 6313 http://sourceforge.net/p/web-erp/reponame/6313 Author: rchacon Date: 2013-08-31 14:49:20 +0000 (Sat, 31 Aug 2013) Log Message: ----------- Minor change: Adding space between 'PO' and OrderNo. Modified Paths: -------------- trunk/GoodsReceived.php Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2013-08-30 21:08:37 UTC (rev 6312) +++ trunk/GoodsReceived.php 2013-08-31 14:49:20 UTC (rev 6313) @@ -673,7 +673,7 @@ $_POST['DefaultReceivedDate'] . "','" . $PeriodNo . "','" . $OrderLine->GLCode . "','" . - _('PO') . $_SESSION['PO'.$identifier]->OrderNo . ': ' . $_SESSION['PO'.$identifier]->SupplierID . ' - ' . $OrderLine->StockID . ' - ' . DB_escape_string($OrderLine->ItemDescription) . ' x ' . $OrderLine->ReceiveQty . " @ " . locale_number_format($CurrentStandardCost,$_SESSION['CompanyRecord']['decimalplaces']) . "','" . + _('PO') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ': ' . $_SESSION['PO'.$identifier]->SupplierID . ' - ' . $OrderLine->StockID . ' - ' . DB_escape_string($OrderLine->ItemDescription) . ' x ' . $OrderLine->ReceiveQty . " @ " . locale_number_format($CurrentStandardCost,$_SESSION['CompanyRecord']['decimalplaces']) . "','" . $CurrentStandardCost * $OrderLine->ReceiveQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase GL posting could not be inserted because'); @@ -695,7 +695,7 @@ $_POST['DefaultReceivedDate'] . "','" . $PeriodNo . "','" . $_SESSION['CompanyRecord']['grnact'] . "','" . - _('PO') . $_SESSION['PO'.$identifier]->OrderNo . ': ' . $_SESSION['PO'.$identifier]->SupplierID . ' - ' . $OrderLine->StockID . ' - ' . DB_escape_string($OrderLine->ItemDescription) . ' x ' . $OrderLine->ReceiveQty . ' @ ' . locale_number_format($UnitCost,$_SESSION['CompanyRecord']['decimalplaces']) . "','" . + _('PO') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ': ' . $_SESSION['PO'.$identifier]->SupplierID . ' - ' . $OrderLine->StockID . ' - ' . DB_escape_string($OrderLine->ItemDescription) . ' x ' . $OrderLine->ReceiveQty . ' @ ' . locale_number_format($UnitCost,$_SESSION['CompanyRecord']['decimalplaces']) . "','" . -$UnitCost * $OrderLine->ReceiveQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN suspense side of the GL posting could not be inserted because'); |
From: <ex...@us...> - 2014-03-18 05:21:05
|
Revision: 6616 http://sourceforge.net/p/web-erp/reponame/6616 Author: exsonqu Date: 2014-03-18 05:21:00 +0000 (Tue, 18 Mar 2014) Log Message: ----------- 18/03/14 Exson: Fixed the bugs in GoodsReceived.php which will leads to duplicated goods receiving. Modified Paths: -------------- trunk/GoodsReceived.php Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2014-03-17 21:29:05 UTC (rev 6615) +++ trunk/GoodsReceived.php 2014-03-18 05:21:00 UTC (rev 6616) @@ -304,7 +304,19 @@ $Changes=0; $LineNo=1; + if(DB_num_rows($Result)==0){//Those goods must have been received by another user. So should destroy the session data and show warning to users + prnMsg(_('This order has been changed or invoiced since this delivery was started to be actioned').' . '._('Processing halted'),'error'); + echo '<div class="centre"><a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' . + _('Select a different purchase order for receiving goods against') . '</a></div>'; + unset($_SESSION['PO'.$identifier]->LineItems); + unset($_SESSION['PO'.$identifier]); + unset($_POST['ProcessGoodsReceived']); + echo '</div>'; + echo '</form>'; + include ('includes/footer.inc'); + exit; + } while ($myrow = DB_fetch_array($Result)) { if ($_SESSION['PO'.$identifier]->LineItems[$LineNo]->GLCode != $myrow['glcode'] OR |
From: <ex...@us...> - 2015-03-11 02:45:55
|
Revision: 7215 http://sourceforge.net/p/web-erp/reponame/7215 Author: exsonqu Date: 2015-03-11 02:45:48 +0000 (Wed, 11 Mar 2015) Log Message: ----------- 11/3/15 Exson: Fixed wrong handling for dummy parts receiving from PO in GoodsReceived.php. Modified Paths: -------------- trunk/GoodsReceived.php Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2015-03-10 15:28:27 UTC (rev 7214) +++ trunk/GoodsReceived.php 2015-03-11 02:45:48 UTC (rev 7215) @@ -403,7 +403,7 @@ if ($OrderLine->StockID!='') { //Its a stock item line /*Need to get the current standard cost as it is now so we can process GL jorunals later*/ - $SQL = "SELECT materialcost + labourcost + overheadcost as stdcost + $SQL = "SELECT materialcost + labourcost + overheadcost as stdcost,mbflag FROM stockmaster WHERE stockid='" . $OrderLine->StockID . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The standard cost of the item being received cannot be retrieved because'); @@ -411,24 +411,29 @@ $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); $myrow = DB_fetch_row($Result); - - if ($OrderLine->QtyReceived==0){ //its the first receipt against this line - $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = $myrow[0]; + if($myrow[1] != 'D') { + if ($OrderLine->QtyReceived==0){ //its the first receipt against this line + $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = $myrow[0]; + } + $CurrentStandardCost = $myrow[0]; + /*Set the purchase order line stdcostunit = weighted average / standard cost used for all receipts of this line + This assures that the quantity received against the purchase order line multiplied by the weighted average of standard + costs received = the total of standard cost posted to GRN suspense*/ + $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = (($CurrentStandardCost * $OrderLine->ReceiveQty) + ($_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost * $OrderLine->QtyReceived)) / ($OrderLine->ReceiveQty + $OrderLine->QtyReceived); + } elseif ($myrow[1] == 'D') { //it's a dummy part which without stock. + $Dummy = true; + if($OrderLine->QtyReceived == 0){//There is + $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = $LocalCurrencyPrice; + } } - $CurrentStandardCost = $myrow[0]; - /*Set the purchase order line stdcostunit = weighted average / standard cost used for all receipts of this line - This assures that the quantity received against the purchase order line multiplied by the weighted average of standard - costs received = the total of standard cost posted to GRN suspense*/ - $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = (($CurrentStandardCost * $OrderLine->ReceiveQty) + ($_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost *$OrderLine->QtyReceived)) / ($OrderLine->ReceiveQty + $OrderLine->QtyReceived); - } elseif ($OrderLine->QtyReceived==0 AND $OrderLine->StockID=='') { /*Its a nominal item being received */ /*Need to record the value of the order per unit in the standard cost field to ensure GRN account entries clear */ $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = $LocalCurrencyPrice; } - if ($OrderLine->StockID=='') { /*Its a NOMINAL item line */ + if ($OrderLine->StockID=='' OR !empty($Dummy)) { /*Its a NOMINAL item line */ $CurrentStandardCost = $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost; } @@ -452,7 +457,7 @@ $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); - if ($OrderLine->StockID !=''){ /*Its a stock item so use the standard cost for the journals */ + if ($OrderLine->StockID !='' AND !isset($Dummy)){ /*Its a stock item so use the standard cost for the journals */ $UnitCost = $CurrentStandardCost; } else { /*otherwise its a nominal PO item so use the purchase cost converted to local currency */ $UnitCost = $OrderLine->Price / $_SESSION['PO'.$identifier]->ExRate; |