From: <tim...@us...> - 2010-10-28 20:19:15
|
Revision: 4124 http://web-erp.svn.sourceforge.net/web-erp/?rev=4124&view=rev Author: tim_schofield Date: 2010-10-28 20:19:08 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Fix bug # 3017709. When bulk transfers are received for controlled items serial numbers are required Modified Paths: -------------- trunk/StockLocTransferReceive.php trunk/StockTransferControlled.php trunk/doc/Change.log.html trunk/includes/Add_SerialItems.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsExisting.php trunk/includes/InputSerialItemsKeyed.php Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2010-10-28 09:27:33 UTC (rev 4123) +++ trunk/StockLocTransferReceive.php 2010-10-28 20:19:08 UTC (rev 4124) @@ -44,11 +44,11 @@ prnMsg( _('The Quantity entered plus the Quantity Previously Received can not be greater than the Total Quantity shipped for').' '. $TrfLine->StockID , 'error'); $InputError = True; } - if (isset($_POST['CancelBalance' . $i]) and $_POST['CancelBalance' . $i]==1){ - $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=1; - } else { - $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; - } + if (isset($_POST['CancelBalance' . $i]) and $_POST['CancelBalance' . $i]==1){ + $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=1; + } else { + $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; + } $TotalQuantity += $TrfLine->Quantity; $i++; } /*end loop to validate and update the SESSION['Transfer'] data */ @@ -454,20 +454,26 @@ if (isset($_POST['Qty' . $i]) and is_numeric($_POST['Qty' . $i])){ $_SESSION['Transfer']->TransferItem[$i]->Quantity= $_POST['Qty' . $i]; $Qty = $_POST['Qty' . $i]; + } else if ($TrfLine->Controlled==1) { + if (sizeOf($TrfLine->SerialItems)==0) { + $Qty = 0; + } else { + $Qty = $TrfLine->Quantity; + } } else { $Qty = $TrfLine->Quantity; } - echo '<td class=number>' . number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; + echo '<td class=number>' . number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; if ($TrfLine->Controlled==1){ - echo '<td><input type=hidden name="Qty' . $i . '" VALUE="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . $Qty . '</a></td>'; + echo '<td class=number><input type=hidden name="Qty' . $i . '" VALUE="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . $Qty . '</a></td>'; } else { - echo '<td><input type=TEXT class="number" name="Qty' . $i . '" maxlength=10 class="number" size=10 VALUE="' . $Qty . '"></td>'; + echo '<td><input type=text class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto VALUE="' . $Qty . '"></td>'; } echo '<td>' . $TrfLine->PartUnit . '</td>'; - echo '<td><input type="checkbox" name="CancelBalance' . $i . '" value=1></td>'; + echo '<td><input type="checkbox" name="CancelBalance' . $i . '" value=1></td>'; if ($TrfLine->Controlled==1){ Modified: trunk/StockTransferControlled.php =================================================================== --- trunk/StockTransferControlled.php 2010-10-28 09:27:33 UTC (rev 4123) +++ trunk/StockTransferControlled.php 2010-10-28 20:19:08 UTC (rev 4124) @@ -13,6 +13,8 @@ include('includes/header.inc'); +echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . + '" alt=""><b>' . $title . '</p>'; if (!isset($_SESSION['Transfer'])) { /* This page can only be called when a stock Transfer is pending */ @@ -56,7 +58,7 @@ if (isset($TransferItem)){ echo _('Transfer Items is set equal to') . ' ' . $TransferItem; - + echo '<br><a href="'.$rootpath.'/StockLocTransferReceive.php?' . SID . '&StockID='.$LineItem->StockID.'">'._('Back To Transfer Screen').'</a>'; } else { echo '<br><a href="'.$rootpath.'/StockTransfers.php?' . SID. '&StockID='.$LineItem->StockID. '">'._('Back To Transfer Screen').'</a>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-10-28 09:27:33 UTC (rev 4123) +++ trunk/doc/Change.log.html 2010-10-28 20:19:08 UTC (rev 4124) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/10/10 Tim: Fix bug # 3017709. When bulk transfers are received for controlled items serial numbers are required</p> <p>28/10/10 Tim: PcExpensesTypeTab.php - SQL quoting corrections and layout changes and improvements</p> <p>28/10/10 Tim: PcTabs.php - SQL quoting corrections and layout changes and improvements</p> <p>28/10/10 Tim: PcTypeTabs.php - SQL quoting corrections and layout changes and improvements</p> Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2010-10-28 09:27:33 UTC (rev 4123) +++ trunk/includes/Add_SerialItems.php 2010-10-28 20:19:08 UTC (rev 4124) @@ -9,7 +9,7 @@ if ( isset($_POST['AddBatches']) && $_POST['AddBatches']!='') { for ($i=0;$i < 10;$i++){ - if(strlen($_POST['SerialNo' . $i])>0){ + if(isset($_POST['SerialNo' . $i]) and strlen($_POST['SerialNo' . $i])>0){ if ($ItemMustExist){ $ExistingBundleQty = ValidBundleRef($StockID, $LocationOut, $_POST['SerialNo' . $i]); if ($ExistingBundleQty >0 or ($ExistingBundleQty==1 and $IsCredit=true)){ Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2010-10-28 09:27:33 UTC (rev 4123) +++ trunk/includes/InputSerialItems.php 2010-10-28 20:19:08 UTC (rev 4124) @@ -49,10 +49,10 @@ $valid = true; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" enctype="multipart/form-data" >'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type=hidden name="LineNo" value="' . $LineNo . '">'; echo '<input type=hidden name="StockID" value="'. $StockID. '">'; -echo '<table border=1><tr><td>'; +echo '<table class=selection><tr><td>'; echo '<input type=radio name=EntryType onClick="submit();" '; if ($_POST['EntryType']=='KEYED') { echo ' checked '; @@ -100,7 +100,6 @@ } echo $EditLink . $RemoveLink; -echo '<table><tr><td>'; if ($_POST['EntryType'] == 'FILE'){ include('includes/InputSerialItemsFile.php'); } elseif ($_POST['EntryType'] == 'SEQUENCE'){ @@ -108,5 +107,4 @@ } else { /*KEYED or BARCODE */ include('includes/InputSerialItemsKeyed.php'); } -echo '</td></tr></table>'; -?> +?> \ No newline at end of file Modified: trunk/includes/InputSerialItemsExisting.php =================================================================== --- trunk/includes/InputSerialItemsExisting.php 2010-10-28 09:27:33 UTC (rev 4123) +++ trunk/includes/InputSerialItemsExisting.php 2010-10-28 20:19:08 UTC (rev 4124) @@ -5,61 +5,62 @@ /** If the User has selected Keyed Entry, show them this special select list... it is just in the way if they are doing file imports -it also would not be applicable in a PO and possible other situations... +it also would not be applicable in a PO and possible other situations... **/ if ($_POST['EntryType'] == 'KEYED'){ /*Also a multi select box for adding bundles to the dispatch without keying */ - $sql = "SELECT serialno, quantity - FROM stockserialitems + $sql = "SELECT serialno, quantity + FROM stockserialitems WHERE stockid='" . $StockID . "' AND loccode ='" . $LocationOut."' AND quantity > 0"; //echo $sql; - $ErrMsg = '<BR>'. _('Could not retrieve the items for'). ' ' . $StockID; + $ErrMsg = '<br />'. _('Could not retrieve the items for'). ' ' . $StockID; $Bundles = DB_query($sql,$db, $ErrMsg ); - echo '<TABLE><TR>'; + echo '<table class=selection><tr>'; if (DB_num_rows($Bundles)>0){ $AllSerials=array(); - - foreach ($LineItem->SerialItems as $Itm){ - $AllSerials[$Itm->BundleRef] = $Itm->BundleQty; + + foreach ($LineItem->SerialItems as $Itm){ + $AllSerials[$Itm->BundleRef] = $Itm->BundleQty; } - - echo '<TD VALIGN=TOP><B>'. _('Select Existing Items'). '</B><BR>'; - - echo '<FORM ACTION="' . $_SERVER['PHP_SELF'] . '?=' . $SID . '" METHOD="POST"> - <input type=hidden name=LineNo value="' . $LineNo . '"> + + echo '<td valign="top"><b>'. _('Select Existing Items'). '</b><br />'; + + echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" method="POST">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type=hidden name=LineNo value="' . $LineNo . '"> <input type=hidden name=StockID value="' . $StockID . '"> <input type=hidden name=EntryType value="KEYED"> <input type=hidden name=EditControlled value="true"> - <SELECT Name=Bundles[] multiple>'; + <select Name=Bundles[] multiple>'; $id=0; $ItemsAvailable=0; while ($myrow=DB_fetch_array($Bundles,$db)){ if ($LineItem->Serialised==1){ if ( !array_key_exists($myrow['serialno'], $AllSerials) ){ - echo '<OPTION VALUE="' . $myrow['serialno'] . '">' . $myrow['serialno'].'</OPTION>'; + echo '<option value="' . $myrow['serialno'] . '">' . $myrow['serialno'].'</option>'; $ItemsAvailable++; } } else { if ( !array_key_exists($myrow['serialno'], $AllSerials) || ($myrow['quantity'] - $AllSerials[$myrow['serialno']] >= 0) ) { $RecvQty = $myrow['quantity'] - $AllSerials[$myrow['serialno']]; - echo '<OPTION VALUE="' . $myrow['serialno'] . '/|/'. $RecvQty .'">' . + echo '<OPTION VALUE="' . $myrow['serialno'] . '/|/'. $RecvQty .'">' . $myrow['serialno'].' - ' . _('Qty left'). ': ' . $RecvQty . '</OPTION>'; $ItemsAvailable += $RecvQty; } } } - echo '</SELECT><br>'; - echo '<br><center><INPUT TYPE=SUBMIT NAME="AddBatches" VALUE="'. _('Enter'). '"></center><BR>'; - echo '</FORM>'; + echo '</select><br>'; + echo '<br><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div><br />'; + echo '</form>'; echo $ItemsAvailable . ' ' . _('items available'); - echo '</TD>'; + echo '</td>'; } else { - echo '<TD>'. prnMsg( _('There does not appear to be any of') . ' ' . $StockID . ' ' . _('left in'). ' '. $LocationOut , 'warn') . '</TD>'; + echo '<td>'. prnMsg( _('There does not appear to be any of') . ' ' . $StockID . ' ' . _('left in'). ' '. $LocationOut , 'warn') . '</td>'; } - echo '</TR></TABLE>'; + echo '</tr></table>'; } \ No newline at end of file Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2010-10-28 09:27:33 UTC (rev 4123) +++ trunk/includes/InputSerialItemsKeyed.php 2010-10-28 20:19:08 UTC (rev 4124) @@ -21,7 +21,7 @@ /*Display the batches already entered with quantities if not serialised */ -echo '<table><tr><td valign=top><table>'; +echo '<table class=selection><tr><td valign=top><table class=selection>'; echo $tableheader; $TotalQuantity = 0; /*Variable to accumulate total quantity received */ @@ -72,7 +72,7 @@ //echo '<TABLE><TR><TD valign=TOP>'; /*in the first column add a table for the input of newies */ -echo '<table>'; +echo '<table class=selection>'; echo $tableheader; @@ -125,7 +125,7 @@ } echo '</table>'; -echo '<br><input type=submit name="AddBatches" value="'. _('Enter'). '"><br>'; +echo '<br><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div>'; echo '</form></td><td valign=top>'; if ($ShowExisting){ include('includes/InputSerialItemsExisting.php'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |