comxe-cvslog Mailing List for Compiere ERP-CRM on Oracle XE
Brought to you by:
trifonnt
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(390) |
Jul
(318) |
Aug
(23) |
Sep
(59) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(465) |
Jul
(17) |
Aug
(1517) |
Sep
(138) |
Oct
(9) |
Nov
(8) |
Dec
(15) |
2008 |
Jan
(3) |
Feb
|
Mar
|
Apr
(21) |
May
(9) |
Jun
(6) |
Jul
(1) |
Aug
|
Sep
(4) |
Oct
|
Nov
(12) |
Dec
|
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:16
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/decorator In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model/product/decorator Modified Files: ProductDecorator.java ImportProductDecorator.java GenericProductDecorator.java UomProductDecorator.java Log Message: added more interfaces. Index: GenericProductDecorator.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/decorator/GenericProductDecorator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GenericProductDecorator.java 15 Jun 2008 13:32:39 -0000 1.2 --- GenericProductDecorator.java 27 Nov 2008 11:59:08 -0000 1.3 *************** *** 4,8 **** import java.util.Map; ! import name.trifon.erp.model.product.Product; import org.mvel.CompiledExpression; --- 4,8 ---- import java.util.Map; ! import name.trifon.erp.model.product.impl.Product; import org.mvel.CompiledExpression; Index: ProductDecorator.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/decorator/ProductDecorator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProductDecorator.java 30 Apr 2008 07:05:28 -0000 1.2 --- ProductDecorator.java 27 Nov 2008 11:59:08 -0000 1.3 *************** *** 17,21 **** package name.trifon.erp.model.product.decorator; ! import name.trifon.erp.model.product.Product; --- 17,21 ---- package name.trifon.erp.model.product.decorator; ! import name.trifon.erp.model.product.impl.Product; Index: ImportProductDecorator.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/decorator/ImportProductDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImportProductDecorator.java 29 Jul 2006 21:55:23 -0000 1.1 --- ImportProductDecorator.java 27 Nov 2008 11:59:08 -0000 1.2 *************** *** 17,21 **** package name.trifon.erp.model.product.decorator; ! import name.trifon.erp.model.product.Product; --- 17,21 ---- package name.trifon.erp.model.product.decorator; ! import name.trifon.erp.model.product.impl.Product; Index: UomProductDecorator.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/decorator/UomProductDecorator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UomProductDecorator.java 30 Apr 2008 07:05:28 -0000 1.2 --- UomProductDecorator.java 27 Nov 2008 11:59:08 -0000 1.3 *************** *** 17,21 **** package name.trifon.erp.model.product.decorator; ! import name.trifon.erp.model.product.Product; import name.trifon.erp.model.uom.UOM; --- 17,21 ---- package name.trifon.erp.model.product.decorator; ! import name.trifon.erp.model.product.impl.Product; import name.trifon.erp.model.uom.UOM; |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:16
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/order In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model/order Modified Files: OrderLine.java Order.java Added Files: HasOrderLineItem.java IOrderLineItem.java Log Message: added more interfaces. Index: OrderLine.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/order/OrderLine.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OrderLine.java 29 Jul 2006 21:55:24 -0000 1.1 --- OrderLine.java 27 Nov 2008 11:59:08 -0000 1.2 *************** *** 19,29 **** import java.math.BigDecimal; ! import name.trifon.erp.model.product.Product; import name.trifon.erp.model.tax.Tax; import name.trifon.erp.model.uom.UOM; ! public class OrderLine { ! private Product product; private BigDecimal qty; --- 19,30 ---- import java.math.BigDecimal; ! import name.trifon.erp.model.product.IProduct; ! import name.trifon.erp.model.product.impl.Product; import name.trifon.erp.model.tax.Tax; import name.trifon.erp.model.uom.UOM; ! public class OrderLine implements IOrderLineItem { ! private IProduct product; private BigDecimal qty; *************** *** 39,43 **** public OrderLine (Order order) { this.setOrder(order); ! order.addOrderLine(this); } --- 40,44 ---- public OrderLine (Order order) { this.setOrder(order); ! order.addOrderLineItem(this); } *************** *** 59,63 **** * @return Returns the product of this OrderLine. */ ! public Product getProduct() { return product; } --- 60,64 ---- * @return Returns the product of this OrderLine. */ ! public IProduct getProduct() { return product; } *************** *** 87,90 **** --- 88,92 ---- this.qty = new BigDecimal(qty); } + /** * @param tax The tax to set. Index: Order.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/order/Order.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Order.java 27 Apr 2008 20:58:10 -0000 1.2 --- Order.java 27 Nov 2008 11:59:08 -0000 1.3 *************** *** 22,37 **** import java.util.Vector; import name.trifon.erp.model.tax.Tax; ! public class Order { ! private Collection<OrderLine> orderLines = new Vector<OrderLine>(); ! public void addOrderLine(OrderLine line) { line.setOrder(this); ! orderLines.add(line); } ! public Collection<OrderLine> getOrderLines() { return orderLines; } --- 22,38 ---- import java.util.Vector; + import name.trifon.erp.model.ILineItem; import name.trifon.erp.model.tax.Tax; ! public class Order implements HasOrderLineItem { ! private Collection<IOrderLineItem> orderLines = new Vector<IOrderLineItem>(); ! public void addOrderLineItem(IOrderLineItem line) { line.setOrder(this); ! orderLines.add( line ); } ! public Collection<IOrderLineItem> getOrderLineItems() { return orderLines; } *************** *** 39,47 **** public BigDecimal calculateTax() { BigDecimal result = BigDecimal.ZERO; ! Iterator<OrderLine> lineIterator = orderLines.iterator(); while (lineIterator.hasNext()) { ! OrderLine line = (OrderLine) lineIterator.next(); Tax currentTax = line.getTax(); ! result = result.add(currentTax.calculateTax(line)); // TODO this can be done in OrderLine too } --- 40,48 ---- public BigDecimal calculateTax() { BigDecimal result = BigDecimal.ZERO; ! Iterator<IOrderLineItem> lineIterator = orderLines.iterator(); while (lineIterator.hasNext()) { ! IOrderLineItem line = (IOrderLineItem) lineIterator.next(); Tax currentTax = line.getTax(); ! result = result.add(currentTax.calculateTax( line )); // TODO this can be done in OrderLine too } *************** *** 51,55 **** public BigDecimal getTotal() { BigDecimal result = BigDecimal.ZERO; ! Iterator<OrderLine> lineIterator = orderLines.iterator(); while (lineIterator.hasNext()) { OrderLine line = (OrderLine) lineIterator.next(); --- 52,56 ---- public BigDecimal getTotal() { BigDecimal result = BigDecimal.ZERO; ! Iterator<IOrderLineItem> lineIterator = orderLines.iterator(); while (lineIterator.hasNext()) { OrderLine line = (OrderLine) lineIterator.next(); *************** *** 65,69 **** StringBuffer result = new StringBuffer(); ! Iterator<OrderLine> lineIterator = orderLines.iterator(); while (lineIterator.hasNext()) { OrderLine line = (OrderLine) lineIterator.next(); --- 66,70 ---- StringBuffer result = new StringBuffer(); ! Iterator<IOrderLineItem> lineIterator = orderLines.iterator(); while (lineIterator.hasNext()) { OrderLine line = (OrderLine) lineIterator.next(); *************** *** 80,84 **** StringBuffer result = new StringBuffer(); ! Iterator<OrderLine> lineIterator = orderLines.iterator(); while (lineIterator.hasNext()) { OrderLine line = (OrderLine) lineIterator.next(); --- 81,85 ---- StringBuffer result = new StringBuffer(); ! Iterator<IOrderLineItem> lineIterator = orderLines.iterator(); while (lineIterator.hasNext()) { OrderLine line = (OrderLine) lineIterator.next(); *************** *** 96,99 **** --- 97,111 ---- return result.toString(); } + + public void addLineItem(ILineItem line) { + // TODO Auto-generated method stub + //orderLines.add( line ); + } + + public Collection<ILineItem> getLineItems() { + // TODO Auto-generated method stub + //return orderLines; + return null; + } } --- NEW FILE: IOrderLineItem.java --- package name.trifon.erp.model.order; import java.math.BigDecimal; import name.trifon.erp.model.ILineItem; import name.trifon.erp.model.tax.Tax; public interface IOrderLineItem extends ILineItem { public void setTax(Tax tax); public Tax getTax(); public void setPrice(BigDecimal price); public BigDecimal getPrice(); public void setOrder(Order order); } --- NEW FILE: HasOrderLineItem.java --- package name.trifon.erp.model.order; import java.util.Collection; import name.trifon.erp.model.HasLineItem; public interface HasOrderLineItem extends HasLineItem { public Collection<IOrderLineItem> getOrderLineItems(); public void addOrderLineItem(IOrderLineItem line); } |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:15
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp Modified Files: Main.java Log Message: added more interfaces. Index: Main.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/Main.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Main.java 15 Jun 2008 13:32:40 -0000 1.4 --- Main.java 27 Nov 2008 11:59:08 -0000 1.5 *************** *** 27,36 **** import name.trifon.erp.model.order.Order; import name.trifon.erp.model.order.OrderLine; - import name.trifon.erp.model.product.Product; - import name.trifon.erp.model.product.ProductGroup; import name.trifon.erp.model.product.decorator.GenericProductDecorator; import name.trifon.erp.model.product.decorator.ImportProductDecorator; import name.trifon.erp.model.product.decorator.ProductDecorator; import name.trifon.erp.model.product.decorator.UomProductDecorator; import name.trifon.erp.model.tax.BasicSalesTax; import name.trifon.erp.model.tax.ImportTax; --- 27,36 ---- import name.trifon.erp.model.order.Order; import name.trifon.erp.model.order.OrderLine; import name.trifon.erp.model.product.decorator.GenericProductDecorator; import name.trifon.erp.model.product.decorator.ImportProductDecorator; import name.trifon.erp.model.product.decorator.ProductDecorator; import name.trifon.erp.model.product.decorator.UomProductDecorator; + import name.trifon.erp.model.product.impl.Product; + import name.trifon.erp.model.product.impl.ProductGroup; import name.trifon.erp.model.tax.BasicSalesTax; import name.trifon.erp.model.tax.ImportTax; |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:15
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/impl In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model/product/impl Added Files: ProductGroup.java Product.java Log Message: added more interfaces. --- NEW FILE: ProductGroup.java --- /* * Copyright 2005-2006 Trifon N. Trifonov. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package name.trifon.erp.model.product.impl; import java.util.HashSet; import java.util.Set; import name.trifon.erp.model.product.IProduct; import name.trifon.erp.model.product.IProductGroup; /** * TODO - Trifon; What if we want to have one product belonging to two ProductGroups? * With current design this is not a problem. But research is required in order to find how to persist it? * @author trifon * */ public class ProductGroup implements IProductGroup { private String name; private Set<String> products = new HashSet<String>(); public static ProductGroup BOOKS_GROUP = new ProductGroup("books"); public static ProductGroup FOOD_GROUP = new ProductGroup("food"); public static ProductGroup MEDICAL_GROUP = new ProductGroup("medical products"); public ProductGroup(String name) { this.name = name; } /** * @return Returns the name of this ProductGroup. */ public String getName() { return name; } /** * @return Returns all products belonging to this Group. */ public Set<String> getProducts() { return products; } /** * @return true if this group contains product. */ public boolean containsProduct(IProduct product) throws IllegalArgumentException { if (product == null) { throw new IllegalArgumentException("Argument product is null!"); } return products.contains(product.getKey()); } public void addProduct(Product product) throws IllegalArgumentException { if (product == null) { throw new IllegalArgumentException("Argument product is null!"); } products.add( product.getKey() ); } } --- NEW FILE: Product.java --- /* * Copyright 2005-2006 Trifon N. Trifonov. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package name.trifon.erp.model.product.impl; import name.trifon.erp.model.product.IProduct; public class Product implements IProduct { private String id; private String key; private String name; public static final Product BOOK = new Product("book_ID", "book"); public static final Product MUSIC_CD = new Product("music_ID", "music CD"); public static final Product CHOCOLATE = new Product("chocolate_ID", "chocolate"); public static final Product PERFUME = new Product("perfume_ID", "perfume"); public static final Product HEADACHE_PILLS = new Product("headachePills_ID", "headache pills"); public Product(String key, String name) throws IllegalArgumentException { if (key == null) { throw new IllegalArgumentException("Product KEY MUST not be null!!!"); } this.key = key; setName( name ); } /** * @return Returns the name of the product. */ public String getName() { return name; } /** * @param name New name of the product to set. */ public void setName(String name) { this.name = name; } /** * @return Returns the key of this Product. */ public String getKey() { return key; } /** * @param name New key of the product to set. */ public void setKey(String key) { this.key = key; } /** * @return Returns the Id of this Product. */ public String getId() { return id; } } |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:15
|
Update of /cvsroot/comxe/Trifon-HG-ERP In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001 Modified Files: Main.launch Log Message: added more interfaces. Index: Main.launch =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/Main.launch,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Main.launch 29 Jul 2006 21:55:23 -0000 1.1 --- Main.launch 27 Nov 2008 11:59:08 -0000 1.2 *************** *** 1,12 **** <?xml version="1.0" encoding="UTF-8"?> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> - <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="name.trifon.erp.Main"/> - <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> - <listEntry value="4"/> - </listAttribute> - <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Trifon-HG-ERP"/> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> ! <listEntry value="/Trifon-HG-ERP"/> </listAttribute> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> </launchConfiguration> --- 1,12 ---- <?xml version="1.0" encoding="UTF-8"?> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> ! <listEntry value="/Trifon-HG-ERP/src/name/trifon/erp/Main.java"/> ! </listAttribute> ! <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> ! <listEntry value="1"/> </listAttribute> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> + <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="name.trifon.erp.Main"/> + <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Trifon-HG-ERP"/> </launchConfiguration> |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:15
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/invoice In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model/invoice Modified Files: InvoiceLine.java Log Message: added more interfaces. Index: InvoiceLine.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/invoice/InvoiceLine.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InvoiceLine.java 27 Apr 2008 20:58:10 -0000 1.2 --- InvoiceLine.java 27 Nov 2008 11:59:08 -0000 1.3 *************** *** 1,8 **** package name.trifon.erp.model.invoice; ! public class InvoiceLine { private Invoice invoice = null; public void setInvoice(Invoice invoice) { --- 1,65 ---- package name.trifon.erp.model.invoice; ! import java.math.BigDecimal; ! ! import name.trifon.erp.model.ILineItem; ! import name.trifon.erp.model.product.IProduct; ! import name.trifon.erp.model.product.impl.Product; ! ! public class InvoiceLine implements ILineItem { ! ! private IProduct product; ! ! private BigDecimal qty; ! ! private BigDecimal price; private Invoice invoice = null; + /** + * @return Returns the price of the product set in this OrderLine. + */ + public BigDecimal getPrice() { + return price; + } + + /** + * @param price new price to set. + */ + public void setPrice(BigDecimal price) { + this.price = price; + } + + /** + * @return Returns the product of this OrderLine. + */ + public IProduct getProduct() { + return product; + } + + /** + * @param product The product to set. + */ + public void setProduct(Product product) { + this.product = product; + } + + /** + * @return Returns the qty in this OrderLine. + */ + public BigDecimal getQty() { + return qty; + } + + /** + * @param qty The qty to set. + */ + public void setQty(BigDecimal qty) { + this.qty = qty; + } + + public void setQty(int qty) { + this.qty = new BigDecimal(qty); + } public void setInvoice(Invoice invoice) { |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:15
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model/account Modified Files: AccountEntry.java Log Message: added more interfaces. Index: AccountEntry.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account/AccountEntry.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AccountEntry.java 6 May 2008 13:02:38 -0000 1.3 --- AccountEntry.java 27 Nov 2008 11:59:08 -0000 1.4 *************** *** 28,32 **** import name.trifon.erp.model.misc.Money; import name.trifon.erp.model.partner.BusinessPartner; ! import name.trifon.erp.model.product.Product; import name.trifon.erp.model.project.Project; --- 28,32 ---- import name.trifon.erp.model.misc.Money; import name.trifon.erp.model.partner.BusinessPartner; ! import name.trifon.erp.model.product.impl.Product; import name.trifon.erp.model.project.Project; *************** *** 344,347 **** --- 344,361 ---- this.businessPartner = partner; } + + /** + * @return the salesRegion + */ + public SalesRegion getSalesRegion() { + return salesRegion; + } + + /** + * @param salesRegion the salesRegion to set + */ + public void setSalesRegion(SalesRegion salesRegion) { + this.salesRegion = salesRegion; + } } |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:15
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model/product Added Files: IProductGroup.java IProduct.java Removed Files: ProductGroup.java Product.java Log Message: added more interfaces. --- ProductGroup.java DELETED --- --- Product.java DELETED --- --- NEW FILE: IProduct.java --- package name.trifon.erp.model.product; public interface IProduct { public String getName(); public void setName(String name); public String getKey(); public void setKey(String key); } --- NEW FILE: IProductGroup.java --- package name.trifon.erp.model.product; public interface IProductGroup { public String getName(); } |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:14
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax/calculation In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model/tax/calculation Modified Files: ITaxCalculationAlgorithm.java FiveCentRoundingTaxCalculationAlgorithm.java Log Message: added more interfaces. Index: ITaxCalculationAlgorithm.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax/calculation/ITaxCalculationAlgorithm.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ITaxCalculationAlgorithm.java 30 Apr 2008 07:05:29 -0000 1.2 --- ITaxCalculationAlgorithm.java 27 Nov 2008 11:59:08 -0000 1.3 *************** *** 19,23 **** import java.math.BigDecimal; ! import name.trifon.erp.model.order.OrderLine; import name.trifon.erp.model.tax.Tax; --- 19,23 ---- import java.math.BigDecimal; ! import name.trifon.erp.model.order.IOrderLineItem; import name.trifon.erp.model.tax.Tax; *************** *** 39,43 **** */ ! public BigDecimal doCalculation(OrderLine line, Tax tax); } --- 39,43 ---- */ ! public BigDecimal doCalculation(IOrderLineItem line, Tax tax); } Index: FiveCentRoundingTaxCalculationAlgorithm.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax/calculation/FiveCentRoundingTaxCalculationAlgorithm.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FiveCentRoundingTaxCalculationAlgorithm.java 30 Apr 2008 07:05:29 -0000 1.3 --- FiveCentRoundingTaxCalculationAlgorithm.java 27 Nov 2008 11:59:08 -0000 1.4 *************** *** 21,25 **** import name.trifon.erp.model.Const; ! import name.trifon.erp.model.order.OrderLine; import name.trifon.erp.model.tax.Tax; --- 21,25 ---- import name.trifon.erp.model.Const; ! import name.trifon.erp.model.order.IOrderLineItem; import name.trifon.erp.model.tax.Tax; *************** *** 28,32 **** private static Logger logger = Logger.getLogger(FiveCentRoundingTaxCalculationAlgorithm.class.getName()); ! public BigDecimal doCalculation(OrderLine line, Tax tax) { BigDecimal result = null; --- 28,32 ---- private static Logger logger = Logger.getLogger(FiveCentRoundingTaxCalculationAlgorithm.class.getName()); ! public BigDecimal doCalculation(IOrderLineItem line, Tax tax) { BigDecimal result = null; |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:13
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model/tax Modified Files: ImportTax.java BasicSalesTax.java Tax.java Log Message: added more interfaces. Index: ImportTax.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax/ImportTax.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImportTax.java 30 Apr 2008 07:05:28 -0000 1.2 --- ImportTax.java 27 Nov 2008 11:59:08 -0000 1.3 *************** *** 19,23 **** import java.math.BigDecimal; ! import name.trifon.erp.model.order.OrderLine; public class ImportTax extends Tax { --- 19,23 ---- import java.math.BigDecimal; ! import name.trifon.erp.model.order.IOrderLineItem; public class ImportTax extends Tax { *************** *** 41,45 **** } ! public boolean isTaxApplicable(OrderLine line) { return true; } --- 41,45 ---- } ! public boolean isTaxApplicable(IOrderLineItem line) { return true; } Index: Tax.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax/Tax.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Tax.java 6 Sep 2008 12:29:05 -0000 1.4 --- Tax.java 27 Nov 2008 11:59:08 -0000 1.5 *************** *** 20,24 **** import java.util.logging.Logger; ! import name.trifon.erp.model.order.OrderLine; import name.trifon.erp.model.tax.calculation.FiveCentRoundingTaxCalculationAlgorithm; import name.trifon.erp.model.tax.calculation.ITaxCalculationAlgorithm; --- 20,24 ---- import java.util.logging.Logger; ! import name.trifon.erp.model.order.IOrderLineItem; import name.trifon.erp.model.tax.calculation.FiveCentRoundingTaxCalculationAlgorithm; import name.trifon.erp.model.tax.calculation.ITaxCalculationAlgorithm; *************** *** 67,71 **** * @return tax rate */ ! public BigDecimal getTaxRate(OrderLine line) { return rate; } --- 67,71 ---- * @return tax rate */ ! public BigDecimal getTaxRate(IOrderLineItem line) { return rate; } *************** *** 77,81 **** * @return tax for given OrderLine */ ! public BigDecimal calculateTax(OrderLine line) { if (line == null) { throw new IllegalArgumentException("Order Line MUST not be null!"); --- 77,81 ---- * @return tax for given OrderLine */ ! public BigDecimal calculateTax(IOrderLineItem line) { if (line == null) { throw new IllegalArgumentException("Order Line MUST not be null!"); *************** *** 100,104 **** * @return true if tax have to be applied */ ! public abstract boolean isTaxApplicable(OrderLine line); /** --- 100,104 ---- * @return true if tax have to be applied */ ! public abstract boolean isTaxApplicable(IOrderLineItem line); /** Index: BasicSalesTax.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax/BasicSalesTax.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicSalesTax.java 6 Sep 2008 12:29:05 -0000 1.3 --- BasicSalesTax.java 27 Nov 2008 11:59:08 -0000 1.4 *************** *** 19,24 **** import java.math.BigDecimal; ! import name.trifon.erp.model.order.OrderLine; ! import name.trifon.erp.model.product.ProductGroup; public class BasicSalesTax extends Tax { --- 19,24 ---- import java.math.BigDecimal; ! import name.trifon.erp.model.order.IOrderLineItem; ! import name.trifon.erp.model.product.impl.ProductGroup; public class BasicSalesTax extends Tax { *************** *** 38,42 **** } ! public boolean isTaxApplicable(OrderLine line) { boolean result = true; --- 38,42 ---- } ! public boolean isTaxApplicable(IOrderLineItem line) { boolean result = true; |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:13
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27001/src/name/trifon/erp/model Added Files: HasLineItem.java ILineItem.java Log Message: added more interfaces. --- NEW FILE: ILineItem.java --- package name.trifon.erp.model; import java.math.BigDecimal; import name.trifon.erp.model.product.IProduct; public interface ILineItem { public IProduct getProduct(); public BigDecimal getQty(); } --- NEW FILE: HasLineItem.java --- package name.trifon.erp.model; import java.util.Collection; public interface HasLineItem { public Collection<ILineItem> getLineItems(); public void addLineItem(ILineItem line); } |
From: Trifon N. T. <tri...@us...> - 2008-11-27 11:59:09
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/impl In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26985/src/name/trifon/erp/model/product/impl Log Message: Directory /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/impl added to the repository |
From: Trifon N. T. <tri...@us...> - 2008-09-06 12:29:10
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/core In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29651/src/name/trifon/erp/model/core Removed Files: CurrencyRate.java Log Message: small refactoring. --- CurrencyRate.java DELETED --- |
From: Trifon N. T. <tri...@us...> - 2008-09-06 12:29:09
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29651/src/name/trifon/erp/model/tax Modified Files: BasicSalesTax.java Tax.java Log Message: small refactoring. Index: Tax.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax/Tax.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Tax.java 30 Apr 2008 07:05:28 -0000 1.3 --- Tax.java 6 Sep 2008 12:29:05 -0000 1.4 *************** *** 83,87 **** BigDecimal result = BigDecimal.ZERO; ! // First deligate calculation to parent Tax if (parentTax != null) { result = parentTax.calculateTax( line ); --- 83,87 ---- BigDecimal result = BigDecimal.ZERO; ! // First delegate calculation to parent Tax if (parentTax != null) { result = parentTax.calculateTax( line ); Index: BasicSalesTax.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/tax/BasicSalesTax.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicSalesTax.java 30 Apr 2008 07:05:28 -0000 1.2 --- BasicSalesTax.java 6 Sep 2008 12:29:05 -0000 1.3 *************** *** 42,48 **** if (ProductGroup.BOOKS_GROUP.containsProduct( line.getProduct() ) ! || ProductGroup.FOOD_GROUP.containsProduct( line.getProduct() ) ! || ProductGroup.MEDICAL_GROUP.containsProduct( line.getProduct() ) ! ){ result = false; } --- 42,49 ---- if (ProductGroup.BOOKS_GROUP.containsProduct( line.getProduct() ) ! || ProductGroup.FOOD_GROUP.containsProduct( line.getProduct() ) ! || ProductGroup.MEDICAL_GROUP.containsProduct( line.getProduct() ) ! ) ! { result = false; } |
From: Trifon N. T. <tri...@us...> - 2008-09-06 12:29:09
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/currency In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29651/src/name/trifon/erp/model/currency Added Files: CurrencyRate.java Log Message: small refactoring. --- NEW FILE: CurrencyRate.java --- package name.trifon.erp.model.currency; import java.util.Currency; import name.trifon.erp.model.core.BaseModel; import name.trifon.erp.model.misc.DateRange; public class CurrencyRate implements BaseModel { /** * */ private static final long serialVersionUID = 5644207407472186994L; private String searchKey; // Account code private String name; private String description; private Currency fromCurrency; private Currency toCurrency; private DateRange period; private Double rate; public CurrencyRate(Currency from, Currency to, DateRange period, Double rate) throws IllegalArgumentException { if (from == null) { throw new IllegalArgumentException("Currency 'from' can't be null!"); } if (to == null) { throw new IllegalArgumentException("Currency 'to' can't be null!"); } if (period == null) { throw new IllegalArgumentException("Period can't be null!"); } if (rate == null) { throw new IllegalArgumentException("Currency Exchange Rate can't be null!"); } fromCurrency = from; } public String getSearchKey() { return searchKey; } public void setSearchKey(String key) { this.searchKey = key; } /** * @return the name */ public String getName() { return name; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the description */ public String getDescription() { return description; } /** * @param description the description to set */ public void setDescription(String description) { this.description = description; } /** * @return the fromCurrency */ public Currency getFromCurrency() { return fromCurrency; } /** * @return the toCurrency */ public Currency getToCurrency() { return toCurrency; } /** * @return the period */ public DateRange getPeriod() { return period; } /** * @return the rate */ public Double getRate() { return rate; } } |
From: Trifon N. T. <tri...@us...> - 2008-09-06 12:29:03
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/currency In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29389/src/name/trifon/erp/model/currency Log Message: Directory /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/currency added to the repository |
From: Trifon N. T. <tri...@us...> - 2008-07-03 15:42:16
|
Update of /cvsroot/comxe/d3soft/GAG/doc In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23521/doc Modified Files: GUI-display-size.txt Log Message: typo errors. Index: GUI-display-size.txt =================================================================== RCS file: /cvsroot/comxe/d3soft/GAG/doc/GUI-display-size.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GUI-display-size.txt 10 Sep 2007 14:51:22 -0000 1.1 --- GUI-display-size.txt 3 Jul 2008 15:38:37 -0000 1.2 *************** *** 94,98 **** ! It's better that you work using tha latest OX version, at the momment 2.1.4 Have note of all the changes you do. --- 94,98 ---- ! It's better that you work using the latest OX version, at the moment 2.1.4 Have note of all the changes you do. |
From: Trifon N. T. <tri...@us...> - 2008-06-15 13:32:48
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27535/src/name/trifon/erp Modified Files: Main.java Log Message: added eclipse launch configuration Index: Main.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/Main.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Main.java 6 May 2008 13:02:38 -0000 1.3 --- Main.java 15 Jun 2008 13:32:40 -0000 1.4 *************** *** 51,54 **** --- 51,55 ---- } catch (IOException e) { e.printStackTrace(); + return; } // handler = new ConsoleHandler(); *************** *** 102,106 **** lineCD.setTax(new BasicSalesTax()); ! ProductDecorator chocolateBar = new GenericProductDecorator(new UomProductDecorator(Product.CHOCOLATE, UOM.BAR), "product.name + ' [' + product.key + ']'"); OrderLine lineChocolate = new OrderLine(order); --- 103,108 ---- lineCD.setTax(new BasicSalesTax()); ! ProductDecorator chocolateBar = new GenericProductDecorator( ! new UomProductDecorator(Product.CHOCOLATE, UOM.BAR), "product.name + ' [' + product.key + ']'"); OrderLine lineChocolate = new OrderLine(order); |
From: Trifon N. T. <tri...@us...> - 2008-06-15 13:32:45
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27535/src/name/trifon/erp/model/product Modified Files: ProductGroup.java Log Message: added eclipse launch configuration Index: ProductGroup.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/ProductGroup.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ProductGroup.java 6 May 2008 13:02:38 -0000 1.4 --- ProductGroup.java 15 Jun 2008 13:32:39 -0000 1.5 *************** *** 59,67 **** * @return true if this group contains product. */ ! public boolean containsProduct(Product product) { return products.contains(product.getKey()); } ! public void addProduct(Product product) { products.add( product.getKey() ); } --- 59,73 ---- * @return true if this group contains product. */ ! public boolean containsProduct(Product product) throws IllegalArgumentException { ! if (product == null) { ! throw new IllegalArgumentException("Argument product is null!"); ! } return products.contains(product.getKey()); } ! public void addProduct(Product product) throws IllegalArgumentException { ! if (product == null) { ! throw new IllegalArgumentException("Argument product is null!"); ! } products.add( product.getKey() ); } |
From: Trifon N. T. <tri...@us...> - 2008-06-15 13:32:44
|
Update of /cvsroot/comxe/Trifon-HG-ERP In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27535 Added Files: DemoAccountingTransaction.launch Log Message: added eclipse launch configuration --- NEW FILE: DemoAccountingTransaction.launch --- <?xml version="1.0" encoding="UTF-8"?> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listEntry value="/Trifon-HG-ERP/src/name/trifon/erp/model/account/DemoAccountingTransaction.java"/> </listAttribute> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> <listAttribute key="org.eclipse.debug.ui.favoriteGroups"> <listEntry value="org.eclipse.debug.ui.launchGroup.run"/> </listAttribute> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="name.trifon.erp.model.account.DemoAccountingTransaction"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Trifon-HG-ERP"/> </launchConfiguration> |
From: Trifon N. T. <tri...@us...> - 2008-06-15 13:32:44
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/decorator In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27535/src/name/trifon/erp/model/product/decorator Modified Files: GenericProductDecorator.java Log Message: added eclipse launch configuration Index: GenericProductDecorator.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/decorator/GenericProductDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenericProductDecorator.java 6 May 2008 13:02:38 -0000 1.1 --- GenericProductDecorator.java 15 Jun 2008 13:32:39 -0000 1.2 *************** *** 27,31 **** } ! public GenericProductDecorator(Product product, String expr) { super( product ); setExpression( expr ); --- 27,31 ---- } ! public GenericProductDecorator(Product product, String expr) throws IllegalArgumentException { super( product ); setExpression( expr ); |
From: Trifon N. T. <tri...@us...> - 2008-06-15 13:32:44
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/core In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27535/src/name/trifon/erp/model/core Added Files: IAccountProcessor.java Document.java Log Message: added eclipse launch configuration --- NEW FILE: IAccountProcessor.java --- package name.trifon.erp.model.core; public interface IAccountProcessor { public void post(Document document) throws Exception; } --- NEW FILE: Document.java --- package name.trifon.erp.model.core; public interface Document { } |
From: Trifon N. T. <tri...@us...> - 2008-06-15 13:32:44
|
Update of /cvsroot/comxe/Trifon-HG-ERP/doc In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27535/doc Modified Files: info.txt Log Message: added eclipse launch configuration Index: info.txt =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/doc/info.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** info.txt 6 May 2008 13:02:38 -0000 1.4 --- info.txt 15 Jun 2008 13:32:40 -0000 1.5 *************** *** 15,19 **** -05) Account Entry to have: Campaign ! Trx. Organization Location From Location To --- 15,19 ---- -05) Account Entry to have: Campaign ! Trx. Organization Not sure how this can be used! Have to research in Adempiere! Location From Location To *************** *** 34,37 **** --- 34,38 ---- this.getSearchKey() + ' ' + this.getName() or searchKey + ' ' + name this.getSearchKey() + '-' + this.getEAN() or searchKey + '-' + ean + product.name + ' [' + product.key + ']' How to add custom columns and expression language to recognize this column?... TODO. Probably we must have standard interface? *************** *** 42,53 **** -08) Create Document Interface........ TODO Probably we can reuse Document from Java Content Repository or other Specification? Should we have standard method like: complete(), close(), reverse() or have more general method changeStatus(newStatus) throws Exception? Probably we must have some default states: Prepared, Completed, Closed, Invalid -09) Create Document Transition Interface..... TODO Idea is to have standard way which allows to transfer data(custom columns) from one document to another Document. -10) Research how Rule Engines can be used?... TODO -11) Mandatory columns: ! C_Tenant_ID ! C_Org_ID DateCreated DateUpdated --- 43,62 ---- -08) Create Document Interface........ TODO Probably we can reuse Document from Java Content Repository or other Specification? + Alfresco ECM has very good model and good documentation. It supports model driven design. Should we have standard method like: complete(), close(), reverse() or have more general method changeStatus(newStatus) throws Exception? + Probably we need to have fields: currentStatus and nextStatus? But isn't it supposed this fields to be part of the Workflow? + How the workflow engine know which is the current state and which must be next state? Probably we must have some default states: Prepared, Completed, Closed, Invalid + Probably we can use Visitor Design Patter inorder to generate Account postings for each document? TODO. -09) Create Document Transition Interface..... TODO Idea is to have standard way which allows to transfer data(custom columns) from one document to another Document. + I think that this would be very useful! + For example to create Purchase Order from Sales Order. Most of the fields are only copied from purchase order to sales order. -10) Research how Rule Engines can be used?... TODO -11) Mandatory columns: ! C_Holding_ID/C_Tenant_ID... ! ??? C_Company_ID ???....... ! C_Org_ID................... 3 level structure ! C_Department_ID............ 4 level structure DateCreated DateUpdated *************** *** 56,64 **** SearchKey Name ! Description UniqueIndex - number. Multiple unique columns. ! -12) If new ERP would be created then it must integrate with already existing packages on the market. Like POS applications, Commerce applications. ! -13) --- 65,78 ---- SearchKey Name ! Description/Comment ! Help UniqueIndex - number. Multiple unique columns. ! C_Tenant_ID, SearchKey usually will form unique index. We can have Business Partners with the same key in different Tenants. ! -12) If new ERP would be created then it must integrate with already existing packages on the market. Like POS applications, Commerce applications. ! It must be able to import data from existing ERP systems. ! -13) Sales Order must have Ordering B.Partner, Bill/Invoice B.Partner, Ship B.Partner ! Sales Order must have Ordering Location, Bill/Invoice Location, Ship Location ! -14) |
From: Trifon N. T. <tri...@us...> - 2008-05-06 13:02:55
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13718/src/name/trifon/erp/model/product Modified Files: ProductGroup.java Product.java Log Message: refactoring and documentation. Index: ProductGroup.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/ProductGroup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ProductGroup.java 27 Apr 2008 20:58:10 -0000 1.3 --- ProductGroup.java 6 May 2008 13:02:38 -0000 1.4 *************** *** 64,68 **** public void addProduct(Product product) { ! products.add(product.getKey()); } --- 64,68 ---- public void addProduct(Product product) { ! products.add( product.getKey() ); } Index: Product.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/product/Product.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Product.java 30 Apr 2008 07:05:29 -0000 1.2 --- Product.java 6 May 2008 13:02:38 -0000 1.3 *************** *** 30,34 **** public static final Product HEADACHE_PILLS = new Product("headachePills_ID", "headache pills"); ! public Product(String key, String name) { if (key == null) { throw new IllegalArgumentException("Product KEY MUST not be null!!!"); --- 30,34 ---- public static final Product HEADACHE_PILLS = new Product("headachePills_ID", "headache pills"); ! public Product(String key, String name) throws IllegalArgumentException { if (key == null) { throw new IllegalArgumentException("Product KEY MUST not be null!!!"); |
From: Trifon N. T. <tri...@us...> - 2008-05-06 13:02:52
|
Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13718/src/name/trifon/erp/model/account Modified Files: Account.java AccountingTransaction.java AccountEntry.java DemoAccountingTransaction.java PostingType.java IAccountEntry.java Log Message: refactoring and documentation. Index: Account.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account/Account.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Account.java 29 Apr 2008 07:54:21 -0000 1.3 --- Account.java 6 May 2008 13:02:38 -0000 1.4 *************** *** 18,22 **** import java.util.Collection; - import java.util.Currency; import java.util.HashMap; import java.util.HashSet; --- 18,21 ---- *************** *** 148,152 **** } ! // TODO - we can have different type of postings: Budget, Accrual to the same account! public Money balance(DateRange period, PostingType postingType) { Money result = new Money (0, getAccountSchema().getCurrency() ); --- 147,151 ---- } ! // TODO - we can have different type of postings: Budget, Actual to the same account! public Money balance(DateRange period, PostingType postingType) { Money result = new Money (0, getAccountSchema().getCurrency() ); Index: AccountingTransaction.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account/AccountingTransaction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AccountingTransaction.java 29 Apr 2008 07:54:21 -0000 1.4 --- AccountingTransaction.java 6 May 2008 13:02:38 -0000 1.5 *************** *** 64,68 **** */ - // TODO - Add more details about each transaction... public void add (Money amount, Account account) throws ImmutableTransactionException { if (isPosted()) { --- 64,67 ---- *************** *** 70,74 **** ("Cannot add entry to a transaction that's already posted!"); } ! getTransactionEntries().add(new AccountEntry (amount, account, this )); } --- 69,74 ---- ("Cannot add entry to a transaction that's already posted!"); } ! IAccountEntry accountEntry = new AccountEntry (amount, account, this ); ! getTransactionEntries().add( accountEntry ); } *************** *** 97,105 **** while (it.hasNext()) { IAccountEntry accountEntry = (IAccountEntry) it.next(); ! accountEntry.post( getPostingType() ); // TODO - What happens when one entry fails to post? All must be rolled back. } wasPosted = true; } public boolean canPost(){ return balance().isZero(); --- 97,132 ---- while (it.hasNext()) { IAccountEntry accountEntry = (IAccountEntry) it.next(); ! //accountEntry.post( getPostingType() ); // TODO - What happens when one entry fails to post? All must be rolled back. ! post(accountEntry, getPostingType() ); } wasPosted = true; } + /* + * TODO - Trifon; probably here is the place to check if all mandatory additional + * descriptors are set and throw proper exception... + * + * (non-Javadoc) + * @see name.trifon.erp.model.account.IAccountEntry#post() + */ + // only used by AccountingTransaction + private void post( IAccountEntry accountEntry, PostingType postingType ) throws UnableToPostException { + + if (accountEntry.getAccount() == null + || getBookingDate() == null + ) + { + throw new UnableToPostException(); + } + + if (postingType == null) { + accountEntry.getAccount().addEntry(accountEntry, getPostingType() ); + } else { + accountEntry.getAccount().addEntry(accountEntry, postingType ); + } + + accountEntry.close(); + } + public boolean canPost(){ return balance().isZero(); *************** *** 108,112 **** private Money balance() { if (getTransactionEntries().isEmpty()) { ! return Money.dollars( 0d ); } --- 135,139 ---- private Money balance() { if (getTransactionEntries().isEmpty()) { ! return Money.dollars( 0d ); // TODO - Must return Money in the proper Currency! } Index: DemoAccountingTransaction.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account/DemoAccountingTransaction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DemoAccountingTransaction.java 29 Apr 2008 07:54:21 -0000 1.1 --- DemoAccountingTransaction.java 6 May 2008 13:02:38 -0000 1.2 *************** *** 22,26 **** budget = PostingType.DEFAULT; ! AccountingTransaction multiAcctTrans = new AccountingTransaction(new MfDate(2008, 1, 4), budget); System.out.println(" transaction.getBookingDate()-before = " + multiAcctTrans.getBookingDate()); multiAcctTrans.getBookingDate().addDays( 12 ); --- 22,28 ---- budget = PostingType.DEFAULT; ! AccountingTransaction multiAcctTrans = null; ! //multiAcctTrans = new AccountingTransaction(new MfDate(2008, 1, 4)); ! multiAcctTrans = new AccountingTransaction(new MfDate(2008, 1, 4), budget); System.out.println(" transaction.getBookingDate()-before = " + multiAcctTrans.getBookingDate()); multiAcctTrans.getBookingDate().addDays( 12 ); *************** *** 41,44 **** --- 43,49 ---- System.out.println(" Account: " + deferred.getName() + "; balance = " + deferred.balance( budget )); System.out.println(" Account Transaction date: " + multiAcctTrans.getBookingDate()); + //System.out.println(" Account Transaction currency: " + multiAcctTrans.getCurrency()); + //revenue.getAccountSchema().getCurrency() + IAccountEntry accountEntry = (IAccountEntry)multiAcctTrans.getTransactionEntries().toArray()[0]; System.out.println( "accountEntry.getPostingType() = " + accountEntry.getPostingType() ); Index: AccountEntry.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account/AccountEntry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AccountEntry.java 29 Apr 2008 07:54:21 -0000 1.2 --- AccountEntry.java 6 May 2008 13:02:38 -0000 1.3 *************** *** 21,34 **** import name.trifon.erp.model.account.exceptions.ImmutableEntryException; - import name.trifon.erp.model.account.exceptions.UnableToPostException; import name.trifon.erp.model.area.SalesRegion; - import name.trifon.erp.model.core.Tenant; import name.trifon.erp.model.core.CostType; import name.trifon.erp.model.core.Organization; import name.trifon.erp.model.partner.BusinessPartner; import name.trifon.erp.model.product.Product; import name.trifon.erp.model.project.Project; - import name.trifon.erp.model.misc.MfDate; - import name.trifon.erp.model.misc.Money; --- 21,33 ---- import name.trifon.erp.model.account.exceptions.ImmutableEntryException; import name.trifon.erp.model.area.SalesRegion; import name.trifon.erp.model.core.CostType; import name.trifon.erp.model.core.Organization; + import name.trifon.erp.model.core.Tenant; + import name.trifon.erp.model.misc.MfDate; + import name.trifon.erp.model.misc.Money; import name.trifon.erp.model.partner.BusinessPartner; import name.trifon.erp.model.product.Product; import name.trifon.erp.model.project.Project; *************** *** 47,50 **** --- 46,51 ---- private Account account; + private Money sourceAmount; + private Money amount; *************** *** 105,108 **** --- 106,113 ---- } + public Money getSourceAmount() { + return sourceAmount; + } + public Money getAmount() { return amount; *************** *** 116,127 **** return open; } ! public void post() throws UnableToPostException { post( getAccountingTransaction().getPostingType() ); } ! ! /* ! * TODO - Trifon; probably here is the place to check if all mandatory additional ! * descriptors are set and throw proper exception... * * (non-Javadoc) --- 121,134 ---- return open; } ! ! public void close() { ! open = false; ! } ! /* public void post() throws UnableToPostException { post( getAccountingTransaction().getPostingType() ); } ! */ ! /* TODO - This code can be removed. * * (non-Javadoc) *************** *** 129,133 **** */ // only used by AccountingTransaction ! public void post( PostingType postingType ) throws UnableToPostException { if (account == null || transaction == null --- 136,140 ---- */ // only used by AccountingTransaction ! /* public void post( PostingType postingType ) throws UnableToPostException { if (account == null || transaction == null *************** *** 144,150 **** } ! open = false; } ! /** * @return Returns the product. --- 151,157 ---- } ! close(); } ! */ /** * @return Returns the product. Index: PostingType.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account/PostingType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PostingType.java 29 Apr 2008 07:54:21 -0000 1.1 --- PostingType.java 6 May 2008 13:02:38 -0000 1.2 *************** *** 10,14 **** private static final long serialVersionUID = 6463370672193673330L; ! public static final PostingType DEFAULT = new PostingType( "Accrual" ); private String searchKey; // Account code --- 10,14 ---- private static final long serialVersionUID = 6463370672193673330L; ! public static final PostingType DEFAULT = new PostingType( "Actual" ); private String searchKey; // Account code Index: IAccountEntry.java =================================================================== RCS file: /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/account/IAccountEntry.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IAccountEntry.java 29 Apr 2008 07:54:21 -0000 1.3 --- IAccountEntry.java 6 May 2008 13:02:38 -0000 1.4 *************** *** 18,22 **** import name.trifon.erp.model.account.exceptions.ImmutableEntryException; - import name.trifon.erp.model.account.exceptions.UnableToPostException; import name.trifon.erp.model.core.CostType; import name.trifon.erp.model.misc.MfDate; --- 18,21 ---- *************** *** 28,46 **** //public IAccountEntry newEntry(CostType costType, Project project, Money amount, Date date); ! public CostType getCostType(); public Project getProject(); ! public Money getAmount(); public boolean isOpen(); ! public PostingType getPostingType(); ! // TODO - Trifon; I'm not sure that post MUST be in thi sinterface. It sounds more applicable to AccountingTransaction! ! public void post() throws UnableToPostException; ! public void post( PostingType postingType ) throws UnableToPostException; public AccountingTransaction getAccountingTransaction(); --- 27,51 ---- //public IAccountEntry newEntry(CostType costType, Project project, Money amount, Date date); ! ! public Account getAccount(); ! public CostType getCostType(); public Project getProject(); ! ! // Necessary if we have posting in different currencies. ! public Money getSourceAmount(); ! public Money getAmount(); public boolean isOpen(); ! public void close(); ! public PostingType getPostingType(); ! // TODO - Trifon; I'm not sure that post MUST be in this interface. It sounds more applicable to AccountingTransaction! ! // public void post() throws UnableToPostException; ! // public void post( PostingType postingType ) throws UnableToPostException; public AccountingTransaction getAccountingTransaction(); |