×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Dorian Cuentas
Added: Oct 25, 2016 5:19 PM
Views: 2113
Tags: no tags
  1. posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, LF);
  2.  
  3.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, "" + data.getCOMPLETENAME() + LF);
  4.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, "" + data.getDOCUMENTTYPE() + " : " + data.getDOCUMENTNUMBER() + LF);
  5.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, "" + data.getADDRESS() + LF);
  6.  
  7.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, LF);
  8.                 List<ClsPaymentEBillingDetail> detailList = data.getDetail().getClsPaymentEBillingDetail();
  9.                 String formatedLine = String.format("%-5s%-22s%-5s%-8s",
  10.                         "Item  ",
  11.                         "Descripción",
  12.                         "Cant. ",
  13.                         "Precio");
  14.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, ESC + "|uC"
  15.                         + formatedLine
  16.                         + LF);
  17.                 for (ClsPaymentEBillingDetail singleLine : detailList) {
  18.                     formatedLine = String.format("%-5s%-24s%-4s%-8s",
  19.                             singleLine.getIProductId(),
  20.                             singleLine.getVDescription(),
  21.                             singleLine.getFQuantity(),
  22.                             singleLine.getFPriceTotal());
  23.                     posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, " "
  24.                             + formatedLine
  25.                             + LF);
  26.                 }
  27.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, LF);
  28.  
  29.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, ESC + "|rA"
  30.                         + String.format("%-9s%-8s", "Subtotal : ", data.getSUBTOTAL() + " ")
  31.                         + LF);
  32.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, ESC + "|rA"
  33.                         + String.format("%-9s%-8s", "I.G.V. : ", data.getIGV() + " ")
  34.                         + LF);
  35.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, ESC + "|rA" + ESC + "|bC"
  36.                         + String.format("%-9s%-8s", "Total : ", data.getTOTAL() + " ")
  37.                         + LF);
  38.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, LF);
  39.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, LF);
  40.  
  41.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, "Autorizado mediante resolución Nro:" + LF);
  42.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, "0340050006039/SUNAT" + LF);
  43.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, "Representación impresa del comprobante" + LF);
  44.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, "de venta electrónico, para consultar el" + LF);
  45.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, "documento ingrese a :" + ESC + "|bC" + "www.aap.org.pe" + LF);
  46.  
  47.                 posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, LF);