Portal payment added print and pdf action..
This commit is contained in:
@ -7,10 +7,13 @@ use App\Models\Banking\Transaction;
|
||||
use App\Models\Setting\Currency;
|
||||
use App\Http\Requests\Portal\PaymentShow as Request;
|
||||
use App\Utilities\Modules;
|
||||
use App\Traits\Transactions;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class Payments extends Controller
|
||||
{
|
||||
use Transactions;
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
@ -53,6 +56,50 @@ class Payments extends Controller
|
||||
return $this->response('portal.currencies.index', compact('currencies'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for viewing the specified resource.
|
||||
*
|
||||
* @param Transaction $payment
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function printPayment(Transaction $payment, Request $request)
|
||||
{
|
||||
event(new \App\Events\Transaction\TransactionPrinting($payment));
|
||||
|
||||
$revenue = $payment;
|
||||
$view = view($payment->template_path, compact('revenue'));
|
||||
|
||||
return mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for viewing the specified resource.
|
||||
*
|
||||
* @param Transaction $payment
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function pdfPayment(Transaction $payment, Request $request)
|
||||
{
|
||||
event(new \App\Events\Transaction\TransactionPrinting($payment));
|
||||
|
||||
$currency_style = true;
|
||||
|
||||
$revenue = $payment;
|
||||
$view = view($payment->template_path, compact('revenue', 'currency_style'))->render();
|
||||
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
|
||||
|
||||
$pdf = app('dompdf.wrapper');
|
||||
$pdf->loadHTML($html);
|
||||
|
||||
//$pdf->setPaper('A4', 'portrait');
|
||||
|
||||
$file_name = $this->getTransactionFileName($payment);
|
||||
|
||||
return $pdf->download($file_name);
|
||||
}
|
||||
|
||||
public function signed(Transaction $payment)
|
||||
{
|
||||
if (empty($payment)) {
|
||||
|
Reference in New Issue
Block a user