details:   https://code.openbravo.com/erp/devel/pi/rev/9c64f5a535d5
changeset: 25764:9c64f5a535d5
user:      Reinaldo Guerra <reinaldo.guerra <at> peoplewalking.com>
date:      Mon Jan 26 23:28:17 2015 -0500
summary:   Fixed bug 27822: Price List is not created and no error message is 
shown.

Create Price List stored procedure, was changed to launch an error message when 
the price list schema, defined in the price list version, have no lines defined.
Now, when creating a price list for a schema without lines, no product prices 
are added and an error message indicating that price list schema lines are 
required to execute the process.

diffstat:

 src-db/database/model/functions/M_PRICELIST_CREATE.xml |   9 ++++++++-
 src-db/database/sourcedata/AD_MESSAGE.xml              |  12 ++++++++++++
 2 files changed, 20 insertions(+), 1 deletions(-)

diffs (63 lines):

diff -r 01a9a7114bf5 -r 9c64f5a535d5 
src-db/database/model/functions/M_PRICELIST_CREATE.xml
--- a/src-db/database/model/functions/M_PRICELIST_CREATE.xml    Tue Jan 27 
13:16:28 2015 +0100
+++ b/src-db/database/model/functions/M_PRICELIST_CREATE.xml    Mon Jan 26 
23:28:17 2015 -0500
@@ -19,7 +19,7 @@
   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
   * All Rights Reserved.
   * Contributor(s): Openbravo SLU
-  * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
+  * Contributions are Copyright (C) 2001-2015 Openbravo, S.L.U.
   *
   * Specifically, this derivative work is based upon the following Compiere
   * file and version.
@@ -61,6 +61,8 @@
     v_result NUMBER:=1;
     v_user AD_USER.AD_USER_ID%TYPE;
     
+    v_shline_count rowcount%TYPE;
+    
   BEGIN
     --  Update AD_PInstance
     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing') ;
@@ -225,6 +227,7 @@
       /**
       * For All Discount Lines in Sequence
       */
+      v_shline_count := 0;
       FOR Cur_DiscountLine IN
         (SELECT *
         FROM M_DiscountSchemaLine
@@ -551,7 +554,11 @@
           ;   
         END IF;
         v_Message:='';
+        v_shline_count := v_shline_count + 1;
       END LOOP; -- For all DiscountLines
+      IF (v_shline_count = 0) THEN
+        RAISE_APPLICATION_ERROR(-20000, '@PLSchemaLinesRequired@');
+      END IF;
       -- Delete Temporary Selection
       DELETE FROM C_TEMP_Selection;
       
diff -r 01a9a7114bf5 -r 9c64f5a535d5 src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Tue Jan 27 13:16:28 2015 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Mon Jan 26 23:28:17 2015 -0500
@@ -18055,6 +18055,18 @@
 <!--33ED747B6F0B4F27B0000B5F1818F8BB-->  
<ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--33ED747B6F0B4F27B0000B5F1818F8BB--></AD_MESSAGE>
 
+<!--3417290F9E144567AF71A6E6990777F3--><AD_MESSAGE>
+<!--3417290F9E144567AF71A6E6990777F3-->  
<AD_MESSAGE_ID><![CDATA[3417290F9E144567AF71A6E6990777F3]]></AD_MESSAGE_ID>
+<!--3417290F9E144567AF71A6E6990777F3-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3417290F9E144567AF71A6E6990777F3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3417290F9E144567AF71A6E6990777F3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3417290F9E144567AF71A6E6990777F3-->  
<VALUE><![CDATA[PLSchemaLinesRequired]]></VALUE>
+<!--3417290F9E144567AF71A6E6990777F3-->  <MSGTEXT><![CDATA[Price List Schema 
line is required to complete Create Price List process]]></MSGTEXT>
+<!--3417290F9E144567AF71A6E6990777F3-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--3417290F9E144567AF71A6E6990777F3-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3417290F9E144567AF71A6E6990777F3-->  
<ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--3417290F9E144567AF71A6E6990777F3--></AD_MESSAGE>
+
 <!--342574C1C71D4FA3A70C33D182A8A32D--><AD_MESSAGE>
 <!--342574C1C71D4FA3A70C33D182A8A32D-->  
<AD_MESSAGE_ID><![CDATA[342574C1C71D4FA3A70C33D182A8A32D]]></AD_MESSAGE_ID>
 <!--342574C1C71D4FA3A70C33D182A8A32D-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to