<?php
	$this->load->library('printer');
	$this->load->library('enletras');
	
	$phpPrinter = new Printer();
	$phpInletters = new EnLetras();
	
	$phpPrinter->resetAcum();
	$acum = 0;
	
	/*Init*/
	$printer = printer_open("EPSON TM-U950 Slip CCF");

	printer_set_option($printer, PRINTER_MODE, 'RAW');

	printer_start_doc($printer, 'Recibo');

	printer_start_page($printer);
	
	/*Body*/
	
	$font = printer_create_font('Arial', 9, 7, PRINTER_FW_THIN, false, false, false, 0);	
	printer_select_font($printer, $font);
	
	/*Ghost*/
	$phpPrinter->printString(strtoupper(utf8_decode(substr(" ",0,24))),2,$printer,$acum,13,11,70);
	$phpPrinter->tabPrinter($acum,90);
	
	$phpPrinter->printString(date("d"),2,$printer,$acum,13,11,520);
	$phpPrinter->printString(date("m"),2,$printer,$acum,13,0,610);
	$phpPrinter->printString(date("Y"),2,$printer,$acum,13,0,680);
	
	$phpPrinter->tabPrinter($acum,5);
	
	$phpPrinter->printString($totales['totalTotal'],2,$printer,$acum,13,11,660);
	
	printer_draw_text($printer,$cliente, 110, 155);
	printer_draw_text($printer,$phpInletters->ValorEnLetras($totales['totalTotal'],""), 110, 175);
	printer_draw_text($printer,"Venta con Factura a cobro numero ".$doc_numero, 110, 200);
	
	printer_delete_font($font);
	
	printer_end_page($printer);

	printer_end_doc($printer);

	printer_close($printer);
?>