From 402343d988175445a4fcd552ff6addb1fa81c4c5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 1 Sep 2023 13:20:37 +1000 Subject: [PATCH] FIxes for refundable requests --- .../Payment/ValidRefundableRequest.php | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/app/Http/ValidationRules/Payment/ValidRefundableRequest.php b/app/Http/ValidationRules/Payment/ValidRefundableRequest.php index 24e86c2236f0..6de59ca0b9ca 100644 --- a/app/Http/ValidationRules/Payment/ValidRefundableRequest.php +++ b/app/Http/ValidationRules/Payment/ValidRefundableRequest.php @@ -100,26 +100,6 @@ class ValidRefundableRequest implements Rule } } - // private function checkCreditIsPaymentable($credit, $payment) - // { - // /** @var \App\Models\Credit $credit */ - // $credit = Credit::whereId($credit['credit_id'])->whereCompanyId($payment->company_id)->first(); - - // if ($payment->credits()->exists()) { - // $paymentable_credit = $payment->credits->where('id', $credit->id)->first(); - - // if (! $paymentable_credit) { - // $this->error_msg = ctrans('texts.credit_not_related_to_payment', ['credit' => $credit->hashed_id]); - - // return false; - // } - // } else { - // $this->error_msg = ctrans('texts.credit_not_related_to_payment', ['credit' => $credit->hashed_id]); - - // return false; - // } - // } - private function checkInvoice($paymentables, $request_invoices) { $record_found = false; @@ -150,33 +130,6 @@ class ValidRefundableRequest implements Rule } } - // private function checkCredit($paymentable, $request_credits) - // { - // $record_found = null; - - // foreach ($request_credits as $request_credit) { - // if ($request_credit['credit_id'] == $paymentable->pivot->paymentable_id) { - // $record_found = true; - - // $refundable_amount = ($paymentable->pivot->amount - $paymentable->pivot->refunded); - - // if ($request_credit['amount'] > $refundable_amount) { - // $credit = $paymentable; - - // $this->error_msg = ctrans('texts.max_refundable_credit', ['credit' => $credit->hashed_id, 'amount' => $refundable_amount]); - - // return false; - // } - // } - // } - - // if (! $record_found) { - // $this->error_msg = ctrans('texts.refund_without_credits'); - - // return false; - // } - // } - /** * @return string */