Search in sources :

Example 6 with FiscalPacket

use of ar.com.ergio.print.fiscal.FiscalPacket in project lar_361 by comitsrl.

the class HasarFiscalPrinter method cmdSetFantasyName.

public FiscalPacket cmdSetFantasyName(int line, String text) {
    FiscalPacket cmd = createFiscalPacket(CMD_SET_FANTASY_NAME);
    int i = 1;
    cmd.setNumber(i++, line, false);
    cmd.setText(i++, text, 50, false);
    return cmd;
}
Also used : FiscalPacket(ar.com.ergio.print.fiscal.FiscalPacket)

Example 7 with FiscalPacket

use of ar.com.ergio.print.fiscal.FiscalPacket in project lar_361 by comitsrl.

the class HasarFiscalPrinter method cmdGeneralDiscount.

public FiscalPacket cmdGeneralDiscount(String description, BigDecimal amount, boolean substract, boolean baseAmount, Integer display) {
    FiscalPacket cmd = createFiscalPacket(CMD_GENERAL_DISCOUNT);
    int i = 1;
    cmd.setText(i++, description, 50, false);
    cmd.setNumber(i++, amount, 9, 2, false);
    cmd.setBoolean(i++, substract, "m", "M", false);
    cmd.setNumber(i++, display, true);
    cmd.setBoolean(i++, baseAmount, "x", "T", false);
    return cmd;
}
Also used : FiscalPacket(ar.com.ergio.print.fiscal.FiscalPacket)

Example 8 with FiscalPacket

use of ar.com.ergio.print.fiscal.FiscalPacket in project lar_361 by comitsrl.

the class HasarFiscalPrinter method cmdPrintEmbarkItem.

public FiscalPacket cmdPrintEmbarkItem(String description, BigDecimal quantity, Integer display) {
    FiscalPacket cmd = createFiscalPacket(CMD_PRINT_EMBARK_ITEM);
    int i = 1;
    cmd.setText(i++, description, 108, false);
    cmd.setQuantity(i++, quantity, false);
    cmd.setNumber(i++, display, true);
    return cmd;
}
Also used : FiscalPacket(ar.com.ergio.print.fiscal.FiscalPacket)

Example 9 with FiscalPacket

use of ar.com.ergio.print.fiscal.FiscalPacket in project lar_361 by comitsrl.

the class HasarFiscalPrinter method checkTaxes.

private void checkTaxes(Document document) throws FiscalPrinterStatusError, FiscalPrinterIOException {
    // ////////////////////////////////////////////////////////////
    // Incia la transmisiĆ³n de informaciĆ³n de IVA
    // Comando: @SendFirstIVA
    FiscalPacket response = execute(cmdSendFirstIVA());
    BigDecimal taxRate = null;
    BigDecimal taxAmount = null;
    BigDecimal taxBaseAmt = null;
    int type = response.getInt(3);
    while (type == 1) {
        // Tipo = 1 es IVA del documento
        taxRate = response.getBigDecimal(4);
        taxAmount = response.getBigDecimal(5);
        taxBaseAmt = response.getBigDecimal(8);
        System.out.println("- IVA: " + taxRate + ", Importe: " + taxAmount + ", Base:" + taxBaseAmt);
        response = execute(cmdNextIVATransmission());
        type = response.getInt(3);
    }
}
Also used : FiscalPacket(ar.com.ergio.print.fiscal.FiscalPacket) BigDecimal(java.math.BigDecimal)

Example 10 with FiscalPacket

use of ar.com.ergio.print.fiscal.FiscalPacket in project lar_361 by comitsrl.

the class HasarFiscalPrinter method cmdGetEmbarkNumber.

public FiscalPacket cmdGetEmbarkNumber(int line) {
    FiscalPacket cmd = createFiscalPacket(CMD_GET_EMBARK_NUMBER);
    int i = 1;
    cmd.setNumber(i++, line, false);
    return cmd;
}
Also used : FiscalPacket(ar.com.ergio.print.fiscal.FiscalPacket)

Aggregations

FiscalPacket (ar.com.ergio.print.fiscal.FiscalPacket)39 FiscalPrinterIOException (ar.com.ergio.print.fiscal.exception.FiscalPrinterIOException)5 Customer (ar.com.ergio.print.fiscal.document.Customer)4 Payment (ar.com.ergio.print.fiscal.document.Payment)1 FiscalPrinterStatusError (ar.com.ergio.print.fiscal.exception.FiscalPrinterStatusError)1 IOException (java.io.IOException)1 BigDecimal (java.math.BigDecimal)1