Fixes issue 12043 Create VAT Registers process takes now multi-organization into account.
authorRafa Roda Palacios <rafael.roda@openbravo.com>
Fri, 22 Jan 2010 20:47:45 +0100
changeset 5990 49572b27b43a
parent 5989 06b4bc2129d3
child 5991 54a4f104b26b
Fixes issue 12043 Create VAT Registers process takes now multi-organization into account.
src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java
src/org/openbravo/erpCommon/ad_actionButton/TaxPayment.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java	Tue Jan 26 17:45:15 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java	Fri Jan 22 20:47:45 2010 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2008-2009 Openbravo SL 
+ * All portions are Copyright (C) 2008-2010 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -128,7 +128,8 @@
     if (strProcessed.equalsIgnoreCase("N")) {
       // check for already used periods)
       BigDecimal CrossPeriodCount = new BigDecimal(TaxPayment.selectCrossPeriodCount(this, vars
-          .getClient(), strDatefrom, strDateto));
+          .getClient(), Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()),
+          taxpayment[0].adOrgId), strDatefrom, strDateto));
       if (CrossPeriodCount.intValue() > 0) {
         myMessage = Utility.translateError(this, vars, vars.getLanguage(), Utility.messageBD(this,
             "PeriodsDontMatch", vars.getLanguage()));
--- a/src/org/openbravo/erpCommon/ad_actionButton/TaxPayment.xsql	Tue Jan 26 17:45:15 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/TaxPayment.xsql	Fri Jan 22 20:47:45 2010 +0100
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2008 Openbravo SL 
+ * All portions are Copyright (C) 2008-2010 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -94,6 +94,7 @@
   <![CDATA[
      SELECT COUNT(*) FROM C_TAXPAYMENT WHERE PROCESSED='Y' 
      AND AD_CLIENT_ID = ?
+     AND AD_Org_ID IN ('1')
      AND ((DATEFROM <= TO_DATE(?) AND DATETO >=TO_DATE(?)
      OR DATEFROM <= TO_DATE(?) AND DATETO >=TO_DATE(?))
      OR 
@@ -102,6 +103,7 @@
       ]]>
   </Sql>
   <Parameter name="adClientId"/>
+  <Parameter name="adUserOrg" type="replace" optional="true" after="AND AD_Org_ID IN (" text="'1'"/>
   <Parameter name="DateFrom"/>
   <Parameter name="DateFrom"/>
   <Parameter name="DateTo"/>