Examples of TicketLineInfo


Examples of com.openbravo.pos.ticket.TicketLineInfo

    private void addTicketLine(ProductInfoExt oProduct, double dMul, double dPrice) {  
       
        TaxInfo tax = taxeslogic.getTaxInfo(oProduct.getTaxCategoryID(), m_oTicket.getCustomer());
       
        addTicketLine(new TicketLineInfo(oProduct, dMul, dPrice, tax, (java.util.Properties) (oProduct.getProperties().clone())));
    }
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

                    Toolkit.getDefaultToolkit().beep();
                } else if (m_App.getDeviceScale().existsScale()) {
                    try {
                        Double value = m_App.getDeviceScale().readWeight();
                        if (value != null) {
                            TicketLineInfo newline = new TicketLineInfo(m_oTicket.getLine(i));
                            newline.setMultiply(value.doubleValue());
                            newline.setPrice(Math.abs(newline.getPrice()));
                            paintTicketLine(i, newline);
                        }
                    } catch (ScaleException e) {
                        // Error de pesada.
                        Toolkit.getDefaultToolkit().beep();
                        new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.noweight"), e).show(this);          
                        stateToZero();
                    }
                } else {
                    // No existe la balanza;
                    Toolkit.getDefaultToolkit().beep();
                }     
               
            // Add one product more to the selected line
            } else if (cTrans == '+'
                    && m_iNumberStatusInput == NUMBERZERO && m_iNumberStatusPor == NUMBERZERO) {
                int i = m_ticketlines.getSelectedIndex();
                if (i < 0){
                    Toolkit.getDefaultToolkit().beep();
                } else {
                    TicketLineInfo newline = new TicketLineInfo(m_oTicket.getLine(i));
                    //If it's a refund + button means one unit less
                    if (m_oTicket.getTicketType() == TicketInfo.RECEIPT_REFUND){
                        newline.setMultiply(newline.getMultiply() - 1.0);
                        paintTicketLine(i, newline);                  
                    }
                    else {
                        // add one unit to the selected line
                        newline.setMultiply(newline.getMultiply() + 1.0);
                        paintTicketLine(i, newline);
                    }
                }

            // Delete one product of the selected line
            } else if (cTrans == '-'
                    && m_iNumberStatusInput == NUMBERZERO && m_iNumberStatusPor == NUMBERZERO
                    && m_App.getAppUserView().getUser().hasPermission("sales.EditLines")) {
               
                int i = m_ticketlines.getSelectedIndex();
                if (i < 0){
                    Toolkit.getDefaultToolkit().beep();
                } else {
                    TicketLineInfo newline = new TicketLineInfo(m_oTicket.getLine(i));
                    //If it's a refund - button means one unit more
                    if (m_oTicket.getTicketType() == TicketInfo.RECEIPT_REFUND){
                        newline.setMultiply(newline.getMultiply() + 1.0);
                        if (newline.getMultiply() >= 0) {
                            removeTicketLine(i);
                        } else {
                            paintTicketLine(i, newline);
                        }
                    } else {
                        // substract one unit to the selected line
                        newline.setMultiply(newline.getMultiply() - 1.0);
                        if (newline.getMultiply() <= 0.0) {                  
                            removeTicketLine(i); // elimino la linea
                        } else {
                            paintTicketLine(i, newline);                  
                        }
                    }
                }

            // Set n products to the selected line
            } else if (cTrans == '+'
                    && m_iNumberStatusInput == NUMBERZERO && m_iNumberStatusPor == NUMBERVALID) {
                int i = m_ticketlines.getSelectedIndex();
                if (i < 0){
                    Toolkit.getDefaultToolkit().beep();
                } else {
                    double dPor = getPorValue();
                    TicketLineInfo newline = new TicketLineInfo(m_oTicket.getLine(i));
                    if (m_oTicket.getTicketType() == TicketInfo.RECEIPT_REFUND) {
                        newline.setMultiply(-dPor);
                        newline.setPrice(Math.abs(newline.getPrice()));
                        paintTicketLine(i, newline);               
                    } else {
                        newline.setMultiply(dPor);
                        newline.setPrice(Math.abs(newline.getPrice()));
                        paintTicketLine(i, newline);
                    }
                }

            // Set n negative products to the selected line
            } else if (cTrans == '-'
                    && m_iNumberStatusInput == NUMBERZERO && m_iNumberStatusPor == NUMBERVALID
                    && m_App.getAppUserView().getUser().hasPermission("sales.EditLines")) {
               
                int i = m_ticketlines.getSelectedIndex();
                if (i < 0){
                    Toolkit.getDefaultToolkit().beep();
                } else {
                    double dPor = getPorValue();
                    TicketLineInfo newline = new TicketLineInfo(m_oTicket.getLine(i));
                    if (m_oTicket.getTicketType() == TicketInfo.RECEIPT_NORMAL) {
                        newline.setMultiply(dPor);
                        newline.setPrice(-Math.abs(newline.getPrice()));
                        paintTicketLine(i, newline);
                    }          
                }

            // Anadimos 1 producto
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

        int i = m_ticketlines.getSelectedIndex();
        if (i < 0){
            Toolkit.getDefaultToolkit().beep(); // no line selected
        } else {
            try {
                TicketLineInfo newline = JProductLineEdit.showMessage(this, m_App, m_oTicket.getLine(i));
                if (newline != null) {
                    // line has been modified
                    paintTicketLine(i, newline);
                }
            } catch (BasicException e) {
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

        int i = m_ticketlines.getSelectedIndex();
        if (i < 0) {
            Toolkit.getDefaultToolkit().beep(); // no line selected
        } else {
            try {
                TicketLineInfo line = m_oTicket.getLine(i);
                JProductAttEdit attedit = JProductAttEdit.getAttributesEditor(this, m_App.getSession());
                attedit.editAttributes(line.getProductAttSetId(), line.getProductAttSetInstId());
                attedit.setVisible(true);
                if (attedit.isOK()) {
                    // The user pressed OK
                    line.setProductAttSetInstId(attedit.getAttributeSetInst());
                    line.setProductAttSetInstDesc(attedit.getAttributeSetInstDescription());
                    paintTicketLine(i, line);
                }
            } catch (BasicException ex) {
                MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindattributes"), ex);
                msg.show(this);
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

          discountrate/=100;

          int index = m_ticketlines.getSelectedIndex();
          String sdiscount;
        TicketLineInfo remise;

          if (index >= 0) {
             TicketLineInfo line = m_oTicket.getLine(index);
             if (line.getPrice() > 0.0 && discountrate > 0.0) {

                 sdiscount = Formats.PERCENT.formatValue(discountrate);
                remise = new TicketLineInfo("Remise " + line.getProductName() + " " + sdiscount,
                     line.getProductTaxCategoryID(),
                     line.getMultiply(),
                     -line.getPrice () * discountrate,
                     line.getTaxInfo());
                int i = index + 1;
                 m_oTicket.insertLine(i, remise);
                 refreshTicket();
                  setSelectedIndex(i);
             }
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

                taxes = m_oTicket.getTaxLines();
                for (int i = 0; i < taxes.length; i++) {

                    taxline = taxes[i];
                    m_oTicket.insertLine(m_oTicket.getLinesCount(),
                            new TicketLineInfo(
                            "Remise totale " + sdiscount,
                            taxline.getTaxInfo().getTaxCategoryID(),
                            1.0,
                            -taxline.getSubTotal() * discountrate,
                            taxline.getTaxInfo()));
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

//        refreshTicket();
           
        for (int i = 0; i < tLines.size(); i++) {

            TicketLineInfo currentLine = tLines.get(i);
            taxline = currentLine.getTaxInfo();
           
            if (taxline.getName().contains(taxTakeAwayName)) {

                marge = (currentLine.getPriceTax() / taxTakeAway);
                currentLine.setPrice(marge);
                m_oTicket.setLine(i, currentLine);
            }
        }


        refreshTicket();
        if (closeTicket(m_oTicket, m_oTicketExt)) {
            m_ticketsbag.deleteTicket();

        } else {
            m_oTicket.setCustomer(null);
             refreshTicket();
            for (int i = 0; i < tLines.size(); i++) {

                // taxline = taxes[i];
                TicketLineInfo currentLine = tLines.get(i);
                taxline = currentLine.getTaxInfo();

               
                if (taxline.getName().contains(taxTakeAwayName)) {
                    Double tax = (taxline.getRate())+1.0;

                    marge = ((currentLine.getPrice()*taxTakeAway) / tax);
                    currentLine.setPrice(marge);

                    m_oTicket.setLine(i, currentLine);
                }

            }
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

                taxes = m_oTicket.getTaxLines();
                for (int i = 0; i < taxes.length; i++) {

                    taxline = taxes[i];
                    m_oTicket.insertLine(m_oTicket.getLinesCount(),
                            new TicketLineInfo(
                            "Service supp. " + sdiscount,
                            taxline.getTaxInfo().getTaxCategoryID(),
                            1.0,
                            +taxline.getSubTotal() * discountrate,
                            taxline.getTaxInfo()));
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

          discountrate/=100;

          int index = m_ticketlines.getSelectedIndex();
          String sdiscount;
        TicketLineInfo remise;

          if (index >= 0) {
             TicketLineInfo line = m_oTicket.getLine(index);
             if (line.getPrice() > 0.0 && discountrate > 0.0) {

                 sdiscount = Formats.PERCENT.formatValue(discountrate);
                remise = new TicketLineInfo("Supplément " + line.getProductName() + " " + sdiscount,
                     line.getProductTaxCategoryID(),
                     line.getMultiply(),
                     +line.getPrice () * discountrate,
                     line.getTaxInfo());
                int i = index + 1;
                 m_oTicket.insertLine(i, remise);
                 refreshTicket();
                  setSelectedIndex(i);
             }
View Full Code Here

Examples of com.openbravo.pos.ticket.TicketLineInfo

      
        if (i >= 0) {

            List<TicketLineInfo> l = new ArrayList<TicketLineInfo>();
           
            TicketLineInfo line = ticket.getLine(i);
            l.add(line);
            ticket.removeLine(i);
            ticketlines.removeTicketLine(i);
           
            // add also auxiliars
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.