PageRenderTime 212ms CodeModel.GetById 110ms app.highlight 5ms RepoModel.GetById 96ms app.codeStats 0ms

/src/mpv5/db/objects/ProductPrice.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 118 lines | 58 code | 16 blank | 44 comment | 0 complexity | 471c1cae0cb192a0a388fab0c2d5585a MD5 | raw file
  1/*
  2 *  This file is part of YaBS.
  3 *
  4 *      YaBS is free software: you can redistribute it and/or modify
  5 *      it under the terms of the GNU General Public License as published by
  6 *      the Free Software Foundation, either version 3 of the License, or
  7 *      (at your option) any later version.
  8 *
  9 *      YaBS is distributed in the hope that it will be useful,
 10 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12 *      GNU General Public License for more details.
 13 *
 14 *      You should have received a copy of the GNU General Public License
 15 *      along with YaBS.  If not, see <http://www.gnu.org/licenses/>.
 16 */
 17package mpv5.db.objects;
 18
 19import java.math.BigDecimal;
 20import javax.swing.JComponent;
 21
 22import mpv5.db.common.Context;
 23import mpv5.db.common.DatabaseObject;
 24import mpv5.ui.panels.ProductPanel;
 25
 26/**
 27 *
 28 * 
 29 */
 30public class ProductPrice extends DatabaseObject {
 31
 32    private static final long serialVersionUID = 1L;
 33    private Product product;
 34    private BigDecimal externalnetvalue;
 35    private BigDecimal internalnetvalue;
 36    private BigDecimal mincountvalue;
 37
 38    public ProductPrice() {
 39        setContext(Context.getProductPrice());
 40        setCname("ProductPrice@" + IDENTITY);
 41    }
 42
 43    @Override
 44    public JComponent getView() {
 45        return new ProductPanel(getProduct());
 46    }
 47
 48    @Override
 49    public mpv5.utils.images.MPIcon getIcon() {
 50        return null;
 51    }
 52
 53    /**
 54     * @return the product
 55     */
 56    @Persistable(true)
 57    public Product getProduct() {
 58        return product;
 59    }
 60
 61    /**
 62     * @param product the product to set
 63     */
 64    public void setProduct(Product product) {
 65        this.product = product;
 66    }
 67
 68    /**
 69     * @return the externalnetvalue
 70     */
 71    @Persistable(true)
 72    public BigDecimal getExternalnetvalue() {
 73        return externalnetvalue;
 74    }
 75
 76    /**
 77     * @param externalnetvalue the externalnetvalue to set
 78     */
 79    public void setExternalnetvalue(BigDecimal externalnetvalue) {
 80        this.externalnetvalue = externalnetvalue;
 81    }
 82
 83    /**
 84     * @return the internalnetvalue
 85     */
 86    @Persistable(true)
 87    public BigDecimal getInternalnetvalue() {
 88        return internalnetvalue;
 89    }
 90
 91    /**
 92     * @param internalnetvalue the internalnetvalue to set
 93     */
 94    public void setInternalnetvalue(BigDecimal internalnetvalue) {
 95        this.internalnetvalue = internalnetvalue;
 96    }
 97
 98    /**
 99     * @return the mincountvalue
100     */
101    @Persistable(true)
102    public BigDecimal getMincountvalue() {
103        return mincountvalue;
104    }
105
106    /**
107     * @param mincountvalue the mincountvalue to set
108     */
109    public void setMincountvalue(BigDecimal mincountvalue) {
110        this.mincountvalue = mincountvalue;
111    }
112
113    @Override
114    public boolean save(boolean silent) {
115        setCname("Productprice for " + getProduct() + "@" + mincountvalue);
116        return super.save(silent);
117    }
118}