mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6361 from turbo124/v5-develop
minor fixes for handle reversal
This commit is contained in:
commit
01e608c107
@ -12,6 +12,7 @@
|
||||
namespace App\Http\Controllers\ClientPortal;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\RecurringInvoice;
|
||||
use Auth;
|
||||
|
||||
class ContactHashLoginController extends Controller
|
||||
@ -24,6 +25,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 redirect()->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