Package com.openbravo.pos.ticket

Examples of com.openbravo.pos.ticket.TaxInfo


        return oProduct;
    }
   
    private double includeTaxes(String tcid, double dValue) {
        if (m_jaddtax.isSelected()) {
            TaxInfo tax = taxeslogic.getTaxInfo(tcid,  m_oTicket.getDate(), 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.getDate(), 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

    public final SentenceList getTaxList() {
        return new StaticSentence(s
            , "SELECT ID, NAME, CATEGORY, VALIDFROM, CUSTCATEGORY, PARENTID, RATE, RATECASCADE, RATEORDER FROM TAXES ORDER BY NAME"
            , null
            , new SerializerRead() { public Object readValues(DataRead dr) throws BasicException {
                return new TaxInfo(
                        dr.getString(1),
                        dr.getString(2),
                        dr.getString(3),
                        dr.getTimestamp(4),
                        dr.getString(5),
View Full Code Here

   
    private String getProductLabel(ProductInfoExt product) {

        if (pricevisible) {
            if (taxesincluded) {
                TaxInfo tax = taxeslogic.getTaxInfo(product.getTaxCategoryID(), new Date());
                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

    }


    @Override
    protected TaxInfo map2VO(ResultSet rs) throws SQLException {
        TaxInfo tax = new TaxInfo();
        tax.setId(rs.getString("id"));
        tax.setName(rs.getString("name"));
        tax.setTaxcategoryid(rs.getString("category"));
        tax.setTaxcustcategoryid(rs.getString("custcategory"));
        tax.setParentID(rs.getString("parentid"));
        tax.setRate(rs.getDouble("rate"));
        tax.setCascade(rs.getBoolean("ratecascade"));
        tax.setOrder(rs.getInt("rateorder"));

        return tax;
    }
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.