NavagationEvents.showPosScreen(pos);
}
}
private static synchronized void printTotals(PosScreen pos, GenericValue state, boolean runBalance) {
PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession());
if (!trans.isOpen()) {
pos.showDialog("dialog/error/terminalclosed");
return;
}
if (state == null) {
state = trans.getTerminalState();
}
BigDecimal checkTotal = ZERO;
BigDecimal cashTotal = ZERO;
BigDecimal gcTotal = ZERO;
BigDecimal ccTotal = ZERO;
BigDecimal othTotal = ZERO;
BigDecimal total = ZERO;
boolean beganTransaction = false;
try {
beganTransaction = TransactionUtil.begin();
Delegator delegator = pos.getSession().getDelegator();
List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("originFacilityId", EntityOperator.EQUALS, trans.getFacilityId()),
EntityCondition.makeCondition("terminalId", EntityOperator.EQUALS, trans.getTerminalId()));
EntityListIterator eli = null;
try {
eli = delegator.find("OrderHeaderAndPaymentPref", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, null, null, null);
} catch (GenericEntityException e) {