Refactored Stock Locations validation inside general validation

Signed-off-by: objec <objecttothis@gmail.com>
This commit is contained in:
objec
2026-03-06 18:03:33 +04:00
parent 2b162d6aaa
commit 92f7d0bf29

View File

@@ -1093,12 +1093,12 @@ class Items extends Secure_Controller
*
* @param array $row
* @param array $itemData
* @param array $allowedLocations
* @param array $allowedStockLocations
* @param array $definitionNames
* @param array $attributeData
* @return bool Returns false if all data checks out and true when there is an error in the data
*/
private function validateCSVData(array $row, array $itemData, array $allowedLocations, array $definitionNames, array $attributeData): bool // TODO: Long function and large number of parameters in the declaration... perhaps refactoring is needed
private function validateCSVData(array $row, array $itemData, array $allowedStockLocations, array $definitionNames, array $attributeData): bool // TODO: Long function and large number of parameters in the declaration... perhaps refactoring is needed
{
$itemId = $row['Id'];
$isUpdate = (bool)$itemId;
@@ -1136,7 +1136,7 @@ class Items extends Secure_Controller
'Tax 2 Percent' => $row['Tax 2 Percent']
];
foreach ($allowedLocations as $location_name) {
foreach ($allowedStockLocations as $location_name) {
$valuesToCheckForNumeric[] = $row["location_$location_name"];
}