Problema con pdf y fpdf para detalle de factura
Publicado por giuli (74 intervenciones) el 18/09/2020 18:03:40
Estoy armando una factura en pdf y no logro poner bien los leementos del detalle:
sale como en la imagen:
https://ibb.co/54RF1Xn
Y la verdad no se como hacer.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$pdf = new FPDF();
$pdf->AddPage();
$pdf->Image('logo.png',10,10,-300);
// now write some text above the imported page
$pdf->SetFont('Arial', '', '10');
$pdf->SetTextColor(0,0,0);
//set position in pdf document
$pdf->SetXY(20, 25);
//first parameter defines the line height
$pdf->cell(40,5, 'CORNALO GUILLERMO DARIO',0,1,'L');
$pdf->cell(40,5, 'AVDA BELGRANO 2035 CHAJARI ENTRE RIOS',0,1,'L');
$pdf->cell(40,5, 'IVA RESPONSABLE INSCRIPTO',0,1,'L');
$pdf->cell(40,5, 'PTO. DE VENTA 001',0,1,'L');
$pdf->cell(40,5, 'CBTE. NRO.:',0,1,'L');
$arrayt=obtenerticket($idticket);
$t1=$arrayt[0];
$cae=$t1["cae"];
$pdf->cell(40,5,"CAE.:". $cae, 0,1,'L');
$pdf->cell(40,5,"Fecha Vto.:". $t1["fechavto"], 0,1,'L');
$pdf->cell(40,5,"Fecha de emision:". $t1["fecha"], 0,1,'L');
//force the browser to download the output
$pdf->Cell(15,6,'Cant',1,0,"C");
$pdf->Cell(90,6,utf8_decode('Descripción'),1,0,"C");
$pdf->Cell(15,6,'P/U',1,0,"C",0);
$pdf->Cell(20,6,'Subtotal',1,0,"C");
$pdf->Cell(15,6,'%IVA',1,0,"C");
$pdf->Cell(20,6,'Base Imp.',1,0,"C");
$pdf->Cell(20,6,'Total',1,0,"C");
$pdf->ln(5);
$dt=new Carritoa();
$dt1=$dt->get_content();
foreach($dt1 as $f=>$r){
$pdf-> cell(15,5,$r["cantidad"],0,0,'R');
//$pdf-> cell(58,4,$descripcion,0,0,'R');
$pdf-> Multicell(90,5,$r["nombre"],0,'L',0,1);
//$pdf->SetY(40); /* Set 20 Eje Y */
$y=$pdf->getY();
$pdf->SetY($y);
$pdf->cell(15,5,'$'.$r["precio"],0,'C',0);
$importe=round($r["cantidad"] * $r["precio"],2);
$pdf->cell(20,5,'$'.$importe,0,'C',0);
$pdf->cell(15,5,$r["alicuota"],0,'C',0);
$base=$importe * $r["alicuota"]/100;
$pdf->cell(20,5,'$'.(round($base,2) + $importe),0,1,'C',0);
}
sale como en la imagen:
https://ibb.co/54RF1Xn
Y la verdad no se como hacer.
Valora esta pregunta


0