diff --git a/modules/BC21/Http/Controllers/Api/Purchases/Bills.php b/modules/BC21/Http/Controllers/Api/Purchases/Bills.php index e09111700..144760aeb 100644 --- a/modules/BC21/Http/Controllers/Api/Purchases/Bills.php +++ b/modules/BC21/Http/Controllers/Api/Purchases/Bills.php @@ -27,13 +27,13 @@ class Bills extends ApiController /** * Display the specified resource. * - * @param Document $document + * @param Document $bill * * @return \Dingo\Api\Http\Response */ - public function show(Document $document) + public function show(Document $bill) { - return $this->response->item($document, new Transformer()); + return $this->response->item($bill, new Transformer()); } /** @@ -53,29 +53,29 @@ class Bills extends ApiController /** * Update the specified resource in storage. * - * @param $document + * @param $bill * @param $request * * @return \Dingo\Api\Http\Response */ - public function update(Document $document, Request $request) + public function update(Document $bill, Request $request) { - $document = $this->dispatch(new UpdateDocument($document, $request)); + $bill = $this->dispatch(new UpdateDocument($bill, $request)); - return $this->item($document->fresh(), new Transformer()); + return $this->item($bill->fresh(), new Transformer()); } /** * Remove the specified resource from storage. * - * @param Document $document + * @param Document $bill * * @return \Dingo\Api\Http\Response */ - public function destroy(Document $document) + public function destroy(Document $bill) { try { - $this->dispatch(new DeleteDocument($document)); + $this->dispatch(new DeleteDocument($bill)); return $this->response->noContent(); } catch(\Exception $e) { diff --git a/modules/BC21/Http/Controllers/Api/Sales/Invoices.php b/modules/BC21/Http/Controllers/Api/Sales/Invoices.php index 5731a117e..c8831390d 100644 --- a/modules/BC21/Http/Controllers/Api/Sales/Invoices.php +++ b/modules/BC21/Http/Controllers/Api/Sales/Invoices.php @@ -59,29 +59,29 @@ class Invoices extends ApiController /** * Update the specified resource in storage. * - * @param $document + * @param $invoice * @param $request * * @return \Dingo\Api\Http\Response */ - public function update(Document $document, Request $request) + public function update(Document $invoice, Request $request) { - $document = $this->dispatch(new UpdateDocument($document, $request)); + $invoice = $this->dispatch(new UpdateDocument($invoice, $request)); - return $this->response->item($document->fresh(), new Transformer()); + return $this->response->item($invoice->fresh(), new Transformer()); } /** * Remove the specified resource from storage. * - * @param Document $document + * @param Document $invoice * * @return \Dingo\Api\Http\Response */ - public function destroy(Document $document) + public function destroy(Document $invoice) { try { - $this->dispatch(new DeleteDocument($document)); + $this->dispatch(new DeleteDocument($invoice)); return $this->response->noContent(); } catch(\Exception $e) { diff --git a/modules/OfflinePayments/Http/Controllers/Payment.php b/modules/OfflinePayments/Http/Controllers/Payment.php index 2671e1027..06c50c194 100644 --- a/modules/OfflinePayments/Http/Controllers/Payment.php +++ b/modules/OfflinePayments/Http/Controllers/Payment.php @@ -15,7 +15,7 @@ class Payment extends PaymentController public $type = 'redirect'; - public function show(Document $document, PaymentRequest $request) + public function show(Document $invoice, PaymentRequest $request) { $setting = []; @@ -40,7 +40,7 @@ class Payment extends PaymentController ]); } - public function signed(Document $document, PaymentRequest $request) + public function signed(Document $invoice, PaymentRequest $request) { $setting = []; @@ -54,7 +54,7 @@ class Payment extends PaymentController } } - $confirm_url = URL::signedRoute('signed.invoices.offline-payments.confirm', [$document->id, 'company_id' => session('company_id')]); + $confirm_url = URL::signedRoute('signed.invoices.offline-payments.confirm', [$invoice->id, 'company_id' => session('company_id')]); $html = view('offline-payments::signed', compact('setting', 'document', 'confirm_url'))->render(); @@ -67,10 +67,10 @@ class Payment extends PaymentController ]); } - public function confirm(Document $document, Request $request) + public function confirm(Document $invoice, Request $request) { try { - event(new PaymentReceived($document, $request)); + event(new PaymentReceived($invoice, $request)); $message = trans('messages.success.added', ['type' => trans_choice('general.payments', 1)]); diff --git a/modules/OfflinePayments/Resources/views/show.blade.php b/modules/OfflinePayments/Resources/views/show.blade.php index 03735c95b..02f5aa6cb 100644 --- a/modules/OfflinePayments/Resources/views/show.blade.php +++ b/modules/OfflinePayments/Resources/views/show.blade.php @@ -13,7 +13,7 @@
{!! Form::open([ - 'url' => route("portal.invoices.offline-payments.confirm", $document->id), + 'url' => route("portal.invoices.offline-payments.confirm", $invoice->id), 'id' => 'redirect-form', 'role' => 'form', 'autocomplete' => "off", diff --git a/modules/PaypalStandard/Http/Controllers/Payment.php b/modules/PaypalStandard/Http/Controllers/Payment.php index af7c6083d..9e85bcd1b 100644 --- a/modules/PaypalStandard/Http/Controllers/Payment.php +++ b/modules/PaypalStandard/Http/Controllers/Payment.php @@ -17,15 +17,15 @@ class Payment extends PaymentController public $type = 'redirect'; - public function show(Document $document, PaymentRequest $request) + public function show(Document $invoice, PaymentRequest $request) { $setting = $this->setting; - $this->setContactFirstLastName($document); + $this->setContactFirstLastName($invoice); $setting['action'] = ($setting['mode'] == 'live') ? 'https://www.paypal.com/cgi-bin/webscr' : 'https://www.sandbox.paypal.com/cgi-bin/webscr'; - $document_url = $this->getInvoiceUrl($document); + $invoice_url = $this->getInvoiceUrl($invoice); $html = view('paypal-standard::show', compact('setting', 'document', 'document_url'))->render(); @@ -38,7 +38,7 @@ class Payment extends PaymentController ]); } - public function return(Document $document, Request $request) + public function return(Document $invoice, Request $request) { $success = true; @@ -66,12 +66,12 @@ class Payment extends PaymentController flash($message)->warning(); } - $document_url = $this->getInvoiceUrl($document); + $invoice_url = $this->getInvoiceUrl($invoice); - return redirect($document_url); + return redirect($invoice_url); } - public function complete(Document $document, Request $request) + public function complete(Document $invoice, Request $request) { $setting = $this->setting; @@ -79,7 +79,7 @@ class Payment extends PaymentController $paypal_log->pushHandler(new StreamHandler(storage_path('logs/paypal.log')), Logger::INFO); - if (!$document) { + if (!$invoice) { return; } @@ -115,10 +115,10 @@ class Payment extends PaymentController case 'Completed': $receiver_match = (strtolower($request['receiver_email']) == strtolower($setting['email'])); - $total_paid_match = ((double) $request['mc_gross'] == $document->amount); + $total_paid_match = ((double) $request['mc_gross'] == $invoice->amount); if ($receiver_match && $total_paid_match) { - event(new PaymentReceived($document, $request->merge(['type' => 'income']))); + event(new PaymentReceived($invoice, $request->merge(['type' => 'income']))); } if (!$receiver_match) { diff --git a/modules/PaypalStandard/Resources/views/show.blade.php b/modules/PaypalStandard/Resources/views/show.blade.php index 56ce12eb9..7248daf36 100644 --- a/modules/PaypalStandard/Resources/views/show.blade.php +++ b/modules/PaypalStandard/Resources/views/show.blade.php @@ -21,29 +21,29 @@ - @foreach ($document->items as $item) + @foreach ($invoice->items as $item) @endforeach - - - - + + + + - - + + - - - + + + - +