Pergunta

How to open Day in Fiscal Printer by OPOS?

My code is not working...

device = new OPOSFiscalPrinterClass();

device.Open("FiscPrinter");  //Opened succes
device.ClaimDevice(1000);    //Claimed success
device.DeviceEnabled = true; //Enabled success

if (device.DayOpened)
{
   device.PrintZReport();
}

device.FiscalReceiptType = (int)OPOSFiscalPrinterConstants.FPTR_RT_SALES;

device.BeginFiscalReceipt(true); //After that: ResultCode=114, ResultCodeExtended=221, PrinterState=2, DayOpened=false

device.PrintRecItem("Milk", 25.00M, 10000, 0, 25.00M, "");  
device.EndFiscalReceipt(false); //After that: Receipt cannot be closed, ResultCode=114, ResultCodeExtended=207

device.Release();
device.Close();

Trying with UnifiedPOS documentation. What wrong?

Foi útil?

Solução

Okey, the Fiscal Printer have to have an Operator/User, after that you can use BeginFiscalReceipt, for example.

Outras dicas

In order to complete your receipt you need a Subtotal command issued and a payment command before the end of the receipt. eg.

device.PrintRecSubtotal(25.00M);
device.PrintRecCash(25.00M);

ResultCodeExtended 207 = OPOS_EFPTR_WRONG_STATE: The Fiscal Printer is not currently in the Fiscal Receipt state. You need to do a subtotal as

  device.PrintRecSubTotal(25.00M);
  device.PrintRecTotal(25.00M, 25.00M, 'P'); //Total = 25.00M, Payment = 25.00M

Your code can also be done as below

 device.FiscalReceiptType = (int)OPOSFiscalPrinterConstants.FPTR_RT_SALES

or

 device.FiscalReceiptType = 4; // FPTR_RT_SALES -> 4
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top