Skip to content
Snippets Groups Projects
Commit 58fef715 authored by Jean-Laurent DUZANT's avatar Jean-Laurent DUZANT
Browse files

FIX #20298 TIME 1:10 valide circuit visa when all document of letterbox are signed

parent fe533d98
No related branches found
No related tags found
No related merge requests found
...@@ -311,6 +311,10 @@ foreach ($retrievedMails['noVersion'] as $resId => $value) { ...@@ -311,6 +311,10 @@ foreach ($retrievedMails['noVersion'] as $resId => $value) {
} }
Bt_validatedMail(['status' => $status, 'resId' => $value['res_id_master']]); Bt_validatedMail(['status' => $status, 'resId' => $value['res_id_master']]);
if (empty($validateVisaWorkflow[$value['res_id_master']]['WorkflowCompleted']) || $validateVisaWorkflow[$value['res_id_master']]['WorkflowCompleted'] == false) {
$validateVisaWorkflow[$value['res_id_master']]['WorkflowCompleted'] = true;
}
$historyInfo = 'La signature de la pièce jointe ' . $historyIdentifier . ' a été validée dans le parapheur externe' . $additionalHistoryInfo; $historyInfo = 'La signature de la pièce jointe ' . $historyIdentifier . ' a été validée dans le parapheur externe' . $additionalHistoryInfo;
} elseif ($value['status'] == 'refused') { } elseif ($value['status'] == 'refused') {
if (!empty($value['encodedFile'])) { if (!empty($value['encodedFile'])) {
...@@ -346,7 +350,8 @@ foreach ($retrievedMails['noVersion'] as $resId => $value) { ...@@ -346,7 +350,8 @@ foreach ($retrievedMails['noVersion'] as $resId => $value) {
'where' => ['res_id = ?'], 'where' => ['res_id = ?'],
'data' => [$value['res_id_master']] 'data' => [$value['res_id_master']]
]); ]);
$validateVisaWorkflow[$value['res_id_master']]['WorkflowCompleted'] = false;
$historyInfo = 'La signature de la pièce jointe ' . $historyIdentifier . ' a été refusée dans le parapheur externe' . $additionalHistoryInfo; $historyInfo = 'La signature de la pièce jointe ' . $historyIdentifier . ' a été refusée dans le parapheur externe' . $additionalHistoryInfo;
} }
if (in_array($value['status'], ['validated', 'refused'])) { if (in_array($value['status'], ['validated', 'refused'])) {
...@@ -432,6 +437,11 @@ foreach ($retrievedMails['resLetterbox'] as $resId => $value) { ...@@ -432,6 +437,11 @@ foreach ($retrievedMails['resLetterbox'] as $resId => $value) {
if ($value['status'] == 'validatedNote') { if ($value['status'] == 'validatedNote') {
$status = $validatedStatusAnnot; $status = $validatedStatusAnnot;
} }
if (empty($validateVisaWorkflow[$value['res_id']]['WorkflowCompleted']) || $validateVisaWorkflow[$value['res_id_master']]['WorkflowCompleted'] == false) {
$validateVisaWorkflow[$value['res_id']]['WorkflowCompleted'] = true;
}
$history = 'Le document ' . $historyIdentifier . ' a été validé dans le parapheur externe' . $additionalHistoryInfo; $history = 'Le document ' . $historyIdentifier . ' a été validé dans le parapheur externe' . $additionalHistoryInfo;
} elseif (in_array($value['status'], ['refusedNote', 'refused'])) { } elseif (in_array($value['status'], ['refusedNote', 'refused'])) {
Bt_writeLog(['level' => 'INFO', 'message' => 'Document refused']); Bt_writeLog(['level' => 'INFO', 'message' => 'Document refused']);
...@@ -439,6 +449,7 @@ foreach ($retrievedMails['resLetterbox'] as $resId => $value) { ...@@ -439,6 +449,7 @@ foreach ($retrievedMails['resLetterbox'] as $resId => $value) {
if ($value['status'] == 'refusedNote') { if ($value['status'] == 'refusedNote') {
$status = $refusedStatusAnnot; $status = $refusedStatusAnnot;
} }
$validateVisaWorkflow[$value['res_id']]['WorkflowCompleted'] = false;
$history = 'Le document ' . $historyIdentifier . ' a été refusé dans le parapheur externe' . $additionalHistoryInfo; $history = 'Le document ' . $historyIdentifier . ' a été refusé dans le parapheur externe' . $additionalHistoryInfo;
} }
Bt_history([ Bt_history([
...@@ -459,6 +470,14 @@ foreach ($retrievedMails['resLetterbox'] as $resId => $value) { ...@@ -459,6 +470,14 @@ foreach ($retrievedMails['resLetterbox'] as $resId => $value) {
} }
} }
// valide circuit visa
// only, if all documents of letterbox are signed
foreach ($validateVisaWorkflow as $key => $value) {
if (!empty($value['WorkflowCompleted']) && $value['WorkflowCompleted']) {
\ExternalSignatoryBook\controllers\FastParapheurController::processVisaWorkflow(['res_id' => $key, 'processSignatory' => true]);
}
}
Bt_writeLog(['level' => 'INFO', 'message' => 'End of process']); Bt_writeLog(['level' => 'INFO', 'message' => 'End of process']);
Bt_writeLog(['level' => 'INFO', 'message' => $nbMailsRetrieved.' document(s) retrieved']); Bt_writeLog(['level' => 'INFO', 'message' => $nbMailsRetrieved.' document(s) retrieved']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment