Epson fiscal printer C# printing extensions

573 views Asked by At

I am having an issue with an Epson fiscal printer, I need to send a command to a Epson TM-T88IV printer. The problem is with the extension, the tutorial reads the following:

Bit 0-2 ‘000’ – Factura a consumidor final.
‘001’ – Factura con derecho a crédito fiscal.
‘010’ – Nota de crédito a consumidor final.
‘011’ – Nota de crédito con derecho a crédito fiscal.
‘100’ – Factura a consumidor final con exoneración de ITBIS.
‘101’ – Factura con derecho a crédito fiscal con exoneración de ITBIS.
Bit 3 Reservado(Reserved).
Bit 4-5 ‘00’ – Utilizar fuente predeterminada.(By default)
‘01’ – Utilizar fuente tipo A.(Font-type A)
‘10’ – Utilizar fuente tipo B.(Font-type B)
‘11’ – Reservado.
Bit 6-8 ‘000’ – No realizar copias. (No-Copies) ‘001’ – Realizar una copia. (1-Copies) ‘010’ – Realizar dos copias. (2-Copies) ‘011’ – Realizar tres copias. (3-Copies) ‘100’ – Realizar cuatro copias. (4-Copies) ‘101’ – Realizar cinco copias. (5-Copies) ‘110’ – Realizar seis copias. (6-Copies)

The problem comes to create the format on C# as all the examples are in VB.NET.
I dont know if I need to put all bits as hexadecimal or send it like strings. And if it is like Hexadecimal, how I can parse those string to Hexadecimal.

This is what I have so far:

bAnswer = oEpsonFP.AddDataField("\x0\x1");//COmmand to open the ticket
bAnswer = oEpsonFP.AddDataField("\x0\x1");//Extension 
bAnswer = oEpsonFP.AddDataField("001");
bAnswer = oEpsonFP.AddDataField("0");
bAnswer = oEpsonFP.AddDataField("0001");
bAnswer = oEpsonFP.AddDataField("0001");
bAnswer = oEpsonFP.AddDataField(billInfo.ncf);

bAnswer = oEpsonFP.AddDataField(billInfo.client_name);
bAnswer = oEpsonFP.AddDataField(billInfo.client_rnc);
bAnswer = oEpsonFP.AddDataField(billInfo.ncf);

bAnswer = oEpsonFP.SendCommand();
foreach (Items item in billInfo.items)
{
    //Configuration of the item
    bAnswer = oEpsonFP.AddDataField("\xA\x2");
    bAnswer = oEpsonFP.AddDataField("\x0\x0");
    bAnswer = oEpsonFP.AddDataField("\x0\x0");
    bAnswer = oEpsonFP.AddDataField("\x0\x0");
    bAnswer = oEpsonFP.AddDataField("\x0\x0");
    //Description of the item
    bAnswer = oEpsonFP.AddDataField(item.description7);
    bAnswer = oEpsonFP.AddDataField(item.description8);
    bAnswer = oEpsonFP.AddDataField(item.description9);
    bAnswer = oEpsonFP.AddDataField(item.description10);
    bAnswer = oEpsonFP.AddDataField(item.description11);
    bAnswer = oEpsonFP.AddDataField(item.description12);
    bAnswer = oEpsonFP.AddDataField(item.description13);
    bAnswer = oEpsonFP.AddDataField(item.description14);
    bAnswer = oEpsonFP.AddDataField(item.description15);
    bAnswer = oEpsonFP.AddDataField(item.item_name);
    bAnswer = oEpsonFP.AddDataField(item.amount.ToString());
    bAnswer = oEpsonFP.AddDataField("18.00");

    bAnswer = oEpsonFP.SendCommand();


}
//Add Subtotal
bAnswer = oEpsonFP.AddDataField("\xA\x3");
bAnswer = oEpsonFP.SendCommand();

//Add Payment
bAnswer = oEpsonFP.AddDataField("\xA\x5");
bAnswer = oEpsonFP.AddDataField("\x0\x0");
bAnswer = oEpsonFP.AddDataField("001");
bAnswer = oEpsonFP.AddDataField(billInfo.total);
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.SendCommand();

//Add tip

bAnswer = oEpsonFP.AddDataField("\xA\x13");
bAnswer = oEpsonFP.AddDataField(billInfo.tip);
bAnswer = oEpsonFP.SendCommand();

//Close 
bAnswer = oEpsonFP.AddDataField("\xA\x6");
bAnswer = oEpsonFP.AddDataField("\xA\x1");
bAnswer = oEpsonFP.AddDataField("0");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.AddDataField("0");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.AddDataField("0");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.SendCommand();
0

There are 0 answers