Merge stable changesets from int to main
authorRM packaging bot <staff.rm@openbravo.com>
Fri, 22 Jan 2010 17:02:31 +0100
changeset 5961 8d669592f07b
parent 5942 fa6621f85351 (current diff)
parent 5960 a2126ad12f69 (diff)
child 5962 ba83bb4d9240
Merge stable changesets from int to main
src-db/database/sourcedata/AD_MESSAGE.xml
Binary file src-db/database/lib/dbsourcemanager.jar has changed
--- a/src-db/database/model/functions/C_INVOICE_POST.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/model/functions/C_INVOICE_POST.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -1596,7 +1596,7 @@
                   WHERE AD_Client_ID=v_Client_ID
                     AND isActive='Y'
                     AND isDefault='Y'
-                    AND AD_Org_ID=v_ad_org_id;
+                    AND AD_IsOrgIncluded(v_ad_org_id,AD_ORG_ID, AD_Client_ID)<>-1;
                   IF v_cashBook IS NULL THEN
                       RAISE_APPLICATION_ERROR(-20000, '@NoDefaultCashBook@');
                   END IF;
--- a/src-db/database/model/functions/C_ORDER_POST1.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -592,6 +592,11 @@
      /**************************************************************************
         * Calculate Discounts
         *************************************************************************/
+        -- Delete first previous discounts if any and then recalculate them
+        DELETE
+        FROM C_ORDERLINE
+        WHERE C_ORDER_DISCOUNT_ID IS NOT NULL
+        AND C_ORDER_ID=v_Record_ID;
         v_CumDiscount:=0;
         v_OldCumDiscount:=0;
         v_Line:=10;
--- a/src-db/database/model/functions/C_PERIOD_PROCESS.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/model/functions/C_PERIOD_PROCESS.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -42,7 +42,9 @@
   -- Parameter Variables
   p_Organization C_PeriodControl_Log.AD_Org_ID%TYPE;
   p_IsRecursive C_PeriodControl_Log.IsRecursive%TYPE;
+  p_Calendar C_PeriodControl_Log.C_Calendar_ID%TYPE;
   p_Year C_PeriodControl_Log.C_Year_ID%TYPE;
+  p_YearName C_Year.Year%TYPE;
   p_PeriodNO C_PeriodControl_Log.PeriodNO%TYPE;
   p_DocBaseType C_PeriodControl_Log.DocBaseType%TYPE;
   p_PeriodAction C_PeriodControl_Log.PeriodAction%TYPE;
@@ -62,10 +64,10 @@
     FROM AD_PInstance
     WHERE AD_PInstance_ID=p_PInstance_ID;
     
-    SELECT AD_Client_ID, AD_Org_ID, ISRecursive, C_Year_ID, PeriodNO, DocBaseType, PeriodAction, Processing
-    INTO v_AD_Client_ID, p_Organization, p_IsRecursive, p_Year, p_PeriodNO, p_DocBaseType, p_PeriodAction, p_Processing
-    FROM C_PeriodControl_Log
-    WHERE C_PeriodControl_Log_ID=v_Record_ID_Log;
+    SELECT L.AD_Client_ID, L.AD_Org_ID, L.C_Calendar_ID, L.ISRecursive, L.C_Year_ID, C_Year.Year, L.PeriodNO, L.DocBaseType, L.PeriodAction, L.Processing
+    INTO v_AD_Client_ID, p_Organization, p_Calendar, p_IsRecursive, p_Year, p_YearName, p_PeriodNO, p_DocBaseType, p_PeriodAction, p_Processing
+    FROM C_PeriodControl_Log L, C_Year
+    WHERE L.C_PeriodControl_Log_ID=v_Record_ID_Log AND C_Year.C_Year_Id = L.C_Year_Id;
       
     IF (p_Processing='N') THEN 
       
@@ -116,10 +118,10 @@
         
         -- Action: Close if not permanently closed
       ELSIF(p_PeriodAction='C') THEN
-        SELECT COUNT(DISTINCT C_YEAR.YEAR) INTO v_Count FROM C_PERIOD, C_PERIODCONTROL, C_YEAR WHERE 
-          C_PERIODCONTROL.C_PERIOD_ID=C_PERIOD.C_PERIOD_ID AND C_PERIOD.C_YEAR_ID=C_YEAR.C_YEAR_ID AND C_PERIODCONTROL.PERIODSTATUS='O' AND C_YEAR.YEAR<p_Year
-          AND C_PERIODCONTROL.AD_CLIENT_ID = v_AD_Client_ID;                  
-        IF (v_Count>=1) THEN           
+        SELECT COUNT(DISTINCT C_YEAR.YEAR) INTO v_Count FROM C_PERIOD, C_PERIODCONTROL, C_YEAR WHERE
+          C_PERIODCONTROL.C_PERIOD_ID=C_PERIOD.C_PERIOD_ID AND C_PERIOD.C_YEAR_ID=C_YEAR.C_YEAR_ID AND C_PERIODCONTROL.PERIODSTATUS IN ('N','O') AND C_YEAR.YEAR<p_YearName
+          AND C_PERIODCONTROL.AD_CLIENT_ID = v_AD_Client_ID AND C_YEAR.C_CALENDAR_ID = p_Calendar;
+        IF (v_Count>=1) THEN
           RAISE_APPLICATION_ERROR(-20000, '@YearNotClose@');
         END IF;
         IF (p_IsRecursive='Y') THEN
--- a/src-db/database/model/prescript-PostgreSql.sql	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/model/prescript-PostgreSql.sql	Fri Jan 22 17:02:31 2010 +0100
@@ -151,8 +151,11 @@
 RETURNS varchar AS '
 DECLARE
 BEGIN
-  EXECUTE ''CREATE OR REPLACE FUNCTION dateFormat() RETURNS VARCHAR AS '''' DECLARE BEGIN  RETURN '''''''''' || format || ''''''''''; EXCEPTION WHEN OTHERS THEN RETURN NULL; END; '''' LANGUAGE ''''plpgsql'''' IMMUTABLE; '';
-  RETURN ''dateFormat modified'';
+  IF (dateformat() <> format) THEN
+    EXECUTE ''CREATE OR REPLACE FUNCTION dateFormat() RETURNS VARCHAR AS '''' DECLARE BEGIN  RETURN '''''''''' || format || ''''''''''; EXCEPTION WHEN OTHERS THEN RETURN NULL; END; '''' LANGUAGE ''''plpgsql'''' IMMUTABLE; '';
+    RETURN ''dateFormat modified'';
+  END IF;
+  RETURN ''dateFormat not modified'';
 END;
 ' LANGUAGE 'plpgsql' VOLATILE
 /-- END
--- a/src-db/database/model/triggers/M_INOUT_CHK_RESTRICTIONS_TRG.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/model/triggers/M_INOUT_CHK_RESTRICTIONS_TRG.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -40,6 +40,7 @@
     OR(COALESCE(:old.AD_USER_ID, '0') <> COALESCE(:new.AD_USER_ID, '0'))
     OR(COALESCE(:old.C_ORDER_ID, '0') <> COALESCE(:new.C_ORDER_ID, '0'))
     OR(COALESCE(:old.DATEORDERED, v_DateNull) <> COALESCE(:new.DATEORDERED, v_DateNull))
+    OR(COALESCE(:old.MOVEMENTDATE, v_DateNull) <> COALESCE(:new.MOVEMENTDATE, v_DateNull))
     OR(COALESCE(:OLD.C_BPARTNER_LOCATION_ID, '0') <> COALESCE(:NEW.C_BPARTNER_LOCATION_ID, '0'))
     OR(COALESCE(:old.PICKDATE, v_DateNull) <> COALESCE(:new.PICKDATE, v_DateNull))
     OR(COALESCE(:old.SHIPDATE, v_DateNull) <> COALESCE(:new.SHIPDATE, v_DateNull))
@@ -58,7 +59,7 @@
     OR(COALESCE(:old.AD_CLIENT_ID, '0') <> COALESCE(:new.AD_CLIENT_ID, '0')))) THEN
       RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
     END IF;
-    IF(:old.Posted='Y' AND ((COALESCE(:old.DATEACCT, v_DateNull) <> COALESCE(:new.DATEACCT, v_DateNull)) OR(COALESCE(:old.C_CAMPAIGN_ID, '0') <> COALESCE(:new.C_CAMPAIGN_ID, '0')) OR(COALESCE(:old.C_PROJECT_ID, '0') <> COALESCE(:new.C_PROJECT_ID, '0')) OR(COALESCE(:old.C_ACTIVITY_ID, '0') <> COALESCE(:new.C_ACTIVITY_ID, '0')))) THEN
+    IF(:old.Posted='Y' AND ((COALESCE(:old.DATEACCT, v_DateNull) <> COALESCE(:new.DATEACCT, v_DateNull)) OR (COALESCE(:old.MOVEMENTDATE, v_DateNull) <> COALESCE(:new.MOVEMENTDATE, v_DateNull)) OR(COALESCE(:old.C_CAMPAIGN_ID, '0') <> COALESCE(:new.C_CAMPAIGN_ID, '0')) OR(COALESCE(:old.C_PROJECT_ID, '0') <> COALESCE(:new.C_PROJECT_ID, '0')) OR(COALESCE(:old.C_ACTIVITY_ID, '0') <> COALESCE(:new.C_ACTIVITY_ID, '0')))) THEN
       RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
     END IF;
   END IF;
--- a/src-db/database/sourcedata/AD_CALLOUT.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/sourcedata/AD_CALLOUT.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -776,6 +776,15 @@
 <!--52415CD3A31640B8906555725299FED7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--52415CD3A31640B8906555725299FED7--></AD_CALLOUT>
 
+<!--775917C69E0A45FFB22AEDD232C9D464--><AD_CALLOUT>
+<!--775917C69E0A45FFB22AEDD232C9D464-->  <AD_CALLOUT_ID><![CDATA[775917C69E0A45FFB22AEDD232C9D464]]></AD_CALLOUT_ID>
+<!--775917C69E0A45FFB22AEDD232C9D464-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--775917C69E0A45FFB22AEDD232C9D464-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--775917C69E0A45FFB22AEDD232C9D464-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--775917C69E0A45FFB22AEDD232C9D464-->  <NAME><![CDATA[SL_CreateLines_Conversion_UOM]]></NAME>
+<!--775917C69E0A45FFB22AEDD232C9D464-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--775917C69E0A45FFB22AEDD232C9D464--></AD_CALLOUT>
+
 <!--80DD3736B9EE42C5A0A793009F35C55A--><AD_CALLOUT>
 <!--80DD3736B9EE42C5A0A793009F35C55A-->  <AD_CALLOUT_ID><![CDATA[80DD3736B9EE42C5A0A793009F35C55A]]></AD_CALLOUT_ID>
 <!--80DD3736B9EE42C5A0A793009F35C55A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -53906,6 +53906,7 @@
 <!--3517-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--3517-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
 <!--3517-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--3517-->  <READONLYLOGIC><![CDATA[@Processed@='Y']]></READONLYLOGIC>
 <!--3517-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
 <!--3517-->  <SEQNO><![CDATA[250]]></SEQNO>
 <!--3517-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
@@ -59487,7 +59488,7 @@
 <!--3815-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
 <!--3815-->  <ISSELECTIONCOLUMN><![CDATA[Y]]></ISSELECTIONCOLUMN>
 <!--3815-->  <AD_ELEMENT_ID><![CDATA[459]]></AD_ELEMENT_ID>
-<!--3815-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--3815-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
 <!--3815-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--3815-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--3815-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -6485,7 +6485,7 @@
 <!--460-->  <AD_COLUMN_ID><![CDATA[1010]]></AD_COLUMN_ID>
 <!--460-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--460-->  <DISPLAYLENGTH><![CDATA[44]]></DISPLAYLENGTH>
-<!--460-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--460-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
 <!--460-->  <SEQNO><![CDATA[40]]></SEQNO>
 <!--460-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--460-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -31228,6 +31228,17 @@
 <!--9898E3D73D0644D3B0DE5757D5E7BCD7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--9898E3D73D0644D3B0DE5757D5E7BCD7--></AD_MESSAGE>
 
+<!--9CD7364917F6403B8354C9D75EE4C53E--><AD_MESSAGE>
+<!--9CD7364917F6403B8354C9D75EE4C53E-->  <AD_MESSAGE_ID><![CDATA[9CD7364917F6403B8354C9D75EE4C53E]]></AD_MESSAGE_ID>
+<!--9CD7364917F6403B8354C9D75EE4C53E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9CD7364917F6403B8354C9D75EE4C53E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9CD7364917F6403B8354C9D75EE4C53E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9CD7364917F6403B8354C9D75EE4C53E-->  <VALUE><![CDATA[InvalidCost]]></VALUE>
+<!--9CD7364917F6403B8354C9D75EE4C53E-->  <MSGTEXT><![CDATA[Lines with no cost associated.]]></MSGTEXT>
+<!--9CD7364917F6403B8354C9D75EE4C53E-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--9CD7364917F6403B8354C9D75EE4C53E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9CD7364917F6403B8354C9D75EE4C53E--></AD_MESSAGE>
+
 <!--9D295DA584704A8C85459E14061EC2F0--><AD_MESSAGE>
 <!--9D295DA584704A8C85459E14061EC2F0-->  <AD_MESSAGE_ID><![CDATA[9D295DA584704A8C85459E14061EC2F0]]></AD_MESSAGE_ID>
 <!--9D295DA584704A8C85459E14061EC2F0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -17760,6 +17760,18 @@
 <!--CD9AA6AF3DB348F2885A99F2977CA733-->  <SEQNO><![CDATA[50]]></SEQNO>
 <!--CD9AA6AF3DB348F2885A99F2977CA733--></AD_MODEL_OBJECT>
 
+<!--CE710B1C239D491F8A7D98407283FACE--><AD_MODEL_OBJECT>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <AD_MODEL_OBJECT_ID><![CDATA[CE710B1C239D491F8A7D98407283FACE]]></AD_MODEL_OBJECT_ID>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <ACTION><![CDATA[C]]></ACTION>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.SL_CreateLines_Conversion_UOM]]></CLASSNAME>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <AD_CALLOUT_ID><![CDATA[775917C69E0A45FFB22AEDD232C9D464]]></AD_CALLOUT_ID>
+<!--CE710B1C239D491F8A7D98407283FACE-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--CE710B1C239D491F8A7D98407283FACE--></AD_MODEL_OBJECT>
+
 <!--DAD83563DBAD4904BF434BE7ED0260E6--><AD_MODEL_OBJECT>
 <!--DAD83563DBAD4904BF434BE7ED0260E6-->  <AD_MODEL_OBJECT_ID><![CDATA[DAD83563DBAD4904BF434BE7ED0260E6]]></AD_MODEL_OBJECT_ID>
 <!--DAD83563DBAD4904BF434BE7ED0260E6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -26650,6 +26650,16 @@
 <!--7AEA3C790894370FE040007F01013A5F-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
 <!--7AEA3C790894370FE040007F01013A5F--></AD_MODEL_OBJECT_MAPPING>
 
+<!--7B038CB6877A43349A3C759E9C8970BF--><AD_MODEL_OBJECT_MAPPING>
+<!--7B038CB6877A43349A3C759E9C8970BF-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[7B038CB6877A43349A3C759E9C8970BF]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--7B038CB6877A43349A3C759E9C8970BF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7B038CB6877A43349A3C759E9C8970BF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7B038CB6877A43349A3C759E9C8970BF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7B038CB6877A43349A3C759E9C8970BF-->  <AD_MODEL_OBJECT_ID><![CDATA[CE710B1C239D491F8A7D98407283FACE]]></AD_MODEL_OBJECT_ID>
+<!--7B038CB6877A43349A3C759E9C8970BF-->  <MAPPINGNAME><![CDATA[/ad_callouts/SL_CreateLines_Conversion_UOM.html]]></MAPPINGNAME>
+<!--7B038CB6877A43349A3C759E9C8970BF-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--7B038CB6877A43349A3C759E9C8970BF--></AD_MODEL_OBJECT_MAPPING>
+
 <!--81311EAEE5834B99B7DDD85CCA4EB6C9--><AD_MODEL_OBJECT_MAPPING>
 <!--81311EAEE5834B99B7DDD85CCA4EB6C9-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[81311EAEE5834B99B7DDD85CCA4EB6C9]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--81311EAEE5834B99B7DDD85CCA4EB6C9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -8579,6 +8579,17 @@
 <!--4C6B4B638FC74B72AD5646519F92AB57-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4C6B4B638FC74B72AD5646519F92AB57--></AD_REF_LIST>
 
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC--><AD_REF_LIST>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC-->  <AD_REF_LIST_ID><![CDATA[4E785CCAD3344BF5A0DCE242F5D7A1BC]]></AD_REF_LIST_ID>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC-->  <VALUE><![CDATA[C]]></VALUE>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC-->  <NAME><![CDATA[Error: No cost]]></NAME>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC-->  <AD_REFERENCE_ID><![CDATA[234]]></AD_REFERENCE_ID>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--4E785CCAD3344BF5A0DCE242F5D7A1BC--></AD_REF_LIST>
+
 <!--55F94DB55BD848B99ED7488B45098A48--><AD_REF_LIST>
 <!--55F94DB55BD848B99ED7488B45098A48-->  <AD_REF_LIST_ID><![CDATA[55F94DB55BD848B99ED7488B45098A48]]></AD_REF_LIST_ID>
 <!--55F94DB55BD848B99ED7488B45098A48-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Wed Jan 20 23:22:29 2010 +0100
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Fri Jan 22 17:02:31 2010 +0100
@@ -6560,17 +6560,6 @@
 <!--806676-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--806676--></AD_TEXTINTERFACES>
 
-<!--806677--><AD_TEXTINTERFACES>
-<!--806677-->  <AD_TEXTINTERFACES_ID><![CDATA[806677]]></AD_TEXTINTERFACES_ID>
-<!--806677-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--806677-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--806677-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--806677-->  <TEXT><![CDATA[Account No ]]></TEXT>
-<!--806677-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast.html]]></FILENAME>
-<!--806677-->  <ISUSED><![CDATA[Y]]></ISUSED>
-<!--806677-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--806677--></AD_TEXTINTERFACES>
-
 <!--806679--><AD_TEXTINTERFACES>
 <!--806679-->  <AD_TEXTINTERFACES_ID><![CDATA[806679]]></AD_TEXTINTERFACES_ID>
 <!--806679-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/erpCommon/ad_actionButton/Posted.java	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/Posted.java	Fri Jan 22 17:02:31 2010 +0100
@@ -150,17 +150,14 @@
       } else if (!acct.post(strKey, false, vars, this, con) || acct.errors != 0) {
         releaseRollbackConnection(con);
         String strStatus = acct.getStatus();
-        // return (Utility.messageBD(this, "ProcessRunError",
-        // vars.getLanguage()) + "\\n" + acct.getInfo(vars));
-        myMessage = Utility.translateError(this, vars, vars.getLanguage(),
-            strStatus.equals("L") ? "@OtherPostingProcessActive@" : "@ProcessRunError@");
-        if (strStatus.equals("L"))
+        myMessage = Utility.translateError(this, vars, vars.getLanguage(), strStatus
+            .equals(AcctServer.STATUS_DocumentLocked) ? "@OtherPostingProcessActive@" : strStatus
+            .equals(AcctServer.STATUS_InvalidCost) ? "@InvalidCost@" : "@ProcessRunError@");
+        if (strStatus.equals(AcctServer.STATUS_DocumentLocked))
           myMessage.setType("Warning");
         myMessage.setMessage(myMessage.getMessage());
         return myMessage;
       }
-      // Create Automatic Matching
-      // acct.match (vars, this,con);
       releaseCommitConnection(con);
     } catch (Exception e) {
       log4j.error(e);
@@ -257,11 +254,6 @@
         xmlDocument.setParameter("messageMessage", myMessage.getMessage());
       }
     }
-    /*
-     * String message = vars.getSessionValue("Posted|message"); if (!message.equals("")) message =
-     * "alert('" + message + "');"; vars.removeSessionValue("Posted|message");
-     * xmlDocument.setParameter("message", message);
-     */
     xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
     xmlDocument.setParameter("question", Utility.messageBD(this, "StartProcess?", vars
         .getLanguage()));
--- a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java	Fri Jan 22 17:02:31 2010 +0100
@@ -127,6 +127,10 @@
   public static final String STATUS_Posted = "Y";
   /** Document Status */
   public static final String STATUS_Error = "E";
+  /** Document Status */
+  public static final String STATUS_InvalidCost = "C";
+  /** Document Status */
+  public static final String STATUS_DocumentLocked = "L";
 
   /** AR Invoices */
   public static final String DOCTYPE_ARInvoice = "ARI";
@@ -296,7 +300,7 @@
           con = connectionProvider.getTransactionConnection();
         }
       }
-      if (log4j.isDebugEnabled())
+      if (log4j.isDebugEnabled() && data != null)
         log4j.debug("AcctServer - Run -" + data.length + " IDs [" + strIDs + "]");
       // Create Automatic Matching
       // match (vars, this,con);
@@ -529,7 +533,7 @@
       if (AcctServerData.update(conn, tableName, strClave) != 1) {
         log4j.warn("AcctServer - Post -Cannot lock Document - ignored: " + tableName + "_ID="
             + strClave);
-        Status = "L"; // Status locked document
+        setStatus(STATUS_DocumentLocked); // Status locked document
         return false;
       } else
         AcctServerData.delete(connectionProvider, AD_Table_ID, Record_ID);
@@ -546,7 +550,7 @@
         success++;
       } else {
         errors++;
-        Status = AcctServer.STATUS_Error;
+        // Status = AcctServer.STATUS_Error;
         save(conn);
       }
     } catch (ServletException e) {
@@ -656,7 +660,7 @@
       if (!save(conn)) { // contains unlock
         // conn.releaseRollbackConnection(con);
         unlock(conn);
-        Status = AcctServer.STATUS_Error;
+        // Status = AcctServer.STATUS_Error;
       }
       // conn.releaseCommitConnection(con);
       // *** Transaction End ***
@@ -716,8 +720,8 @@
     if (log4j.isDebugEnabled())
       log4j.debug("loadDocument " + data.length);
 
-    Status = STATUS_Error;
-    String Name = "";
+    setStatus(STATUS_Error);
+    Name = "";
     AD_Client_ID = data[0].getField("AD_Client_ID");
     AD_Org_ID = data[0].getField("AD_Org_ID");
     C_BPartner_ID = data[0].getField("C_BPartner_ID");
@@ -921,6 +925,8 @@
     }
     if (m_fact[index] == null)
       return STATUS_Error;
+    if (Status.equals(STATUS_InvalidCost))
+      return Status;
     Status = STATUS_PostPrepared;
 
     // if (log4j.isDebugEnabled())
@@ -952,7 +958,7 @@
           AcctProcessTemplate newTemplate = (AcctProcessTemplate) Class.forName(strClassname)
               .newInstance();
           if (!newTemplate.execute(this, as, conn, con, vars)) {
-            Status = AcctServer.STATUS_Error;
+            setStatus(AcctServer.STATUS_Error);
             break;
           }
         } catch (Exception e) {
@@ -1292,7 +1298,6 @@
    */
   public final Account getAccount(String AcctType, AcctSchema as, ConnectionProvider conn) {
     BigDecimal AMT = null;
-    BigDecimal ZERO = new BigDecimal("0");
     AcctServerData[] data = null;
     // if (log4j.isDebugEnabled())
     // log4j.debug("*******************************getAccount 1: AcctType:-->"
@@ -1307,7 +1312,7 @@
         AMT = new BigDecimal(getAmount(AMTTYPE_Charge));
         // if (log4j.isDebugEnabled())
         // log4j.debug("AcctServer - *******************AMT;-->" + AMT);
-        int cmp = AMT.compareTo(ZERO);
+        int cmp = AMT.compareTo(BigDecimal.ZERO);
         // if (log4j.isDebugEnabled())
         // log4j.debug("AcctServer - ******************* CMP: " + cmp);
         if (cmp == 0)
@@ -1500,7 +1505,11 @@
 
   public String getStatus() {
     return Status;
-  } // end of getServletInfo() method
+  }
+
+  public void setStatus(String strStatus) {
+    Status = strStatus;
+  }
 
   public ConnectionProvider getConnectionProvider() {
     return connectionProvider;
--- a/src/org/openbravo/erpCommon/ad_forms/DocInOut.java	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocInOut.java	Fri Jan 22 17:02:31 2010 +0100
@@ -45,9 +45,9 @@
     super(AD_Client_ID, AD_Org_ID, connectionProvider);
   }
 
-  public void loadObjectFieldProvider(ConnectionProvider conn, String AD_Client_ID, String Id)
+  public void loadObjectFieldProvider(ConnectionProvider conn, String stradClientId, String Id)
       throws ServletException {
-    setObjectFieldProvider(DocInOutData.selectRegistro(conn, AD_Client_ID, Id));
+    setObjectFieldProvider(DocInOutData.selectRegistro(conn, stradClientId, Id));
   }
 
   /**
@@ -163,6 +163,12 @@
         log4jDocInOut.debug("(MatShipment) - DR account: "
             + line.getAccount(ProductInfo.ACCTTYPE_P_Cogs, as, conn));
         log4jDocInOut.debug("(MatShipment) - DR costs: " + costs);
+        BigDecimal b_Costs = new BigDecimal(costs);
+        if (b_Costs.compareTo(BigDecimal.ZERO) == 0) {
+          setStatus(STATUS_InvalidCost);
+          continue;
+        } else
+          setStatus(STATUS_Error);// Default status. LoadDocument
         // CoGS DR
         dr = fact.createLine(line, line.getAccount(ProductInfo.ACCTTYPE_P_Cogs, as, conn), as
             .getC_Currency_ID(), costs, "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType,
@@ -191,6 +197,12 @@
       for (int i = 0; p_lines != null && i < p_lines.length; i++) {
         DocLine_Material line = (DocLine_Material) p_lines[i];
         String costs = line.getProductCosts(DateAcct, as, conn, con);
+        BigDecimal b_Costs = new BigDecimal(costs);
+        if (b_Costs.compareTo(BigDecimal.ZERO) == 0) {
+          setStatus(STATUS_InvalidCost);
+          continue;
+        } else
+          setStatus(STATUS_Error);// Default status. LoadDocument
 
         // If there exists cost for the product, but it is equals to zero, then no line is added,
         // but no error is thrown. If this is the only line in the document, yes an error will be
--- a/src/org/openbravo/erpCommon/ad_forms/DocInventory.java	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocInventory.java	Fri Jan 22 17:02:31 2010 +0100
@@ -44,9 +44,9 @@
     super(AD_Client_ID, AD_Org_ID, connectionProvider);
   }
 
-  public void loadObjectFieldProvider(ConnectionProvider conn, String AD_Client_ID, String Id)
+  public void loadObjectFieldProvider(ConnectionProvider conn, String stradClientId, String Id)
       throws ServletException {
-    setObjectFieldProvider(DocInventoryData.select(conn, AD_Client_ID, Id));
+    setObjectFieldProvider(DocInventoryData.select(conn, stradClientId, Id));
   }
 
   /**
@@ -160,6 +160,12 @@
       DocLine_Material line = (DocLine_Material) p_lines[i];
       String costs = line.getProductCosts(DateAcct, as, conn, con);
       log4jDocInventory.debug("CreateFact - before DR - Costs: " + costs);
+      BigDecimal b_Costs = new BigDecimal(costs);
+      if (b_Costs.compareTo(BigDecimal.ZERO) == 0) {
+        setStatus(STATUS_InvalidCost);
+        continue;
+      } else
+        setStatus(STATUS_Error);// Default status. LoadDocument
       // Inventory DR CR
       dr = fact.createLine(line, line.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn), as
           .getC_Currency_ID(), costs, Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
@@ -169,7 +175,6 @@
       dr.setM_Locator_ID(line.m_M_Locator_ID);
       log4jDocInventory.debug("CreateFact - before CR");
       // InventoryDiff DR CR
-      BigDecimal b_Costs = new BigDecimal(costs);
       // or Charge
       Account invDiff = line.getChargeAccount(as, b_Costs.negate(), conn);
       log4jDocInventory.debug("CreateFact - after getChargeAccount");
--- a/src/org/openbravo/erpCommon/ad_forms/DocMovement.java	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocMovement.java	Fri Jan 22 17:02:31 2010 +0100
@@ -44,9 +44,9 @@
     super(AD_Client_ID, AD_Org_ID, connectionProvider);
   }
 
-  public void loadObjectFieldProvider(ConnectionProvider conn, String AD_Client_ID, String Id)
+  public void loadObjectFieldProvider(ConnectionProvider conn, String stradClientId, String Id)
       throws ServletException {
-    setObjectFieldProvider(DocMovementData.select(conn, AD_Client_ID, Id));
+    setObjectFieldProvider(DocMovementData.select(conn, stradClientId, Id));
   }
 
   /**
@@ -149,6 +149,11 @@
       log4jDocMovement.debug("DocMovement - Before calculating the costs for line i = " + i);
       String costs = line.getProductCosts(DateAcct, as, conn, con);
       BigDecimal b_Costs = new BigDecimal(costs);
+      if (b_Costs.compareTo(BigDecimal.ZERO) == 0) {
+        setStatus(STATUS_InvalidCost);
+        continue;
+      } else
+        setStatus(STATUS_Error);// Default status. LoadDocument
       // Inventory DR CR
       dr = fact.createLine(line, line.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn), as
           .getC_Currency_ID(), (b_Costs.negate()).toString(), Fact_Acct_Group_ID, nextSeqNo(SeqNo),
--- a/src/org/openbravo/erpCommon/ad_forms/DocProduction.java	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocProduction.java	Fri Jan 22 17:02:31 2010 +0100
@@ -32,7 +32,7 @@
 
 public class DocProduction extends AcctServer {
   private static final long serialVersionUID = 1L;
-  static Logger log4j = Logger.getLogger(DocProduction.class);
+  static Logger log4jDocProduction = Logger.getLogger(DocProduction.class);
 
   private String SeqNo = "0";
 
@@ -46,9 +46,9 @@
     super(AD_Client_ID, AD_Org_ID, conn);
   }
 
-  public void loadObjectFieldProvider(ConnectionProvider conn, String AD_Client_ID, String Id)
+  public void loadObjectFieldProvider(ConnectionProvider conn, String stradClientId, String Id)
       throws ServletException {
-    setObjectFieldProvider(DocProductionData.selectRegistro(conn, AD_Client_ID, Id));
+    setObjectFieldProvider(DocProductionData.selectRegistro(conn, stradClientId, Id));
   }
 
   /**
@@ -64,7 +64,7 @@
     loadDocumentType(); // lines require doc type
     // Contained Objects
     p_lines = loadLines(conn);
-    log4j.debug("Record_ID = " + Record_ID + " - Lines=" + p_lines.length);
+    log4jDocProduction.debug("Record_ID = " + Record_ID + " - Lines=" + p_lines.length);
     return false;
   } // loadDocumentDetails
 
@@ -79,9 +79,9 @@
 
     try {
       data = DocLineProductionData.select(conn, Record_ID);
-      log4j.debug("LoadLines: data.len" + data.length + " record_ID " + Record_ID);
+      log4jDocProduction.debug("LoadLines: data.len" + data.length + " record_ID " + Record_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      log4jDocProduction.warn(e);
     }
 
     //
@@ -135,22 +135,28 @@
             .newInstance();
         return newTemplate.createFact(this, as, conn, con, vars);
       } catch (Exception e) {
-        log4j.error("Error while creating new instance for DocProductionTemplate - " + e);
+        log4jDocProduction.error("Error while creating new instance for DocProductionTemplate - "
+            + e);
       }
     }
-    log4j.debug("createFact - Inicio");
+    log4jDocProduction.debug("createFact - Inicio");
     // create Fact Header
     Fact fact = null;
     String Fact_Acct_Group_ID = SequenceIdData.getUUID();
-    log4j.debug("createFact - object created");
+    log4jDocProduction.debug("createFact - object created");
     // Lines
     fact = new Fact(this, as, Fact.POST_Actual);
     for (int i = 0; p_lines != null && i < p_lines.length; i++) {
       DocLine_Material line = (DocLine_Material) p_lines[i];
       String costs = line.getProductCosts(DateAcct, as, conn, con);
       BigDecimal dCosts = new BigDecimal(costs);
-      costs = dCosts.toString();
-      log4j.debug("DocProduction - createFact - line.m_Productiontype - " + line.m_Productiontype);
+      if (dCosts.compareTo(BigDecimal.ZERO) == 0) {
+        setStatus(STATUS_InvalidCost);
+        continue;
+      } else
+        setStatus(STATUS_Error);// Default status. LoadDocument
+      log4jDocProduction.debug("DocProduction - createFact - line.m_Productiontype - "
+          + line.m_Productiontype);
       if (line.m_Productiontype.equals("+")) {
         fact.createLine(line, line.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn), as
             .getC_Currency_ID(), costs, "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType,
@@ -175,7 +181,7 @@
    * @return the log4j
    */
   public static Logger getLog4j() {
-    return log4j;
+    return log4jDocProduction;
   }
 
   /**
@@ -183,7 +189,7 @@
    *          the log4j to set
    */
   public static void setLog4j(Logger log4j) {
-    DocProduction.log4j = log4j;
+    DocProduction.log4jDocProduction = log4j;
   }
 
   /**
@@ -209,26 +215,26 @@
   }
 
   public String nextSeqNo(String oldSeqNo) {
-    log4j.debug("DocAmortization - oldSeqNo = " + oldSeqNo);
+    log4jDocProduction.debug("DocAmortization - oldSeqNo = " + oldSeqNo);
     BigDecimal seqNo = new BigDecimal(oldSeqNo);
     SeqNo = (seqNo.add(new BigDecimal("10"))).toString();
-    log4j.debug("DocAmortization - nextSeqNo = " + SeqNo);
+    log4jDocProduction.debug("DocAmortization - nextSeqNo = " + SeqNo);
     return SeqNo;
   }
 
   /**
    * Get the account for Accounting Schema
    * 
-   * @param M_Warehouse_ID
+   * @param strmWarehouseId
    *          warehouse
    * @param as
    *          accounting schema
    * @return Account
    */
-  public final Account getAccountWarehouse(String M_Warehouse_ID, AcctSchema as,
+  public final Account getAccountWarehouse(String strmWarehouseId, AcctSchema as,
       ConnectionProvider conn) throws ServletException {
     AcctServerData[] data = null;
-    data = AcctServerData.selectWDifferencesAcct(conn, M_Warehouse_ID, as.getC_AcctSchema_ID());
+    data = AcctServerData.selectWDifferencesAcct(conn, strmWarehouseId, as.getC_AcctSchema_ID());
     // Get Acct
     String Account_ID = "";
     if (data != null && data.length != 0) {
@@ -246,7 +252,7 @@
     try {
       acct = Account.getAccount(conn, Account_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      log4jDocProduction.warn(e);
     }
     return acct;
   }
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Fri Jan 22 17:02:31 2010 +0100
@@ -504,7 +504,7 @@
         error.setType("Error");
         error.setTitle(Utility.messageBD(myPool, "Error", vars.getLanguage()));
         error.setMessage(Utility.messageBD(myPool, "BuildError", vars.getLanguage())
-            + "<a href=\"http://wiki.openbravo.com/wiki/UpgradeTips\" target=\"_blank\">"
+            + "<a href=\"http://wiki.openbravo.com/wiki/ERP/2.50/Update_Tips\" target=\"_blank\">"
             + Utility.messageBD(myPool, "ThisLink", vars.getLanguage()) + "</a>.");
 
       } else {
@@ -514,10 +514,11 @@
         if (rs2.next()) {
           error.setType("Warning");
           error.setTitle(Utility.messageBD(myPool, "Warning", vars.getLanguage()));
-          error.setMessage(Utility.messageBD(myPool, "BuildWarning", vars.getLanguage())
-              + "<a href=\"http://wiki.openbravo.com/wiki/UpgradeTips\" target=\"_blank\">"
-              + Utility.messageBD(myPool, "ThisLink", vars.getLanguage()) + "</a>."
-              + Utility.messageBD(myPool, "BuildWarning2", vars.getLanguage()));
+          error
+              .setMessage(Utility.messageBD(myPool, "BuildWarning", vars.getLanguage())
+                  + "<a href=\"http://wiki.openbravo.com/wiki/ERP/2.50/Update_Tips\" target=\"_blank\">"
+                  + Utility.messageBD(myPool, "ThisLink", vars.getLanguage()) + "</a>."
+                  + Utility.messageBD(myPool, "BuildWarning2", vars.getLanguage()));
 
         } else {
           error.setType("Success");
--- a/src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast.html	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast.html	Fri Jan 22 17:02:31 2010 +0100
@@ -13,7 +13,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) 2001-2009 Openbravo SL
+ * All portions are Copyright (C) 2001-2010 Openbravo SL
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -396,7 +396,7 @@
 <div id="sectionAccount"><!-- ROTURA POR Nº DE CUENTAS. SI NO ELIGEN UNA EN CONCRETO PUES VERAS EL DETALLE DE CADA UNA DE ELLAS/-->
    <table cellspacing="0" cellpadding="0" width="100%" class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto;border-bottom: 0px none;">
       <tr> 
-          <th class="DataGrid_Header_Cell"  width="50%">Account No&nbsp;<span id="fieldAccount">xx1111111111111111</span></th> 
+          <th class="DataGrid_Header_Cell"  width="50%">Account No<span>&nbsp;</span><span id="fieldAccount">xx1111111111111111</span></th> 
           <th class="DataGrid_Header_Cell"  width="25%">Bank Balance (<span id="fieldSysdate">xx12/12/2006</span>) <span id="fieldAmountInitial" >xx12345</span></th> 
           <th class="DataGrid_Header_Cell"  width="25%" >Final<span>&nbsp;</span><span id="fieldAmountfinal" >xx4567</span></th>
         </tr>
--- a/src/org/openbravo/erpCommon/info/Locator.java	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/info/Locator.java	Fri Jan 22 17:02:31 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) 2001-2009 Openbravo SL 
+ * All portions are Copyright (C) 2001-2010 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -59,6 +59,12 @@
     if (vars.commandIn("DEFAULT")) {
       removePageSessionVariables(vars);
       String strWarehouse = vars.getRequestGlobalVariable("inpNameValue", "Locator.warehousename");
+      if (strWarehouse.equals("") || strWarehouse == null) {
+        String windowId = vars.getRequestGlobalVariable("WindowID", "Locator.windowId");
+        if (!windowId.equals("") && windowId != null)
+          strWarehouse = LocatorData.selectname(this, Utility.getContext(this, vars,
+              "M_Warehouse_ID", windowId));
+      }
       strWarehouse = strWarehouse + "%";
       vars.setSessionValue("Locator.warehousename", strWarehouse);
       printPage(response, vars, "", strWarehouse);
@@ -67,6 +73,12 @@
       String strKeyValue = vars.getRequestGlobalVariable("inpNameValue", "Locator.name");
       String strWarehouse = vars
           .getRequestGlobalVariable("inpmWarehouseId", "Locator.mWarehouseId");
+      if ((strKeyValue.equals("") || strKeyValue == null)
+          && (strWarehouse.equals("") || strWarehouse == null)) {
+        String windowId = vars.getRequestGlobalVariable("WindowID", "Locator.windowId");
+        if (!windowId.equals("") && windowId != null)
+          strWarehouse = Utility.getContext(this, vars, "M_Warehouse_ID", windowId);
+      }
       strKeyValue = strKeyValue + "%";
       vars.setSessionValue("Locator.name", strKeyValue);
       vars.setSessionValue("Locator.warehousename", LocatorData.selectname(this, strWarehouse));
@@ -77,7 +89,7 @@
       if (data != null && data.length == 1) {
         printPageKey(response, vars, data);
       } else
-        printPage(response, vars, strKeyValue, strWarehouse);
+        printPage(response, vars, strKeyValue, LocatorData.selectname(this, strWarehouse));
     } else if (vars.commandIn("STRUCTURE")) {
       printGridStructure(response, vars);
     } else if (vars.commandIn("DATA")) {
@@ -238,8 +250,8 @@
         String strOrderBy = SelectorUtility.buildOrderByClause(strOrderCols, strOrderDirs);
         page = TableSQLData.calcAndGetBackendPage(vars, "Locator.currentPage");
         if (vars.getStringParameter("movePage", "").length() > 0) {
-        // on movePage action force executing countRows again
-        	strNewFilter = "";
+          // on movePage action force executing countRows again
+          strNewFilter = "";
         }
         int oldOffset = offset;
         offset = (page * TableSQLData.maxRowsPerGridPage) + offset;
@@ -249,18 +261,18 @@
           // or
           // first
           // load
-        	String rownum = "0", oraLimit1 = null, oraLimit2 = null, pgLimit = null;
-        	if (this.myPool.getRDBMS().equalsIgnoreCase("ORACLE")) {
-	        	oraLimit1 = String.valueOf(offset + TableSQLData.maxRowsPerGridPage);
-	        	oraLimit2 = (offset + 1) + " AND " + oraLimit1;
-	        	rownum = "ROWNUM";
-        	} else {
-        		pgLimit = TableSQLData.maxRowsPerGridPage + " OFFSET " + offset;
-        	}
-        	strNumRows = LocatorData.countRows(this, rownum,Utility.getContext(this, vars,
+          String rownum = "0", oraLimit1 = null, oraLimit2 = null, pgLimit = null;
+          if (this.myPool.getRDBMS().equalsIgnoreCase("ORACLE")) {
+            oraLimit1 = String.valueOf(offset + TableSQLData.maxRowsPerGridPage);
+            oraLimit2 = (offset + 1) + " AND " + oraLimit1;
+            rownum = "ROWNUM";
+          } else {
+            pgLimit = TableSQLData.maxRowsPerGridPage + " OFFSET " + offset;
+          }
+          strNumRows = LocatorData.countRows(this, rownum, Utility.getContext(this, vars,
               "#User_Client", "Locator"), Utility.getSelectorOrgs(this, vars, strOrg), strName,
               strWarehousename, strAisle, strBin, strLevel, pgLimit, oraLimit1, oraLimit2);
-          //strNumRows = String.valueOf(data.length);
+          // strNumRows = String.valueOf(data.length);
           vars.setSessionValue("Locator.numrows", strNumRows);
         } else {
           strNumRows = vars.getSessionValue("Locator.numrows");
@@ -319,7 +331,8 @@
     strRowsData.append("    <title>").append(title).append("</title>\n");
     strRowsData.append("    <description>").append(description).append("</description>\n");
     strRowsData.append("  </status>\n");
-    strRowsData.append("  <rows numRows=\"").append(strNumRows).append("\" backendPage=\"" + page + "\">\n");
+    strRowsData.append("  <rows numRows=\"").append(strNumRows).append(
+        "\" backendPage=\"" + page + "\">\n");
     if (data != null && data.length > 0) {
       for (int j = 0; j < data.length; j++) {
         strRowsData.append("    <tr>\n");
--- a/src/org/openbravo/erpCommon/security/Login_F1.html	Wed Jan 20 23:22:29 2010 +0100
+++ b/src/org/openbravo/erpCommon/security/Login_F1.html	Fri Jan 22 17:02:31 2010 +0100
@@ -78,7 +78,7 @@
       clearForm();
     } catch (e) {}
     setWindowElementFocus('firstElement');
-    if ((!revisionControl('5929')) || (isOpsInstance() != isOpsInstanceCached())) {
+    if ((!revisionControl('5956')) || (isOpsInstance() != isOpsInstanceCached())) {
       alert("Your browser's cache has outdated files. Please clean it and reload the page.");
     }
   }
--- a/web/js/utils.js	Wed Jan 20 23:22:29 2010 +0100
+++ b/web/js/utils.js	Fri Jan 22 17:02:31 2010 +0100
@@ -70,7 +70,7 @@
 * Return a number that would be checked at the Login screen to know if the file is cached with the correct version
 */
 function getCurrentRevision() {
-  var number = '5929';
+  var number = '5956';
   return number;
 }
 
--- a/web/skins/Default/Openbravo_ERP_250.css	Wed Jan 20 23:22:29 2010 +0100
+++ b/web/skins/Default/Openbravo_ERP_250.css	Fri Jan 22 17:02:31 2010 +0100
@@ -4424,8 +4424,8 @@
   font-family: tahoma, arial, helvetica, sans-serif;
   font-size: 8pt;
   background-color: #FFFFFF;
+  padding: 1px;
   padding-left: 4px;
-  padding-top: 1px;
   height: 17px;
 }
 
@@ -4435,8 +4435,8 @@
   font-size: 8pt;
   color: #303030;
   background-color: #FFFFFF;
+  padding: 1px;
   padding-left: 4px;
-  padding-top: 1px;
   height: 17px;
 }
 
@@ -4446,8 +4446,8 @@
   font-size: 8pt;
   background-color: #FFFFFF;
   color: Red;
+  padding: 1px;
   padding-left: 4px;
-  padding-top: 1px;
   height: 17px;
 }
 
@@ -4456,8 +4456,8 @@
   font-family: tahoma, arial, helvetica, sans-serif;
   font-size: 8pt;
   background-color: #FFFFFF;
+  padding: 1px;
   padding-left: 4px;
-  padding-top: 1px;
   height: 17px;
 }
 
@@ -4469,8 +4469,8 @@
   background-position: top left !important;
   background-image: url(Common/TextBox/textField.background.focused.png);
   background-color: #D9F0FB !important;
+  padding: 0px;
   padding-left: 3px;
-  padding-top: 0px;
   height: 17px;
 }
 
@@ -4482,8 +4482,8 @@
   background-position: top left !important;
   background-image: url(Common/TextBox/textField.background.focused.png);
   background-color: #D9F0FB !important;
+  padding: 0px;
   padding-left: 3px;
-  padding-top: 0px;
   height: 17px;
 }
 
@@ -4495,8 +4495,8 @@
   background-position: top left !important;
   background-image: url(Common/TextBox/textField.background.focused.png);
   background-color: #D9F0FB !important;
+  padding: 0px;
   padding-left: 3px;
-  padding-top: 0px;
   height: 17px;
 }
 
@@ -4508,8 +4508,8 @@
   background-position: top left !important;
   background-image: url(Common/TextBox/textField.background.focused.png);
   background-color: #D9F0FB !important;
+  padding: 0px;
   padding-left: 3px;
-  padding-top: 0px;
   height: 17px;
 }