details:   https://code.openbravo.com/erp/devel/pi/rev/02e8506d916c
changeset: 18506:02e8506d916c
user:      Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> 
openbravo.com>
date:      Thu Nov 08 13:52:58 2012 +0100
summary:   Fixes Issue 22238: Copy Lines process fails in Sales invoice

details:   https://code.openbravo.com/erp/devel/pi/rev/b7a3476440f0
changeset: 18507:b7a3476440f0
user:      Naiara Martinez <naiara.martinez <at> openbravo.com>
date:      Mon Oct 22 17:07:51 2012 +0200
summary:   fixed bug 21959: Sales role can't "Copy from Order"

diffstat:

 src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql |   4 +-
 src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java      |  14 
+++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diffs (59 lines):

diff -r 640a49b4fe7a -r b7a3476440f0 
src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql     
Thu Nov 08 13:09:35 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql     
Mon Oct 22 17:07:51 2012 +0200
@@ -65,7 +65,7 @@
             S_RESOURCEASSIGNMENT_ID, TAXAMT, M_ATTRIBUTESETINSTANCE_ID, 
ISDESCRIPTION, QUANTITYORDER, M_PRODUCT_UOM_ID, 
             PRICESTD, ACCOUNT_ID,FINANCIAL_INVOICE_LINE,
             gross_unit_price, line_gross_amount, grosspricelist, grosspricestd,
-            isdeferred, revplantype, periodnumber, c_period_id
+            isdeferred, defplantype, periodnumber, c_period_id
         )
         SELECT ?, ?, ?, ?, 'Y', now(), ?, now(), ?,
         (SELECT COALESCE(MAX(LINE),0)+10 FROM C_InvoiceLine WHERE C_Invoice_ID 
= ?), DESCRIPTION, M_PRODUCT_ID, 
@@ -73,7 +73,7 @@
         S_RESOURCEASSIGNMENT_ID, TAXAMT, M_ATTRIBUTESETINSTANCE_ID, 
ISDESCRIPTION, QUANTITYORDER, M_PRODUCT_UOM_ID, 
         PRICESTD, ACCOUNT_ID,FINANCIAL_INVOICE_LINE,
         TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?),
-        isdeferred, revplantype, periodnumber, c_period_id        
+        isdeferred, defplantype, periodnumber, c_period_id
         FROM C_INVOICELINE 
         WHERE C_INVOICELINE_ID = ? 
       ]]>
diff -r 640a49b4fe7a -r b7a3476440f0 
src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java  Thu Nov 
08 13:09:35 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java  Mon Oct 
22 17:07:51 2012 +0200
@@ -11,7 +11,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) 2001-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -30,6 +30,7 @@
 
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.businessUtility.Tax;
 import org.openbravo.erpCommon.utility.DateTimeData;
@@ -96,8 +97,15 @@
       CopyFromPOOrderData[] data = CopyFromPOOrderData.selectLines(this, 
strOrder);
       CopyFromPOOrderData[] orderData = CopyFromPOOrderData.select(this, 
strKey);
       Order order = OBDal.getInstance().get(Order.class, strKey);
-      int stdPrecision = order.getCurrency().getStandardPrecision().intValue();
-      int pricePrecision = order.getCurrency().getPricePrecision().intValue();
+      int stdPrecision = 0;
+      int pricePrecision = 0;
+      OBContext.setAdminMode(true);
+      try {
+        stdPrecision = order.getCurrency().getStandardPrecision().intValue();
+        pricePrecision = order.getCurrency().getPricePrecision().intValue();
+      } finally {
+        OBContext.restorePreviousMode();
+      }
 
       for (i = 0; data != null && i < data.length; i++) {
         CopyFromPOOrderData[] data3 = 
CopyFromPOOrderData.selectPriceForProduct(this,

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to