From e883bce124562c118fe59fdbd26cba5cf6db2216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Fri, 30 Jan 2026 16:18:42 +0100 Subject: [PATCH] Refactor products software assignment queries to improve clarity. Update accounthierarchy handling in post requests and adjust mass update form styling for better usability. --- api/v2/get/products_software_assignment.php | 2 +- api/v2/post/products_software_assignment.php | 10 +++++++++- equipments_mass_update.php | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/api/v2/get/products_software_assignment.php b/api/v2/get/products_software_assignment.php index fd29ca2..0c0a041 100644 --- a/api/v2/get/products_software_assignment.php +++ b/api/v2/get/products_software_assignment.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2("software_assignment",$permission,$partner,'get'); +list($whereclause,$condition) = getWhereclauselvl2("",$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/post/products_software_assignment.php b/api/v2/post/products_software_assignment.php index 8a7d32c..b5c5151 100644 --- a/api/v2/post/products_software_assignment.php +++ b/api/v2/post/products_software_assignment.php @@ -27,15 +27,23 @@ $clause = ''; $clause_insert =''; $input_insert = ''; +//GET PARTNERDETAILS FROM USER +$sales_user = array( + "salesid"=>$partner->salesid, + "soldto"=>$partner->soldto +); +$accounthierarchy = json_encode($sales_user, JSON_UNESCAPED_UNICODE); + //ADD STANDARD PARAMETERS TO ARRAY BASED ON INSERT OR UPDATE if ($command == 'update'){ $post_content['updated'] = $date; $post_content['updatedby'] = $username; + $post_content['accounthierarchy'] = $accounthierarchy; } elseif ($command == 'insert'){ $post_content['created'] = $date; $post_content['createdby'] = $username; - // No accounthierarchy for assignments + $post_content['accounthierarchy'] = $accounthierarchy; } else { //do nothing diff --git a/equipments_mass_update.php b/equipments_mass_update.php index 565043e..285d955 100644 --- a/equipments_mass_update.php +++ b/equipments_mass_update.php @@ -193,7 +193,7 @@ if (isset($success_msg)){ } $view .= '