details:   https://code.openbravo.com/erp/devel/pi/rev/698aa79b72ae
changeset: 20210:698aa79b72ae
user:      Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> 
openbravo.com>
date:      Wed Apr 24 14:01:26 2013 +0530
summary:   Fixes Issue 23305: Error sending multiple documents by email
The process does not send properly if the contacts of the partners have the 
same name

details:   https://code.openbravo.com/erp/devel/pi/rev/474850a4bb48
changeset: 20211:474850a4bb48
user:      David Miguelez <david.miguelez <at> openbravo.com>
date:      Thu Apr 25 13:41:50 2013 +0200
summary:   Related to Issue 23305. Shows name in message instead of mail 
address.

diffstat:

 src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java |  
30 +++++-----
 1 files changed, 15 insertions(+), 15 deletions(-)

diffs (100 lines):

diff -r 2674db04cea8 -r 474850a4bb48 
src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
--- 
a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java   
    Thu Apr 25 13:24:22 2013 +0200
+++ 
b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java   
    Thu Apr 25 13:41:50 2013 +0200
@@ -81,7 +81,6 @@
   private boolean multiReports = false;
   private boolean archivedReports = false;
 
-
   @Override
   public void init(ServletConfig config) {
     super.init(config);
@@ -396,7 +395,8 @@
         } else if (vars.commandIn("UPDATE_TEMPLATE")) {
           JSONObject o = new JSONObject();
           try {
-            PocData[] pocData = (PocData[]) vars.getSessionObject("pocData" + 
fullDocumentIdentifier);
+            PocData[] pocData = (PocData[]) vars.getSessionObject("pocData"
+                + fullDocumentIdentifier);
             final String templateId = 
vars.getRequestGlobalVariable("templates", "templates");
             final String documentId = pocData[0].documentId;
             for (final PocData documentData : pocData) {
@@ -832,15 +832,15 @@
   }
 
   void createEmailOptionsPage(HttpServletRequest request, HttpServletResponse 
response,
-             VariablesSecureApp vars, DocumentType documentType, String 
strDocumentId,
-             Map<String, Report> reports, HashMap<String, Boolean> checks) {
-         createEmailOptionsPage(request, response, vars, documentType, 
strDocumentId, reports, checks);
+      VariablesSecureApp vars, DocumentType documentType, String strDocumentId,
+      Map<String, Report> reports, HashMap<String, Boolean> checks) {
+    createEmailOptionsPage(request, response, vars, documentType, 
strDocumentId, reports, checks);
   }
 
   void createEmailOptionsPage(HttpServletRequest request, HttpServletResponse 
response,
       VariablesSecureApp vars, DocumentType documentType, String strDocumentId,
-      Map<String, Report> reports, HashMap<String, Boolean> checks, String 
fullDocumentIdentifier) throws IOException,
-      ServletException {
+      Map<String, Report> reports, HashMap<String, Boolean> checks, String 
fullDocumentIdentifier)
+      throws IOException, ServletException {
     XmlDocument xmlDocument = null;
     PocData[] pocData = getContactDetails(documentType, strDocumentId);
     @SuppressWarnings("unchecked")
@@ -954,7 +954,7 @@
     for (final PocData documentData : pocData) {
       // Map used to count the different users
 
-      final String customer = documentData.contactName;
+      final String customer = documentData.contactEmail;
       getEnvironentInformation(pocData, checks);
       if (checks.get("moreThanOneDoc")) {
         if (customer == null || customer.length() == 0) {
@@ -972,7 +972,7 @@
         } else if (documentData.contactEmail == null || 
documentData.contactEmail.equals("")) {
           final OBError on = new OBError();
           on.setMessage(Utility.messageBD(this, "NoEmail", 
vars.getLanguage()).replace(
-              "@customer@", customer));
+              "@customer@", documentData.contactName));
           on.setTitle(Utility.messageBD(this, "Info", vars.getLanguage()));
           on.setType("info");
           final String tabId = vars.getSessionValue("inpTabId");
@@ -987,7 +987,7 @@
         customerMap.put(customer, documentData);
       }
 
-      final String salesRep = documentData.salesrepName;
+      final String salesRep = documentData.salesrepEmail;
 
       boolean moreThanOnesalesRep = 
checks.get("moreThanOnesalesRep").booleanValue();
       if (moreThanOnesalesRep) {
@@ -1004,7 +1004,7 @@
         } else if (documentData.salesrepEmail == null || 
documentData.salesrepEmail.equals("")) {
           final OBError on = new OBError();
           on.setMessage(Utility.messageBD(this, "NoEmailSender", 
vars.getLanguage()).replace(
-              "@salesRep@", salesRep));
+              "@salesRep@", documentData.salesrepName));
           on.setTitle(Utility.messageBD(this, "Info", vars.getLanguage()));
           on.setType("info");
           final String tabId = vars.getSessionValue("inpTabId");
@@ -1162,8 +1162,8 @@
     for (final PocData documentData : pocData) {
       // Map used to count the different users
       docCounter++;
-      final String customer = documentData.contactName;
-      final String salesRep = documentData.salesrepName;
+      final String customer = documentData.contactEmail;
+      final String salesRep = documentData.salesrepEmail;
       if (!customerMap.containsKey(customer)) {
         customerMap.put(customer, documentData);
       }
@@ -1195,8 +1195,8 @@
     for (final PocData documentData : pocData) {
       // Map used to count the different users
 
-      final String customer = documentData.contactName;
-      final String salesRep = documentData.salesrepName;
+      final String customer = documentData.contactEmail;
+      final String salesRep = documentData.salesrepEmail;
       if (!customerMap.containsKey(customer)) {
         customerMap.put(customer, documentData);
       }

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to