details: /erp/devel/main/rev/64da2ed5a594 changeset: 8220:64da2ed5a594 user: David Alsasua <david.alsasua <at> openbravo.com> date: Tue Aug 17 14:17:29 2010 +0200 summary: Fixes issue 14047
details: /erp/devel/main/rev/e1e3c5b69de3 changeset: 8221:e1e3c5b69de3 user: Adrián Romero <adrianromero <at> openbravo.com> date: Tue Aug 17 14:49:38 2010 +0200 summary: Fixes issue 0014140: Multicurrency in purchase invoices doesn't work It has been added the message for not convertible documents details: /erp/devel/main/rev/7b3d7c77f235 changeset: 8222:7b3d7c77f235 user: RM packaging bot <staff.rm <at> openbravo.com> date: Wed Aug 18 00:39:36 2010 +0200 summary: CI: promote changesets from pi to main details: /erp/devel/main/rev/2cad794ceb55 changeset: 8223:2cad794ceb55 user: RM packaging bot <staff.rm <at> openbravo.com> date: Wed Aug 18 00:39:38 2010 +0200 summary: CI: update AD_MODULE - Core version and label diffstat: src-db/database/sourcedata/AD_MESSAGE.xml | 11 + src-db/database/sourcedata/AD_MODULE.xml | 4 +- src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java | 21 ++- src/org/openbravo/erpCommon/businessUtility/Organization_data.xsql | 64 ---------- 4 files changed, 28 insertions(+), 72 deletions(-) diffs (155 lines): diff -r ab63baf13ee9 -r 2cad794ceb55 src-db/database/sourcedata/AD_MESSAGE.xml --- a/src-db/database/sourcedata/AD_MESSAGE.xml Tue Aug 17 14:09:40 2010 +0200 +++ b/src-db/database/sourcedata/AD_MESSAGE.xml Wed Aug 18 00:39:38 2010 +0200 @@ -31247,6 +31247,17 @@ <!--61DD25C13AC94CAF895C25FFFB7A1103--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> <!--61DD25C13AC94CAF895C25FFFB7A1103--></AD_MESSAGE> +<!--6336B95932C2466B8EC610A10743EA43--><AD_MESSAGE> +<!--6336B95932C2466B8EC610A10743EA43--> <AD_MESSAGE_ID><![CDATA[6336B95932C2466B8EC610A10743EA43]]></AD_MESSAGE_ID> +<!--6336B95932C2466B8EC610A10743EA43--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--6336B95932C2466B8EC610A10743EA43--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--6336B95932C2466B8EC610A10743EA43--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--6336B95932C2466B8EC610A10743EA43--> <VALUE><![CDATA[NotConvertible]]></VALUE> +<!--6336B95932C2466B8EC610A10743EA43--> <MSGTEXT><![CDATA[Document currency cannot be converted to the Accounting Schema currency.]]></MSGTEXT> +<!--6336B95932C2466B8EC610A10743EA43--> <MSGTYPE><![CDATA[I]]></MSGTYPE> +<!--6336B95932C2466B8EC610A10743EA43--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--6336B95932C2466B8EC610A10743EA43--></AD_MESSAGE> + <!--63801BDB3B014D6885DA44861692DBBC--><AD_MESSAGE> <!--63801BDB3B014D6885DA44861692DBBC--> <AD_MESSAGE_ID><![CDATA[63801BDB3B014D6885DA44861692DBBC]]></AD_MESSAGE_ID> <!--63801BDB3B014D6885DA44861692DBBC--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> diff -r ab63baf13ee9 -r 2cad794ceb55 src-db/database/sourcedata/AD_MODULE.xml --- a/src-db/database/sourcedata/AD_MODULE.xml Tue Aug 17 14:09:40 2010 +0200 +++ b/src-db/database/sourcedata/AD_MODULE.xml Wed Aug 18 00:39:38 2010 +0200 @@ -6,7 +6,7 @@ <!--0--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--0--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--0--> <NAME><![CDATA[core]]></NAME> -<!--0--> <VERSION><![CDATA[2.50.17989]]></VERSION> +<!--0--> <VERSION><![CDATA[2.50.18222]]></VERSION> <!--0--> <DESCRIPTION><![CDATA[Core module is the base one]]></DESCRIPTION> <!--0--> <HELP><![CDATA[Core module is the base one, all developments in core are included as part of the standard Openbravo ERP.]]></HELP> <!--0--> <URL><![CDATA[www.openbravo.com]]></URL> @@ -22,7 +22,7 @@ <!--0--> <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE> <!--0--> <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA> <!--0--> <REFERENCEDATAINFO><![CDATA[Standard document types for orders, invoices, etc. and settings]]></REFERENCEDATAINFO> -<!--0--> <VERSION_LABEL><![CDATA[dev]]></VERSION_LABEL> +<!--0--> <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL> <!--0--> <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL> <!--0--></AD_MODULE> diff -r ab63baf13ee9 -r 2cad794ceb55 src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java --- a/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java Tue Aug 17 14:09:40 2010 +0200 +++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java Wed Aug 18 00:39:38 2010 +0200 @@ -28,13 +28,16 @@ import org.openbravo.base.secureApp.HttpSecureAppServlet; import org.openbravo.base.secureApp.VariablesSecureApp; +import org.openbravo.dal.core.OBContext; +import org.openbravo.dal.security.OrganizationStructureProvider; +import org.openbravo.dal.service.OBDal; import org.openbravo.data.FieldProvider; -import org.openbravo.erpCommon.businessUtility.OrganizationData; import org.openbravo.erpCommon.businessUtility.PAttributeSet; import org.openbravo.erpCommon.businessUtility.PAttributeSetData; import org.openbravo.erpCommon.businessUtility.Tax; import org.openbravo.erpCommon.utility.ComboTableData; import org.openbravo.erpCommon.utility.Utility; +import org.openbravo.model.common.enterprise.Organization; import org.openbravo.utils.FormatUtilities; import org.openbravo.xmlEngine.XmlDocument; @@ -68,11 +71,17 @@ String strWharehouse = Utility.getContext(this, vars, "#M_Warehouse_ID", strWindowId); String strWarehouseOrg = SLOrderProductData.getWarehouseOrg(this, strWharehouse); String strWarehouseForOrg = ""; - if (!OrganizationData.isOrgInTree(this, strADOrgID, strWarehouseOrg, vars.getClient())) - strWarehouseForOrg = SLOrderProductData.getWarehouseOfOrg(this, vars.getClient(), - strADOrgID); - if (!strWarehouseForOrg.equals("")) - strWharehouse = strWarehouseForOrg; + final OrganizationStructureProvider osp = OBContext.getOBContext() + .getOrganizationStructureProvider(vars.getClient()); + if (!strADOrgID.equals(strWarehouseOrg)) { + Organization org = OBDal.getInstance().get(Organization.class, strADOrgID); + Organization warehouseOrg = OBDal.getInstance().get(Organization.class, strWarehouseOrg); + if (osp.isInNaturalTree(org, warehouseOrg) || osp.isInNaturalTree(warehouseOrg, org)) + strWarehouseForOrg = SLOrderProductData.getWarehouseOfOrg(this, vars.getClient(), + strADOrgID); + if (!strWarehouseForOrg.equals("")) + strWharehouse = strWarehouseForOrg; + } String strTabId = vars.getStringParameter("inpTabId"); try { diff -r ab63baf13ee9 -r 2cad794ceb55 src/org/openbravo/erpCommon/businessUtility/Organization_data.xsql --- a/src/org/openbravo/erpCommon/businessUtility/Organization_data.xsql Tue Aug 17 14:09:40 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - ************************************************************************* - * The contents of this file are subject to the Openbravo Public License - * Version 1.0 (the "License"), being the Mozilla Public License - * Version 1.1 with a permitted attribution clause; you may not use this - * file except in compliance with the License. You may obtain a copy of - * the License at http://www.openbravo.com/legal/license.html - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * The Original Code is Openbravo ERP. - * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2010 Openbravo SLU - * All Rights Reserved. - * Contributor(s): ______________________________________. - ************************************************************************ ---> - - -<SqlClass name="OrganizationData" package="org.openbravo.erpCommon.businessUtility" accessModifier="public"> - <SqlMethod name="select" type="preparedStatement" return="multiple"> - <SqlMethodComment></SqlMethodComment> - <Sql> - <![CDATA[ - SELECT '' AS RESULT - FROM AD_ORG - ]]> - </Sql> - </SqlMethod> - - <SqlMethod name="isOrgInTree" type="preparedStatement" return="Boolean" default="false"> - <SqlMethodComment></SqlMethodComment> - <Sql> - <![CDATA[ - select count(*) as result - from dual - where ad_isorgincluded(?,?,?) <> -1 - or ad_isorgincluded(?,?,?) <> -1 - ]]> - </Sql> - <Parameter name="adOrg1Id"/> - <Parameter name="adOrg2Id"/> - <Parameter name="adClientId"/> - <Parameter name="adOrg2Id"/> - <Parameter name="adOrg1Id"/> - <Parameter name="adClientId"/> - </SqlMethod> - - <SqlMethod name="isParentOrg" type="preparedStatement" return="Boolean" default="false"> - <SqlMethodComment></SqlMethodComment> - <Sql> - <![CDATA[ - select count(*) as result - from dual - where ad_isorgincluded(?,?,?) <> -1 - ]]> - </Sql> - <Parameter name="adOrgId"/> - <Parameter name="adParentOrgId"/> - <Parameter name="adClientId"/> - </SqlMethod> - -</SqlClass> ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits