mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 05:24:34 -04:00
Add findOrFail()
This commit is contained in:
parent
cfcbc485b2
commit
4f26a868a7
@ -73,7 +73,7 @@ class PaymentController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function process()
|
public function process()
|
||||||
{
|
{
|
||||||
$gateway = CompanyGateway::find(request()->input('company_gateway_id'));
|
$gateway = CompanyGateway::findOrFail('id', request()->input('company_gateway_id'));
|
||||||
|
|
||||||
/*find invoices*/
|
/*find invoices*/
|
||||||
|
|
||||||
@ -160,11 +160,13 @@ class PaymentController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$payment_methods = auth()->user()->client->getPaymentMethods(array_sum(array_column($payable_invoices, 'amount_with_fee')));
|
$payment_methods = auth()->user()->client->getPaymentMethods(array_sum(array_column($payable_invoices, 'amount_with_fee')));
|
||||||
|
|
||||||
$payment_method_id = request()->input('payment_method_id');
|
$payment_method_id = request()->input('payment_method_id');
|
||||||
|
|
||||||
$invoice_totals = array_sum(array_column($payable_invoices, 'amount'));
|
$invoice_totals = array_sum(array_column($payable_invoices, 'amount'));
|
||||||
|
|
||||||
$first_invoice = $invoices->first();
|
$first_invoice = $invoices->first();
|
||||||
|
|
||||||
$fee_totals = round($gateway->calcGatewayFee($invoice_totals, true), $first_invoice->client->currency()->precision);
|
$fee_totals = round($gateway->calcGatewayFee($invoice_totals, true), $first_invoice->client->currency()->precision);
|
||||||
|
|
||||||
if (!$first_invoice->uses_inclusive_taxes) {
|
if (!$first_invoice->uses_inclusive_taxes) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user