Fixes issue 22669: Value too long in m_generate_average_costs.
authorIoritz Cia <ioritz.cia@openbravo.com>
Thu, 24 Jan 2013 13:16:12 +0100
changeset 9909 56a1306e07a0
parent 9908 ee6b62b166d7
child 9910 6767429386d8
Fixes issue 22669: Value too long in m_generate_average_costs.
src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml
--- a/src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml	Wed Jan 02 10:14:19 2013 +0100
+++ b/src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml	Thu Jan 24 13:16:12 2013 +0100
@@ -164,7 +164,11 @@
         ELSE
           v_CheckResultStr := v_CheckResultStr || ', ';
         END IF;
-        v_CheckResultStr := v_CheckResultStr || Cur_Docs.DOCUMENTNO;
+        IF (COALESCE(LENGTH(v_CheckResultStr),0) > 1900) THEN
+          v_CheckResultStr:=SUBSTR(v_CheckResultStr,1,1900) || '(...)';
+        ELSE
+          v_CheckResultStr := v_CheckResultStr || Cur_Docs.DOCUMENTNO;
+        END IF;
       END LOOP;
       v_CheckResultStr:=v_CheckResultStr || '.';
     END IF;
@@ -189,7 +193,11 @@
         ELSE
           v_CheckResultStr := v_CheckResultStr || ', ';
         END IF;
-        v_CheckResultStr := v_CheckResultStr || Cur_Docs.INVENTORY || '(@Warehouse@ ' || Cur_Docs.WAREHOUSE || ')';
+        IF (COALESCE(LENGTH(v_CheckResultStr),0) > 1900) THEN
+          v_CheckResultStr:=SUBSTR(v_CheckResultStr,1,1900) || '(...)';
+        ELSE
+          v_CheckResultStr := v_CheckResultStr || Cur_Docs.INVENTORY || '(@Warehouse@ ' || Cur_Docs.WAREHOUSE || ')';
+        END IF;
       END LOOP;
       v_CheckResultStr:=v_CheckResultStr || '.';
     END IF;
@@ -213,7 +221,11 @@
         ELSE
           v_CheckResultStr := v_CheckResultStr || ', ';
         END IF;
-        v_CheckResultStr := v_CheckResultStr || Cur_Docs.DOCUMENTNO;
+        IF (COALESCE(LENGTH(v_CheckResultStr),0) > 1900) THEN
+          v_CheckResultStr:=SUBSTR(v_CheckResultStr,1,1900) || '(...)';
+        ELSE
+          v_CheckResultStr := v_CheckResultStr || Cur_Docs.DOCUMENTNO;
+        END IF;
       END LOOP;
       v_CheckResultStr:=v_CheckResultStr || '.';
     END IF;
@@ -238,7 +250,11 @@
         ELSE
           v_CheckResultStr := v_CheckResultStr || ', ';
         END IF;
-        v_CheckResultStr := v_CheckResultStr || Cur_Docs.DOCUMENTNO;
+        IF (COALESCE(LENGTH(v_CheckResultStr),0) > 1900) THEN
+          v_CheckResultStr:=SUBSTR(v_CheckResultStr,1,1900) || '(...)';
+        ELSE
+          v_CheckResultStr := v_CheckResultStr || Cur_Docs.DOCUMENTNO;
+        END IF;
       END LOOP;
       v_CheckResultStr:=v_CheckResultStr || '.';
     END IF;
@@ -267,7 +283,11 @@
         ELSE
           v_CheckResultStr := v_CheckResultStr || ', ';
         END IF;
-        v_CheckResultStr := v_CheckResultStr || Cur_Docs.DATEINVOICED || ' (' || '@Invoice@ @SOS_DOCUMENTNO@' || Cur_Docs.DOCUMENTNO || ')';
+        IF (COALESCE(LENGTH(v_CheckResultStr),0) > 1900) THEN
+          v_CheckResultStr:=SUBSTR(v_CheckResultStr,1,1900) || '(...)';
+        ELSE
+          v_CheckResultStr := v_CheckResultStr || Cur_Docs.DATEINVOICED || ' (' || '@Invoice@ @SOS_DOCUMENTNO@' || Cur_Docs.DOCUMENTNO || ')';
+        END IF;
       END LOOP;
       v_CheckResultStr:=v_CheckResultStr || '.';
     END IF;