Refactor products software assignment queries to improve clarity. Update accounthierarchy handling in post requests and adjust mass update form styling for better usability.

This commit is contained in:
“VeLiTi”
2026-01-30 16:18:42 +01:00
parent 0bec809940
commit e883bce124
3 changed files with 12 additions and 4 deletions

View File

@@ -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 = [];

View File

@@ -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

View File

@@ -193,7 +193,7 @@ if (isset($success_msg)){
}
$view .= '<form action="" method="post" id="mass_update_form">
<div class="content-block-wrapper">
<div class="content-block-wrapper" style="max-height: 450px;">
';
@@ -205,7 +205,7 @@ $soldto_dropdown = listPartner('soldto',$_SESSION['authorization']['permission']
$shipto_dropdown = listPartner('shipto',$_SESSION['authorization']['permission'],'','');
$location_dropdown = listPartner('location',$_SESSION['authorization']['permission'],'','');
$view .='<div class="content-block">
$view .='<div class="content-block" style="max-height: 450px;">
<div class="block-header">
<i class="fa-solid fa-user fa-sm"></i>
</div>