D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Views
/
Analise_Mix
/
Filename :
imprimeNecCompra.php
back
Copy
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); ob_start(); $path = getcwd(); $Dados = $_GET; $Lanc = new \App\gre\Models\GreLerNecCompra(); $arr = $Lanc->lerNec($Dados); //var_dump(URLADM); $num_linhas = 40; $cont_linha = 9999; $sub_total = 0; $total = 0; $depant = 0; $data_imp = date("d/m/Y H:i:s"); REQUIRE($_SERVER['DOCUMENT_ROOT'].'/idoso/adm/app/gre/Views/include/fpdf/fpdf.php'); define('FPDF_FONTPATH','font/'); $pdf = new FPDF(); $pdf->SetAutoPageBreak(0); foreach ($arr as $lcto) { extract($lcto); if ($cont_linha > $num_linhas) { $pdf->AddPage('l','A4'); $pdf->SetFont('Arial','B',15); $pdf->SetX(15); $pdf->Image(URLADM . 'assets/imagens/logo_login/logo.png',17,10,20,0,'PNG'); $pdf->Cell(220,12,utf8_decode('NECESSIDADE DE COMPRAS - Previsão para ' .$diase.' dias' ),1,0,'C'); $pdf->SetFont('Arial','B',12 ); $pdf->Cell(52,12,utf8_decode($data_imp.' hs'),1,1,'R'); $pdf->SetX(15); $pdf->SetFont('arial','BI',10); $pdf->SetX(15); $pdf->SetFont('arial','B',10); $cont_linha = 0; } if($depto_id <> $depant) { if($depant<>0) { $pdf->SetX(15); $pdf->SetFont('arial','B',10); $pdf->Cell(232,7, utf8_decode('Total do Departamento: '),'1',0,'R'); $pdf->Cell(40,7, 'R$ '.number_format($sub_total,2,',','.'),'1',1,'R'); $sub_total = 0; } $pdf->SetX(15); $pdf->SetFont('arial','B',10); $pdf->Cell(272,7, utf8_decode('Departamento: ' .$depto_nome),'1',1,'C'); $depant = $depto_id; $pdf->SetX(15); $pdf->SetFont('arial','B',9); $pdf->Cell(90,7, utf8_decode('CODIGO - DESCRIÇÃO'),'1',0,'C'); $pdf->Cell(10,7, utf8_decode('Apres'),'1',0,'C'); $pdf->Cell(17,7, utf8_decode('Média/Dia'),'1',0,'C'); $pdf->Cell(17,7, 'Estoque','1',0,'C'); $pdf->Cell(14,7, 'Dias Est','1',0,'C'); $pdf->Cell(17,7, 'Sug.Ped.','1',0,'C'); $pdf->Cell(14,7, 'Custo','1',0,'C'); $pdf->Cell(14,7, 'Total','1',0,'C'); $pdf->Cell(40,7, 'Fornecedor','1',0,'C'); $pdf->Cell(17,7, 'Qtde Ped','1',0,'C'); $pdf->Cell(22,7, utf8_decode('Preço'),'1',1,'C'); } $pdf->SetX(15); $pdf->SetFont('arial','',9); $pdf->Cell(90,7, $prod_id.' - '.utf8_decode($prod_nome),'1',0,'l'); $pdf->Cell(10,7, ' ' . $qtde_apres,'1',0,'C'); $pdf->SetFont('arial','',9); $pdf->Cell(17,7, $media_frac,'1',0,'R'); $pdf->Cell(17,7, $qtde_est,'1',0,'R'); $pdf->Cell(14,7, $dias_est,'1',0,'C'); $pdf->Cell(17,7, $pedido_emb,'1',0,'R'); $pdf->Cell(14,7, $ultimo_custo,'1',0,'R'); $pdf->Cell(14,7, $total_prod,'1',0,'R'); $pdf->Cell(40,7, '','1',0,'C'); $pdf->Cell(17,7, '','1',0,'C'); $pdf->Cell(22,7, '','1',1,'C'); $sub_total = $sub_total + $total_prod_int; $total = $total + $total_prod_int; $cont_linha = $cont_linha + 1; } $pdf->SetX(15); $pdf->SetFont('arial','B',10); $pdf->Cell(232,7, utf8_decode('Total do Departamento: '),'1',0,'R'); $pdf->Cell(40,7, 'R$ '.number_format($sub_total,2,',','.'),'1',1,'R'); $pdf->SetX(15); $pdf->SetFont('arial','B',10); $pdf->Cell(232,7, utf8_decode('TOTAL DA SUGESTÃO DE PEDIDO: '),'1',0,'R'); $pdf->Cell(40,7, 'R$ '.number_format($total,2,',','.'),'1',0,'R'); $pdf->Output(); ?>