Package com.openbravo.pos.ticket

Examples of com.openbravo.pos.ticket.TaxInfo


      }
     
      HashMap<String, Double> localTaxes = new HashMap<String, Double>();
      Iterator<TaxInfo> taxList = dlsales.getTaxList().list().iterator();
      while (taxList.hasNext()) {
        TaxInfo ti = (TaxInfo) taxList.next();
        localTaxes.put(ti.getTaxCategoryID(),ti.getRate());
      }
      HashMap<Double, String> remoteTaxes = externalsales.getTaxes();


     
View Full Code Here


        }
   }

    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

        return oProduct;
    }
   
    private double includeTaxes(String tcid, double dValue) {
        if (m_jaddtax.isSelected()) {
            TaxInfo tax = taxeslogic.getTaxInfo(tcid, m_oTicket.getCustomer());
            double dTaxRate = tax == null ? 0.0 : tax.getRate();          
            return dValue / (1.0 + dTaxRate);     
        } else {
            return dValue;
        }
    }
View Full Code Here

                stateToZero();
            } else {
                // Se anade directamente una unidad con el precio y todo
                if (m_jaddtax.isSelected()) {
                    // debemos quitarle los impuestos ya que el precio es con iva incluido...
                    TaxInfo tax = taxeslogic.getTaxInfo(oProduct.getTaxCategoryID(), m_oTicket.getCustomer());
                    addTicketLine(oProduct, 1.0, dPriceSell / (1.0 + tax.getRate()));
                } else {
                    addTicketLine(oProduct, 1.0, dPriceSell);
                }               
            }
        } catch (BasicException eData) {
View Full Code Here

    private void jTakeAwayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTakeAwayActionPerformed
        List<TicketLineInfo> tLines;
        // TicketLineInfo currentLine;
        TicketTaxInfo[] taxes;
        TaxInfo taxline;
        Double marge;

/*
* Mettre le client à Emporter à "invisible"
* remplacer les données ci-dessous par les bonnes
*
*
*
*/
        Double taxTakeAway = 1.06//taxe à emporter = 6%
        String takeAwayID = "8ba8e7e2-197f-4296-9531-ed27ad875ad8"; // ID du client "A Emporter"
        String taxTakeAwayName = "Sur Place"; // Nom de la taxe "Sur Place"

        double total = m_oTicket.getTotal();
        if (total <= 0.0) {
            java.awt.Toolkit.getDefaultToolkit().beep();
            return;
        }

        tLines = m_oTicket.getLines();

        try {
            m_oTicket.setCustomer(dlSales.loadCustomerExt(takeAwayID));

        } catch (BasicException e) {
            MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindcustomer"), e);
            msg.show(this);
        }

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

   
    private String getProductLabel(ProductInfoExt product) {

        if (pricevisible) {
            if (taxesincluded) {
                TaxInfo tax = taxeslogic.getTaxInfo(product.getTaxCategoryID());
                return "<html><center>" + product.getName() + "<br>" + product.printPriceSellTax(tax);
            } else {
                return "<html><center>" + product.getName() + "<br>" + product.printPriceSell();
            }
        } else {
View Full Code Here

    public double getTaxRate(String tcid, CustomerInfoExt customer) {
       
        if (tcid == null) {
            return 0.0;
        } else {
            TaxInfo tax = getTaxInfo(tcid, customer);
            if (tax == null) {
                return 0.0;
            } else {
                return tax.getRate();
            }           
        }
    }
View Full Code Here

    }   
   
    public TaxInfo getTaxInfo(String tcid, CustomerInfoExt customer) {
       
       
        TaxInfo defaulttax = null;
       
        for (TaxInfo tax : taxlist) {
            if (tax.getParentID() == null && tax.getTaxCategoryID().equals(tcid)) {
                if ((customer == null || customer.getTaxCustCategoryID() == null) && tax.getTaxCustCategoryID() == null) {
                    return tax;
View Full Code Here

        }
   }

    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

        return oProduct;
    }
   
    private double includeTaxes(String tcid, double dValue) {
        if (m_jaddtax.isSelected()) {
            TaxInfo tax = taxeslogic.getTaxInfo(tcid, m_oTicket.getCustomer());
            double dTaxRate = tax == null ? 0.0 : tax.getRate();          
            return dValue / (1.0 + dTaxRate);     
        } else {
            return dValue;
        }
    }
View Full Code Here

TOP

Related Classes of com.openbravo.pos.ticket.TaxInfo

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.