Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java Mon Jan 5 23:13:36 2009 @@ -58,7 +58,7 @@ orderPaymentInfo.add(orderContactMech); GenericValue orderPaymentPreference = delegator.makeValue("OrderPaymentPreference", UtilMisc.toMap("paymentMethodId", "9015", "paymentMethodTypeId", "CREDIT_CARD", - "statusId", "PAYMENT_NOT_AUTH", "overflowFlag", "N", "maxAmount", new Double(49.26))); + "statusId", "PAYMENT_NOT_AUTH", "overflowFlag", "N", "maxAmount", new BigDecimal("49.26"))); orderPaymentInfo.add(orderPaymentPreference); ctx.put("orderPaymentInfo", orderPaymentInfo); @@ -70,11 +70,11 @@ "shipGroupSeqId", "00001", "shipmentMethodTypeId", "NEXT_DAY")); orderItemShipGroupInfo.add(orderItemShipGroup); - GenericValue orderItemShipGroupAssoc = delegator.makeValue("OrderItemShipGroupAssoc", UtilMisc.toMap("orderItemSeqId", "00001", "quantity", new Double(1.0), "shipGroupSeqId", "00001")); + GenericValue orderItemShipGroupAssoc = delegator.makeValue("OrderItemShipGroupAssoc", UtilMisc.toMap("orderItemSeqId", "00001", "quantity", BigDecimal.ONE, "shipGroupSeqId", "00001")); orderItemShipGroupInfo.add(orderItemShipGroupAssoc); GenericValue orderAdjustment = null; - orderAdjustment = delegator.makeValue("OrderAdjustment", UtilMisc.toMap("orderAdjustmentTypeId", "SHIPPING_CHARGES", "shipGroupSeqId", "00001", "amount", new Double(12.45))); + orderAdjustment = delegator.makeValue("OrderAdjustment", UtilMisc.toMap("orderAdjustmentTypeId", "SHIPPING_CHARGES", "shipGroupSeqId", "00001", "amount", new BigDecimal("12.45"))); orderItemShipGroupInfo.add(orderAdjustment); orderAdjustment = delegator.makeValue("OrderAdjustment", UtilMisc.toMap("orderAdjustmentTypeId", "SALES_TAX", "orderItemSeqId", "00001", "overrideGlAccountId", "224153", @@ -112,11 +112,11 @@ ctx.put("orderAdjustments", orderAdjustments); List orderItems = new ArrayList(); - GenericValue orderItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemSeqId", "00001", "orderItemTypeId", "PRODUCT_ORDER_ITEM", "prodCatalogId", "DemoCatalog", "productId", "GZ-2644", "quantity", new Double(1), "selectedAmount", new Double(0.0))); + GenericValue orderItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemSeqId", "00001", "orderItemTypeId", "PRODUCT_ORDER_ITEM", "prodCatalogId", "DemoCatalog", "productId", "GZ-2644", "quantity", BigDecimal.ONE, "selectedAmount", BigDecimal.ZERO)); orderItem.set("isPromo", "N"); orderItem.set("isModifiedPrice", "N"); - orderItem.set("unitPrice", new Double(38.4)); - orderItem.set("unitListPrice", new Double(48.0)); + orderItem.set("unitPrice", new BigDecimal("38.4")); + orderItem.set("unitListPrice", new BigDecimal("48.0")); orderItem.set("statusId", "ITEM_CREATED"); orderItems.add(orderItem); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/taxware/TaxwareServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/taxware/TaxwareServices.java?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/taxware/TaxwareServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/taxware/TaxwareServices.java Mon Jan 5 23:13:36 2009 @@ -27,6 +27,8 @@ import org.ofbiz.service.DispatchContext; import org.ofbiz.service.ModelService; +import com.ibm.icu.math.BigDecimal; + /** * TaxwareServices */ @@ -37,7 +39,7 @@ List items = (List) context.get("itemProductList"); List amnts = (List) context.get("itemAmountList"); List ishpn = (List) context.get("itemShippingList"); - Double shipping = (Double) context.get("orderShippingAmount"); + BigDecimal shipping = (BigDecimal) context.get("orderShippingAmount"); GenericValue address = (GenericValue) context.get("shippingAddress"); if (items.size() != amnts.size()) { @@ -49,14 +51,14 @@ try { TaxwareUTL utl = new TaxwareUTL(); - utl.setShipping(shipping != null ? shipping.doubleValue() : 0.0); + utl.setShipping(shipping != null ? shipping : BigDecimal.ZERO); utl.setShipAddress(address); for (int i = 0; i < items.size(); i++) { GenericValue p = (GenericValue) items.get(i); - Double amount = (Double) amnts.get(i); - Double ishp = ishpn != null ? (Double) ishpn.get(i) : new Double(0.0); + BigDecimal amount = (BigDecimal) amnts.get(i); + BigDecimal ishp = ishpn != null ? (BigDecimal) ishpn.get(i) : BigDecimal.ZERO; - utl.addItem(p, amount.doubleValue(), ishp.doubleValue()); + utl.addItem(p, amount, ishp); } int resp = utl.process(); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/taxware/TaxwareUTL.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/taxware/TaxwareUTL.java?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/taxware/TaxwareUTL.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/taxware/TaxwareUTL.java Mon Jan 5 23:13:36 2009 @@ -24,6 +24,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; @@ -54,7 +55,7 @@ DataFile outHead = null; DataFile outItem = null; - double shippingAmount = 0.00; + BigDecimal shippingAmount = BigDecimal.ZERO; List orderAdjustments = new ArrayList(); List itemAdjustments = new ArrayList(); @@ -91,7 +92,7 @@ Record shipping = outItem.makeRecord("outItem"); shipping = makeItemData(shipping); - shipping.set("FREIGHT_AMOUNT", new Double(shippingAmount)); + shipping.set("FREIGHT_AMOUNT", shippingAmount); outItem.addRecord(shipping); } @@ -146,7 +147,7 @@ return returnCode; } - public void setShipping(double shippingAmount) { + public void setShipping(BigDecimal shippingAmount) { this.shippingAmount = shippingAmount; setShipping = true; } @@ -308,81 +309,81 @@ if (itemAdjustments.size() < records.size()) { List currentItem = new ArrayList(); - if (rec.getDouble("TAX_AMT_COUNTRY").doubleValue() > 0) { - if (Debug.verboseOn()) Debug.logVerbose("Country Tax Amount: " + rec.getDouble("TAX_AMT_COUNTRY"), module); - Double rate = new Double(rec.getDouble("TAX_RATE_COUNTRY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_COUNTRY").compareTo(BigDecimal.ZERO) > 0) { + if (Debug.verboseOn()) Debug.logVerbose("Country Tax Amount: " + rec.getBigDecimal("TAX_AMT_COUNTRY"), module); + BigDecimal rate = rec.getBigDecimal("TAX_RATE_COUNTRY").movePointRight(2); String type = rec.getString("TAX_TYPE_COUNTRY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_COUNTRY") != null ? rec.getString("JUR_COUNTRY").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); currentItem.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_COUNTRY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_COUNTRY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_STATE").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_STATE").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_STATE").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_STATE").movePointRight(2); String type = rec.getString("TAX_TYPE_STATE").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_STATE") != null ? rec.getString("JUR_STATE").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); currentItem.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_STATE"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_STATE"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_COUNTY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_COUNTY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_COUNTY").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_COUNTY").movePointRight(2); String type = rec.getString("TAX_TYPE_COUNTY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_COUNTY_CODE") != null ? rec.getString("JUR_COUNTY_CODE").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); currentItem.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_COUNTY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_COUNTY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_CITY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_CITY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_CITY").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_CITY").movePointRight(2); String type = rec.getString("TAX_TYPE_CITY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_CITY") != null ? rec.getString("JUR_CITY").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); currentItem.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_CITY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_CITY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_SEC_STATE").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_SEC_STATE").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_SEC_STATE").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_SEC_STATE").movePointRight(2); String type = rec.getString("TAX_TYPE_SEC_STATE").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_SEC_STATE") != null ? rec.getString("JUR_SEC_STATE").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); currentItem.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_SEC_STATE"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_SEC_STATE"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_SEC_COUNTY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_SEC_COUNTY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_SEC_COUNTY").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_SEC_COUNTY").movePointRight(2); String type = rec.getString("TAX_TYPE_SEC_COUNTY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_SEC_COUNTY_CODE") != null ? rec.getString("JUR_SEC_COUNTY_CODE").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); currentItem.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_SEC_COUNTY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_SEC_COUNTY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_SEC_CITY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_SEC_CITY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_SEC_CITY").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_SEC_CITY").movePointRight(2); String type = rec.getString("TAX_TYPE_SEC_CITY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_SEC_CITY") != null ? rec.getString("JUR_SEC_CITY").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); currentItem.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_SEC_CITY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_SEC_CITY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } @@ -390,80 +391,80 @@ itemAdjustments.add(currentItem); } else if (orderAdjustments.size() == 0) { - if (rec.getDouble("TAX_AMT_COUNTRY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_COUNTRY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_COUNTRY").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_COUNTRY").movePointRight(2); String type = rec.getString("TAX_TYPE_COUNTRY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_COUNTRY") != null ? rec.getString("JUR_COUNTRY").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); orderAdjustments.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_COUNTRY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_COUNTRY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_STATE").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_STATE").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_STATE").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_STATE").movePointRight(2); String type = rec.getString("TAX_TYPE_STATE").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_STATE") != null ? rec.getString("JUR_STATE").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); orderAdjustments.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_STATE"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_STATE"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_COUNTY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_COUNTY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_COUNTY").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_COUNTY").movePointRight(2); String type = rec.getString("TAX_TYPE_COUNTY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_COUNTY_CODE") != null ? rec.getString("JUR_COUNTY_CODE").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); orderAdjustments.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_COUNTY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_COUNTY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_CITY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_CITY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_CITY")..compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_CITY").movePointRight(2); String type = rec.getString("TAX_TYPE_CITY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_CITY") != null ? rec.getString("JUR_CITY").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); orderAdjustments.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_CITY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_CITY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_SEC_STATE").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_SEC_STATE").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_SEC_STATE").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_SEC_STATE").movePointRight(2); String type = rec.getString("TAX_TYPE_SEC_STATE").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_SEC_STATE") != null ? rec.getString("JUR_SEC_STATE").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); orderAdjustments.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_SEC_STATE"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_SEC_STATE"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_SEC_COUNTY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_SEC_COUNTY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_SEC_COUNTY").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_SEC_COUNTY").movePointRight(2); String type = rec.getString("TAX_TYPE_SEC_COUNTY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_SEC_COUNTY_CODE") != null ? rec.getString("JUR_SEC_COUNTY_CODE").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); orderAdjustments.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_SEC_COUNTY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_SEC_COUNTY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } - if (rec.getDouble("TAX_AMT_SEC_CITY").doubleValue() > 0) { - Double rate = new Double(rec.getDouble("TAX_RATE_SEC_CITY").doubleValue() * 100); + if (rec.getBigDecimal("TAX_AMT_SEC_CITY").compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = rec.getBigDecimal("TAX_RATE_SEC_CITY").movePointRight(2); String type = rec.getString("TAX_TYPE_SEC_CITY").equals("S") ? "SALES TAX" : "USE TAX"; String jur = rec.get("JUR_SEC_CITY") != null ? rec.getString("JUR_SEC_CITY").trim() : ""; String comments = jur + "|" + type + "|" + rate.toString(); orderAdjustments.add(delegator.makeValue("OrderAdjustment", - UtilMisc.toMap("amount", rec.getDouble("TAX_AMT_SEC_CITY"), + UtilMisc.toMap("amount", rec.getBigDecimal("TAX_AMT_SEC_CITY"), "orderAdjustmentTypeId", "SALES_TAX", "comments", comments))); } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java Mon Jan 5 23:13:36 2009 @@ -18,6 +18,7 @@ *******************************************************************************/ package org.ofbiz.order.thirdparty.zipsales; +import java.math.BigDecimal; import java.net.URL; import java.sql.Timestamp; import java.text.DecimalFormat; @@ -59,10 +60,6 @@ public static final String ruleTable = "FreightRuleTable"; public static final String resource_error = "OrderErrorUiLabels"; - // number formatting - private static String curFmtStr = UtilProperties.getPropertyValue("general.properties", "currency.decimal.format", "##0.00"); - private static DecimalFormat curFormat = new DecimalFormat(curFmtStr); - // date formatting private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); @@ -218,7 +215,7 @@ List itemProductList = (List) context.get("itemProductList"); List itemAmountList = (List) context.get("itemAmountList"); List itemShippingList = (List) context.get("itemShippingList"); - Double orderShippingAmount = (Double) context.get("orderShippingAmount"); + BigDecimal orderShippingAmount = (BigDecimal) context.get("orderShippingAmount"); GenericValue shippingAddress = (GenericValue) context.get("shippingAddress"); // flatTaxCalc only uses the Zip + City from the address @@ -246,12 +243,12 @@ // loop through and get per item tax rates for (int i = 0; i < itemProductList.size(); i++) { GenericValue product = (GenericValue) itemProductList.get(i); - Double itemAmount = (Double) itemAmountList.get(i); - Double shippingAmount = (Double) itemShippingList.get(i); - itemAdjustments.add(getItemTaxList(delegator, product, postalCode, city, itemAmount.doubleValue(), shippingAmount.doubleValue(), false)); + BigDecimal itemAmount = (BigDecimal) itemAmountList.get(i); + BigDecimal shippingAmount = (BigDecimal) itemShippingList.get(i); + itemAdjustments.add(getItemTaxList(delegator, product, postalCode, city, itemAmount, shippingAmount, false)); } - if (orderShippingAmount.doubleValue() > 0) { - List taxList = getItemTaxList(delegator, null, postalCode, city, 0.00, orderShippingAmount.doubleValue(), false); + if (orderShippingAmount.compareTo(BigDecimal.ZERO) > 0) { + List taxList = getItemTaxList(delegator, null, postalCode, city, BigDecimal.ZERO, orderShippingAmount, false); orderAdjustments.addAll(taxList); } } catch (GeneralException e) { @@ -264,7 +261,7 @@ return result; } - private static List getItemTaxList(GenericDelegator delegator, GenericValue item, String zipCode, String city, double itemAmount, double shippingAmount, boolean isUseTax) throws GeneralException { + private static List getItemTaxList(GenericDelegator delegator, GenericValue item, String zipCode, String city, BigDecimal itemAmount, BigDecimal shippingAmount, boolean isUseTax) throws GeneralException { List adjustments = new ArrayList(); // check the item for tax status @@ -333,7 +330,7 @@ fieldName = "comboUseTax"; } - Double comboTaxRate = taxEntry.getDouble(fieldName); + BigDecimal comboTaxRate = taxEntry.getBigDecimal(fieldName); if (comboTaxRate == null) { Debug.logWarning("No Combo Tax Rate In Field " + fieldName + " @ " + zipCode + " / " + city + " - " + itemAmount, module); return adjustments; @@ -468,21 +465,19 @@ } } - double taxableAmount = itemAmount; + BigDecimal taxableAmount = itemAmount; if (taxShipping) { //Debug.log("Taxing shipping", module); - taxableAmount += shippingAmount; + taxableAmount = taxableAmount.add(shippingAmount); } else { Debug.log("Shipping is not taxable", module); } // calc tax amount - double taxRate = comboTaxRate.doubleValue(); - double taxCalc = taxableAmount * taxRate; + BigDecimal taxRate = comboTaxRate; + BigDecimal taxCalc = taxableAmount.multiply(taxRate); - // format the number - Double taxAmount = new Double(formatCurrency(taxCalc)); - adjustments.add(delegator.makeValue("OrderAdjustment", UtilMisc.toMap("amount", taxAmount, "orderAdjustmentTypeId", "SALES_TAX", "comments", Double.toString(taxRate), "description", "Sales Tax (" + stateCode + ")"))); + adjustments.add(delegator.makeValue("OrderAdjustment", UtilMisc.toMap("amount", taxCalc, "orderAdjustmentTypeId", "SALES_TAX", "comments", taxRate, "description", "Sales Tax (" + stateCode + ")"))); return adjustments; } @@ -504,8 +499,4 @@ return useWhenNull; } } - - private static String formatCurrency(double currency) { - return curFormat.format(currency); - } } Modified: ofbiz/trunk/applications/party/data/ScheduledJobs.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/ScheduledJobs.xml?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/party/data/ScheduledJobs.xml (original) +++ ofbiz/trunk/applications/party/data/ScheduledJobs.xml Mon Jan 5 23:13:36 2009 @@ -22,5 +22,28 @@ <entity-engine-xml> <!-- create recurring job to check email communication events with the status COM_IN_PROGRESS to send these emails.. --> <TemporalExpression tempExprId="SENDEMAIL" tempExprTypeId="FREQUENCY" integer1="12" integer2="5"/> - <JobSandbox jobId="SENDEMAIL" jobName="Send Email" runTime="2000-01-01 00:00:00.000" serviceName="sendEmailDated" poolId="pool" runAsUser="system" tempExprId="SENDEMAIL" maxRecurrenceCount="-1"/> + <RuntimeData runtimeDataId="TESTID"> + <runtimeInfo><![CDATA[<?xml version="1.0" encoding="UTF-8"?> +<ofbiz-ser> + <map-HashMap> + <map-Entry> + <map-Key> + <std-String value="cookie"/> + </map-Key> + <map-Value> + <std-Integer value="1"/> + </map-Value> + </map-Entry> + <map-Entry> + <map-Key> + <std-String value="runtimeDataId"/> + </map-Key> + <map-Value> + <std-String value="TESTID"/> + </map-Value> + </map-Entry> + </map-HashMap> +</ofbiz-ser> + ]]></runtimeInfo> + </RuntimeData> <JobSandbox jobId="SENDEMAIL" jobName="Send Email" runtimeDataId="TESTID" runTime="2000-01-01 00:00:00.000" serviceName="sendEmailDated" poolId="pool" runAsUser="system" tempExprId="SENDEMAIL" maxRecurrenceCount="-1"/> </entity-engine-xml> Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original) +++ ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Mon Jan 5 23:13:36 2009 @@ -360,6 +360,23 @@ <set-service-fields service-name="sendCommEventAsEmail" map="communicationEvent" to-map="inMap"/> <call-service service-name="sendCommEventAsEmail" in-map-name="inMap" require-new-transaction="true"/> </iterate> + <set field="cookie" from-field="parameters.cookie" type="Integer"/> + <calculate field-name="cookie" type="Integer"> + <calcop operator="add"> + <number value="1"/> + <calcop operator="get" field-name="cookie"/> + </calcop> + </calculate> + <set field="pk.runtimeDataId" value="TESTID"/> + <find-by-primary-key map-name="pk" value-name="runtimeData" entity-name="RuntimeData"/> + <set field="newData.runtimeDataId" from-field="pk.runtimeDataId"/> + <set field="newData.cookie" from-field="cookie"/> + <call-class-method method-name="serialize" class-name="org.ofbiz.entity.serialize.XmlSerializer" ret-field-name="dummy"> + <field field-name="newData" type="Object"/> + </call-class-method> + <log level="always" message="${dummy}"></log> + <set field="runtimeData.runtimeInfo" from-field="dummy"/> + <store-value value-name="runtimeData"/> </simple-method> <simple-method method-name="allocateMsgToParty" short-description="Allocate an emailaddress to an existing/new party, update the communication event accordingly"> Modified: ofbiz/trunk/applications/party/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/party/servicedef/services.xml (original) +++ ofbiz/trunk/applications/party/servicedef/services.xml Mon Jan 5 23:13:36 2009 @@ -793,6 +793,8 @@ <service name="sendEmailDated" engine="simple" use-transaction="false" location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="sendEmailDated" auth="true"> <description>Checks for email communication events with the status COM_IN_PROGRESS and a startdate which is expired, then send the email</description> + <attribute name="cookie" mode="IN" type="Integer" optional="true"/> + <attribute name="runtimeDataId" mode="IN" type="String" optional="false"></attribute> </service> Modified: ofbiz/trunk/applications/product/entitydef/eecas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/eecas.xml?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/product/entitydef/eecas.xml (original) +++ ofbiz/trunk/applications/product/entitydef/eecas.xml Mon Jan 5 23:13:36 2009 @@ -39,7 +39,7 @@ <eca entity="InventoryItem" operation="create-store" event="return"> <condition field-name="productId" operator="is-not-empty"/> <condition field-name="availableToPromiseTotal" operator="is-not-empty"/> - <condition field-name="availableToPromiseTotal" operator="less-equals" value="0" type="Double"/> + <condition field-name="availableToPromiseTotal" operator="less-equals" value="0" type="BigDecimal"/> <action service="checkProductInventoryDiscontinuation" mode="async"/> </eca> <!-- update the totals for serialized inventory items --> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Mon Jan 5 23:13:36 2009 @@ -251,7 +251,7 @@ <field name="purchaseFromDate" type="date-time"></field> <field name="purchaseThruDate" type="date-time"></field> <field name="useCountLimit" type="numeric"></field> - <field name="useDaysLimit" type="floating-point"></field> + <field name="useDaysLimit" type="fixed-point"></field> <prim-key field="productCategoryId"/> <prim-key field="contentId"/> <prim-key field="prodCatContentTypeId"/> @@ -370,7 +370,7 @@ <field name="thruDate" type="date-time"></field> <field name="comments" type="comment"></field> <field name="sequenceNum" type="numeric"></field> - <field name="quantity" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> <prim-key field="productCategoryId"/> <prim-key field="productId"/> <prim-key field="fromDate"/> @@ -682,7 +682,7 @@ <field name="configItemId" type="id-ne"></field> <field name="configOptionId" type="id-ne"></field> <field name="productId" type="id-ne"></field> - <field name="quantity" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> <field name="sequenceNum" type="numeric"></field> <prim-key field="configItemId"/> <prim-key field="configOptionId"/> @@ -777,7 +777,7 @@ <field name="costComponentCalcId" type="id"></field> <field name="fromDate" type="date-time"></field> <field name="thruDate" type="date-time"></field> - <field name="cost" type="floating-point"><description>Higher precision in case it is a calculated number</description></field> + <field name="cost" type="fixed-point"><description>Higher precision in case it is a calculated number</description></field> <field name="costUomId" type="id"></field> <prim-key field="costComponentId"/> <relation type="one" fk-name="COST_COMP_TYPE" rel-entity-name="CostComponentType"> @@ -1191,8 +1191,8 @@ <entity entity-name="ProductFacility" package-name="org.ofbiz.product.facility" title="Product Facility Entity"> <field name="productId" type="id-ne"></field> <field name="facilityId" type="id-ne"></field> - <field name="minimumStock" type="floating-point"></field> - <field name="reorderQuantity" type="floating-point"></field> + <field name="minimumStock" type="fixed-point"></field> + <field name="reorderQuantity" type="fixed-point"></field> <field name="daysToShip" type="numeric"></field> <prim-key field="productId"/> <prim-key field="facilityId"/> @@ -1207,8 +1207,8 @@ <field name="productId" type="id-ne"></field> <field name="facilityId" type="id-ne"></field> <field name="locationSeqId" type="id-ne"></field> - <field name="minimumStock" type="floating-point"></field> - <field name="moveQuantity" type="floating-point"></field> + <field name="minimumStock" type="fixed-point"></field> + <field name="moveQuantity" type="fixed-point"></field> <prim-key field="productId"/> <prim-key field="facilityId"/> <prim-key field="locationSeqId"/> @@ -1294,7 +1294,7 @@ <field name="productFeatureCategoryId" type="id"></field> <field name="description" type="description"></field> <field name="uomId" type="id"></field> - <field name="numberSpecified" type="floating-point"></field> + <field name="numberSpecified" type="fixed-point"></field> <field name="defaultAmount" type="currency-amount"></field> <field name="defaultSequenceNum" type="numeric"></field> <field name="abbrev" type="id"></field> @@ -1648,15 +1648,15 @@ <field name="binNumber" type="id"></field> <field name="locationSeqId" type="id"></field> <field name="comments" type="comment"></field> - <field name="quantityOnHandTotal" type="floating-point"></field> - <field name="availableToPromiseTotal" type="floating-point"></field> - <field name="oldQuantityOnHand" col-name="QUANTITY_ON_HAND" type="floating-point"></field> - <field name="oldAvailableToPromise" col-name="AVAILABLE_TO_PROMISE" type="floating-point"></field> + <field name="quantityOnHandTotal" type="fixed-point"></field> + <field name="availableToPromiseTotal" type="fixed-point"></field> + <field name="oldQuantityOnHand" col-name="QUANTITY_ON_HAND" type="fixed-point"></field> + <field name="oldAvailableToPromise" col-name="AVAILABLE_TO_PROMISE" type="fixed-point"></field> <field name="serialNumber" type="value"></field> <field name="softIdentifier" type="value"></field> <field name="activationNumber" type="value"></field> <field name="activationValidThru" type="date-time"></field> - <field name="unitCost" type="floating-point"><description>Higher precision in case it is a calculated number</description></field> + <field name="unitCost" type="fixed-point"><description>Higher precision in case it is a calculated number</description></field> <field name="currencyUomId" type="id"><description>The currency Uom of the unit cost.</description></field> <prim-key field="inventoryItemId"/> <relation type="one" fk-name="INV_ITEM_TYPE" rel-entity-name="InventoryItemType"> @@ -1780,9 +1780,9 @@ <field name="inventoryItemId" type="id-ne"></field> <field name="inventoryItemDetailSeqId" type="id-ne"></field> <field name="effectiveDate" type="date-time"></field> - <field name="quantityOnHandDiff" type="floating-point"></field> - <field name="availableToPromiseDiff" type="floating-point"></field> - <field name="unitCost" type="floating-point"></field> + <field name="quantityOnHandDiff" type="fixed-point"></field> + <field name="availableToPromiseDiff" type="fixed-point"></field> + <field name="unitCost" type="fixed-point"></field> <field name="orderId" type="id"></field> <field name="orderItemSeqId" type="id"></field> <field name="shipGroupSeqId" type="id"></field> @@ -1902,7 +1902,7 @@ <field name="visitId" type="id-ne"></field> <field name="productId" type="id-ne"></field> <field name="productStoreId" type="id-ne"></field> - <field name="quantity" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> <field name="reservedDate" type="date-time"></field> <prim-key field="visitId"/> <prim-key field="productId"/> @@ -1953,8 +1953,8 @@ <field name="inventoryItemId" type="id-ne"></field> <field name="physicalInventoryId" type="id-ne"></field> <field name="varianceReasonId" type="id"></field> - <field name="availableToPromiseVar" type="floating-point"></field> - <field name="quantityOnHandVar" type="floating-point"></field> + <field name="availableToPromiseVar" type="fixed-point"></field> + <field name="quantityOnHandVar" type="fixed-point"></field> <field name="comments" type="comment"></field> <prim-key field="inventoryItemId"/> <prim-key field="physicalInventoryId"/> @@ -2062,7 +2062,7 @@ title="Lot Entity"> <field name="lotId" type="id-ne"></field> <field name="creationDate" type="date-time"></field> - <field name="quantity" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> <field name="expirationDate" type="date-time"></field> <prim-key field="lotId"/> </entity> @@ -2207,7 +2207,7 @@ <field name="productPriceRuleId" type="id-ne"></field> <field name="productPriceActionSeqId" type="id-ne"></field> <field name="productPriceActionTypeId" type="id-ne"></field> - <field name="amount" type="floating-point"></field> + <field name="amount" type="fixed-point"></field> <field name="rateCode" type="short-varchar"></field> <prim-key field="productPriceRuleId"/> <prim-key field="productPriceActionSeqId"/> @@ -2316,8 +2316,8 @@ title="Quantity Break Entity"> <field name="quantityBreakId" type="id-ne"></field> <field name="quantityBreakTypeId" type="id"></field> - <field name="fromQuantity" type="floating-point"></field> - <field name="thruQuantity" type="floating-point"></field> + <field name="fromQuantity" type="fixed-point"></field> + <field name="thruQuantity" type="fixed-point"></field> <prim-key field="quantityBreakId"/> <relation type="one" fk-name="QUANT_BRK_TYPE" rel-entity-name="QuantityBreakType"> <key-map field-name="quantityBreakTypeId"/> @@ -2454,23 +2454,23 @@ <field name="inventoryMessage" type="description"></field> <field name="requireInventory" type="indicator"></field> <field name="quantityUomId" type="id"></field> - <field name="quantityIncluded" type="floating-point"></field> + <field name="quantityIncluded" type="fixed-point"></field> <field name="piecesIncluded" type="numeric"></field> <field name="requireAmount" type="indicator"></field> <field name="fixedAmount" type="currency-amount"><description>Use this for products which are sold in fixed denominations, such as gift certificates or calling cards.</description></field> <field name="amountUomTypeId" type="id"></field> <field name="weightUomId" type="id"></field> - <field name="weight" type="floating-point"></field> + <field name="weight" type="fixed-point"></field> <field name="heightUomId" type="id"></field> - <field name="productHeight" type="floating-point"></field> - <field name="shippingHeight" type="floating-point"></field> + <field name="productHeight" type="fixed-point"></field> + <field name="shippingHeight" type="fixed-point"></field> <field name="widthUomId" type="id"></field> - <field name="productWidth" type="floating-point"></field> - <field name="shippingWidth" type="floating-point"></field> + <field name="productWidth" type="fixed-point"></field> + <field name="shippingWidth" type="fixed-point"></field> <field name="depthUomId" type="id"></field> - <field name="productDepth" type="floating-point"></field> - <field name="shippingDepth" type="floating-point"></field> - <field name="productRating" type="floating-point"></field> + <field name="productDepth" type="fixed-point"></field> + <field name="shippingDepth" type="fixed-point"></field> + <field name="productRating" type="fixed-point"></field> <field name="ratingTypeEnum" type="id"></field> <field name="returnable" type="indicator"></field> <field name="taxable" type="indicator"></field> @@ -2483,9 +2483,9 @@ <field name="originGeoId" type="id"></field> <field name="requirementMethodEnumId" type="id"></field> <field name="billOfMaterialLevel" type="numeric"></field> - <field name="reservMaxPersons" type="floating-point"><description>maximum number of persons who can rent this asset at the same time</description></field> - <field name="reserv2ndPPPerc" type="floating-point"><description>percentage of the end price for the 2nd person renting this asset connected to this product</description></field> - <field name="reservNthPPPerc" type="floating-point"><description>percentage of the end price for the Nth person renting this asset connected to this product</description></field> + <field name="reservMaxPersons" type="fixed-point"><description>maximum number of persons who can rent this asset at the same time</description></field> + <field name="reserv2ndPPPerc" type="fixed-point"><description>percentage of the end price for the 2nd person renting this asset connected to this product</description></field> + <field name="reservNthPPPerc" type="fixed-point"><description>percentage of the end price for the Nth person renting this asset connected to this product</description></field> <field name="configId" type="id"><description>Used to safe the persisted configuration Id for AGGREGATED products.</description></field> <field name="createdDate" type="date-time"></field> <field name="createdByUserLogin" type="id-vlong"></field> @@ -2562,8 +2562,8 @@ <field name="thruDate" type="date-time"></field> <field name="sequenceNum" type="numeric"></field> <field name="reason" type="long-varchar"></field> - <field name="quantity" type="floating-point"></field> - <field name="scrapFactor" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> + <field name="scrapFactor" type="fixed-point"></field> <field name="instruction" type="long-varchar"></field> <field name="routingWorkEffortId" type="id"></field> <field name="estimateCalcMethod" type="id"></field> @@ -2666,9 +2666,9 @@ package-name="org.ofbiz.product.product" title="Product Calculated Info Entity"> <field name="productId" type="id-ne"></field> - <field name="totalQuantityOrdered" type="floating-point"></field> + <field name="totalQuantityOrdered" type="fixed-point"></field> <field name="totalTimesViewed" type="numeric"></field> - <field name="averageCustomerRating" type="floating-point"></field> + <field name="averageCustomerRating" type="fixed-point"></field> <prim-key field="productId"/> <relation type="one" fk-name="PRODCI_PROD" rel-entity-name="Product"> <key-map field-name="productId"/> @@ -2882,7 +2882,7 @@ <field name="productMaintTypeId" type="id"></field> <field name="maintName" type="name"></field> <field name="maintTemplateWorkEffortId" type="id"><description>Template of Maintenance Plan. WorkEffort may have WorkEffortAssocs for tasks/breakdown detailes</description></field> - <field name="intervalQuantity" type="floating-point"></field> + <field name="intervalQuantity" type="fixed-point"></field> <field name="intervalUomId" type="id"><description>UOM for intervalQuantity; if used intervalMeterTypeId is generally not used (ie one or the other)</description></field> <field name="intervalMeterTypeId" type="id"><description>Meter Type for intervalQuantity; if used intervalUomId is generally not used (ie one or the other)</description></field> <field name="repeatCount" type="numeric"><description>If 0 or null means no limit to repeat count; can be used with multiple ProductMaint records for a single ProductMaintType in cases where maintenance intervals are not evenly distributed, or only need to be done once like a break-in period</description></field> @@ -2932,7 +2932,7 @@ <field name="statusId" type="id"></field> <field name="postedAnonymous" type="indicator"></field> <field name="postedDateTime" type="date-time"></field> - <field name="productRating" type="floating-point"></field> + <field name="productRating" type="fixed-point"></field> <field name="productReview" type="very-long"></field> <prim-key field="productReviewId"/> <relation type="one" fk-name="PROD_REVIEW_PRDSTR" rel-entity-name="ProductStore"> @@ -3149,7 +3149,7 @@ <field name="useLimitPerOrder" type="numeric"></field> <field name="useLimitPerCustomer" type="numeric"></field> <field name="useLimitPerPromotion" type="numeric"></field> - <field name="billbackFactor" type="floating-point"></field> + <field name="billbackFactor" type="fixed-point"></field> <field name="overrideOrgPartyId" type="id"></field> <field name="createdDate" type="date-time"></field> <field name="createdByUserLogin" type="id-vlong"></field> @@ -3174,8 +3174,8 @@ <field name="productPromoActionSeqId" type="id-ne"></field> <field name="productPromoActionEnumId" type="id-ne"></field> <field name="orderAdjustmentTypeId" type="id"></field> - <field name="quantity" type="floating-point"></field> - <field name="amount" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> + <field name="amount" type="fixed-point"></field> <field name="productId" type="id"></field> <field name="partyId" type="id"></field> <prim-key field="productPromoId"/> @@ -3383,7 +3383,7 @@ <field name="productPromoCodeId" type="id-ne"></field> <field name="partyId" type="id-ne"></field> <field name="totalDiscountAmount" type="currency-amount"></field> - <field name="quantityLeftInActions" type="floating-point"></field> + <field name="quantityLeftInActions" type="fixed-point"></field> <prim-key field="orderId"/> <prim-key field="promoSequenceId"/> <relation type="one" fk-name="PROD_PRUSE_PROMO" rel-entity-name="ProductPromo"> @@ -3900,10 +3900,10 @@ <field name="partyId" type="id-ne"></field> <field name="roleTypeId" type="id-ne"></field> <field name="companyPartyId" type="id"></field> - <field name="minWeight" type="floating-point"></field> - <field name="maxWeight" type="floating-point"></field> - <field name="minSize" type="floating-point"></field> - <field name="maxSize" type="floating-point"></field> + <field name="minWeight" type="fixed-point"></field> + <field name="maxWeight" type="fixed-point"></field> + <field name="minSize" type="fixed-point"></field> + <field name="maxSize" type="fixed-point"></field> <field name="minTotal" type="currency-amount"></field> <field name="maxTotal" type="currency-amount"></field> <field name="allowUspsAddr" type="indicator"></field> @@ -4359,8 +4359,8 @@ <field name="geoId" type="id"></field> <field name="fromDate" type="date-time"></field> <field name="thruDate" type="date-time"></field> - <field name="reorderQuantity" type="floating-point"></field> - <field name="reorderLevel" type="floating-point"></field> + <field name="reorderQuantity" type="fixed-point"></field> + <field name="reorderLevel" type="fixed-point"></field> <prim-key field="reorderGuidelineId"/> <relation type="one" fk-name="REORDER_GD_PROD" rel-entity-name="Product"> <key-map field-name="productId"/> @@ -4391,10 +4391,10 @@ <field name="availableThruDate" type="date-time"></field> <field name="supplierPrefOrderId" type="id"></field> <field name="supplierRatingTypeId" type="id"></field> - <field name="standardLeadTimeDays" type="floating-point"></field> - <field name="minimumOrderQuantity" type="floating-point"></field> - <field name="orderQtyIncrements" type="floating-point"></field> - <field name="unitsIncluded" type="floating-point"></field> + <field name="standardLeadTimeDays" type="fixed-point"></field> + <field name="minimumOrderQuantity" type="fixed-point"></field> + <field name="orderQtyIncrements" type="fixed-point"></field> + <field name="unitsIncluded" type="fixed-point"></field> <field name="quantityUomId" type="id"></field> <field name="agreementId" type="id"></field> <field name="agreementItemSeqId" type="id"></field> @@ -4403,7 +4403,7 @@ <field name="supplierProductName" type="name"></field> <field name="supplierProductId" type="id"></field> <field name="canDropShip" type="indicator"></field> - <field name="supplierCommissionPerc" type="floating-point"></field> + <field name="supplierCommissionPerc" type="fixed-point"></field> <field name="comments" type="comment"></field> <prim-key field="productId"/> <prim-key field="partyId"/> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml (original) +++ ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml Mon Jan 5 23:13:36 2009 @@ -57,8 +57,8 @@ <field name="maintHistSeqId" type="id"></field> <field name="issuedDateTime" type="date-time"></field> <field name="issuedByUserLoginId" type="id-vlong"></field> - <field name="quantity" type="floating-point"></field> - <field name="cancelQuantity" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> + <field name="cancelQuantity" type="fixed-point"></field> <prim-key field="itemIssuanceId"/> <relation type="one" fk-name="ITEM_ISS_INVITM" rel-entity-name="InventoryItem"> <key-map field-name="inventoryItemId"/> @@ -196,7 +196,7 @@ <field name="shipGroupSeqId" type="id-ne"></field> <field name="inventoryItemId" type="id-ne"></field> <field name="itemStatusId" type="id-ne"></field> - <field name="quantity" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> <prim-key field="picklistBinId"/> <prim-key field="orderId"/> <prim-key field="orderItemSeqId"/> @@ -341,8 +341,8 @@ <field name="receivedByUserLoginId" type="id-vlong"></field> <field name="datetimeReceived" type="date-time"></field> <field name="itemDescription" type="description"></field> - <field name="quantityAccepted" type="floating-point"></field> - <field name="quantityRejected" type="floating-point"></field> + <field name="quantityAccepted" type="fixed-point"></field> + <field name="quantityRejected" type="fixed-point"></field> <prim-key field="receiptId"/> <relation type="one" fk-name="SHP_RCPT_INVITM" rel-entity-name="InventoryItem"> <key-map field-name="inventoryItemId"/> @@ -478,9 +478,9 @@ <field name="estimatedStartDate" type="date-time"></field> <field name="estimatedArrivalDate" type="date-time"></field> <field name="fixedAssetId" type="id"></field> - <field name="startMileage" type="floating-point"></field> - <field name="endMileage" type="floating-point"></field> - <field name="fuelUsed" type="floating-point"></field> + <field name="startMileage" type="fixed-point"></field> + <field name="endMileage" type="fixed-point"></field> + <field name="fuelUsed" type="fixed-point"></field> <prim-key field="deliveryId"/> <relation type="one" fk-name="DELIV_FXAS" rel-entity-name="FixedAsset"> <key-map field-name="fixedAssetId"/> @@ -689,11 +689,11 @@ <field name="shipmentBoxTypeId" type="id-ne"></field> <field name="description" type="description"></field> <field name="dimensionUomId" type="id"></field> - <field name="boxLength" type="floating-point"></field> - <field name="boxWidth" type="floating-point"></field> - <field name="boxHeight" type="floating-point"></field> + <field name="boxLength" type="fixed-point"></field> + <field name="boxWidth" type="fixed-point"></field> + <field name="boxHeight" type="fixed-point"></field> <field name="weightUomId" type="id"></field> - <field name="boxWeight" type="floating-point"></field> + <field name="boxWeight" type="fixed-point"></field> <prim-key field="shipmentBoxTypeId"/> <relation type="one" fk-name="SHMT_BXTP_DUOM" title="Dimension" rel-entity-name="Uom"> <key-map field-name="dimensionUomId" rel-field-name="uomId"/> @@ -750,13 +750,13 @@ <field name="priceUomId" type="id"></field> <field name="priceUnitPrice" type="currency-amount"></field> <field name="orderFlatPrice" type="currency-amount"></field> - <field name="orderPricePercent" type="floating-point"></field> + <field name="orderPricePercent" type="fixed-point"></field> <field name="orderItemFlatPrice" type="currency-amount"></field> - <field name="shippingPricePercent" type="floating-point"></field> + <field name="shippingPricePercent" type="fixed-point"></field> <field name="productFeatureGroupId" type="id"></field> - <field name="oversizeUnit" type="floating-point"></field> + <field name="oversizeUnit" type="fixed-point"></field> <field name="oversizePrice" type="currency-amount"></field> - <field name="featurePercent" type="floating-point"></field> + <field name="featurePercent" type="fixed-point"></field> <field name="featurePrice" type="currency-amount"></field> <prim-key field="shipmentCostEstimateId"/> <relation type="one" fk-name="SHPMNT_CE_CSHMTH" rel-entity-name="CarrierShipmentMethod"> @@ -805,7 +805,7 @@ <field name="shipmentId" type="id-ne"></field> <field name="shipmentItemSeqId" type="id-ne"></field> <field name="productId" type="id"></field> - <field name="quantity" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> <field name="shipmentContentDescription" type="description"></field> <prim-key field="shipmentId"/> <prim-key field="shipmentItemSeqId"/> @@ -1019,7 +1019,7 @@ <field name="shipmentPackageSeqId" type="id-ne"></field> <field name="shipmentBoxTypeId" type="id"></field> <field name="dateCreated" type="date-time"></field> - <field name="weight" type="floating-point"></field> + <field name="weight" type="fixed-point"></field> <field name="weightUomId" type="id"></field> <field name="insuredValue" type="currency-amount"></field> <prim-key field="shipmentId"/> @@ -1043,9 +1043,9 @@ <field name="shipmentId" type="id-ne"></field> <field name="shipmentPackageSeqId" type="id-ne"></field> <field name="shipmentItemSeqId" type="id-ne"></field> - <field name="quantity" type="floating-point"></field> + <field name="quantity" type="fixed-point"></field> <field name="subProductId" type="id"></field> - <field name="subProductQuantity" type="floating-point"></field> + <field name="subProductQuantity" type="fixed-point"></field> <prim-key field="shipmentId"/> <prim-key field="shipmentPackageSeqId"/> <prim-key field="shipmentItemSeqId"/> @@ -1118,7 +1118,7 @@ <field name="carrierDeliveryZone" type="short-varchar"></field> <field name="carrierRestrictionCodes" type="short-varchar"></field> <field name="carrierRestrictionDesc" type="very-long"></field> - <field name="billingWeight" type="floating-point"></field> + <field name="billingWeight" type="fixed-point"></field> <field name="billingWeightUomId" type="id"></field> <field name="actualTransportCost" type="currency-amount"></field> <field name="actualServiceCost" type="currency-amount"></field> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml Mon Jan 5 23:13:36 2009 @@ -25,7 +25,7 @@ <make-value value-field="newEntity" entity-name="CostComponent"/> <set-nonpk-fields map="parameters" value-field="newEntity"/> <sequenced-id sequence-name="CostComponent" field="newEntity.costComponentId"/> - <field-to-result field="costComponentId" map-name="newEntity"/> + <field-to-result field="newEntity.costComponentId" result-name="costComponentId"/> <if-empty field="newEntity.fromDate"> <now-timestamp field="newEntity.fromDate"/> </if-empty> @@ -99,8 +99,8 @@ <filter-list-by-date list="otherCosts"/> <first-from-list list="otherCosts" entry="otherCost"/> - <set field="productCost" value="0" type="Double" /> - <calculate field="productCost" type="Double" decimal-scale="6"> + <set field="productCost" value="0" type="BigDecimal" /> + <calculate field="productCost" decimal-scale="6"> <calcop field="laborCost.cost" operator="add"> <calcop field="materialsCost.cost" operator="get"/> <calcop field="routeCost.cost" operator="get"/> @@ -108,7 +108,7 @@ </calcop> </calculate> <!-- if the cost is zero, and the product is a variant, get the cost of the virtual --> - <if-compare field="productCost" operator="equals" value="0" type="Double"> + <if-compare field="productCost" operator="equals" value="0" type="BigDecimal"> <entity-one entity-name="Product" value-field="product"/> <set from-field="product.productId" field="assocAndMap.productIdTo"/> <set value="PRODUCT_VARIANT" field="assocAndMap.productAssocTypeId"/> @@ -125,7 +125,7 @@ </if-not-empty> </if-compare> <!-- if the cost is zero, get the purchase cost from the SupplierProduct --> - <if-compare field="productCost" operator="equals" value="0" type="Double"> + <if-compare field="productCost" operator="equals" value="0" type="BigDecimal"> <set field="orderByList[]" value="+supplierPrefOrderId"/> <set field="orderByList[]" value="+lastPrice"/> <clear-field field="costsAndMap"/> @@ -140,7 +140,7 @@ <!-- if the cost is zero, get the purchase cost from the SupplierProduct in a different currency and try to convert --> - <if-compare field="productCost" operator="equals" value="0" type="Double"> + <if-compare field="productCost" operator="equals" value="0" type="BigDecimal"> <clear-field field="costsAndMap"/> <set from-field="parameters.productId" field="costsAndMap.productId"/> <set from-field="parameters.productPriceTypeId" field="costsAndMap.productPriceTypeId"/> @@ -160,7 +160,7 @@ </if-compare> </if-compare> <!-- - <if-compare field="productCost" operator="equals" value="0" type="Double"> + <if-compare field="productCost" operator="equals" value="0" type="BigDecimal"> <clear-field field="costsAndMap"/> <set from-field="parameters.productId" field="costsAndMap.productId"/> <set from-field="parameters.currencyUomId" field="costsAndMap.currencyUomId"/> @@ -184,7 +184,7 @@ <result-to-field result-name="setupTime"/> </call-service> - <calculate field="estimatedTaskTime" type="Double" decimal-scale="6"> + <calculate field="estimatedTaskTime" decimal-scale="6"> <calcop field="estimatedTaskTime" operator="subtract"> <calcop field="setupTime" operator="get"/> </calcop> @@ -204,7 +204,7 @@ <filter-list-by-date list="usageCosts"/> <first-from-list list="usageCosts" entry="usageCost"/> </if-not-empty> - <calculate field="taskCost" type="Double" decimal-scale="6"> + <calculate field="taskCost" decimal-scale="6"> <calcop operator="add"> <calcop field="estimatedTaskTime" operator="multiply"> <calcop field="usageCost.amount" operator="get"/> @@ -216,7 +216,7 @@ </calculate> <!-- Time is converted from milliseconds to hours --> - <calculate field="taskCost" type="Double" decimal-scale="6"> + <calculate field="taskCost" decimal-scale="6"> <calcop field="taskCost" operator="divide"> <number value="3600000"/> </calcop> @@ -261,7 +261,7 @@ <call-service service-name="getProductCost" in-map-name="inputMap"> <result-to-field result-name="productCost"/> </call-service> - <calculate field="totalProductsCost" type="Double" decimal-scale="6"> + <calculate field="totalProductsCost" decimal-scale="6"> <calcop field="totalProductsCost" operator="add"> <calcop field="componentMap.quantity" operator="multiply"> <calcop field="productCost" operator="get"/> @@ -277,7 +277,7 @@ <call-service service-name="getProductCost" in-map-name="inputMap"> <result-to-field result-name="productCost"/> </call-service> - <calculate field="totalProductsCost" type="Double" decimal-scale="6"> + <calculate field="totalProductsCost" decimal-scale="6"> <calcop field="productCost" operator="get"/> </calculate> </else> @@ -297,14 +297,14 @@ <call-service service-name="getTaskCost" in-map-name="callSvcMap"> <result-to-field result-name="taskCost" field="taskCost"/> </call-service> - <calculate field="totalTaskCost" type="Double" decimal-scale="6"> + <calculate field="totalTaskCost" decimal-scale="6"> <calcop field="totalTaskCost" operator="add"> <calcop field="taskCost" operator="get"/> </calcop> </calculate> </iterate> - <calculate field="totalCost" type="Double" decimal-scale="6"> + <calculate field="totalCost" decimal-scale="6"> <calcop field="totalTaskCost" operator="add"> <calcop field="totalProductsCost" operator="get"/> </calcop> @@ -312,7 +312,7 @@ <!-- The CostComponent records are created. --> <if-not-empty field="totalTaskCost"> - <if-compare field="totalTaskCost" operator="greater" value="0" type="Double"> + <if-compare field="totalTaskCost" operator="greater" value="0" type="BigDecimal"> <clear-field field="callSvcMap"/> <set value="${parameters.costComponentTypePrefix}_ROUTE_COST" field="callSvcMap.costComponentTypeId"/> <set from-field="parameters.productId" field="callSvcMap.productId"/> @@ -322,7 +322,7 @@ </if-compare> </if-not-empty> <if-not-empty field="totalProductsCost"> - <if-compare field="totalProductsCost" operator="greater" value="0" type="Double"> + <if-compare field="totalProductsCost" operator="greater" value="0" type="BigDecimal"> <clear-field field="callSvcMap"/> <set value="${parameters.costComponentTypePrefix}_MAT_COST" field="callSvcMap.costComponentTypeId"/> <set from-field="parameters.productId" field="callSvcMap.productId"/> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml?rev=731851&r1=731850&r2=731851&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml Mon Jan 5 23:13:36 2009 @@ -33,12 +33,12 @@ <!-- before issuing inventory, check to see if there is inventory information in this database --> <!-- if inventory info is not available for all of the products, then don't do the issuance, ie there has to be at least SOME inventory info in the database to facilitate inventory-less POS terminals --> - <entity-count entity-name="InventoryItem" count-name="iiCount"> + <entity-count entity-name="InventoryItem" count-field="iiCount"> <condition-expr field-name="facilityId" operator="equals" from-field="orderHeader.originFacilityId"/> </entity-count> <!-- now go through each order item and call a service to issue the inventory --> - <if-compare field="iiCount" operator="greater" value="0" type="Double"> + <if-compare field="iiCount" operator="greater" value="0" type="BigDecimal"> <iterate list="orderItemList" entry="orderItem"> <if-not-empty field="orderItem.productId"> <clear-field field="callSvcMap"/> @@ -121,7 +121,7 @@ </iterate> <!-- if quantityNotIssued is not 0, then pull it from the last non-serialized inventory item found, in the quantityNotIssued field --> - <if-compare field="parameters.quantityNotIssued" operator="not-equals" value="0" type="Double"> + <if-compare field="parameters.quantityNotIssued" operator="not-equals" value="0" type="BigDecimal"> <if-not-empty field="lastNonSerInventoryItem"> <!-- create ItemIssuance record --> <set field="issuanceCreateMap.orderId" from-field="parameters.orderId" /> @@ -138,10 +138,10 @@ <set field="createDetailMap.orderId" from-field="parameters.orderId" /> <set field="createDetailMap.orderItemSeqId" from-field="parameters.orderItemSeqId" /> <set field="createDetailMap.itemIssuanceId" from-field="itemIssuanceId" /> - <calculate field="createDetailMap.availableToPromiseDiff" type="Double"> + <calculate field="createDetailMap.availableToPromiseDiff"> <calcop field="parameters.quantityNotIssued" operator="negative"/> </calculate> - <calculate field="createDetailMap.quantityOnHandDiff" type="Double"> + <calculate field="createDetailMap.quantityOnHandDiff"> <calcop field="parameters.quantityNotIssued" operator="negative"/> </calculate> <call-service service-name="createInventoryItemDetail" in-map-name="createDetailMap"/> @@ -173,10 +173,10 @@ <set field="createDetailMap.orderId" from-field="parameters.orderId" /> <set field="createDetailMap.orderItemSeqId" from-field="parameters.orderItemSeqId" /> <set field="createDetailMap.itemIssuanceId" from-field="itemIssuanceId" /> - <calculate field="createDetailMap.availableToPromiseDiff" type="Double"> + <calculate field="createDetailMap.availableToPromiseDiff"> <calcop field="parameters.quantityNotIssued" operator="negative"/> </calculate> - <calculate field="createDetailMap.quantityOnHandDiff" type="Double"> + <calculate field="createDetailMap.quantityOnHandDiff"> <calcop field="parameters.quantityNotIssued" operator="negative"/> </calculate> <call-service service-name="createInventoryItemDetail" in-map-name="createDetailMap"/> @@ -192,7 +192,7 @@ </simple-method> <simple-method method-name="issueImmediateForInventoryItemInline" short-description="Does a issuance for one InventoryItem, meant to be called in-line"> <!-- only do something with this inventoryItem if there is more inventory to issue --> - <if-compare field="parameters.quantityNotIssued" operator="greater" value="0" type="Double"> + <if-compare field="parameters.quantityNotIssued" operator="greater" value="0" type="BigDecimal"> <if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId"> <if-compare value="INV_AVAILABLE" operator="equals" field="inventoryItem.statusId"> <!-- change status on inventoryItem --> @@ -223,11 +223,11 @@ <if-compare operator="equals" field="inventoryItem.statusId" value="INV_AVAILABLE"/> </or> <not><if-empty field="inventoryItem.availableToPromiseTotal"/></not> - <if-compare field="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/> + <if-compare field="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="BigDecimal"/> </and> </condition> <then> - <if-compare-field field="parameters.quantityNotIssued" to-field="inventoryItem.availableToPromiseTotal" operator="greater" type="Double"> + <if-compare-field field="parameters.quantityNotIssued" to-field="inventoryItem.availableToPromiseTotal" operator="greater" type="BigDecimal"> <set field="parameters.deductAmount" from-field="inventoryItem.availableToPromiseTotal" /> <else> <set field="parameters.deductAmount" from-field="parameters.quantityNotIssued" /> @@ -249,10 +249,10 @@ <set field="createDetailMap.orderItemSeqId" from-field="parameters.orderItemSeqId" /> <set field="createDetailMap.itemIssuanceId" from-field="itemIssuanceId" /> <!-- update availableToPromiseDiff AND quantityOnHandDiff since this is an issuance --> - <calculate field="createDetailMap.availableToPromiseDiff" type="Double"> + <calculate field="createDetailMap.availableToPromiseDiff"> <calcop field="parameters.deductAmount" operator="negative"/> </calculate> - <calculate field="createDetailMap.quantityOnHandDiff" type="Double"> + <calculate field="createDetailMap.quantityOnHandDiff"> <calcop field="parameters.deductAmount" operator="negative"/> </calculate> <call-service service-name="createInventoryItemDetail" in-map-name="createDetailMap"/> |
Free forum by Nabble | Edit this page |