PageRenderTime 14ms CodeModel.GetById 0ms RepoModel.GetById 1ms 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
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  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. */
  17. package mpv5.db.objects;
  18. import java.math.BigDecimal;
  19. import javax.swing.JComponent;
  20. import mpv5.db.common.Context;
  21. import mpv5.db.common.DatabaseObject;
  22. import mpv5.ui.panels.ProductPanel;
  23. /**
  24. *
  25. *
  26. */
  27. public class ProductPrice extends DatabaseObject {
  28. private static final long serialVersionUID = 1L;
  29. private Product product;
  30. private BigDecimal externalnetvalue;
  31. private BigDecimal internalnetvalue;
  32. private BigDecimal mincountvalue;
  33. public ProductPrice() {
  34. setContext(Context.getProductPrice());
  35. setCname("ProductPrice@" + IDENTITY);
  36. }
  37. @Override
  38. public JComponent getView() {
  39. return new ProductPanel(getProduct());
  40. }
  41. @Override
  42. public mpv5.utils.images.MPIcon getIcon() {
  43. return null;
  44. }
  45. /**
  46. * @return the product
  47. */
  48. @Persistable(true)
  49. public Product getProduct() {
  50. return product;
  51. }
  52. /**
  53. * @param product the product to set
  54. */
  55. public void setProduct(Product product) {
  56. this.product = product;
  57. }
  58. /**
  59. * @return the externalnetvalue
  60. */
  61. @Persistable(true)
  62. public BigDecimal getExternalnetvalue() {
  63. return externalnetvalue;
  64. }
  65. /**
  66. * @param externalnetvalue the externalnetvalue to set
  67. */
  68. public void setExternalnetvalue(BigDecimal externalnetvalue) {
  69. this.externalnetvalue = externalnetvalue;
  70. }
  71. /**
  72. * @return the internalnetvalue
  73. */
  74. @Persistable(true)
  75. public BigDecimal getInternalnetvalue() {
  76. return internalnetvalue;
  77. }
  78. /**
  79. * @param internalnetvalue the internalnetvalue to set
  80. */
  81. public void setInternalnetvalue(BigDecimal internalnetvalue) {
  82. this.internalnetvalue = internalnetvalue;
  83. }
  84. /**
  85. * @return the mincountvalue
  86. */
  87. @Persistable(true)
  88. public BigDecimal getMincountvalue() {
  89. return mincountvalue;
  90. }
  91. /**
  92. * @param mincountvalue the mincountvalue to set
  93. */
  94. public void setMincountvalue(BigDecimal mincountvalue) {
  95. this.mincountvalue = mincountvalue;
  96. }
  97. @Override
  98. public boolean save(boolean silent) {
  99. setCname("Productprice for " + getProduct() + "@" + mincountvalue);
  100. return super.save(silent);
  101. }
  102. }