Skip to content

Commit

Permalink
Mejorada la capcaidad de impresión masiva
Browse files Browse the repository at this point in the history
  • Loading branch information
Borja José committed Aug 28, 2015
1 parent d7e9e35 commit 1ffc25b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 180 deletions.
6 changes: 1 addition & 5 deletions app/Http/Controllers/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

use DB;
use View;
use PDF;

use Validator;

class InvoiceController extends Controller
Expand Down Expand Up @@ -291,8 +289,6 @@ public function postMassivePrint(Request $request)
//generate the data to the view
$rawData[] = ['invoice' => $invoice, 'client' => $client, 'payments' => $payments, 'lines' => $lines];
}
$view = View::make('invoice.massivePrint',['rawData' => $rawData]);
PDF::saveFromView($view, 'path/filename.pdf');

return view('invoice.massivePrint', ['rawData' => $rawData]);
}
}
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"barryvdh/laravel-dompdf": "0.6.*",
"antking/phantom-pdf": "^0.6.2"
"laravel/framework": "5.1.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
Expand Down
168 changes: 1 addition & 167 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@
*/
App\Providers\AppServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Barryvdh\DomPDF\ServiceProvider::class,
PhantomPdf\Laravel\Laravel5ServiceProvider::class
App\Providers\RouteServiceProvider::class

],

Expand Down Expand Up @@ -193,7 +191,7 @@
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'PDF' => PhantomPdf\Laravel\PDFFacade::class
'PDF' => Vsmoraes\Pdf\PdfFacade::class

],

Expand Down
7 changes: 6 additions & 1 deletion resources/views/invoice/massivePrint.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
?>

@foreach($rawData as $data)
<section class="content-header">
<section class="content-header invoice-unit">
<h1>
Factura
<small>{{$data['invoice']->facnumber}}</small>
Expand Down Expand Up @@ -134,6 +134,7 @@
</div>
</div>
</section>
<hr class="hr-break"/>
@endforeach
<style>
.main-header, .main-sidebar, .breadcrumb, .btn, .main-footer{
Expand All @@ -142,5 +143,9 @@
.content-wrapper{
margin-left: 0px !important;
}
.hr-break{
page-break-before: always !important;
clear :both !important
}
</style>
@stop

0 comments on commit 1ffc25b

Please sign in to comment.