Package com.openbravo.pos.payment

Examples of com.openbravo.pos.payment.JPaymentSelect$JPaymentCashCreditCreator


                    // 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;
                        }
                    }
View Full Code Here


                    // 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;
                        }
                    }
View Full Code Here

    //TODO ROUNDED
    long checkPay = Math.round(toPay);
   
    if (checkPay > 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) {
View Full Code Here

     */
}//GEN-LAST:event_m_jRenduActionPerformed

private void jDebtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDebtActionPerformed

    JPaymentSelect paymentdialog;
    paymentdialog = JPaymentSelectCustomer.getDialog(this);
    paymentdialog.init(m_App);
    paymentdialog.setPrintSelected(true);

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

        DataLogicSales dlsales = (DataLogicSales) m_App.getBean("com.openbravo.pos.forms.DataLogicSales");

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

        payments.add(new PaymentInfoTicket(-total, "debtpaid"));
        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());

        try {
            dlsales.saveTicket(ticket, m_App.getInventoryLocation());
        } catch (BasicException eData) {
            MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.nosaveticket"), eData);
View Full Code Here

    } 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) {
View Full Code Here

     */
}//GEN-LAST:event_m_jRenduActionPerformed

private void jDebtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDebtActionPerformed

    JPaymentSelect paymentdialog;
    paymentdialog = JPaymentSelectCustomer.getDialog(this);
    paymentdialog.init(m_App);
    paymentdialog.setPrintSelected(true);

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

        DataLogicSales dlsales = (DataLogicSales) m_App.getBean("com.openbravo.pos.forms.DataLogicSales");

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

        payments.add(new PaymentInfoTicket(-total, "debtpaid"));
        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());

        try {
            dlsales.saveTicket(ticket, m_App.getInventoryLocation());
        } catch (BasicException eData) {
            MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.nosaveticket"), eData);
View Full Code Here

                    // Muestro el total
                    printTicket("Printer.TicketTotal", ticket, ticketext);
                   
                   
                    // Select the Payments information
                    JPaymentSelect paymentdialog = ticket.getTicketType() == TicketInfo.RECEIPT_NORMAL
                            ? paymentdialogreceipt
                            : paymentdialogrefund;
                    paymentdialog.setPrintSelected("true".equals(m_jbtnconfig.getProperty("printselected", "true")));

                    paymentdialog.setTransactionID(ticket.getTransactionID());

                    if (paymentdialog.showDialog(ticket.getTotal(), ticket.getCustomer())) {

                        // 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

                        // MJARA 19/04/2011
                        //Generar el código de ticket por el tipo de comprobante
                        if (ticket.getCustomer() == null) {
                            ticket.setDocType(0);
                        }
                        else {
                            ticket.setDocType(1);
                        }

                        // MJARA 19/04/2011

                        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;
                        }
                    }
View Full Code Here

TOP

Related Classes of com.openbravo.pos.payment.JPaymentSelect$JPaymentCashCreditCreator

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.