mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Updates for harvesting fee invoice
This commit is contained in:
parent
3ec604919e
commit
06233240ce
@ -121,12 +121,15 @@ class PaymentController extends Controller
|
||||
{
|
||||
/** @var \App\Models\CompanyGateway $gateway **/
|
||||
$gateway = CompanyGateway::findOrFail($request->input('company_gateway_id'));
|
||||
$payment_hash = PaymentHash::where('hash', $request->payment_hash)->firstOrFail();
|
||||
$payment_hash = PaymentHash::with('fee_invoice')->where('hash', $request->payment_hash)->firstOrFail();
|
||||
|
||||
// if($payment_hash)
|
||||
$invoice = $payment_hash->fee_invoice;
|
||||
// else
|
||||
// $invoice = Invoice::with('client')->where('id',$payment_hash->fee_invoice_id)->orderBy('id','desc')->first();
|
||||
|
||||
// $invoice = Invoice::with('client')->find($payment_hash->fee_invoice_id);
|
||||
|
||||
if($payment_hash)
|
||||
$invoice = $payment_hash->fee_invoice;
|
||||
else
|
||||
$invoice = Invoice::with('client')->where('id',$payment_hash->fee_invoice_id)->orderBy('id','desc');
|
||||
|
||||
$client = $invoice ? $invoice->client : auth()->guard('contact')->user()->client;
|
||||
|
||||
|
@ -53,5 +53,6 @@ class UpdateInvoiceActivity implements ShouldQueue
|
||||
$fields->invoice_id = $event->invoice->id;
|
||||
|
||||
$this->activity_repo->save($fields, $event->invoice, $event->event_vars);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ class InstantPayment
|
||||
$hash_data['billing_context'] = Cache::get($this->request->query('hash'));
|
||||
} elseif ($this->request->hash) {
|
||||
$hash_data['billing_context'] = Cache::get($this->request->hash);
|
||||
} elseif ($old_hash = PaymentHash::query()->where('fee_invoice_id', $first_invoice->id)->whereNull('payment_id')->first()) {
|
||||
} elseif ($old_hash = PaymentHash::query()->where('fee_invoice_id', $first_invoice->id)->whereNull('payment_id')->orderBy('id','desc')->first()) {
|
||||
if (isset($old_hash->data->billing_context)) {
|
||||
$hash_data['billing_context'] = $old_hash->data->billing_context;
|
||||
}
|
||||
|
@ -27,10 +27,6 @@ class RefundPayment
|
||||
|
||||
private float $credits_used = 0;
|
||||
|
||||
private $gateway_refund_status;
|
||||
|
||||
private $activity_repository;
|
||||
|
||||
private bool $refund_failed = false;
|
||||
|
||||
private string $refund_failed_message = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user