diff --git a/app/Classes/Modules/Questionnaires/ControllersLogic/UpdateNextQuestionV1AdminWFLogic.php b/app/Classes/Modules/Questionnaires/ControllersLogic/UpdateNextQuestionV1AdminWFLogic.php index 89019ae2..5ee4cc6f 100644 --- a/app/Classes/Modules/Questionnaires/ControllersLogic/UpdateNextQuestionV1AdminWFLogic.php +++ b/app/Classes/Modules/Questionnaires/ControllersLogic/UpdateNextQuestionV1AdminWFLogic.php @@ -129,14 +129,14 @@ class UpdateNextQuestionV1AdminWFLogic extends AbstractControllerLogic $key1 = '1688_'.$key1; $key2 = '1688_'.$key2; } - // if (strpos($currentQuestion['question_number'], 'fill_po') === 0) { - // $key1 = 'fill_po_'.$key1; - // $key2 = 'fill_po_'.$key2; - // } - // if (strpos($currentQuestion['question_number'], 'approve_po') === 0) { - // $key1 = 'approve_po_'.$key1; - // $key2 = 'approve_po_'.$key2; - // } + if (strpos($currentQuestion['question_number'], 'fill_po') === 0) { + $key1 = 'xfill_po_'.$key1; + $key2 = 'xfill_po_'.$key2; + } + if (strpos($currentQuestion['question_number'], 'approve_po') === 0) { + $key1 = 'xapprove_po_'.$key1; + $key2 = 'xapprove_po_'.$key2; + } $processingRecord = $booking->attributesKVP()->where('key', $key2)->first(); if ($processingRecord) { @@ -149,7 +149,7 @@ class UpdateNextQuestionV1AdminWFLogic extends AbstractControllerLogic $keyValuePairObject = new KeyValuePairObject($key1, true); $this->createsKeyValuePair->execute($booking, $keyValuePairObject); } - // $isNoGoingBack = 1; + $isNoGoingBack = 1; } $previousAnswer = null; diff --git a/app/Classes/Modules/Questionnaires/Processors/SaveAnswerActionV1AdminWFProcessor.php b/app/Classes/Modules/Questionnaires/Processors/SaveAnswerActionV1AdminWFProcessor.php index 0e1ead49..737f8758 100644 --- a/app/Classes/Modules/Questionnaires/Processors/SaveAnswerActionV1AdminWFProcessor.php +++ b/app/Classes/Modules/Questionnaires/Processors/SaveAnswerActionV1AdminWFProcessor.php @@ -4,6 +4,7 @@ namespace App\Classes\Modules\Questionnaires\Processors; use App\Classes\Modules\Bookings\Processors\ApprovePurchaseOrderProcessor; +use App\Models\QAAnswerOptions; use Illuminate\Support\Facades\Log; class SaveAnswerActionV1AdminWFProcessor @@ -23,8 +24,9 @@ class SaveAnswerActionV1AdminWFProcessor /** * @return */ - public function execute($questionMetadata, $answerInText){ - if($answerInText === "approve_po_approved"){ + public function execute($questionMetadata, $answerOptionId){ + $answerOption = QAAnswerOptions::where('id', $answerOptionId)->first(); + if($answerOption && $answerOption->value === "approve_po_approved"){ $this->approvePurchaseOrderProcessor->execute($questionMetadata['id']); } } diff --git a/app/Classes/Modules/Questionnaires/Processors/SaveAnswerV1AdminWFProcessor.php b/app/Classes/Modules/Questionnaires/Processors/SaveAnswerV1AdminWFProcessor.php index 1a92a56c..cd5e6bdc 100644 --- a/app/Classes/Modules/Questionnaires/Processors/SaveAnswerV1AdminWFProcessor.php +++ b/app/Classes/Modules/Questionnaires/Processors/SaveAnswerV1AdminWFProcessor.php @@ -79,7 +79,7 @@ class SaveAnswerV1AdminWFProcessor } $answer->save(); - $this->saveAnswerActionProcessor->execute($questionMetadata, $answerInText); + $this->saveAnswerActionProcessor->execute($questionMetadata, $answerOptionId); return $answer; } diff --git a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue index 83afca8d..c6b1aa76 100644 --- a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue @@ -302,6 +302,9 @@ if((Math.round((this.poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) === (Math.round((this.data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3)){ this.submitted = true; } + this.$emit('amount-tally-poTotal', { + isDone: this.submitted, + }); this.updateList() }, addProduct(){ diff --git a/resources/assets/vue/components/general/forms/AdminWorkFlowFormComponent.vue b/resources/assets/vue/components/general/forms/AdminWorkFlowFormComponent.vue index 3ae4aa05..91a0d549 100644 --- a/resources/assets/vue/components/general/forms/AdminWorkFlowFormComponent.vue +++ b/resources/assets/vue/components/general/forms/AdminWorkFlowFormComponent.vue @@ -184,7 +184,7 @@