details:   https://code.openbravo.com/erp/devel/pi/rev/5dbcb5394a22
changeset: 33638:5dbcb5394a22
user:      Mark <markmm82 <at> gmail.com>
date:      Thu Mar 01 18:45:40 2018 -0500
summary:   Fixes issue 37960: When not stocked product is exploded before 
booking the order
and price includes taxes, Gross Unit Price is updated to 0.

When the it is exploded a BOM line with not stock and the price list includes 
taxes
then the M_EXPLODEBOMNOTSTOCK function was creating lines with the 
gross_unit_price,
grosspricelist and line_gross_amount values, but it wasn't copying the 
grosspricestd
column and it was taking 0 as default value.

For this reason, when the order was booked, as the Explode process sets the
grosspricestd to 0, M_PROMOTION_CALCULATE function uses and transfers it for the
gross_unit_price column.

To fix this issue, the grosspricestd is also inserted into the exploded lines at
line insertion in M_EXPLODEBOMNOTSTOCK PL.

diffstat:

 src-db/database/model/functions/M_EXPLODEBOMNOTSTOCK.xml |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r ce890b7032d4 -r 5dbcb5394a22 
src-db/database/model/functions/M_EXPLODEBOMNOTSTOCK.xml
--- a/src-db/database/model/functions/M_EXPLODEBOMNOTSTOCK.xml  Tue Mar 06 
09:07:37 2018 +0100
+++ b/src-db/database/model/functions/M_EXPLODEBOMNOTSTOCK.xml  Thu Mar 01 
18:45:40 2018 -0500
@@ -19,7 +19,7 @@
 * 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-2017 Openbravo SLU
+* All portions are Copyright (C) 2013-2018 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -193,7 +193,7 @@
             QuantityOrder, M_Product_Uom_ID, PriceStd,
             c_project_id, a_asset_id, c_costcenter_id,
             user1_id, user2_id, bom_parent_id,
-            gross_unit_price, grosspricelist, line_gross_amount,
+            gross_unit_price, grosspricelist, line_gross_amount, grosspricestd,
             c_aum, aumqty
           )
         VALUES
@@ -212,7 +212,8 @@
             CUR_BOM_Line.QuantityOrder, CUR_BOM_Line.M_Product_UOM_ID, 
M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
             CUR_BOM_Line.c_project_id, CUR_BOM_Line.a_asset_id, 
CUR_BOM_Line.c_costcenter_id,
             CUR_BOM_Line.user1_id, CUR_BOM_Line.user2_id, v_Record_ID,
-            v_gross_unit_price, v_gross_price_list, v_line_gross_amount, 
v_aum, v_aumqty*CUR_BOM.BOMQty
+            v_gross_unit_price, v_gross_price_list, v_line_gross_amount, 
v_gross_unit_price,
+            v_aum, v_aumqty*CUR_BOM.BOMQty
           );
           SELECT BASEAMOUNT
           INTO v_BaseAmount

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to