POS - Remove 0 byte Old Tickets
Code snippetName: POS - Remove 0 byte Old Tickets
|
This functionality/code is created based on this thread.
View saveCurrentTicket method in the JTicketsBagShared class.
Update the saveCurrentTicket function with this new code.
Code:
private void saveCurrentTicket() { // save current ticket, if exists, if (m_sCurrentTicket != null) { try { dlReceipts.insertSharedTicket(m_sCurrentTicket, m_panelticket.getActiveTicket()); TicketInfo l = dlReceipts.getSharedTicket(m_sCurrentTicket); if(l.getLinesCount() == 0) { dlReceipts.deleteSharedTicket(m_sCurrentTicket); } } catch (BasicException e) { new MessageInf(e).show(this); } } }
This saveCurrentTicket function is now included a functionality that will not saved a ticket if the sales is empty or a 0-byte ticket.