View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Add page
Show collection (0 pages)
Collections help

Search

POS - Remove 0 byte Old Tickets

Code snippet

Name: POS - Remove 0 byte Old Tickets
Version: POS/2.20 & 2.30
Author: James Bolongan



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.

Retrieved from "http://wiki.openbravo.com/wiki/POS_-_Remove_0_byte_Old_Tickets"

This page has been accessed 3,961 times. This page was last modified on 19 November 2009, at 04:03. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.