#INCLUDE OPOS.H #INCLUDE OPOSPTR.H #INCLUDE EPSON.H #INCLUDE EPSNPTR.H #DEFINE RECEIPT_LINE_FEED CHR(10) + CHR(13) lParameter tnInvoice local lnInvoice if !inlist(vartype(tnInvoice), "N", "I") lnInvoice = 0 else lnInvoice = tnInvoice endif if lnInvoice = 0 return .f. endif if !used("Sales") use Sales in 0 endif select Sales set order to Invoice if !used("Items") use Items in 0 endif select Items set order to Invoice seek lnInvoice if eof() return .f. endif local lnRetVal with This.oleOPOS lnRetVal = .Open("T88II") lnRetVal = .Claim(10) if .ResultCode = OPOS_SUCCESS .DeviceEnabled = .T. .AsyncMode = .F. local lcPrintLine lcPrintLine = "STORE_NAME" .PrintNormal(PTR_S_RECEIPT, lcPrintLine + RECEIPT_LINE_FEED) This.BlankLines(1) lcPrintLine = TTOC(DateTime()) + " Invoice " ; + alltrim(str(lnInvoice,7,0)) .PrintNormal(PTR_S_RECEIPT, lcPrintLine + RECEIPT_LINE_FEED) This.BlankLines(1) do while Items.Invoice = lnInvoice if items.quant = 1 lcPrintLine = substr(Items.descript,1,30) ; + space(4) + str(items.extprice,8,2) .PrintNormal(PTR_S_RECEIPT, lcPrintLine ; + RECEIPT_LINE_FEED) else lcPrintLine = substr(Items.descript,1,30) .PrintNormal(PTR_S_RECEIPT, lcPrintLine ; + RECEIPT_LINE_FEED) lcPrintLine = str(quant,4,0) + " each @ $" ; + str(price,8,2) + space(13) ; + str(items.extprice,8,2) .PrintNormal(PTR_S_RECEIPT, lcPrintLine ; + RECEIPT_LINE_FEED) endif skip enddo select Sales seek lnInvoice if !eof() lcPrintLine = replicate(chr(196),42) .PrintNormal(PTR_S_RECEIPT, lcPrintLine + RECEIPT_LINE_FEED) lcPrintLine = space(20) + "Taxable " + str(Sales.Taxable,8,2) .PrintNormal(PTR_S_RECEIPT, lcPrintLine + RECEIPT_LINE_FEED) lcPrintLine = space(20) + "Exempt " + str(Sales.Exempt,8,2) .PrintNormal(PTR_S_RECEIPT, lcPrintLine + RECEIPT_LINE_FEED) lcPrintLine = space(20) + "Sales Tax " + str(Sales.SaleTax,8,2) .PrintNormal(PTR_S_RECEIPT, lcPrintLine + RECEIPT_LINE_FEED) lcPrintLine = space(20) + replicate(chr(196),22) .PrintNormal(PTR_S_RECEIPT, lcPrintLine + RECEIPT_LINE_FEED) lcPrintLine = space(20) + "Sales Total " ; + str(Sales.Taxable+Sales.Exempt+Sales.SaleTax,8,2) .PrintNormal(PTR_S_RECEIPT, lcPrintLine + RECEIPT_LINE_FEED) endif This.BlankLines(6) if .CapRecPaperCut .CutPaper(90) endif .Release() endif endwith