details:   /erp/devel/int/rev/098eeb5c3218
changeset: 7092:098eeb5c3218
user:      Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
date:      Tue Apr 20 11:21:28 2010 +0530
summary:   Fixes issue 11996: The jasper report linked to MM Shipment/Receipt 
is not printed

details:   /erp/devel/int/rev/e765cd806d02
changeset: 7093:e765cd806d02
user:      Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
date:      Tue Apr 20 11:31:17 2010 +0530
summary:   Commit for the License contents.

diffstat:

 
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplate.class
     |    0 
 
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplateData.class
 |    0 
 
src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java 
               |   40 +++++
 
src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate_Data.xsql
           |   68 ++++++++++
 4 files changed, 108 insertions(+), 0 deletions(-)

diffs (122 lines):

diff -r 7fdc688179fe -r e765cd806d02 
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplate.class
Binary file 
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplate.class
 has changed
diff -r 7fdc688179fe -r e765cd806d02 
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplateData.class
Binary file 
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplateData.class
 has changed
diff -r 7fdc688179fe -r e765cd806d02 
src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java
   Tue Apr 20 11:31:17 2010 +0530
@@ -0,0 +1,40 @@
+package org.openbravo.modulescript;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.UUID;
+import org.apache.log4j.Logger;
+
+import javax.servlet.ServletException;
+
+import org.openbravo.database.ConnectionProvider;
+
+public class CreateDoctypeTemplate extends ModuleScript{
+
+       @Override
+       //Inserting Doctype template for shipment and receipt.Related to the 
issue https://issues.openbravo.com/view.php?id=11996
+       public void execute() {
+               try {
+                     ConnectionProvider cp = getConnectionProvider();
+                     CreateDoctypeTemplateData[] data = 
CreateDoctypeTemplateData.select(cp);
+                     for (int i = 0; i < data.length; i++) {
+                               
+                         if(data[i].vCount.equals("0")){
+                                 String strReportFileName="Goods 
shipme...@our_ref@";
+                                 if(data[i].docbasetype.equals("MMR")){
+                                         strReportFileName="Goods 
recei...@our_ref@";
+                                 }
+                                 String 
strDoctypeTemplate_id=UUID.randomUUID().toString().replace("-", 
"").toUpperCase();
+                                 
CreateDoctypeTemplateData.insertDoctypeTemplate(cp.getConnection(), cp, 
strDoctypeTemplate_id, data[i].adClientId, data[i].cDoctypeId, data[i].name+" 
Report Template", "@basedesign@/org/openbravo/erpReports", strReportFileName, 
"RptM_InOut.jrxml");
+                                 
CreateDoctypeTemplateData.insertEmailDefinition(cp.getConnection(), cp, 
data[i].adClientId, strDoctypeTemplate_id);
+                         }
+                       }
+                   } catch (Exception e) {
+                       handleError(e);
+                   }
+
+       }
+       
+       
+
+}
\ No newline at end of file
diff -r 7fdc688179fe -r e765cd806d02 
src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate_Data.xsql
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate_Data.xsql
      Tue Apr 20 11:31:17 2010 +0530
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2010 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<SqlClass name="CreateDoctypeTemplateData" 
package="org.openbravo.modulescript">
+   <SqlClassComment></SqlClassComment>
+   <SqlMethod name="select" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+      select c_doctype_id, ad_client_id, name,(select count(*) from 
c_poc_doctype_template ct where ct.c_doctype_id = c_doctype.c_doctype_id) AS 
v_count, docBaseType 
+      from c_doctype where docbasetype in ('MMR','MMS')
+      ]]>
+    </Sql>
+  </SqlMethod>
+<SqlMethod name="insertDoctypeTemplate" type="preparedStatement" 
connection="true" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+      INSERT INTO c_poc_doctype_template(
+            c_poc_doctype_template_id, ad_client_id, ad_org_id, isactive, 
+            created, createdby, updated, updatedby, c_doctype_id, name, 
+            templatelocation, reportfilename, templatefilename)
+      VALUES (?, ?, '0', 'Y', 
+            now(), '0', now(), '0', ?, ?, 
+            ?, ?, ?)
+      ]]>
+    </Sql>
+    <Parameter name="doctypetemplateId"/>
+    <Parameter name="clientId"/>
+    <Parameter name="doctypeId"/>
+    <Parameter name="name"/>
+    <Parameter name="templatelocation"/>
+    <Parameter name="reportfilename"/>
+    <Parameter name="templatefilename"/>
+  </SqlMethod>
+  <SqlMethod name="insertEmailDefinition" type="preparedStatement" 
connection="true" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+      INSERT INTO c_poc_emaildefinition(
+            c_poc_emaildefinition_id, ad_client_id, ad_org_id, isactive, 
+            created, createdby, updated, updatedby, c_poc_doctype_template_id, 
+            subject, body, isdefault, ad_language)
+      VALUES (GET_UUID(), ?, '0', 'Y', 
+            now(), '0', now(), '0', ?, 
+            '', '', 'Y', 'en_US')
+      ]]>
+    </Sql>
+    <Parameter name="clientId"/>
+    <Parameter name="doctypetemplateId"/>
+  </SqlMethod>
+</SqlClass>
\ No newline at end of file

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to