Skip to content

Commit

Permalink
Fixes incorrect counter numbering of form elements
Browse files Browse the repository at this point in the history
Files changed in commit:
SelectOrderItems.php
On branch master

The form item for the stockid and the quantity were out of sync
especially if there were frequently ordered items shown
on the selection screen.
This fix ensures all stock items on the search screen, FOI and
searched for have unique numbers and the numbers are kept in sync.
Reported, and testing of the fix done by Jeff Harr

References : http://www.weberp.org/forum/showthread.php?tid=8144
  • Loading branch information
timschofield committed Apr 10, 2018
1 parent 7d6cec6 commit 3fcaa6b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SelectOrderItems.php
Expand Up @@ -1579,7 +1579,7 @@
<td class="number">%s</td>
<td class="number">%s</td>
<td class="number">%s</td>
<td><input class="number" ' . ($i==0 ? 'autofocus="autofocus"':'') . ' type="text" required="required" size="6" name="OrderQty%s" value="0" />
<td><input class="number" ' . ($j==0 ? 'autofocus="autofocus"':'') . ' type="text" required="required" size="6" name="OrderQty%s" value="0" />
<input name="StockID%s" type="hidden" value="%s" />
</td>
</tr>',
Expand All @@ -1591,9 +1591,10 @@
locale_number_format($DemandQty, $QOHRow['decimalplaces']),
locale_number_format($OnOrder, $QOHRow['decimalplaces']),
locale_number_format($Available, $QOHRow['decimalplaces']),
strval($j+7),
$i,
$j,
$j,
$myrow['stockid']);
$j++;
$i++;
#end of page full new headings if
}
Expand Down Expand Up @@ -1676,7 +1677,6 @@
echo '<br />';
echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>';
echo '<br />';
$j = 1;

echo '<div>';
echo '<input name="FormID" type="hidden" value="' . $_SESSION['FormID'] . '" />';
Expand Down Expand Up @@ -1765,8 +1765,8 @@
locale_number_format($DemandQty,$QOHRow['decimalplaces']),
locale_number_format($OnOrder,$QOHRow['decimalplaces']),
locale_number_format($Available,$QOHRow['decimalplaces']),
strval($j+7),
$i,
$j,
$j,
$myrow['stockid'] );
$i++;
$j++;
Expand Down

0 comments on commit 3fcaa6b

Please sign in to comment.