details:   https://code.openbravo.com/erp/devel/pi/rev/715e891eae22
changeset: 16449:715e891eae22
user:      Naiara Martinez <naiara.martinez <at> openbravo.com>
date:      Tue May 08 11:30:40 2012 +0200
summary:   fixed bug 18872 modify the callout to populate the unit price.Add a 
message.
The unit price is populated with the price of the pricelist. A message has
been added to advertise the user that the products added in projectline
after the project has been ordered are not added to the temporary pricelist.

details:   https://code.openbravo.com/erp/devel/pi/rev/35f4310c1d25
changeset: 16450:35f4310c1d25
user:      Naiara Martinez <naiara.martinez <at> openbravo.com>
date:      Tue May 08 14:02:33 2012 +0200
summary:   fixed bug 15140 in c_taxPayment_post add an organization and client 
validation
this is done to retrieve correctly the GL Categories

details:   https://code.openbravo.com/erp/devel/pi/rev/40337ad8318e
changeset: 16451:40337ad8318e
user:      Mikel Irurita <mikel.irurita <at> openbravo.com>
date:      Tue May 08 19:18:12 2012 +0200
summary:   Related to issue 18872: complete message text

diffstat:

 src-db/database/model/functions/C_TAXPAYMENT_POST.xml             |  20 
+++++++-
 src-db/database/sourcedata/AD_COLUMN.xml                          |   2 +
 src-db/database/sourcedata/AD_MESSAGE.xml                         |  22 
++++++++++
 src/org/openbravo/erpCommon/ad_callouts/SE_ProjectLine_Value.java |  16 +++++-
 4 files changed, 54 insertions(+), 6 deletions(-)

diffs (153 lines):

diff -r d9063574a9ef -r 40337ad8318e 
src-db/database/model/functions/C_TAXPAYMENT_POST.xml
--- a/src-db/database/model/functions/C_TAXPAYMENT_POST.xml     Tue May 08 
19:15:57 2012 +0200
+++ b/src-db/database/model/functions/C_TAXPAYMENT_POST.xml     Tue May 08 
19:18:12 2012 +0200
@@ -86,6 +86,7 @@
 v_currencyratetype VARCHAR2(30);
 v_gl_category_ID VARCHAR2(32);
 v_period_ID VARCHAR2(32);
+v_gl_category_count  NUMBER;
 
 v_name NVARCHAR2(255);
 v_TRTcountY  NUMBER;
@@ -135,9 +136,22 @@
         from c_taxpayment
         where c_taxpayment_id=v_record_id;
 
-      select max(gl_category_id)
-      into v_gl_category_id
-      from gl_category where name='Standard';
+      select count(*) 
+      into v_gl_category_count
+      from gl_category where name='Standard'
+      AND ad_isorgincluded(v_org_id, gl_category.ad_org_id, v_client_id)<>-1
+      AND gl_category.ad_client_id = v_client_id;
+
+      if (v_gl_category_count>0) then
+          select max(gl_category_id)
+          into v_gl_category_id
+          from gl_category where name='Standard'
+          AND ad_isorgincluded(v_org_id, gl_category.ad_org_id, 
v_client_id)<>-1
+          AND gl_category.ad_client_id = v_client_id;
+      else
+          RAISE_APPLICATION_ERROR(-20000, '@OrgForStandardGLCategory@');
+      end if;
+   
 
         v_paymentrule := 'T';
         v_currencyratetype := 'S';
diff -r d9063574a9ef -r 40337ad8318e src-db/database/sourcedata/AD_COLUMN.xml
--- a/src-db/database/sourcedata/AD_COLUMN.xml  Tue May 08 19:15:57 2012 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml  Tue May 08 19:18:12 2012 +0200
@@ -123671,6 +123671,7 @@
 <!--800152-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--800152-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
 <!--800152-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--800152-->  <READONLYLOGIC><![CDATA[@Projectstatus@!'OP']]></READONLYLOGIC>
 <!--800152-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
 <!--800152-->  <SEQNO><![CDATA[0]]></SEQNO>
 <!--800152-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
@@ -218650,6 +218651,7 @@
 <!--1005900007-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--1005900007-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
 <!--1005900007-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--1005900007-->  
<READONLYLOGIC><![CDATA[@Projectstatus@!'OP']]></READONLYLOGIC>
 <!--1005900007-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
 <!--1005900007-->  <SEQNO><![CDATA[251]]></SEQNO>
 <!--1005900007-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
diff -r d9063574a9ef -r 40337ad8318e src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Tue May 08 19:15:57 2012 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Tue May 08 19:18:12 2012 +0200
@@ -16924,6 +16924,17 @@
 <!--68082E2D67E94A7E8FB1416A7FCEBC47-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--68082E2D67E94A7E8FB1416A7FCEBC47--></AD_MESSAGE>
 
