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:
@@ -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 = [];
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user