Guest User

Untitled

a guest
Mar 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.72 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require_once "config.php";
  4.  
  5. require_once LIB . DIRECTORY_SEPARATOR . "fffff.php";
  6. require_once MOD . DIRECTORY_SEPARATOR . "sag_venta.php";
  7. require_once CPD . DIRECTORY_SEPARATOR . "tcpdf.php";
  8. require_once CPD . DIRECTORY_SEPARATOR . "config/tcpdf_config.php";
  9. require_once LIB . DIRECTORY_SEPARATOR . "numero_a_texto.php";
  10.  
  11. class MYPDF extends TCPDF {
  12.  
  13. public function Header() {
  14. $ar = $this->info;
  15. //deb($ar);
  16. $this->Image("../graph/escudoilo.jpg", 12, 12, 20, 19);
  17. $this->SetFont("helvetica", "B", 14);
  18. $this->setXY(35, 14);
  19. $this->Cell( 100 ,4, "MUNICIPALIDAD PROVINCIAL DE ILO", 0, 0, "", false);
  20. $this->SetFont("helvetica", "", 8);
  21. $this->setXY(35, 19);
  22. $this->Cell( 100 ,4, "AV MALECÓN COSTERO MIRAMAR 1200 - 1202 ", 0, 0, "", false);
  23. $this->setXY(35, 22);
  24. $this->Cell( 100 ,4, "ILO - ILO - MOQUEGUA ", 0, 0, "", false);
  25. $this->setXY(35, 25);
  26. $this->Cell( 100 ,4, "CENTRAL TELEFÓNICA: (053) 48 1141 WEB: www.mpi.gob.pe", 0, 0, "", false);
  27.  
  28. $this->setXY(140, 10);
  29. $this->SetFont("helvetica", "B", 14);
  30. $this->SetFillColor(235, 235, 235);
  31. $this->MultiCell(60, 25, $ar['doc_nombre_ext'], 1, 'C', 1, 0, '', '', true, 0, false, true, 25, 'M');
  32. $this->setXY(140, 11);
  33. $this->SetFont("helvetica", "", 11);
  34. $this->Cell(60 ,4, "RUC: XXXXXXXX", "", 0, "C", false);
  35. $this->setXY(140, 29);
  36. $this->SetFont("helvetica", "", 12);
  37. $this->Cell(60 ,4, $ar['serie_desc'] . "-" . fnCerosIzq($ar['vent_nrodoc'], $ar['docserie_nrodoc_length']), "", 0, "C", false);
  38.  
  39. $this->SetFont("helvetica", "", 9);
  40. $this->SetFillColor(255, 255, 255);
  41. $this->setXY(10, 38);
  42.  
  43. $this->MultiCell(128, 24, '', 1, 'C', 1, 0, '', '', true, 0, false, true, 24, 'M');
  44. $this->MultiCell(2, 24, '', 'RL', 'C', 1, 0, '', '', true, 0, false, true, 24, 'M');
  45. $this->MultiCell(60, 24, '', 1, 'C', 1, 0, '', '', true, 0, false, true, 24, 'M');
  46. /*
  47. $ejey = 40; $ejex = 12; $h = 4;
  48. $this->setXY($ejex, $ejey); $ejey += $h;
  49. $this->Cell(20, 4, "SEÑOR(ES)", '', 0, "", false);
  50. $this->Cell(3, 4, ":", "", 0, "", false);
  51. $this->Cell(82, 4, $ar['cli_nombres'], 0, 0, "", false);
  52.  
  53. $this->setXY($ejex, $ejey); $ejey += $h;
  54. $this->Cell(20, 4, $ar['cli_tipodoc'] == '6' ? "RUC" : "DNI", 0, 0, "", false);
  55. $this->Cell(3, 4, ":", "", 0, "", false);
  56. $this->Cell(82, 4, $ar['cli_nrodoc'], "", 0, "", false);
  57.  
  58. $this->setXY($ejex, $ejey); $ejey += $h;
  59. $this->Cell(20, 4, "DIRECCIÓN", "", 0, "", false);
  60. $this->Cell(3, 4, ":", "", 0, "", false);
  61. $this->Cell(82, 4, $ar['cli_razon'], "", 0, "", false);
  62.  
  63. $this->setXY($ejex, $ejey); $ejey += $h;
  64. $this->Cell(20, 4, "E-MAIL", "", 0, "", false);
  65. $this->Cell(3, 4, ":", "", 0, "", false);
  66. $this->Cell(82, 4, "", "", 0, "", false);
  67.  
  68. $this->setXY($ejex, $ejey); $ejey += $h;
  69. $this->Cell(20, 4, "TELEFONO", "", 0, "", false);
  70. $this->Cell(3, 4, ":", "", 0, "", false);
  71. $this->Cell(82, 4, "", "", 0, "", false);
  72.  
  73.  
  74. $ejey = 40; $ejex = 142; $h = 4;
  75. $this->setXY($ejex, $ejey); $ejey += $h;
  76. $this->Cell(35, 4, "FECHA EMISIÓN", '', 0, "", false);
  77. $this->Cell(3, 4, ":", "", 0, "", false);
  78. $this->Cell(92, 4, fnDateDDMMAAAA($ar['vent_fechadoc']), 0, 0, "", false);
  79.  
  80. $this->setXY($ejex, $ejey); $ejey += $h;
  81. $this->Cell(35, 4, "FECHA VENCIMIENTO", "", 0, "", false);
  82. $this->Cell(3, 4, ":", "", 0, "", false);
  83. $this->Cell(92, 4, fnDateDDMMAAAA($ar['vent_fechaven']), "", 0, "", false);
  84.  
  85. $this->setXY($ejex, $ejey); $ejey += $h;
  86. $this->Cell(35, 4, "MONEDA", "", 0, "", false);
  87. $this->Cell(3, 4, ":", "", 0, "", false);
  88. $this->Cell(92, 4, $ar['moneda'], "", 0, "", false);
  89.  
  90. $this->setXY($ejex, $ejey); $ejey += $h;
  91. $this->Cell(35, 4, "RESPONSABLE", "", 0, "", false);
  92. $this->Cell(3, 4, ":", "", 0, "", false);
  93. $this->Cell(92, 4, "", "", 0, "", false);
  94.  
  95. $this->setXY($ejex, $ejey); $ejey += $h;
  96. $this->Cell(35, 4, "PLACA VEHICULO", "", 0, "", false);
  97. $this->Cell(3, 4, ":", "", 0, "", false);
  98. $this->Cell(92, 4, $ar['placa'], "", 0, "", false);*/
  99.  
  100. $cn_raz = strlen($ar['cli_nombres']);
  101. $hx = $cn_raz > 48 ? 8 : 4;
  102. $ejey = 40; $ejex = 12; $h = 4;
  103.  
  104. $this->setXY($ejex, $ejey); $ejey += $hx;
  105. $this->SetFillColor(255, 255, 255);
  106. $this->MultiCell(20, 4, 'SEÑOR(ES)', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  107. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  108. $this->MultiCell(100, $hx, $ar['cli_nombres'], 0, 'L', 1, 0, '', '', true, 0, false, true, $hx, 'M');
  109.  
  110. $this->setXY($ejex, $ejey); $ejey += 4;
  111. $this->SetFillColor(255, 255, 255);
  112. $this->MultiCell(20, 4, $ar['cli_tipodoc'] == '6' ? "RUC" : "DNI", 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  113. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  114. $this->MultiCell(100, 4, $ar['cli_nrodoc'], 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  115.  
  116.  
  117. $this->setXY($ejex, $ejey); $ejey += 4;
  118. $this->SetFillColor(255, 255, 255);
  119. $this->MultiCell(20, 4, 'DIRECCION', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  120. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  121. $this->MultiCell(100, 4, $ar['cli_razon'], 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  122.  
  123.  
  124. $this->setXY($ejex, $ejey); $ejey += 4;
  125. $this->SetFillColor(255, 255, 255);
  126. $this->MultiCell(20, 4, 'E-MAIL', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  127. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  128. $this->MultiCell(100, 4, '', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  129.  
  130. if ($hx == 4) {
  131. $this->setXY($ejex, $ejey); $ejey += 4;
  132. $this->SetFillColor(255, 255, 255);
  133. $this->MultiCell(20, 4, 'TELEFONO', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  134. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  135. $this->MultiCell(100, 4, '', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  136. }
  137.  
  138. $ejey = 40; $ejex = 142; $h = 4;
  139.  
  140. $this->setXY($ejex, $ejey); $ejey += $h;
  141. $this->SetFillColor(255, 255, 255);
  142. $this->MultiCell(30, 4, 'FECHA EMISIÓN', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  143. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  144. $this->MultiCell(22, 4, fnDateDDMMAAAA($ar['vent_fechadoc']), 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  145.  
  146. $this->setXY($ejex, $ejey); $ejey += $h;
  147. $this->SetFillColor(255, 255, 255);
  148. $this->MultiCell(30, 4, 'FECHA VENCIMIENTO', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  149. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  150. $this->MultiCell(22, 4, fnDateDDMMAAAA($ar['vent_fechaven']), 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  151.  
  152.  
  153. $this->setXY($ejex, $ejey); $ejey += $h;
  154. $this->SetFillColor(255, 255, 255);
  155. $this->MultiCell(30, 4, 'MONEDA', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  156. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  157. $this->MultiCell(22, 4, $ar['moneda'], 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  158.  
  159. $this->setXY($ejex, $ejey); $ejey += $h;
  160. $this->SetFillColor(255, 255, 255);
  161. $this->MultiCell(30, 4, 'RESPONSABLE', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  162. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  163. $this->MultiCell(22, 4, "", 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  164.  
  165. $this->setXY($ejex, $ejey); $ejey += $h;
  166. $this->SetFillColor(255, 255, 255);
  167. $this->MultiCell(30, 4, 'PLACA VEHICULO', 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  168. $this->MultiCell(5, 4, ':', 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  169. $this->MultiCell(22, 4, $ar['placa'], 0, 'L', 1, 0, '', '', true, 0, false, true, 4, 'M');
  170.  
  171. }
  172.  
  173. // Page footer
  174. public function Footer() {
  175. // Position at 15 mm from bottom
  176. $this->SetY(-15);
  177. // Set font
  178. $this->SetFont('helvetica', 'I', 8);
  179. // Page number
  180. $this->Cell(0, 0, 'Página '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
  181. }
  182. }
  183.  
  184.  
  185. $ob = new Sag_Venta();
  186. $ob->set_vent_id($_REQUEST['phpVENT_IIDD'] == "" ? '0' : $_REQUEST['phpVENT_IIDD']);
  187. $ob->set_vent_key($_REQUEST['phpVENT_KEY']);
  188. $doc = $ob->registros();
  189. $det = $ob->registros_detalle();
  190.  
  191. if (count($doc) != 1) {
  192. echo "No se puede generar el PDF";
  193. exit;
  194. }
  195.  
  196. $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  197. $pdf->info = $doc[0];
  198.  
  199.  
  200. // set document information
  201. $pdf->SetCreator(PDF_CREATOR);
  202. $pdf->SetAuthor('Municipalidad Provincial de Ilo');
  203. $pdf->SetTitle('XXXXXX' . '-' . $doc[0]['doc_sunat'] . '-' . $doc[0]['serie_desc'] . '-' . $doc[0]['vent_nrodoc']);
  204. $pdf->SetSubject('Facturacion electronica');
  205. $pdf->SetMargins(PDF_MARGIN_LEFT, 55, PDF_MARGIN_RIGHT);
  206.  
  207. // set font
  208. $pdf->SetFont("helvetica", "B", 8);
  209.  
  210. // add a page
  211. $pdf->AddPage();
  212. $pdf->SetLineStyle(array('width' => 0.1));
  213.  
  214.  
  215. $ejey = 65; $ejex = 10; $h = 4;
  216. $pdf->setXY($ejex, $ejey); $ejey += 8;
  217. $pdf->SetFillColor(235, 235, 235);
  218. $pdf->MultiCell(8, 8, '', 1, 'C', 1, 0, '', '', true, 0, false, true, 8, 'M');
  219. $pdf->MultiCell(20, 8, 'CANTIDAD', 1, 'C', 1, 0, '', '', true, 0, false, true, 8, 'M');
  220. $pdf->MultiCell(10, 8, 'UM', 1, 'C', 1, 0, '', '', true, 0, false, true, 8, 'M');
  221. $pdf->MultiCell(17, 8, 'CODIGO', 1, 'C', 1, 0, '', '', true, 0, false, true, 8, 'M');
  222. $pdf->MultiCell(95, 8, 'DESCRIPCION', 1, 'C', 1, 0, '', '', true, 0, false, true, 8, 'M');
  223. $pdf->MultiCell(20, 8, 'Val. V.', 1, 'C', 1, 0, '', '', true, 0, false, true, 8, 'M');
  224. $pdf->MultiCell(20, 8, 'IMPORTE', 1, 'C', 1, 0, '', '', true, 0, false, true, 8, 'M');
  225.  
  226. $pdf->setXY($ejex, $ejey);
  227. $pdf->SetFillColor(255, 255, 255);
  228. $pdf->MultiCell(8, 146, '', 1, '', 1, 0, '', '', true, 0, false, true, 146, 'M');
  229. $pdf->MultiCell(20, 146, '', 1, '', 1, 0, '', '', true, 0, false, true, 146, 'M');
  230. $pdf->MultiCell(10, 146, '', 1, '', 1, 0, '', '', true, 0, false, true, 146, 'M');
  231. $pdf->MultiCell(17, 146, '', 1, '', 1, 0, '', '', true, 0, false, true, 146, 'M');
  232. $pdf->MultiCell(95, 146, '', 1, '', 1, 0, '', '', true, 0, false, true, 146, 'M');
  233. $pdf->MultiCell(20, 146, '', 1, '', 1, 0, '', '', true, 0, false, true, 146, 'M');
  234. $pdf->MultiCell(20, 146, '', 1, '', 1, 0, '', '', true, 0, false, true, 146, 'M');
  235.  
  236.  
  237. $h = 6; $ejey += 1;
  238. $pdf->SetFillColor(255, 255, 255);
  239. $pdf->SetFont("helvetica", "", 8);
  240.  
  241. foreach ($det as $k => $val) {
  242. $pdf->setXY($ejex, $ejey); $ejey += $h;
  243. $pdf->MultiCell(8, 6, $k+1, 0, 'C', 0, 0, '', '', true, 0, false, true, 6, 'M');
  244. $pdf->MultiCell(20, 6, fnNume01($val['cantidad']*1,5), 0, 'C', 0, 0, '', '', true, 0, false, true, 6, 'M');
  245. $pdf->MultiCell(10, 6, $val['unimed'], 0, 'C', 0, 0, '', '', true, 0, false, true, 6, 'M');
  246. $pdf->MultiCell(17, 6, $val['codigo'], 0, 'C', 0, 0, '', '', true, 0, false, true, 6, 'M');
  247. $pdf->MultiCell(95, 6, $val['detalle'], 0, 'L', 0, 0, '', '', true, 0, false, true, 6, 'M');
  248. $pdf->MultiCell(20, 6, fnNume01($val['precio_unitario'],4), 0, 'R', 0, 0, '', '', true, 0, false, true, 6, 'M');
  249. $pdf->MultiCell(20, 6, fnNume01($val['suma'],2), 0, 'R', 0, 0, '', '', true, 0, false, true, 6, 'M');
  250. }
  251.  
  252. // QR
  253. $style = array(
  254. 'border' => 2,
  255. 'vpadding' => 'auto',
  256. 'hpadding' => 'auto',
  257. 'fgcolor' => array(0,0,0),
  258. 'bgcolor' => false, //array(255,255,255)
  259. 'module_width' => 1, // width of a single module in points
  260. 'module_height' => 1 // height of a single module in points
  261. );
  262.  
  263. $dat = array(
  264. 'XXXXX',
  265. $doc[0]['doc_sunat'],
  266. $doc[0]['serie_desc'],
  267. $doc[0]['vent_nrodoc'],
  268. $doc[0]['total_igv'],
  269. $doc[0]['total_venta'],
  270. $doc[0]['vent_fechadoc'],
  271. $doc[0]['cli_tipodoc'],
  272. $doc[0]['cli_nrodoc'],
  273. ''
  274. );
  275.  
  276. $qrdat = implode($dat, '|');
  277.  
  278. $pdf->write2DBarcode($qrdat, 'QRCODE,Q', 10, 222, 38, 38, $style, 'N');
  279.  
  280.  
  281. $ejey = 220; $ejex = 51; $h = 6;
  282. $pdf->setXY($ejex, $ejey); $ejey += $h;
  283.  
  284. $pdf->MultiCell(150, 6, 'SON: ' . convertir_a_letras($doc[0]['total_venta']), 0, '', 1, 0, '', '', true, 0, false, true, 6, 'M');
  285.  
  286.  
  287.  
  288. $ejey = 228; $ejex = 52;
  289. $pdf->SetFont("helvetica", "B", 9);
  290. $pdf->setXY($ejex, $ejey);
  291. $pdf->MultiCell(84, 32, 'OBSERVACIONES:', 1, 'L', 1, 0, '', '', true, 0, false, true, 8, 'M');
  292.  
  293. $ejey = 234; $ejex = 53;
  294. $pdf->SetFont("helvetica", "", 9);
  295. $pdf->setXY($ejex, $ejey);
  296. $pdf->MultiCell(81, 25, $doc[0]['observ'], 0, 'L', 1, 0, '', '', true, 0, false, true, 25, 'M');
  297.  
  298.  
  299.  
  300.  
  301. $ejey = 254; $ejex = 140; $h = 6;
  302. $pdf->setXY($ejex, $ejey); $ejey += $h;
  303. $pdf->SetFillColor(235, 235, 235);
  304. $pdf->MultiCell(60, 6, '', 1, '', 1, 0, '', '', true, 0, false, true, 6, 'M');
  305. $pdf->SetFillColor(255, 255, 255);
  306.  
  307. $pdf->SetFont("helvetica", "", 9);
  308. $ejey = 225; $ejex = 143; $h = 4;
  309.  
  310.  
  311. $pdf->setXY($ejex, $ejey); $ejey += $h;
  312. $pdf->Cell(25, 4, "GRAVADAS", 0, 0, "R", false);
  313. $pdf->Cell(8 ,4, ": S/.", "", 0, "", false);
  314. $pdf->Cell(24, 4, $doc[0]['gravadas']*1 == 0 ? "0.00" : fnNume01($doc[0]['gravadas']*1, 2), 0, 0, "R", false);
  315.  
  316.  
  317. $pdf->setXY($ejex, $ejey); $ejey += $h;
  318. $pdf->Cell(25, 4, "GRATUITAS", 0, 0, "R", false);
  319. $pdf->Cell(8 ,4, ": S/.", "", 0, "", false);
  320. $pdf->Cell(24, 4, $doc[0]['gratuitas']*1 == 0 ? "0.00" : fnNume01($doc[0]['gratuitas']*1, 2), 0, 0, "R", false);
  321.  
  322.  
  323. $pdf->setXY($ejex, $ejey); $ejey += $h;
  324. $pdf->Cell(25, 4, "INAFECTAS", 0, 0, "R", false);
  325. $pdf->Cell(8 ,4, ": S/.", "", 0, "", false);
  326. $pdf->Cell(24, 4, $doc[0]['inafectas']*1 == 0 ? "0.00" : fnNume01($doc[0]['inafectas']*1, 2), 0, 0, "R", false);
  327.  
  328.  
  329. $pdf->setXY($ejex, $ejey); $ejey += $h;
  330. $pdf->Cell(25, 4, "EXONERADAS", 0, 0, "R", false);
  331. $pdf->Cell(8 ,4, ": S/.", "", 0, "", false);
  332. $pdf->Cell(24, 4, $doc[0]['exoneradas']*1 == 0 ? "0.00" : fnNume01($doc[0]['exoneradas']*1, 2), 0, 0, "R", false);
  333.  
  334. $pdf->setXY($ejex, $ejey); $ejey += $h;
  335. $pdf->Cell(25, 4, "DESCUENTOS", 0, 0, "R", false);
  336. $pdf->Cell(8 ,4, ": S/.", "", 0, "", false);
  337. $pdf->Cell(24, 4, $doc[0]['descuentos']*1 == 0 ? "0.00" : fnNume01($doc[0]['descuentos']*1, 2), 0, 0, "R", false);
  338.  
  339. $pdf->setXY($ejex, $ejey); $ejey += $h;
  340. $pdf->Cell(25, 4, "IGV", 0, 0, "R", false);
  341. $pdf->Cell(8 ,4, ": S/.", "", 0, "", false);
  342. $pdf->Cell(24, 4, $doc[0]['total_igv']*1 == 0 ? "0.00" : fnNume01($doc[0]['total_igv']*1, 2), 0, 0, "R", false);
  343.  
  344.  
  345. $pdf->setXY($ejex, $ejey); $ejey += $h;
  346. $pdf->Cell(25, 4, "ISC", 0, 0, "R", false);
  347. $pdf->Cell(8 ,4, ": S/.", "", 0, "", false);
  348. $pdf->Cell(24, 4, $doc[0]['tota_isc']*1 == 0 ? "0.00" : fnNume01($doc[0]['tota_isc']*1, 2), 0, 0, "R", false);
  349.  
  350. $pdf->SetFont("helvetica", "B", 9);
  351. $pdf->setXY($ejex, $ejey+2);
  352. $pdf->Cell(25, 4, "IMPORTE TOTAL", 0, 0, "R", false);
  353. $pdf->Cell(8 ,4, ": S/.", 0, 0, "", false);
  354. $pdf->Cell(24, 4, $doc[0]['total_venta']*1 == 0 ? "0.00" : fnNume01($doc[0]['total_venta']*1, 2), 0, 0, "R", false);
  355.  
  356.  
  357.  
  358. $ejey = 262; $ejex = 10; $h = 6;
  359. $pdf->SetFont("helvetica", "", 8);
  360. $pdf->setXY($ejex, $ejey); $ejey += $h;
  361. $pdf->MultiCell(190, 8, 'Representación impresa de la boleta de venta electrónica. Autorizado mediante resolución de intendencia N° 112-005-0000138/SUNAT. Para consultar ingrese a www.mpi.gob.pe/cpe', 0, 'C', 1, 0, '', '', true, 0, false, true, 8, 'M');
  362.  
  363. $ejey = 272; $ejex = 10; $h = 6;
  364. $pdf->SetFont("helvetica", "", 8);
  365. $pdf->setXY($ejex, $ejey); $ejey += $h;
  366. $pdf->MultiCell(190, 4, 'RESUMEN: ' . $doc[0]['hash_resumen'], 0, 'C', 1, 0, '', '', true, 0, false, true, 4, 'M');
  367.  
  368.  
  369. //$pdf->Output('xxxxx' . '-' . $doc[0]['doc_sunat'] . '-' . $doc[0]['serie_desc'] . '-' . $doc[0]['vent_nrodoc'] . '.pdf', 'I');
  370. if ($_REQUEST['xxDownload'] == 'OK') {
  371. $pdf->Output('xxxxx' . '-' . $doc[0]['doc_sunat'] . '-' . $doc[0]['serie_desc'] . '-' . $doc[0]['vent_nrodoc'] . '.pdf', 'D');
  372. } else {
  373. $pdf->Output('xxxxx' . '-' . $doc[0]['doc_sunat'] . '-' . $doc[0]['serie_desc'] . '-' . $doc[0]['vent_nrodoc'] . '.pdf', 'I');
  374. }
Add Comment
Please, Sign In to add comment