+<!--681E09E265944CFB9FDED468F351081E--><AD_MESSAGE>
+<!--681E09E265944CFB9FDED468F351081E-->  
<AD_MESSAGE_ID><![CDATA[681E09E265944CFB9FDED468F351081E]]></AD_MESSAGE_ID>
+<!--681E09E265944CFB9FDED468F351081E-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--681E09E265944CFB9FDED468F351081E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--681E09E265944CFB9FDED468F351081E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--681E09E265944CFB9FDED468F351081E-->  
<VALUE><![CDATA[PriceListNotUpdated]]></VALUE>
+<!--681E09E265944CFB9FDED468F351081E-->  <MSGTEXT><![CDATA[The temporary price 
list is not going to be automatically updated (you can do it manually). The 
Unit Net Price defined on Project Line tab will be used when creating orders 
from this project.]]></MSGTEXT>
+<!--681E09E265944CFB9FDED468F351081E-->  <MSGTYPE><![CDATA[W]]></MSGTYPE>
+<!--681E09E265944CFB9FDED468F351081E-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--681E09E265944CFB9FDED468F351081E--></AD_MESSAGE>
+
 <!--684157E8D36E455DA27AB1C1C4987403--><AD_MESSAGE>
 <!--684157E8D36E455DA27AB1C1C4987403-->  
<AD_MESSAGE_ID><![CDATA[684157E8D36E455DA27AB1C1C4987403]]></AD_MESSAGE_ID>
 <!--684157E8D36E455DA27AB1C1C4987403-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -18153,6 +18164,17 @@
 <!--9898E3D73D0644D3B0DE5757D5E7BCD7-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--9898E3D73D0644D3B0DE5757D5E7BCD7--></AD_MESSAGE>
 
+<!--98A052B862994F0BB4AA32BC78434C07--><AD_MESSAGE>
+<!--98A052B862994F0BB4AA32BC78434C07-->  
<AD_MESSAGE_ID><![CDATA[98A052B862994F0BB4AA32BC78434C07]]></AD_MESSAGE_ID>
+<!--98A052B862994F0BB4AA32BC78434C07-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--98A052B862994F0BB4AA32BC78434C07-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--98A052B862994F0BB4AA32BC78434C07-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--98A052B862994F0BB4AA32BC78434C07-->  
<VALUE><![CDATA[OrgForStandardGLCategory]]></VALUE>
+<!--98A052B862994F0BB4AA32BC78434C07-->  <MSGTEXT><![CDATA[There is no 
'Standard' G/L category defined for this organization.]]></MSGTEXT>
+<!--98A052B862994F0BB4AA32BC78434C07-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--98A052B862994F0BB4AA32BC78434C07-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--98A052B862994F0BB4AA32BC78434C07--></AD_MESSAGE>
+
 <!--9A6B5D3A2FC544C79ABB21C6029DC24D--><AD_MESSAGE>
 <!--9A6B5D3A2FC544C79ABB21C6029DC24D-->  
<AD_MESSAGE_ID><![CDATA[9A6B5D3A2FC544C79ABB21C6029DC24D]]></AD_MESSAGE_ID>
 <!--9A6B5D3A2FC544C79ABB21C6029DC24D-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r d9063574a9ef -r 40337ad8318e 
src/org/openbravo/erpCommon/ad_callouts/SE_ProjectLine_Value.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_ProjectLine_Value.java Tue May 
08 19:15:57 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_ProjectLine_Value.java Tue May 
08 19:18:12 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.VariablesSecureApp;
 import org.openbravo.erpCommon.businessUtility.Tax;
 import org.openbravo.erpCommon.utility.DateTimeData;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.utils.FormatUtilities;
 import org.openbravo.xmlEngine.XmlDocument;
@@ -51,11 +52,14 @@
       String strProjectId = vars.getStringParameter("inpcProjectId");
       String strPhaseId = vars.getStringParameter("inpcProjectphaseId");
       String strADOrgID = vars.getStringParameter("inpadOrgId");
+      String strPriceStd = vars.getNumericParameter("inpmProductId_PSTD");
+      String strCreatePL = vars.getStringParameter("inpcreatetemppricelist");
+      String strStatus = vars.getStringParameter("inpprojectstatus");
       String strPriceListVersion = 
vars.getGlobalVariable("inpPriceListVersion",
           "Product.priceListVersion", "");
       try {
         printPage(response, vars, strmProductId, strPriceListVersion, 
strTabId, strProjectId,
-            strPhaseId, strADOrgID);
+            strPhaseId, strADOrgID, strPriceStd, strCreatePL, strStatus);
       } catch (ServletException ex) {
         pageErrorCallOut(response);
       }
@@ -65,7 +69,8 @@
 
   private void printPage(HttpServletResponse response, VariablesSecureApp vars,
       String strmProductId, String strPriceListVersion, String strTabId, 
String strProjectId,
-      String strPhaseId, String strADOrgID) throws IOException, 
ServletException {
+      String strPhaseId, String strADOrgID, String strPriceStd, String 
strCreatePL, String strStatus)
+      throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
@@ -106,6 +111,11 @@
         } else
           strMessage = "PriceNotFound";
       }
+      if ("OR".equalsIgnoreCase(strStatus) && 
"Y".equalsIgnoreCase(strCreatePL)) {
+        // Warning message: is not going to add in the pricelist.
+        strMessage = OBMessageUtils.messageBD("PriceListNotUpdated");
+      }
+      resultado.append("new Array(\"inpplannedprice\", " + strPriceStd + " 
),\n");
       if (!strProjCat.equals("S")) {
         if (strCBPartnerLocationID != null && 
!strCBPartnerLocationID.equals("")
             && strMWarehouseID != null && !strMWarehouseID.equals("")) {

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to