cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable cash drawer opening

former_member703173
Participant
0 Kudos
526

Hello dear experts.

I need to disable the opening of the cash drawer associated to an epson printer model (T88V) configured in JPOS only in the case of cash withdrawals (pick ups) and payments.

I have used the following without success

Any idea?

Thanks in advance

@ListenToExit(exitName="cashDrawer.before.open")

public void cashDrawerOpenBefore(Object caller, Object[] args) {

mLog.writeLine("[JSFR] ANTES DE ABRIR CAJON CCO " );

ReceiptEntity receiptEntity = (ReceiptEntity) args[0];

if(receiptEntity.getTypeCode().equalsIgnoreCase("3") || receiptEntity.getTypeCode().equalsIgnoreCase("9")) {

mLog.writeLine("[JSFR] CANCELO APERTURA DE CAJON...Retirada y Pagos" );

stopCashDrawerJPOS();

}

}

public boolean stopCashDrawerJPOS() {

boolean bRet = false;

try {

mLog.writeLine("Stop Cajon JPOS 1 ");

CPOSDevices posDevices = CPOSDevices.getInstance();

posDevices.setPushCashDrawerStatus(false);

CPOSDevices.getInstance().setDrawerClosed();

mLog.writeLine("Reiniciar Cajon JPOS 2");

List<ICashDrawerService> dsl = posDevices.getCashDrawerServices(true);

// Tenemos cajón por JPOS.

if (dsl.size() > 0) {

ICashDrawerService ics = dsl.get(0);

ics.stopDevice();

mLog.writeLine("Stop Cajon JPOS OK");

bRet = true;

}

} catch (Exception ex) {

mLog.writeLine("reStartCashDrawerJPOS Cajón por JPOS no configurado");

mLog.writeLine(ex.getMessage());

}

return bRet;

}

Accepted Solutions (0)

Answers (0)