1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #6300 from turbo124/v5-develop

Fixes for queries
This commit is contained in:
David Bomba 2021-07-20 19:58:57 +10:00 committed by GitHub
commit f9ffe7e76e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ class ValidRefundableRequest implements Rule
return false;
}
$payment = Payment::whereId($this->input['id'])->first();
$payment = Payment::whereId($this->input['id'])->withTrashed()->first();
if (! $payment) {
$this->error_msg = ctrans('texts.unable_to_retrieve_payment');
@ -77,7 +77,7 @@ class ValidRefundableRequest implements Rule
private function checkInvoiceIsPaymentable($invoice, $payment)
{
$invoice = Invoice::whereId($invoice['invoice_id'])->whereCompanyId($payment->company_id)->first();
$invoice = Invoice::whereId($invoice['invoice_id'])->whereCompanyId($payment->company_id)->withTrashed()->first();
if ($payment->invoices()->exists()) {
$paymentable_invoice = $payment->invoices->where('id', $invoice->id)->first();