mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
minor fixes for handle reversal
This commit is contained in:
parent
0904222eef
commit
8e41c801c8
@ -24,6 +24,17 @@ class ContactHashLoginController extends Controller
|
||||
*/
|
||||
public function login(string $contact_key)
|
||||
{
|
||||
if(request()->has('subscription') && $request->subscription == 'true') {
|
||||
|
||||
$recurring_invoice = RecurringInvoice::where('client_id', auth()->guard('contact')->client->id)
|
||||
->whereNotNull('subscription_id')
|
||||
->whereNull('deleted_at')
|
||||
->first();
|
||||
|
||||
return route('client.recurring_invoice.show', $recurring_invoice->hashed_id);
|
||||
|
||||
}
|
||||
|
||||
return redirect('/client/invoices');
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ class HandleReversal extends AbstractService
|
||||
}
|
||||
|
||||
/*If there is a payment linked, then the credit needs to be linked back to that payment in case of refund*/
|
||||
if ($paymentables->count() > 0) {
|
||||
if ($paymentables->count() > 0 && $credit) {
|
||||
$payment = $paymentables->first()->payment;
|
||||
$payment->credits()->save($credit);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user