Resending, In cease -

If this has been missed.
Please look at the inline comments -


On Jun 19, 2009, at 7:22 PM, Sumit Pandit wrote:

Hi bibryam,
It might be possible that I am missing something, but I have a doubt -

Please find inline comment -
----- [email protected] wrote:

| Author: bibryam
| Date: Fri Nov 28 03:16:07 2008
| New Revision: 721431
|
| URL: http://svn.apache.org/viewvc?rev=721431&view=rev
| Log:
| Added purposeEnumId field to UomConversionDated entity. This will
| allow having different currency exchange rates for different on
| purposea.
| Also extended convertUom service to search rates by purpose. If a rate | with specified purposeEnumId is not found, then the conversion is done
| based on rates w/o purpose.
|
| Modified:
|
| ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ admin/AcctgAdminServices.xml | ofbiz/trunk/applications/accounting/servicedef/ services_admin.xml
|     ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml
|     ofbiz/trunk/framework/common/data/CommonTypeData.xml
|     ofbiz/trunk/framework/common/entitydef/entitymodel.xml
|
| ofbiz/trunk/framework/common/script/org/ofbiz/common/ CommonServices.xml
|

| Modified:
| ofbiz/trunk/framework/common/script/org/ofbiz/common/ CommonServices.xml
| URL:
| 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml?rev=721431&r1=721430&r2=721431&view=diff
| = = = = = = = = ======================================================================
| ---
| ofbiz/trunk/framework/common/script/org/ofbiz/common/ CommonServices.xml
| (original)
| +++
| ofbiz/trunk/framework/common/script/org/ofbiz/common/ CommonServices.xml
| Fri Nov 28 03:16:07 2008
| @@ -83,6 +83,7 @@
|                  <condition-list combine="and">
|                      <condition-expr field-name="uomId"
| env-name="parameters.uomId"/>
|                      <condition-expr field-name="uomIdTo"
| env-name="parameters.uomIdTo"/>
| +                    <condition-expr field-name="purposeEnumId"
| operator="equals" env-name="parameters.purposeEnumId"
| ignore-if-empty="true"/>
|                      <condition-expr field-name="fromDate"
| operator="less-equals" env-name="asOfDate"/>
|                      <condition-list combine="or">
|                          <condition-expr field-name="thruDate"
| operator="greater-equals" env-name="asOfDate"/>
| @@ -93,6 +94,25 @@
|                  <order-by field-name="-fromDate"/>
|              </entity-condition>
|              <first-from-list list-name="uomConversions"
| entry-name="uomConversion"/>
| +
| +            <!-- if no conversion found with specified purpose, try
| w/o purpose -->
| +            <if-empty field="uomConversion">
| +                <if-not-empty field="parameters.purposeEnumId">





I think in above line check should be there as - if parameters.purposeEnumId is empty. (<if-empty field="parameters.purposeEnumId">) (line#100 of CommonServices.xml)
Otherwise following wouold be happened -

In CommonServices.xml - @line # 81 it is checked that if uomConversion empty, then get records based on fields - uomId, uomIdTo, purposeEnumId, fromDate<asOfDate and thruDate >= asOfDate OR thruDate = null. It is okay, but @line# 99/100 it again checked that if uomConversion and parameters.purposeEnumId are empty and get record based same condition given above except - parameters.purposeEnumId

Here  -
if we have value in parameters.purposeEnumId then we get our record in entity-condition @82, in such case we never get in entity- condition @line # 101, due to check @99. And if parameters.purposeEnumId is empty, even though we never enter in block @100.

So here @line#100 either check should be - <if-empty field="parameters.purposeEnumId"> or block will never execute.

Please let me know if I am wrong.


Thanks And Regards
Sumit Pandit





| +                    <entity-condition
| entity-name="UomConversionDated" list-name="uomConversions"
| use-cache="true">
| +                        <condition-list combine="and">
| +                            <condition-expr field-name="uomId"
| env-name="parameters.uomId"/>
| +                            <condition-expr field-name="uomIdTo"
| env-name="parameters.uomIdTo"/>
| +                            <condition-expr field-name="fromDate"
| operator="less-equals" env-name="asOfDate"/>
| +                            <condition-list combine="or">
| + <condition-expr field- name="thruDate"
| operator="greater-equals" env-name="asOfDate"/>
| + <condition-expr field- name="thruDate"
| operator="equals" env-name="nullField"/>
| +                            </condition-list>
| +                        </condition-list>
| +                        <order-by field-name="-fromDate"/>
| +                    </entity-condition>
| +                    <first-from-list list-name="uomConversions"
| entry-name="uomConversion"/>
| +                </if-not-empty>
| +            </if-empty>
|          </if-empty>
|          <log level="verbose" message="using conversion
| factor=${uomConversion.conversionFactor}"/>

--
--
  Thanks and Regards
  Sumit Pandit
  Senior Manager, Hotwax Media Inc.
  +91-9926681124


Reply via email to