Commit 5ae8b349 authored by smane's avatar smane

Change remarks field description while generating Purchase Milestone Transaction


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99232 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 20720487
......@@ -160,6 +160,11 @@ public class POMilestoneCnf
// Timestamp newsysDate = java.sql.Timestamp.valueOf( sdf.format(currentDate)+" 00:00:00.0");
Timestamp newsysDate = getCurrdateAppFormat();
System.out.println("Now the date is :=> ["+newsysDate+"]");
// wfStatusDate code Added by Sagar on 23/11/15
java.util.Date date1= new java.util.Date();
Timestamp wfStatusDate = new Timestamp(date1.getTime());
System.out.println(">>wfStatusDate["+wfStatusDate+"]");
java.sql.Timestamp today = null;
java.util.Date date = null;
......@@ -174,7 +179,7 @@ public class POMilestoneCnf
String chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"CHG_TERM");
String chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"CHG_USER");
String suppName="",taskDescr="";
String mileStoneVouchAutoCnf="",mileStoneDebitAutoCnf="";
sql = " select tran_id,tran_date,purc_order,line_no__ord,tran_type,site_code,supp_code,acct_code,cctr_code," +
" tax_class,tax_chap,tax_env, task_code, amount,due_date,task_status,payment_opt,remarks,tran_id__vch," +
......@@ -269,7 +274,8 @@ public class POMilestoneCnf
*/
System.out.println("tranId["+tranId+"]tranType["+tranType+"]timeDiff["+timeDiff+"]paymentOpt["+paymentOpt+"]taskCode["+taskCode+"]complDateStr["+complDateStr+"]amountStr["+amountStr+"]");
if( "P".equalsIgnoreCase(tranType))
{ // voucher created for tran type 'P'
System.out.println("@@@@@@@@ voucher created for tran type 'P' ");
......@@ -307,18 +313,75 @@ public class POMilestoneCnf
if(returnStr.indexOf("Success") > -1 )
{
System.out.println("CreatePoVoucherAdvance created Successfully["+returnStr+"]");
conn.commit();
// Code added by Sagar on 20/11/15, Start..
String[] arrayForTranId = returnStr.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
tranIdForVoucher = arrayForTranId[1].substring(0,endIndex);
tranIdForVoucher=tranIdForVoucher==null ? "" : tranIdForVoucher.trim();
System.out.println(">>tranIdForVoucher["+tranIdForVoucher+"]");
/*java.util.Date date1= new java.util.Date();
Timestamp ts_now = new Timestamp(date1.getTime());
System.out.println(">>ts_now["+ts_now+"]");*/
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y', tran_id__vch= ? where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, newsysDate);
pstmt.setTimestamp(2, wfStatusDate);
pstmt.setString(3, tranIdForVoucher);
pstmt.setString(4, tranId);
int cntVouch = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println(">>>cntVouch:"+cntVouch);
// Code added by Sagar on 20/11/15, End..
conn.commit();
/*String[] arrayForTranId = returnStr.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
tranIdForVoucher = arrayForTranId[1].substring(0,endIndex);
tranIdForVoucher=tranIdForVoucher==null ? "" : tranIdForVoucher.trim();
System.out.println("tranIdForVoucher["+tranIdForVoucher+"]");
returnStr = confirmTranscation("voucher_adv",tranIdForVoucher,xtraParams,conn);
*/
//returnStr = confirmTranscation("voucher_adv",tranIdForVoucher,xtraParams,conn); // Comment added by Sagar on 20/11/15
//Code added by Sagar on 20/11/15 Start..
FinCommon fincommon = new FinCommon();
mileStoneVouchAutoCnf= fincommon.getFinparams("999999", "MLSTNVOUCH_AUTOCNF", conn);
System.out.println(">>>mileStoneVouchAutoCnf:"+mileStoneVouchAutoCnf);
if(mileStoneVouchAutoCnf!= null && mileStoneVouchAutoCnf.trim().length() > 0)
{
mileStoneVouchAutoCnf= mileStoneVouchAutoCnf.trim();
if("NULLFOUND".equals(mileStoneVouchAutoCnf))
{
mileStoneVouchAutoCnf ="N";
}
}
else
{
mileStoneVouchAutoCnf ="N";
}
if("Y".equalsIgnoreCase(mileStoneVouchAutoCnf))
{
returnStr = confirmTranscation("voucher_adv",tranIdForVoucher,xtraParams,conn);
}
else
{
returnStr = "Success";
}
//Code added by Sagar on 20/11/15 End.
System.out.println("CreatePoVoucherAdvance confirmTranscation returnStr["+returnStr+"]");
if(returnStr.indexOf("Success") > -1 || returnStr.indexOf("VTSUCC1") > -1 )
{
sql = " update pur_milstn set tran_id__vch = ? where tran_id = ? ";
// Comment added by Sagar on 20/11/15, Start.
/*sql = " update pur_milstn set tran_id__vch = ? where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranIdForVoucher);
......@@ -326,7 +389,9 @@ public class POMilestoneCnf
int cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("@@@@@ updated sucessfully pur_milstn tranId["+tranId+"]tranIdForVoucher["+tranIdForVoucher+"]cnt["+cnt+"]");
System.out.println("@@@@@ updated sucessfully pur_milstn tranId["+tranId+"]tranIdForVoucher["+tranIdForVoucher+"]cnt["+cnt+"]");*/
// Comment added by Sagar on 20/11/15, End.
// conn.commit();
}
else
......@@ -347,9 +412,25 @@ public class POMilestoneCnf
}
else
{
System.out.println("paymentOpt is 'N' ...rollback()...");
System.out.println("paymentOpt is 'N' .....");
//conn.rollback();
//return returnStr;
//Code added by Sagar on 23/11/15 Start.
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y' where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, newsysDate);
pstmt.setTimestamp(2, wfStatusDate);
pstmt.setString(3, tranId);
int cntPurMlstn = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println(">>>If paymentOpt is 'N' cntPurMlstn:"+cntPurMlstn);
conn.commit();
//Code added by Sagar on 23/11/15 End.
returnStr = "Success";
}
......@@ -389,7 +470,8 @@ public class POMilestoneCnf
pstmt.close();
pstmt = null;
remarks = "Penalty for "+taskCode+"("+taskDescr+") delayed by "+timeDiff+" days.";
// remarks = "Penalty for "+taskCode+"("+taskDescr+") delayed by "+timeDiff+" days."; // Comment added by Sagar on 24/11/15
remarks = "Penalty request generated for "+taskCode+"("+taskDescr+") delayed by "+timeDiff+" days."; // Code added by Sagar on 24/11/15
xmlBuff = new StringBuffer();
System.out.println("--XML CREATION !!!!!--");
......@@ -532,20 +614,78 @@ public class POMilestoneCnf
if( returnStr.indexOf("Success") > -1 )
{
System.out.println("createDebitNote created Successfully["+returnStr+"]");
conn.commit();
// Code added by Sagar on 20/11/15, Start..
String[] arrayForTranId = returnStr.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
String tranIdForDebit = arrayForTranId[1].substring(0,endIndex);
tranIdForDebit=tranIdForDebit==null ? "" : tranIdForDebit.trim();
System.out.println("-tranIdForDebit["+tranIdForDebit+"]");
System.out.println(">>tranIdForDebit["+tranIdForDebit+"]");
/*java.util.Date date1= new java.util.Date();
Timestamp ts_now = new Timestamp(date1.getTime());
System.out.println(">>ts_now["+ts_now+"]");*/
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y', tran_id__vch= ? where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, newsysDate);
pstmt.setTimestamp(2, wfStatusDate);
pstmt.setString(3, tranIdForDebit);
pstmt.setString(4, tranId);
int cntDebit = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println(">>>cntDebit:"+cntDebit);
// Code added by Sagar on 20/11/15, End.
conn.commit();
// Comment added by Sagar on 20/11/15
/*String[] arrayForTranId = returnStr.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
String tranIdForDebit = arrayForTranId[1].substring(0,endIndex);
tranIdForDebit=tranIdForDebit==null ? "" : tranIdForDebit.trim();
System.out.println("-tranIdForDebit["+tranIdForDebit+"]"); */
returnStr = confirmTranscation("drcrpay_dr",tranIdForDebit,xtraParams,conn);
//returnStr = confirmTranscation("drcrpay_dr",tranIdForDebit,xtraParams,conn); // Comment added by Sagar on 20/11/15
// Code added by Sagar on 20/11/15, Start.
FinCommon fincommon = new FinCommon();
mileStoneDebitAutoCnf= fincommon.getFinparams("999999", "MLSTNDEBIT_AUTOCNF", conn);
System.out.println(">>>mileStoneDebitAutoCnf:"+mileStoneDebitAutoCnf);
if(mileStoneDebitAutoCnf!= null && mileStoneDebitAutoCnf.trim().length() > 0)
{
mileStoneDebitAutoCnf= mileStoneDebitAutoCnf.trim();
if("NULLFOUND".equals(mileStoneDebitAutoCnf))
{
mileStoneDebitAutoCnf ="N";
}
}
else
{
mileStoneDebitAutoCnf ="N";
}
if("Y".equalsIgnoreCase(mileStoneDebitAutoCnf))
{
returnStr = confirmTranscation("drcrpay_dr",tranIdForDebit,xtraParams,conn);
}
else
{
returnStr = "Success";
}
// Code added by Sagar on 20/11/15, End.
System.out.println("confirmTranscation debit node returnStr["+returnStr+"]");
// conn.commit();
if(returnStr.indexOf("Success") > -1 || returnStr.indexOf("VTSUCC1") > -1 )
{
sql = " update pur_milstn set tran_id__vch = ? where tran_id = ? ";
// Comment added by Sagar on 20/11/15, Start
/*sql = " update pur_milstn set tran_id__vch = ? where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranIdForDebit);
......@@ -554,6 +694,9 @@ public class POMilestoneCnf
pstmt.close();
pstmt = null;
System.out.println("@@@@@ updated sucessfully pur_milstn tranId["+tranId+"]tranIdForDebit["+tranIdForDebit+"]cnt["+cnt+"]");
*/
// Comment added by Sagar on 20/11/15, End
// conn.commit();
}
else
......@@ -572,24 +715,40 @@ public class POMilestoneCnf
} // end amount condition
else
{
// Code added by Sagar on 23/11/15, Start.
System.out.println(">>>If tranType 'D' and amount in less than ZERO then update....");
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y' where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, newsysDate);
pstmt.setTimestamp(2, wfStatusDate);
pstmt.setString(3, tranId);
int cntPurMlstn = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println(">>>If paymentOpt is 'N' cntPurMlstn:"+ cntPurMlstn);
conn.commit();
// Code added by Sagar on 23/11/15, End.
returnStr = "SucAmtZero";
}
}
System.out.println("@@@@@@@@@@@ before status update pur_milstn returnStr["+returnStr+"]");
if(returnStr.indexOf("Success") > -1 || returnStr.indexOf("VTSUCC1") > -1 || returnStr.indexOf("SucAmtZero") > -1 )
//if(returnStr.indexOf("Success") > -1 || returnStr.indexOf("VTSUCC1") > -1 || returnStr.indexOf("SucAmtZero") > -1 ) // Comment Added by Sagar on 20/11/15
if(returnStr.indexOf("SucAmtZero") > -1 ) // Condition added by Sagar on 20/11/15
{
java.util.Date date1= new java.util.Date();
Timestamp ts_now = new Timestamp(date1.getTime());
System.out.println("ts_now["+ts_now+"]");
/*java.util.Date date1= new java.util.Date();
Timestamp ts_now = new Timestamp(date1.getTime());
System.out.println("ts_now["+ts_now+"]");
*/
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y' where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,newsysDate);
pstmt.setTimestamp(2,ts_now);
pstmt.setTimestamp(2,wfStatusDate);
pstmt.setString(3,tranId);
int cnt = pstmt.executeUpdate();
pstmt.close();
......
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