Package com.openbravo.data.gui

Examples of com.openbravo.data.gui.MessageInf


            try {
                ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
                script.put("ticket", m_ticket);
                m_TTP2.printTicket(script.eval(m_dlSystem.getResourceAsXML("Printer.TicketPreview2")).toString());
            } catch (ScriptException e) {
                JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotprint"), e));
            } catch (TicketPrinterException e) {
                JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotprint"), e));
            }
        }
    // TODO add your handling code here:
}//GEN-LAST:event_m_jPrint1ActionPerformed
View Full Code Here


            try {
                ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
                script.put("ticket", m_ticket);
                m_TTP.printTicket(script.eval(m_dlSystem.getResourceAsXML("Printer.TicketPreview")).toString());
            } catch (ScriptException e) {
                MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotprintticket"), e);
                msg.show(this);
            } catch (TicketPrinterException eTP) {
                MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotprintticket"), eTP);
                msg.show(this);
            }
        }
    }
View Full Code Here

                    dlintegration.syncCustomer(cinfo);
                }
            }
           
            if (products.length == 0 && customers.length == 0) {
                return new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.zeroproducts"));              
            } else {
                return new MessageInf(MessageInf.SGN_SUCCESS, AppLocal.getIntString("message.syncproductsok"), AppLocal.getIntString("message.syncproductsinfo", products.length, customers.length));
            }
               
        } catch (ServiceException e) {           
            throw new BasicException(AppLocal.getIntString("message.serviceexception"), e);
        } catch (RemoteException e){
View Full Code Here

            try {
                ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
                script.put("ticket", m_ticket);
                m_TTP2.printTicket(script.eval(m_dlSystem.getResourceAsXML("Printer.TicketPreview")).toString());
            } catch (ScriptException e) {
                JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotprint"), e));
            } catch (TicketPrinterException e) {
                JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotprint"), e));
            }
        }

    }//GEN-LAST:event_m_jPrintActionPerformed
View Full Code Here

        int status = 0;
        if (TicketInfo.isWS()) {
            //WebService Sync needs remote order ID.
            if (m_ticket.getStatus() == 0) {

                JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.errorrefund"), AppLocal.getIntString("message.refundnotsynced")));
                return;
            }else if (hasDebt()) {
           
                JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.errorrefund"), AppLocal.getIntString("message.refunddebtremain")+" > "+m_ticket.getDebt()));
                return;
            } else {
                status = m_ticket.getStatus();
            }
        }
View Full Code Here

}//GEN-LAST:event_jButton2ActionPerformed

private void m_jRenduActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jRenduActionPerformed
    if (TicketInfo.isWS() && (m_ticket.getStatus() == 0)) {

        JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.errorrefund"), AppLocal.getIntString("message.refundnotsynced")));
        return;

    }
    currentCustomer = m_ticket.getCustomer();
    double toPay = 0.0;
    try {
        toPay = currentCustomer.getCurdebt();
    } catch (NullPointerException npe) {
    }

    if (TicketInfo.isWS()) {
        //WebService Sync needs remote order ID.
        if (m_ticket.getStatus() == 0) {
            JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.hastobesynced")));
            return;
        } else {
            toPay = m_ticket.hasToBePaid();
        }
    } else {
        toPay = currentCustomer.getCurdebt();
    }

    if (toPay > 0.0) {
        JPaymentSelect paymentdialog;
        paymentdialog = JPaymentSelectCustomer.getDialog(this);
        paymentdialog.init(m_App);
        paymentdialog.setPrintSelected(true);

        if (paymentdialog.showDialog(toPay, currentCustomer, null, null)) {

            TicketInfo ticket = new TicketInfo();
            ticket.setTicketType(TicketInfo.RECEIPT_PAYMENT);

            List<PaymentInfo> payments = paymentdialog.getSelectedPayments();

            double total = 0.0;
            for (PaymentInfo p : payments) {
                total += p.getTotal();
                m_ticket.getPayments().add(p);
            }

            payments.add(new PaymentInfoTicket(-total, "debtpaid"));
            currentDebt -= total;

            ticket.setPayments(payments);
            ticket.setUser(m_App.getAppUserView().getUser().getUserInfo());
            ticket.setActiveCash(m_App.getActiveCashIndex());
            ticket.setDate(new Date());
            ticket.setCustomer(currentCustomer);
            ticket.setDateReturn(paymentdialog.getrDate());
            ticket.setStatus(m_ticket.getStatus());

            try {
                m_dlSales.saveTicket(ticket, m_App.getInventoryLocation());
            } catch (BasicException eData) {
                MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.nosaveticket"), eData);
                msg.show(this);
            }


            // reload customer
            CustomerInfoExt c;
            try {
                c = m_dlSales.loadCustomerExt(currentCustomer.getId());
                if (c == null) {
                    MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindcustomer"));
                    msg.show(this);
                } else {
                    //                   editCustomer(c);
                }
            } catch (BasicException ex) {
                c = null;
                MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindcustomer"), ex);
                msg.show(this);
            }

            m_jRendu.setEnabled(m_ticket != null && (ticket.isPickable()));
            if (ticket != null) {
                try {
                    ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
                    script.put("ticket", ticket);
                    script.put("customer", currentCustomer);
                    m_TTP2.printTicket(script.eval(m_dlSystem.getResourceAsXML("Printer.CustomerPaid")).toString());
                } catch (ScriptException e) {
                    JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotprint"), e));
                } catch (TicketPrinterException e) {
                    JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotprint"), e));
                }
            }

            hasDebt();
View Full Code Here

        ticket.setDateReturn(paymentdialog.getrDate());

        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);
        }


        // reload customer
        CustomerInfoExt c;
        try {
            c = dlsales.loadCustomerExt(currentCustomer.getId());
            if (c == null) {
                MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindcustomer"));
                msg.show(this);
            } else {
                //                   editCustomer(c);
            }
        } catch (BasicException ex) {
            c = null;
            MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindcustomer"), ex);
            msg.show(this);
        }

        hasDebt();

        m_jRendu.setEnabled(m_ticket != null && (ticket.isPickable()));
        if (ticket != null) {
            try {
                ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
                script.put("ticket", ticket);
                script.put("customer", currentCustomer);
                m_TTP2.printTicket(script.eval(m_dlSystem.getResourceAsXML("Printer.CustomerPaid")).toString());
            } catch (ScriptException e) {
                JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotprint"), e));
            } catch (TicketPrinterException e) {
                JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotprint"), e));
            }
        }
    }
}//GEN-LAST:event_jDebtActionPerformed
View Full Code Here

        // save current ticket, if exists,
        if (m_sCurrentTicket != null) {
            try {
                dlReceipts.insertSharedTicket(m_sCurrentTicket, m_panelticket.getActiveTicket());
            } catch (BasicException e) {
                new MessageInf(e).show(this);
           
        }   
    }
View Full Code Here

                newTicket();
            } else {
                setActiveTicket(l.get(0).getId());
            }
        } catch (BasicException e) {
            new MessageInf(e).show(this);
            newTicket();
        }   
    }   
View Full Code Here

                    if (id != null) {
                        saveCurrentTicket();
                        setActiveTicket(id);
                    }
                } catch (BasicException e) {
                    new MessageInf(e).show(JTicketsBagShared.this);
                    newTicket();
                }                   
            }
        });
       
View Full Code Here

TOP

Related Classes of com.openbravo.data.gui.MessageInf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.