Attached Files | 36621.diff [^] (15,213 bytes) 2017-08-07 15:08 [Show Content] [Hide Content]# HG changeset patch
# User Mark <markmm82@gmail.com>
# Date 1501696851 14400
# Wed Aug 02 14:00:51 2017 -0400
# Node ID f1c68e4b5df730c3d3e39084d6c191e5c30f6b5c
# Parent 439855d2ed2633832a7e0504038a5cd3c0d06429
Added the client filter when find conversion rate between UOMs.
It avoids use conversions defined in other clients than used when callout is called.
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_CreateFromMultiple_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_CreateFromMultiple_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_CreateFromMultiple_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_CreateFromMultiple_Conversion.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2010 Openbravo SLU
+ * All portions are Copyright (C) 2001-2017 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -78,11 +78,13 @@
String strMultiplyRate;
boolean check = false;
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, localStrUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, localStrUOM,
+ vars.getClient());
if (strInitUOM.equals(localStrUOM))
strMultiplyRate = "1";
if (strMultiplyRate.equals(""))
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, localStrUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, localStrUOM, strInitUOM,
+ vars.getClient());
if (strMultiplyRate.equals("")) {
strMultiplyRate = "1";
if (!strMProductUOMID.equals(""))
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_CreateLines_Conversion_UOM.java b/src/org/openbravo/erpCommon/ad_callouts/SL_CreateLines_Conversion_UOM.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_CreateLines_Conversion_UOM.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_CreateLines_Conversion_UOM.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2010 Openbravo SLU
+ * All portions are Copyright (C) 2001-2017 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -75,11 +75,13 @@
String strMultiplyRate;
boolean check = false;
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ vars.getClient());
if (strInitUOM.equals(strUOM))
strMultiplyRate = "1";
if (strMultiplyRate.equals(""))
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ vars.getClient());
if (strMultiplyRate.equals("")) {
strMultiplyRate = "1";
if (!strMProductUOMID.equals(""))
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_GlobalUse_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_GlobalUse_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_GlobalUse_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_GlobalUse_Conversion.java
@@ -46,10 +46,12 @@
String strInitUOM = SLInvoiceConversionData.initUOMId(this, strMProductUOMID);
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
strMultiplyRate = "1";
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_Conversion.java
@@ -46,10 +46,12 @@
String strInitUOM = SLInvoiceConversionData.initUOMId(this, strMProductUOMID);
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
// Set message when no UOM Conversion exists
if (StringUtils.isEmpty(strMultiplyRate)) {
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_Internal_Consumption_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_Internal_Consumption_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Internal_Consumption_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Internal_Consumption_Conversion.java
@@ -43,19 +43,22 @@
String strQuantityOrder = info.vars.getNumericParameter("inpquantityorder");
// Multiple Rate for UOM Conversion if any
- boolean check = false;
String strInitUOM = SLInvoiceConversionData.initUOMId(this, strMProductUOMID);
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
strMultiplyRate = "1";
if (StringUtils.isNotEmpty(strMProductUOMID)) {
- check = true;
+ // Set message when no UOM Conversion exists
+ info.showMessage(FormatUtilities.replaceJS(Utility.messageBD(this, "NoUOMConversion",
+ info.vars.getLanguage())));
}
}
@@ -83,10 +86,5 @@
info.addResult("inpmProductUomId", null);
}
- // Set message when no UOM Conversion exists
- if (check) {
- info.showMessage(FormatUtilities.replaceJS(Utility.messageBD(this, "NoUOMConversion",
- info.vars.getLanguage())));
- }
}
}
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Conversion.java
@@ -46,10 +46,12 @@
String strInitUOM = SLInvoiceConversionData.initUOMId(this, strMProductUOMID);
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
strMultiplyRate = "1";
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion.java
@@ -47,10 +47,12 @@
boolean check = false;
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
strMultiplyRate = "1";
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion_data.xsql b/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion_data.xsql
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion_data.xsql
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion_data.xsql
@@ -48,17 +48,19 @@
<SqlMethod name="multiplyRate" type="preparedStatement" return="String" default="">
<SqlMethodComment></SqlMethodComment>
<Sql>
- SELECT MULTIPLYRATE FROM C_UOM_CONVERSION WHERE C_UOM_ID = ? AND C_UOM_TO_ID = ?
+ SELECT MULTIPLYRATE FROM C_UOM_CONVERSION WHERE C_UOM_ID = ? AND C_UOM_TO_ID = ? AND AD_CLIENT_ID = ?
</Sql>
<Parameter name="mProductUOM"/>
<Parameter name="mProduct"/>
+ <Parameter name="client"/>
</SqlMethod>
<SqlMethod name="divideRate" type="preparedStatement" return="String" default="">
<SqlMethodComment></SqlMethodComment>
<Sql>
- SELECT DIVIDERATE FROM C_UOM_CONVERSION WHERE C_UOM_ID = ? AND C_UOM_TO_ID = ?
+ SELECT DIVIDERATE FROM C_UOM_CONVERSION WHERE C_UOM_ID = ? AND C_UOM_TO_ID = ? AND AD_CLIENT_ID = ?
</Sql>
<Parameter name="mProduct"/>
<Parameter name="mProductUOM"/>
+ <Parameter name="client"/>
</SqlMethod>
</SqlClass>
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Conversion.java
@@ -46,10 +46,12 @@
String strInitUOM = SLInvoiceConversionData.initUOMId(this, strMProductUOMID);
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
strMultiplyRate = "1";
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Conversion.java
@@ -46,10 +46,12 @@
String strInitUOM = SLInvoiceConversionData.initUOMId(this, strMProductUOMID);
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
strMultiplyRate = "1";
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_Production_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_Production_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Production_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Production_Conversion.java
@@ -46,10 +46,12 @@
String strInitUOM = SLInvoiceConversionData.initUOMId(this, strMProductUOMID);
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
strMultiplyRate = "1";
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Conversion.java b/src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Conversion.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Conversion.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Conversion.java
@@ -46,10 +46,12 @@
String strInitUOM = SLInvoiceConversionData.initUOMId(this, strMProductUOMID);
String strMultiplyRate = StringUtils.equals(strInitUOM, strUOM) ? "1" : "";
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM);
+ strMultiplyRate = SLInvoiceConversionData.multiplyRate(this, strInitUOM, strUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
- strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM);
+ strMultiplyRate = SLInvoiceConversionData.divideRate(this, strUOM, strInitUOM,
+ info.vars.getClient());
}
if (StringUtils.isEmpty(strMultiplyRate)) {
strMultiplyRate = "1";
|