From: <Ex...@us...> - 2012-03-30 14:22:13
|
Revision: 5171 http://web-erp.svn.sourceforge.net/web-erp/?rev=5171&view=rev Author: ExsonQu Date: 2012-03-30 14:22:02 +0000 (Fri, 30 Mar 2012) Log Message: ----------- 31/3/2012 Dafydd Crosby: Revise scripts Add_SerialItemsOut.php and OutputSerialItems.php fixes a problem that occurs when receiving a bulk inventory transfer. There was a hard-coded loop that prevented adding bundles that were greater than 10. Modified Paths: -------------- trunk/includes/Add_SerialItemsOut.php trunk/includes/OutputSerialItems.php Modified: trunk/includes/Add_SerialItemsOut.php =================================================================== --- trunk/includes/Add_SerialItemsOut.php 2012-03-30 14:19:40 UTC (rev 5170) +++ trunk/includes/Add_SerialItemsOut.php 2012-03-30 14:22:02 UTC (rev 5171) @@ -5,8 +5,13 @@ if (isset($_POST['AddBatches'])){ - for ($i=0;$i < 10;$i++){ - if(isset($_POST['SerialNo' . $i]) and mb_strlen($_POST['SerialNo' . $i])>0){ + if (isset($_POST['TotalBundles'])){ + $loop_max = $_POST['TotalBundles']; + } else { + $loop_max = 10; + } + for ($i=0;$i < $loop_max;$i++){ + if(isset($_POST['SerialNo' . $i]) and mb_strlen($_POST['SerialNo' . $i])>0){ $ExistingBundleQty = ValidBundleRef($StockID, $LocationOut, $_POST['SerialNo' . $i]); if ($ExistingBundleQty >0){ $AddThisBundle = true; @@ -54,4 +59,4 @@ $LineItem->SerialItems=array(); } -?> \ No newline at end of file +?> Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2012-03-30 14:19:40 UTC (rev 5170) +++ trunk/includes/OutputSerialItems.php 2012-03-30 14:22:02 UTC (rev 5171) @@ -202,7 +202,7 @@ } $RowNumber++; } - +echo '<input type="hidden" name="TotalBundles" value="'.($RowNumber).'">'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="AddBatches" value="'. _('Enter'). '" /></div>'; echo '</form> @@ -220,4 +220,4 @@ document.Ga6uF5Wa.SerialNo0.focus(); //]]> </script>'; /*end of nested table */ -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |