Commit 6106e6fd authored by msingh's avatar msingh

Changes in SalesReturnConf.java for DDUK


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99325 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 892337e6
package ibase.webitm.ejb.wms;
import ibase.utility.CommonConstants;
import ibase.utility.EMail;
import ibase.webitm.utility.*;
import ibase.webitm.utility.wms.CommonWmsUtil;
import ibase.system.config.*;
......@@ -222,7 +223,8 @@ public class SalesReturnConf extends ActionHandlerEJB implements SalesReturnConf
//End by Sneha on 02/07/2015, for Auto Confirm Payment, Request ID: D15DKAT001
}
if( "success".equalsIgnoreCase(sorderRtrStr) || "success".equalsIgnoreCase(refundReturnStr))
{
{
SendMail(invoiceId, tranType, conn); //Added By Manish for send mail to customer on 02/12/2015
return errString;
}
else
......@@ -2475,5 +2477,53 @@ public class SalesReturnConf extends ActionHandlerEJB implements SalesReturnConf
}
return (currDate);
}
//Change By Manish for send mail to customer on 02/12/2015 [Start]
private void SendMail(String invoiceId, String tranType, Connection conn) throws Exception
{
String sendTo = "", sql = "";
String subject = "";
System.out.println("----------in sendingMail--------------------");
StringBuffer commInfo = new StringBuffer();
ResultSet rs=null;
PreparedStatement pstmt=null;
EMail email = new EMail();
sql="SELECT C.EMAIL_ADDR FROM CUSTOMER C, INVOICE I WHERE C.CUST_CODE = I.CUST_CODE AND I.INVOICE_ID = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, invoiceId);
rs = pstmt.executeQuery();
if(rs.next())
{
sendTo = checkNull(rs.getString(1));
}
rs.close();
pstmt.close();
rs=null;
pstmt=null;
System.out.println("sendTo========["+sendTo+"]");
if("RP".equalsIgnoreCase(tranType))
{
subject ="Sales Return Successfully for Replacement";
}
if("RF".equalsIgnoreCase(tranType))
{
subject ="Sales Return Successfully for Refund";
}
if(sendTo.length()>0)
{
commInfo.append("<ROOT>");
commInfo.append("<MAILINFO>");
commInfo.append("<EMAIL_TYPE>").append("page").append("</EMAIL_TYPE>");
commInfo.append("<TO_ADD>").append("<![CDATA[" + sendTo + "]]>").append("</TO_ADD>");
commInfo.append("<SUBJECT>").append("<![CDATA[" + subject + "]]>").append("</SUBJECT>");
commInfo.append("</MAILINFO>");
commInfo.append("</ROOT>");
System.out.println(" calling sendMail method()");
email.sendMail(commInfo.toString(), "ITM", null);
System.out.println(" ********Email send succesfully ***********");
}
}
//Change By Manish for send mail to customer on 02/12/2015 [End]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment