CM91 - RMA update
This commit is contained in:
@@ -28,11 +28,11 @@ $rma_status = 'Status';
|
||||
$rma_sw_version_latest = 'Latest software version';
|
||||
$rma_servicereport_latest = 'Servicereport created last 7days';
|
||||
|
||||
$rma_status0_text = '1';
|
||||
$rma_status1_text = '2';
|
||||
$rma_status2_text = '3';
|
||||
$rma_status3_text = '4';
|
||||
$rma_status4_text = '5';
|
||||
$rma_status0_text = 'New';
|
||||
$rma_status1_text = 'In Progress';
|
||||
$rma_status2_text = 'Approved';
|
||||
$rma_status3_text = 'Completed';
|
||||
$rma_status4_text = 'Cancelled';
|
||||
|
||||
$rma_information = 'RMA information';
|
||||
$rma_return_reason = 'Return reason';
|
||||
@@ -184,9 +184,9 @@ if (isset($_GET['rowID'])) {
|
||||
|
||||
if (isset($equipment[0]['rowID'])){
|
||||
//CHECK FOR LATEST SERVICEREPORT
|
||||
$servicereport_date = date("Y-m-d", strtotime("-7 days"));
|
||||
$servicereport_date = date("Y-m-d", strtotime("-457 days"));
|
||||
|
||||
$api_url = '/v2/history/equipmentid='.$equipment[0]['rowID'].'&type=servicereport&created='.$servicereport_date.'&totals=';
|
||||
$api_url = '/v2/history/equipmentid='.$equipment[0]['rowID'].'&type=servicereport&created='.$servicereport_date;
|
||||
$servicereport = ioServer($api_url,'');
|
||||
//Decode Payload
|
||||
if (!empty($servicereport)){$servicereport = json_decode( $servicereport,true);}else{$servicereport = null;}
|
||||
@@ -211,7 +211,7 @@ if (isset($_GET['rowID'])) {
|
||||
'warranty_date'=> date('Y-m-d', strtotime($equipment[0]['warranty_date']. ' + 365 days')),
|
||||
'order_ref'=>$equipment[0]['order_ref'],
|
||||
'sw_version_latest'=>$equipment[0]['sw_version_latest'],
|
||||
'servicereport_available' => (($servicereport !=0) ? 1 : 0),
|
||||
'servicereport_available' => ((count($servicereport) !=0) ? 1 : 0),
|
||||
'productrowid'=> $equipment[0]['productrowid'],
|
||||
'productcode'=> $equipment[0]['productcode'],
|
||||
'productname'=> $equipment[0]['productname'],
|
||||
@@ -265,7 +265,7 @@ if (isset($_GET['rowID'])) {
|
||||
|
||||
//GET ALL POST DATA
|
||||
$payload = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
||||
var_dump($payload);
|
||||
|
||||
//API call
|
||||
$responses = ioServer('/v2/rma', $payload);
|
||||
if ($responses === 'NOK'){
|
||||
@@ -299,6 +299,10 @@ $view .= ' <div class="content-block order-details">
|
||||
<div class="block-header">
|
||||
<i class="fa-solid fa-circle-info"></i></i>'.($rma_information ?? 'RMA details').'
|
||||
</div>
|
||||
<div class="order-detail">
|
||||
<h3>'.$equipment_label2.'</h3>
|
||||
<p>'.$serial_input.'</p>
|
||||
</div>
|
||||
<div class="order-detail">
|
||||
<h3>'.$equipment_label3.'</h3>
|
||||
<p><select id="status" name="status" >
|
||||
@@ -309,11 +313,6 @@ $view .= ' <div class="content-block order-details">
|
||||
<option value="4" '.($rma['status']==4?' selected':'').'>'.$rma_status4_text .'</option>
|
||||
</select></p>
|
||||
</div>
|
||||
<div class="order-detail">
|
||||
<h3>'.$equipment_label2.'</h3>
|
||||
<p>'.$serial_input.'</p>
|
||||
</div>
|
||||
|
||||
<div class="order-detail">
|
||||
<h3>'.$product_code.'</h3>
|
||||
<p>'.(($view_product == 1)? '<a href="index.php?page=product&rowID='.$rma['header']['productrowid'].'" class="btn2">'.$rma['header']['productcode'].'</a>':'<input type="text" name="header[productcode]" value="'.$rma['header']['productcode'].'">').'</p>
|
||||
@@ -342,13 +341,22 @@ $view .= ' <div class="content-block order-details">
|
||||
</select>
|
||||
</p>
|
||||
</div>
|
||||
<input type="hidden" name="header[productrowid]" value="'.$rma['header']['productrowid'].'" readonly>
|
||||
<input type="hidden" name="header[rowID]" value="'.$rma['header']['rowID'].'" readonly>
|
||||
<input type="hidden" name="header[productcode]" value="'.$rma['header']['productcode'].'" readonly>
|
||||
<input type="hidden" name="header[productname]" value="'.$rma['header']['productname'].'" readonly>
|
||||
<input type="hidden" name="rowID" value="'.$rma['rowID'].'" readonly>
|
||||
|
||||
<input type="hidden" name="header[productrowid]" value="'.$rma['header']['productrowid'].'" readonly>
|
||||
<input type="hidden" name="header[rowID]" value="'.$rma['header']['rowID'].'" readonly>
|
||||
<input type="hidden" name="header[productcode]" value="'.$rma['header']['productcode'].'" readonly>
|
||||
<input type="hidden" name="header[productname]" value="'.$rma['header']['productname'].'" readonly>
|
||||
<input type="hidden" name="rowID" value="'.$rma['rowID'].'" readonly>
|
||||
';
|
||||
|
||||
if ($rma['header']['servicereport_available']==1){
|
||||
$view .='
|
||||
<div class="order-detail">
|
||||
<h3>'.$service_report_id.'</h3>
|
||||
<p><input type="text" name="questions[historyID]" value="'.(isset($rma['questions']['historyID'])?$rma['questions']['historyID']:$servicereport[0]['historyID']).'"></p>
|
||||
<input type="hidden" name="questions[equipmentID]" value="'.(isset($rma['questions']['equipmentID'])?$rma['questions']['equipmentID']:$servicereport[0]['equipmentID']).'" readonly>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
$view .='
|
||||
</div>
|
||||
@@ -415,22 +423,22 @@ if($rma['header']['servicereport_available'] == 0 ){
|
||||
$view .= '<select id="" name="questions['.$question['QuestionID'].']" required>';
|
||||
$view .= '<option value=>'.$cartest_allowed_label0.'</option>';
|
||||
foreach ($question['Response'] as $response){
|
||||
$view .= '<option value="'.$response['responseID'].'" '.((isset($cartest['questions'][$question['QuestionID']]) && $cartest['questions'][$question['QuestionID']] == $response['responseID'])? 'selected':'').'>'.$response['Response'].'</option>';
|
||||
$view .= '<option value="'.$response['responseID'].'" '.((isset($rma['questions'][$question['QuestionID']]) && $rma['questions'][$question['QuestionID']] == $response['responseID'])? 'selected':'').'>'.$response['Response'].'</option>';
|
||||
}
|
||||
$view .= '</select>';
|
||||
break;
|
||||
|
||||
case 'textarea':
|
||||
$view .= '<label for="" id="'.$question['QuestionID'].'">'.$question['Question'].'</label>';
|
||||
$view .= '<textarea id="QuestionID" name="questions['.$question['QuestionID'].']" placeholder="">'.(isset($cartest['questions'][$question['QuestionID']])?$cartest['questions'][$question['QuestionID']]:'').'</textarea>';
|
||||
$view .= '<textarea id="QuestionID" name="questions['.$question['QuestionID'].']" placeholder="">'.(isset($rma['questions'][$question['QuestionID']])?$rma['questions'][$question['QuestionID']]:'').'</textarea>';
|
||||
break;
|
||||
|
||||
case 'file';
|
||||
$view .= '<label for="" id="">'.$question['Question'].'</label>';
|
||||
|
||||
if ($question['QuestionID'] !=''){
|
||||
$view .= '<input type="hidden" name="questions['.$question['QuestionID'].']" value="'.$cartest['questions'][$question['QuestionID']].'" />
|
||||
<input type="file" name="fileToUpload['.$question['QuestionID'].']" onchange="preview('.$question['QuestionID'].')" style="width: 30%;padding: 50px 0 0 0;height: 10px;"><img id="'.$question['QuestionID'].'" src="'.$cartest['questions'][$question['QuestionID']].'" width="150px"/>';
|
||||
$view .= '<input type="hidden" name="questions['.$question['QuestionID'].']" value="'.$rma['questions'][$question['QuestionID']].'" />
|
||||
<input type="file" name="fileToUpload['.$question['QuestionID'].']" onchange="preview('.$question['QuestionID'].')" style="width: 30%;padding: 50px 0 0 0;height: 10px;"><img id="'.$question['QuestionID'].'" src="'.$rma['questions'][$question['QuestionID']].'" width="150px"/>';
|
||||
} else {
|
||||
$view .= '<input type="file" name="fileToUpload['.$question['QuestionID'].']" onchange="preview('.$question['QuestionID'].')" style="width: 30%;padding: 50px 0 0 0;height: 10px;" required><img id="'.$question['QuestionID'].'" src="" width="150px"/>';
|
||||
}
|
||||
@@ -439,7 +447,7 @@ if($rma['header']['servicereport_available'] == 0 ){
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$view .= ' </div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user