FahimAnzamDip / triangle-pos

Triangle POS is an open source Inventory Management with POS System. Developed with Laravel 10, Bootstrap 4 & Livewire 3. It's completely free to use.
574 stars 191 forks source link

Simply replace this code inside of [ROOT_document]\triangle-pos-master\Modules\Sale\Routes\web.php #29

Closed Orochimaru97 closed 1 year ago

Orochimaru97 commented 1 year ago
    Simply replace this code inside of  [ROOT_document]\triangle-pos-master\Modules\Sale\Routes\web.php 
Route::get('/sales/pos/pdf/{id}', function ($id) {
        $sale = \Modules\Sale\Entities\Sale::findOrFail($id);
//        $pdf = \PDF::loadView('sale::print-pos', [
//            'sale' => $sale,
//        ])->setPaper('a7')
//            ->setOption('margin-top', 8)
//            ->setOption('margin-bottom', 8)
//            ->setOption('margin-left', 5)
//            ->setOption('margin-right', 5);
//
//        return $pdf->stream('sale-'. $sale->reference .'.pdf');
        $html=view('sale::print-pos',['sale'=>$sale]);
        $mpdf = new \Mpdf\Mpdf(['format' => [80, 150]]);
        $mpdf->WriteHTML($html);
        $mpdf->Output();
    })->name('sales.pos.pdf');

Originally posted by @sarmadmahar in https://github.com/FahimAnzamDip/triangle-pos/issues/8#issuecomment-1003424608

Orochimaru97 commented 1 year ago

always the same problem