From: <tim...@us...> - 2010-07-01 18:10:16
|
Revision: 3538 http://web-erp.svn.sourceforge.net/web-erp/?rev=3538&view=rev Author: tim_schofield Date: 2010-07-01 17:10:13 +0000 (Thu, 01 Jul 2010) Log Message: ----------- Numerous problems with stock adjustments for batch controlled items. Modified Paths: -------------- trunk/StockAdjustments.php trunk/StockAdjustmentsControlled.php trunk/doc/Change.log.html trunk/includes/Add_SerialItems.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php trunk/index.php Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2010-07-01 17:09:45 UTC (rev 3537) +++ trunk/StockAdjustments.php 2010-07-01 17:10:13 UTC (rev 3538) @@ -13,12 +13,12 @@ include('includes/SQL_CommonFunctions.inc'); if (isset($_GET['NewAdjustment'])){ - unset($_SESSION['Adjustment']); - $_SESSION['Adjustment'] = new StockAdjustment; + unset($_SESSION['Adjustment']); + $_SESSION['Adjustment'] = new StockAdjustment; } if (!isset($_SESSION['Adjustment'])){ - $_SESSION['Adjustment'] = new StockAdjustment; + $_SESSION['Adjustment'] = new StockAdjustment; } $NewAdjustment = false; @@ -27,7 +27,7 @@ $_SESSION['Adjustment']->StockID = trim(strtoupper($_GET['StockID'])); $NewAdjustment = true; } elseif (isset($_POST['StockID'])){ - if ($_POST['StockID'] != $_SESSION['Adjustment']->StockID){ + if(isset($_POST['StockID']) and $_POST['StockID'] != $_SESSION['Adjustment']->StockID){ $NewAdjustment = true; $_SESSION['Adjustment']->StockID = trim(strtoupper($_POST['StockID'])); } @@ -39,6 +39,9 @@ $_SESSION['Adjustment']->Quantity = $_POST['Quantity']; } +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + _('Inventory Adjustment') . '" alt="">' . ' ' . _('Inventory Adjustment') . '</p>'; + if ($NewAdjustment){ $sql ="SELECT description, @@ -55,7 +58,7 @@ $myrow = DB_fetch_row($result); if (DB_num_rows($result)==0){ - prnMsg( _('Unable to locate Stock Code').' '.$_SESSION['Adjustment']->StockID, 'error' ); + prnMsg( _('Unable to locate Stock Code').' '.$_SESSION['Adjustment']->StockID, 'error' ); unset($_SESSION['Adjustment']); } elseif (DB_num_rows($result)>0){ @@ -305,7 +308,7 @@ $Controlled = $_SESSION['Adjustment']->Controlled; $Quantity = $_SESSION['Adjustment']->Quantity; } -echo '<table><tr><td>'. _('Stock Code'). ':</td><td><input type=text name="StockID" size=21 value="' . $StockID . '" maxlength=20> <input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; +echo '<br><table class=selection><tr><td>'. _('Stock Code'). ':</td><td><input type=text name="StockID" size=21 value="' . $StockID . '" maxlength=20> <input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; if (isset($_SESSION['Adjustment']) and strlen($_SESSION['Adjustment']->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Adjustment']->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Adjustment']->PartUnit . ' ) - ' . _('Unit Cost').' = ' . $_SESSION['Adjustment']->StandardCost . '</font></td></tr>'; @@ -318,9 +321,9 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Adjustment']->StockLocation)){ if ($myrow['loccode'] == $_SESSION['Adjustment']->StockLocation){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; Modified: trunk/StockAdjustmentsControlled.php =================================================================== --- trunk/StockAdjustmentsControlled.php 2010-07-01 17:09:45 UTC (rev 3537) +++ trunk/StockAdjustmentsControlled.php 2010-07-01 17:10:13 UTC (rev 3538) @@ -20,7 +20,7 @@ exit; } if (isset($_SESSION['Adjustment'])){ - if ($_GET['AdjType']!=''){ + if (isset($_GET['AdjType']) and $_GET['AdjType']!=''){ $_SESSION['Adjustment']->AdjustmentType = $_GET['AdjType']; } } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-01 17:09:45 UTC (rev 3537) +++ trunk/doc/Change.log.html 2010-07-01 17:10:13 UTC (rev 3538) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>01/07/10 Tim: Numerous problems with stock adjustments for batch controlled items.</p> <p>01/07/10 Tim: DateFunctions.inc - Correction to GetPeriod() for case when future period didn't exist.</p> <p>30/06/10 Phil: Resolution of GL posting problem - removed INSERTs of new chartdetails from DateFunctions.inc CreatePeriod function and GLAccounts.php when adding a new GL account. Now all chartdetails are created from includes/GLPostings.inc and correct bfwd balances updated as they should be - I hope this solves this long outstanding previously unsquashable bug!!</p> <p>25/06/10 Tim: PDFPriceList.php - Layout improvements.</p> Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2010-07-01 17:09:45 UTC (rev 3537) +++ trunk/includes/Add_SerialItems.php 2010-07-01 17:10:13 UTC (rev 3538) @@ -72,7 +72,9 @@ } /* end if posted Serialno . i is not blank */ } /* end of the loop aroung the form input fields */ - + if (!isset($_POST['Bundles'])) { + $_POST['Bundles']=0; + } for ($i=0;$i < count($_POST['Bundles']);$i++){ /*there is an entry in the multi select list box */ if ($LineItem->Serialised==1){ /*only if the item is serialised */ $LineItem->SerialItems[$_POST['Bundles'][$i]] = new SerialItem ($_POST['Bundles'][$i], ($InOutModifier>0?1:-1) ); @@ -119,7 +121,7 @@ Validate an uploaded FILE and save entries ********************************************/ $valid = true; -if ($_POST['EntryType']=='FILE' && isset($_POST['ValidateFile'])){ +if (isset($_POST['EntryType']) and $_POST['EntryType']=='FILE' and isset($_POST['ValidateFile'])){ $filename = $_SESSION['CurImportFile']['tmp_name']; Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2010-07-01 17:09:45 UTC (rev 3537) +++ trunk/includes/InputSerialItems.php 2010-07-01 17:10:13 UTC (rev 3538) @@ -16,6 +16,8 @@ $LineNo = $_GET['LineNo']; } elseif (isset($_POST['LineNo'])){ $LineNo = $_POST['LineNo']; +} else { + $LineNo=0; } /* Entry Types: @@ -31,6 +33,9 @@ possibly override setting elsewhere. */ +if (!isset($RecvQty)) { + $RecvQty=0; +} if (!isset($_POST['EntryType']) OR trim($_POST['EntryType']) == ''){ if ($RecvQty <= 50) { $_POST['EntryType'] = 'KEYED'; @@ -39,7 +44,7 @@ $_POST['EntryType'] = 'FILE'; } } - + $invalid_imports = 0; $valid = true; Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2010-07-01 17:09:45 UTC (rev 3537) +++ trunk/includes/InputSerialItemsKeyed.php 2010-07-01 17:10:13 UTC (rev 3538) @@ -27,6 +27,7 @@ $TotalQuantity = 0; /*Variable to accumulate total quantity received */ $RowCounter =0; +$k=0; foreach ($LineItem->SerialItems as $Bundle){ if ($RowCounter == 10){ @@ -75,7 +76,7 @@ echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . $SID . '" name="Ga6uF5Wa" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> <input type=hidden name=LineNo value="' . $LineNo . '"> <input type=hidden name=StockID value="' . $StockID . '"> <input type=hidden name=EntryType value="KEYED">'; @@ -83,7 +84,10 @@ $EditControlled = isset($_GET['EditControlled'])?$_GET['EditControlled']:false; } elseif ( isset($_POST['EditControlled']) ){ $EditControlled = isset($_POST['EditControlled'])?$_POST['EditControlled']:false; +} else { + $EditControlled=false; } + $StartAddingAt = 0; if ($EditControlled){ foreach ($LineItem->SerialItems as $Bundle){ Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-07-01 17:09:45 UTC (rev 3537) +++ trunk/index.php 2010-07-01 17:10:13 UTC (rev 3538) @@ -576,7 +576,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?' . sid . '">' . _('Inventory Adjustments') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes' . sid . '">' . _('Inventory Adjustments') . '</a></p>'; ?> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |