1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Merge pull request #7643 from turbo124/v5-develop

Minor fixes for rendering payments
This commit is contained in:
David Bomba 2022-07-16 16:16:23 +10:00 committed by GitHub
commit 5642e7b779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 3 deletions

View File

@ -97,8 +97,20 @@ class PaymentController extends Controller
$client = $invoice ? $invoice->client : auth()->guard('contact')->user()->client;
// 09-07-2022 catch duplicate responses for invoices that already paid here.
if($invoice && $invoice->status_id == Invoice::STATUS_PAID)
abort(400, 'Invoice paid. Duplicate submission');
if($invoice && $invoice->status_id == Invoice::STATUS_PAID){
$data = [
'invoice' => $invoice,
'key' => false
];
if ($request->query('mode') === 'fullscreen') {
return render('invoices.show-fullscreen', $data);
}
return $this->render('invoices.show', $data);
}
return $gateway
->driver($client)

View File

@ -123,7 +123,7 @@ class Request extends FormRequest
}
}
if (isset($input['invitations'])) {
if (isset($input['invitations']) && is_array($input['invitations'])) {
foreach ($input['invitations'] as $key => $value) {
if (isset($input['invitations'][$key]['id']) && is_numeric($input['invitations'][$key]['id'])) {
unset($input['invitations'][$key]['id']);

View File

@ -204,4 +204,9 @@ class BaseModel extends Model
return $formatted_number;
}
public function translate_entity()
{
return ctrans('texts.item');
}
}

View File

@ -271,4 +271,8 @@ class PurchaseOrder extends BaseModel
return $purchase_order_calc->build();
}
public function translate_entity()
{
return ctrans('texts.purchase_order');
}
}