From 8ac7ec8ef498ee831214a5f21ec1f9f208ac0cb5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 23 Jul 2021 10:16:59 +1000 Subject: [PATCH] Fixes for validation rule --- app/Http/ValidationRules/Payment/ValidRefundableRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/ValidationRules/Payment/ValidRefundableRequest.php b/app/Http/ValidationRules/Payment/ValidRefundableRequest.php index 8dc5567beb65..b29c6ab06a18 100644 --- a/app/Http/ValidationRules/Payment/ValidRefundableRequest.php +++ b/app/Http/ValidationRules/Payment/ValidRefundableRequest.php @@ -80,7 +80,7 @@ class ValidRefundableRequest implements Rule $invoice = Invoice::whereId($invoice['invoice_id'])->whereCompanyId($payment->company_id)->withTrashed()->first(); if ($payment->invoices()->exists()) { - $paymentable_invoice = $payment->invoices->where('invoice_id', $invoice->id)->first(); + $paymentable_invoice = $payment->invoices->where('id', $invoice->id)->first(); if (! $paymentable_invoice) { $this->error_msg = ctrans('texts.invoice_not_related_to_payment', ['invoice' => $invoice->hashed_id]);