You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In latest WorkOrderEntry.php, when DB (or just one category) has more than 10 manufactured items, the SQL in line 506:
$SQL = "SELECT stockmaster.stockid,
description,
stockmaster.units
FROM stockmaster
INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M')
AND stockmaster.description " . LIKE . " '" . $SearchString . "'
AND stockmaster.categoryid " . LIKE . " '" . $_POST['StockCat'] . "'
AND stockmaster.stockid " . LIKE . " '" . $SearchCode . "'
AND stockmaster.discontinued=0
AND mbflag='M'
AND (SELECT COUNT(bom.parent) FROM bom WHERE bom.parent=stockmaster.stockid)>0
ORDER BY stockmaster.stockid";
Returns more than 10 rows.
Then the modified query in line 550 should return $_SESSION['DisplayRecordsMax'] rows (by default 20 rows).
Selecting one item (in this example the first one, marked in yellow) and clicking "add to work order":
The item marked in blue (position 11) has not been selected.
After clicking on Add to Work Order
Two items are added to the work order, which is wrong.
The script always adds the item selected (position i) and another one, (in position 10 + i)
As I can see, it is due to the rewritten logic in the foreach loop in line 77
foreach ($_POST as $Key => $Value) {
if (substr($Key, 0, 7) == 'StockID') {
$Index = substr($Key, -1);
if ($_POST['Quantity' . $Index] > 0) {
So, if user only selects item in position 1, the condition
$_POST['Quantity' . $Index] > 0
is true for item 1, but also item in position 11, 21, 31, etc.
Besides this, no pagination buttons are shown (to move to the next or previous page).
The logic of the script was changed completely on Tim's commit done on 05 Set 2024 "Change the data input forms to use
rather than the uglier which should only be used to display tables of data.". Not sure of the reasons for the change of logic.
Previous version 09 August 2020 worked OK.
The text was updated successfully, but these errors were encountered:
Hi @pakricard I presume @timschofield intended only to change the presentation and not any business logic. At this point, it might be simplest to manually merge the logic from the old file back into the latest file.
Regarding the missing pagination buttons, perhaps this is only a pagination issue and not related to the change in logic.
Hi all:
In latest WorkOrderEntry.php, when DB (or just one category) has more than 10 manufactured items, the SQL in line 506:
Returns more than 10 rows.
Then the modified query in line 550 should return $_SESSION['DisplayRecordsMax'] rows (by default 20 rows).
Selecting one item (in this example the first one, marked in yellow) and clicking "add to work order":
The item marked in blue (position 11) has not been selected.
After clicking on Add to Work Order
Two items are added to the work order, which is wrong.
The script always adds the item selected (position i) and another one, (in position 10 + i)
As I can see, it is due to the rewritten logic in the foreach loop in line 77
So, if user only selects item in position 1, the condition
$_POST['Quantity' . $Index] > 0
is true for item 1, but also item in position 11, 21, 31, etc.
Besides this, no pagination buttons are shown (to move to the next or previous page).
The logic of the script was changed completely on Tim's commit done on 05 Set 2024 "Change the data input forms to use
rather than the uglier which should only be used to display tables of data.". Not sure of the reasons for the change of logic.Previous version 09 August 2020 worked OK.
The text was updated successfully, but these errors were encountered: