|
|
@@ -2753,6 +2753,22 @@ class PreventiveMaintenanceController extends Controller
|
|
|
} elseif ($newStatus == 'CA') {
|
|
|
$updateArr['RVTN_USCA'] = $idUser;
|
|
|
$updateArr['RVTN_FECA'] = $nowStr;
|
|
|
+
|
|
|
+ // Registrar comentario de cancelación
|
|
|
+ if (!empty($form['comments'])) {
|
|
|
+ $commentsArr = json_decode($visit->RVTN_COME, true);
|
|
|
+ if (!is_array($commentsArr)) {
|
|
|
+ $commentsArr = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ $commentsArr['COMENTARIO_CANCELACION'] = [
|
|
|
+ 'ID' => $idUser,
|
|
|
+ 'COMENTARIO' => $form['comments'],
|
|
|
+ 'FECHA' => $nowStr
|
|
|
+ ];
|
|
|
+
|
|
|
+ $updateArr['RVTN_COME'] = json_encode($commentsArr);
|
|
|
+ }
|
|
|
} elseif ($newStatus == 'RE') {
|
|
|
$updateArr['RVTN_UARE'] = $idUser;
|
|
|
$updateArr['RVTN_FARE'] = $nowStr;
|