mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-31 18:34:10 +00:00
Admin Workflow - Fix new unclear workflow requirement
This commit is contained in:
+14
-13
@@ -106,33 +106,34 @@ class FetchNextQuestionV1AdminWFProcessor
|
||||
$questions = $this->listsQuestions->execute(['questionnaire_set_id' => $questionnaireSetId, 'question_number' => $question_number]);
|
||||
if($previousAnswer['answer'] === '1688_order_verified' && count($questions) == 0){
|
||||
$questionMetadata = $questionContext['questionMetadata'] ?? null;
|
||||
$processed = $questionMetadata['amount_processed'];
|
||||
$amount = $questionMetadata['amount'];
|
||||
$amountProcessed = $questionMetadata['amount_processed'];
|
||||
$amountPaid = $questionMetadata['paid_amount'];
|
||||
$wallet = $booking->company->wallets()->first();
|
||||
$walletAmount = $wallet->amount;
|
||||
|
||||
if ($processed === $amount) {
|
||||
if ($amountProcessed === $amountPaid) {
|
||||
$question_number = '1688_proceed_order';
|
||||
}
|
||||
else if ($processed < $amount) {
|
||||
else if ($amountProcessed > $amountPaid) {
|
||||
$outstanding = $this->calculatesBookingOutstanding->execute($booking) + $this->calculatesBookingRefundAmount->execute($booking, $booking->fix_currency_id);
|
||||
|
||||
$differenceUnder = $amount - $processed;
|
||||
|
||||
$conversionObject = new CurrencyConversionObject(floatval(str_replace(',', '', $differenceUnder)), $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, PaymentMethodType::PAYMENT_METHODS['wallet']);
|
||||
$differenceUnderPayinCNY = $amountProcessed - $amountPaid;
|
||||
$conversionObject = new CurrencyConversionObject(floatval(str_replace(',', '', $differenceUnderPayinCNY)), $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, PaymentMethodType::PAYMENT_METHODS['wallet']);
|
||||
$configurations = $this->fetchBookingQuotation->execute($booking->company, $conversionObject);
|
||||
$underpay = $configurations->getTotal();
|
||||
$amountUnderpay = $configurations->getTotal();
|
||||
|
||||
if($underpay > round($outstanding, 2)) {
|
||||
$question_number = '1688_underpaid_order_3';
|
||||
}
|
||||
else if($walletAmount > $underpay) {
|
||||
// if($amountUnderpay > round($outstanding, 2)) {
|
||||
// $question_number = '1688_underpaid_order_3';
|
||||
// }
|
||||
|
||||
if($walletAmount > $amountUnderpay) {
|
||||
$question_number = '1688_underpaid_order_1';
|
||||
}
|
||||
else {
|
||||
$question_number = '1688_underpaid_order_2';
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$question_number = '1688_overpaid_order';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user