Fixes Bug 28534: Fix Backdated From is now displayed properly.
authorUnai Martirena <unai.martirena@openbravo.com>
Thu, 08 Jan 2015 12:30:31 +0100
changeset 25677 26e29327d389
parent 25676 5d5f68403fb7
child 25678 2517423ec50b
Fixes Bug 28534: Fix Backdated From is now displayed properly.

'Fix Backdated From' now is only displayed when 'Backdated Transactions Fixed' is set to Yes.
Also a callout has been added to clear the value in 'Fix Backdated From' when is hidden.
src-db/database/sourcedata/AD_CALLOUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
src/org/openbravo/erpCommon/ad_callouts/SL_CostingRule_FixBackdated.java
--- a/src-db/database/sourcedata/AD_CALLOUT.xml	Wed Jan 07 19:31:01 2015 +0100
+++ b/src-db/database/sourcedata/AD_CALLOUT.xml	Thu Jan 08 12:30:31 2015 +0100
@@ -1069,6 +1069,16 @@
 <!--8896DB516AF14588AE9D9B56FC23156C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--8896DB516AF14588AE9D9B56FC23156C--></AD_CALLOUT>
 
+<!--896299C6800F496C83FAE276E1F37B6A--><AD_CALLOUT>
+<!--896299C6800F496C83FAE276E1F37B6A-->  <AD_CALLOUT_ID><![CDATA[896299C6800F496C83FAE276E1F37B6A]]></AD_CALLOUT_ID>
+<!--896299C6800F496C83FAE276E1F37B6A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--896299C6800F496C83FAE276E1F37B6A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--896299C6800F496C83FAE276E1F37B6A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--896299C6800F496C83FAE276E1F37B6A-->  <NAME><![CDATA[SL_CostingRule_FixBackdated]]></NAME>
+<!--896299C6800F496C83FAE276E1F37B6A-->  <DESCRIPTION><![CDATA[Callout to reset Fix Backdated From in Costing Rule window when the costing rule is nor marked as FIx Backdated]]></DESCRIPTION>
+<!--896299C6800F496C83FAE276E1F37B6A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--896299C6800F496C83FAE276E1F37B6A--></AD_CALLOUT>
+
 <!--8D5A298D3BEF4E14BB9B9C2A7D0CFA18--><AD_CALLOUT>
 <!--8D5A298D3BEF4E14BB9B9C2A7D0CFA18-->  <AD_CALLOUT_ID><![CDATA[8D5A298D3BEF4E14BB9B9C2A7D0CFA18]]></AD_CALLOUT_ID>
 <!--8D5A298D3BEF4E14BB9B9C2A7D0CFA18-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Wed Jan 07 19:31:01 2015 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Jan 08 12:30:31 2015 +0100
@@ -240260,6 +240260,7 @@
 <!--480CC1DA0E0F432CACE9360D07842B65-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
 <!--480CC1DA0E0F432CACE9360D07842B65-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--480CC1DA0E0F432CACE9360D07842B65-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--480CC1DA0E0F432CACE9360D07842B65-->  <AD_CALLOUT_ID><![CDATA[896299C6800F496C83FAE276E1F37B6A]]></AD_CALLOUT_ID>
 <!--480CC1DA0E0F432CACE9360D07842B65-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--480CC1DA0E0F432CACE9360D07842B65-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--480CC1DA0E0F432CACE9360D07842B65-->  <POSITION><![CDATA[18]]></POSITION>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Jan 07 19:31:01 2015 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Jan 08 12:30:31 2015 +0100
@@ -198386,6 +198386,7 @@
 <!--39932E6D9F234DE7BE28C602E43BD91D-->  <AD_COLUMN_ID><![CDATA[842AB447B9D1488EA42F3DACA71934F3]]></AD_COLUMN_ID>
 <!--39932E6D9F234DE7BE28C602E43BD91D-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
 <!--39932E6D9F234DE7BE28C602E43BD91D-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--39932E6D9F234DE7BE28C602E43BD91D-->  <DISPLAYLOGIC><![CDATA[@Backdatedtrxsfixed@='Y']]></DISPLAYLOGIC>
 <!--39932E6D9F234DE7BE28C602E43BD91D-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
 <!--39932E6D9F234DE7BE28C602E43BD91D-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--39932E6D9F234DE7BE28C602E43BD91D-->  <SEQNO><![CDATA[70]]></SEQNO>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Wed Jan 07 19:31:01 2015 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Thu Jan 08 12:30:31 2015 +0100
