// Muestro el total
printTicket("Printer.TicketTotal", ticket, ticketext);
// Select the Payments information
JPaymentSelect paymentdialog = ticket.getTicketType() == TicketInfo.RECEIPT_NORMAL
? paymentdialogreceipt
: paymentdialogrefund;
paymentdialog.setPrintSelected((!m_App.getProperties().getProperty("machine.printerenabled").equals("false"))
&& "true".equals(m_jbtnconfig.getProperty("printselected", "true")));
paymentdialog.setTransactionID(ticket.getTransactionID());
if (paymentdialog.showDialog(ticket.getTotal(), ticket.getCustomer(), ticket.getDateReturn(), ticket.isPressing())) {
// assign the payments selected and calculate taxes.
ticket.setPayments(paymentdialog.getSelectedPayments());
// Asigno los valores definitivos del ticket...
ticket.setUser(m_App.getAppUserView().getUser().getUserInfo()); // El usuario que lo cobra
ticket.setActiveCash(m_App.getActiveCashIndex());
ticket.setDate(new Date()); // Le pongo la fecha de cobro
ticket.setDateReturn(paymentdialog.getrDate());
if (executeEvent(ticket, ticketext, "ticket.save") == null) {
// Save the receipt and assign a receipt number
try {
dlSales.saveTicket(ticket, m_App.getInventoryLocation());
} catch (BasicException eData) {
MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.nosaveticket"), eData);
msg.show(this);
}
executeEvent(ticket, ticketext, "ticket.close", new ScriptArg("print", paymentdialog.isPrintSelected()));
// Print receipt.
printTicket(paymentdialog.isPrintSelected()
? "Printer.Ticket"
: "Printer.Ticket2", ticket, ticketext);
resultok = true;
}
}