mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 09:34:35 -04:00
Fixes for queries
This commit is contained in:
parent
cdcd58a098
commit
11ae85732b
@ -46,7 +46,7 @@ class ValidRefundableRequest implements Rule
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$payment = Payment::whereId($this->input['id'])->first();
|
$payment = Payment::whereId($this->input['id'])->withTrashed()->first();
|
||||||
|
|
||||||
if (! $payment) {
|
if (! $payment) {
|
||||||
$this->error_msg = ctrans('texts.unable_to_retrieve_payment');
|
$this->error_msg = ctrans('texts.unable_to_retrieve_payment');
|
||||||
@ -77,7 +77,7 @@ class ValidRefundableRequest implements Rule
|
|||||||
|
|
||||||
private function checkInvoiceIsPaymentable($invoice, $payment)
|
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()) {
|
if ($payment->invoices()->exists()) {
|
||||||
$paymentable_invoice = $payment->invoices->where('id', $invoice->id)->first();
|
$paymentable_invoice = $payment->invoices->where('id', $invoice->id)->first();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user