@@ -4074,6 +4074,18 @@
 <!--89D3D9EC0AAC4BA4AC8B3AA400B138BA-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--89D3D9EC0AAC4BA4AC8B3AA400B138BA--></AD_MODEL_OBJECT>
 
+<!--89D878C0E07C471F98D0F6D02C9B7C5B--><AD_MODEL_OBJECT>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <AD_MODEL_OBJECT_ID><![CDATA[89D878C0E07C471F98D0F6D02C9B7C5B]]></AD_MODEL_OBJECT_ID>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <ACTION><![CDATA[C]]></ACTION>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.SL_CostingRule_FixBackdated]]></CLASSNAME>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <AD_CALLOUT_ID><![CDATA[896299C6800F496C83FAE276E1F37B6A]]></AD_CALLOUT_ID>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--89D878C0E07C471F98D0F6D02C9B7C5B--></AD_MODEL_OBJECT>
+
 <!--8A935F84A79B45F8457CB91B09764786--><AD_MODEL_OBJECT>
 <!--8A935F84A79B45F8457CB91B09764786-->  <AD_MODEL_OBJECT_ID><![CDATA[8A935F84A79B45F8457CB91B09764786]]></AD_MODEL_OBJECT_ID>
 <!--8A935F84A79B45F8457CB91B09764786-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Wed Jan 07 19:31:01 2015 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Thu Jan 08 12:30:31 2015 +0100
@@ -4700,6 +4700,16 @@
 <!--F171914D8B8A47D3A8492ABB85CE87D6-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
 <!--F171914D8B8A47D3A8492ABB85CE87D6--></AD_MODEL_OBJECT_MAPPING>
 
+<!--F3BC866564544AE9B161AB7F1B4967E5--><AD_MODEL_OBJECT_MAPPING>
+<!--F3BC866564544AE9B161AB7F1B4967E5-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[F3BC866564544AE9B161AB7F1B4967E5]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--F3BC866564544AE9B161AB7F1B4967E5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F3BC866564544AE9B161AB7F1B4967E5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F3BC866564544AE9B161AB7F1B4967E5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F3BC866564544AE9B161AB7F1B4967E5-->  <AD_MODEL_OBJECT_ID><![CDATA[89D878C0E07C471F98D0F6D02C9B7C5B]]></AD_MODEL_OBJECT_ID>
+<!--F3BC866564544AE9B161AB7F1B4967E5-->  <MAPPINGNAME><![CDATA[/ad_callouts/SL_CostingRule_FixBackdated.html]]></MAPPINGNAME>
+<!--F3BC866564544AE9B161AB7F1B4967E5-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--F3BC866564544AE9B161AB7F1B4967E5--></AD_MODEL_OBJECT_MAPPING>
+
 <!--F4C04EC868E9420CB92D63070279833D--><AD_MODEL_OBJECT_MAPPING>
 <!--F4C04EC868E9420CB92D63070279833D-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[F4C04EC868E9420CB92D63070279833D]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--F4C04EC868E9420CB92D63070279833D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_CostingRule_FixBackdated.java	Thu Jan 08 12:30:31 2015 +0100
@@ -0,0 +1,39 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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) 2013 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.erpCommon.ad_callouts;
+
+import javax.servlet.ServletException;
+
+import org.openbravo.base.secureApp.VariablesSecureApp;
+
+public class SL_CostingRule_FixBackdated extends SimpleCallout {
+
+  private static final long serialVersionUID = 1L;
+
+  @Override
+  protected void execute(CalloutInfo info) throws ServletException {
+
+    VariablesSecureApp vars = info.vars;
+    String strIsFixBackdated = vars.getStringParameter("inpbackdatedtrxsfixed");
+    boolean isFixBackdated = strIsFixBackdated.equals("Y");
+    if (!isFixBackdated) {
+      info.addResult("inpfixbackdatedfrom", "");
+    }
+  }
+}