Commit 52585e1b authored by pchavan's avatar pchavan

Changed to show proper descr while generating failed credit policy.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@201623 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4ee32ab5
......@@ -49,6 +49,7 @@ public class PostOrdCreditChk
String lsReasCode = "", lsReasDetail = "";
String lsPolicySql="", lsPolicyInput="", lsPolicyResult="", lsPolicyCondition="" , lsResult ="";
String lsStr="" , lsStr1="" , lsStr2="" , lsCustName="" , lsSlpersName="" , lsContactName="", lsStr3="";
String lsCustCodeBill = "",lsCustNameBillTo ="",lsCustNameSoldTo= ""; // Added By PriyankaC on 03June2019
String lsValue="" , lsFail="", lsStatus="";//, lsMail[];
double lcCustCrlmt = 0, lcContCrlmt = 0 ,lcPendOrdSord = 0;
ArrayList PolicyList = null;
......@@ -118,7 +119,33 @@ public class PostOrdCreditChk
ordTypeNewPrd = "FN";
}
ordTypeNewPrd = ordTypeNewPrd.trim();
//Added By PriyankaC on 03June2019 [Start]
lsSql = "select cust_name from customer where cust_code = ?" ;
pstmt = conn.prepareStatement(lsSql);
pstmt.setString(1,asCustCodeBil);
rs = pstmt.executeQuery();
if (rs.next())
{
lsCustNameBillTo = rs.getString("cust_name");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
lsSql = "select cust_name from customer where cust_code = ?" ;
pstmt = conn.prepareStatement(lsSql);
pstmt.setString(1,asCustCodeSoldTo);
rs = pstmt.executeQuery();
if (rs.next())
{
lsCustNameSoldTo = rs.getString("cust_name");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//Added By PriyankaC on 03June2019 [END].
///amish 21-08-03 common script for order is having cash discount or not.
///tax amount will be used in cash discount credit policy.
// pick up tax code of cash discount from dis parm
......@@ -303,8 +330,8 @@ public class PostOrdCreditChk
lsCrPolicy = PolicyList.get(policyCtr).toString();
System.out.println("@@@@@@@@@ PolicyList.Size()["+PolicyList.size()+"]");
System.out.println("@@@@@@@@@ lsCrPolicy["+lsCrPolicy+"]");
lsSql = "select cust_name from customer where cust_code = ?" ;
//Changed By PriyankaC on 03June2019 [Start]
/* lsSql = "select cust_name from customer where cust_code = ?" ;
pstmt = conn.prepareStatement(lsSql);
pstmt.setString(1,asCustCodeBil);
rs = pstmt.executeQuery();
......@@ -312,12 +339,14 @@ public class PostOrdCreditChk
{
lsCustName = rs.getString("cust_name");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
*/
//Changed By PriyankaC on 03June2019[END]
if ("P01".equals(lsCrPolicy.trim()) || "P21".equals(lsCrPolicy.trim()))
{
......@@ -533,7 +562,21 @@ public class PostOrdCreditChk
/// amish 13-08-03
/// pick up the outstanding order amount. on the basis of the despatch percentage.
/// order should be pending and order should not be the same as the current order.
lsSql = "SELECT round(sum( sorddet.net_amt * (100 - ( (case when sorditem.qty_desp is null then 0 else sorditem.qty_desp end ) / sorditem.qty_ord * 100) ) / 100 ),3) pend_amt "
//Changed By PriyankaC on 03June2019.[Start]
/*lsSql = "SELECT round(sum( sorddet.net_amt * (100 - ( (case when sorditem.qty_desp is null then 0 else sorditem.qty_desp end ) / sorditem.qty_ord * 100) ) / 100 ),3) pend_amt "
+ " FROM sorddet, sorder, sorditem "
+ " WHERE ( sorddet.sale_order = sorditem.sale_order ) "
+ " and ( sorddet.line_no = sorditem.line_no ) "
+ " and ( sorder.sale_order = sorddet.sale_order ) "
+ " and ( sorder.cust_code__bil = ? ) "
+ " and ( sorder.status = 'P' ) "
+ " and ( sorder.confirmed = 'Y' )"
+ " and ( sorder.order_type <> ? ) "
+ " and ( sorditem.qty_ord > 0 ) "
+ " and ( sorder.item_ser in (select item_ser from itemser "
+ " where (case when item_ser__crpolicy is null then item_ser else item_ser__crpolicy end ) = ?)) ";
*/
lsSql = "SELECT round(sum( (case when sorddet.net_amt = 0 then sorddet.ord_value else sorddet.net_amt end ) * (100 - ( (case when sorditem.qty_desp is null then 0 else sorditem.qty_desp end ) / sorditem.qty_ord * 100) ) / 100 ),3) pend_amt "
+ " FROM sorddet, sorder, sorditem "
+ " WHERE ( sorddet.sale_order = sorditem.sale_order ) "
+ " and ( sorddet.line_no = sorditem.line_no ) "
......@@ -546,6 +589,7 @@ public class PostOrdCreditChk
+ " and ( sorder.item_ser in (select item_ser from itemser "
+ " where (case when item_ser__crpolicy is null then item_ser else item_ser__crpolicy end ) = ?)) ";
//Changed By PriyankaC on 03June2019.[END]
pstmt = conn.prepareStatement(lsSql);
if("P02".equals(lsCrPolicy.trim()))
{
......@@ -621,8 +665,10 @@ public class PostOrdCreditChk
}
System.out.println("@@@@@ lsCrPolicy["+lsCrPolicy+"]lcCheckAmt["+lcCheckAmt+"]lsStatus["+lsStatus+"]");
lsStr1 = "Outstanding amount exceeds limit for customer "+lsCustName;
//Changed By PriyankaC on 03June2019.[Start]
//lsStr1 = "Outstanding amount exceeds limit for customer "+lsCustName;
lsStr1 = "Outstanding amount exceeds limit for Sold to "+lsCustNameSoldTo +" Bill to "+lsCustNameBillTo ;
//Changed By PriyankaC on 03June2019.[END]
lsStr2 = " , Total O/S Amt: " + mTotOsAmt + " for division "+ lsItemSerDescr.trim() + " exceeds limit: "+ mCrLimit ;
//To show the Invoice/SO amt in credit chek fail description, Added Ruchira 21/08/2k6
if ("I".equals(asApplyTime))
......@@ -743,8 +789,10 @@ public class PostOrdCreditChk
}
//System.out.println("@@@@@ lsCrPolicy["+lsCrPolicy+"]lcCheckAmt["+lcCheckAmt+"]lsStatus["+lsStatus+"]");
lsStr1 = "Overall credit check failed for "+lsCustName;
//Changed By PriyankaC on 03June2019.[Start]
// lsStr1 = "Overall total credit check failed for "+lsCustName;
lsStr1 = "Overall total credit check failed for Sold to "+lsCustNameSoldTo +" Bill to "+lsCustNameBillTo ;
//Changed By PriyankaC on 03June2019.[END]
lsStr2 = " , Total O/S Amt over and above "+ llIgnGays +" days is " + mTotalOsAmt + " exceeds limit: "+String(mIgnCr);
//To show the Invoice/SO amt in credit chek fail description, Added Ruchira 21/08/2k6
if ("I".equals(asApplyTime))
......@@ -927,8 +975,10 @@ public class PostOrdCreditChk
}
//System.out.println("@@@@@ lsCrPolicy["+lsCrPolicy+"]lcCheckAmt["+lcCheckAmt+"]lsStatus["+lsStatus+"]");
lsStr1 = "Overall total credit check failed for "+lsCustName;
//Changed By PriyankaC on 03June2019.[Start]
// lsStr1 = "Overall total credit check failed for "+lsCustName;
lsStr1 = "Overall total credit check failed for Sold to "+lsCustNameSoldTo +" Bill to "+lsCustNameBillTo ;
////Changed By PriyankaC on 03June2019.[END]
lsStr2 = " , Total O/S Amt: "+ mTotOsAmt + " exceeds credit limit: "+ mCrLimit;
//To show the Invoice/SO amt in credit chek fail description, Added Ruchira 21/08/2k6
if ("I".equals(asApplyTime))
......@@ -1101,8 +1151,10 @@ public class PostOrdCreditChk
}
// System.out.println("@@@@@ lsCrPolicy["+lsCrPolicy+"]lcCheckAmt["+lcCheckAmt+"]lsStatus["+lsStatus+"]");
lsStr1 = lsCustName + " is on Advance Term";
//Changed By PriyankaC on 03June2019.[Start]
//lsStr1 = lsCustName + " is on Advance Term";
lsStr1 = "for Sold to "+lsCustNameSoldTo +" Bill to "+lsCustNameBillTo +" is on Advance Term";
//Changed By PriyankaC on 03June2019.[END]
lsStr2 = " , Credit Balance: "+ lcNetAdv + " is less than invoice amount: "+ adNetAmt;
//To show the Invoice/SO amt in credit chek fail description, Added Ruchira 21/08/2k6
if ("I".equals(asApplyTime))
......@@ -1273,8 +1325,10 @@ public class PostOrdCreditChk
}
//System.out.println("@@@@@ lsCrPolicy["+lsCrPolicy+"]lcCheckAmt["+lcCheckAmt+"]lsStatus["+lsStatus+"]");
lsStr1 = lsCustName + " is crossing the business limit";
//Changed By PriyankaC on 03June2019.[Start]
//lsStr1 = lsCustName + " is crossing the business limit";
lsStr1 = "for Sold to "+lsCustNameSoldTo +" Bill to "+lsCustNameBillTo + " is crossing the business limit";
//Changed By PriyankaC on 03June2019 [END]
lsStr2 = " , Sales for the month: " + lcNetAmt + " exceeds defined business limit: "+ lcBusiLimit +"*"+asItemSer;
//To show the Invoice/SO amt in credit chek fail description, Added Ruchira 21/08/2k6
if ("I".equals(asApplyTime))
......@@ -1429,8 +1483,10 @@ public class PostOrdCreditChk
}
//System.out.println("@@@@@ lsCrPolicy["+lsCrPolicy+"]lcCheckAmt["+lcCheckAmt+"]lsStatus["+lsStatus+"]");
lsStr1 = lsCustName + " is crossing the minimum invoice limit";
//Changed By PriyankaC on 03June2019. [Start].
//lsStr1 = lsCustName + " is crossing the minimum invoice limit";
lsStr1 = "for Sold to "+lsCustNameSoldTo +" Bill to "+lsCustNameBillTo+ " is crossing the minimum invoice limit";
//Changed By PriyankaC on 03June2019. [END]
lsStr2 = " , Net Invoice Amt: " + adNetAmt + " is below the minimum sales value: " + lcMinInvAmt;
//To show the Invoice/SO amt in credit chek fail description, Added Ruchira 21/08/2k6
if ("I".equals(asApplyTime))
......@@ -2658,8 +2714,10 @@ public class PostOrdCreditChk
}
//System.out.println("@@@@@ lsCrPolicy["+lsCrPolicy+"]lcCheckAmt["+lcCheckAmt+"]lsStatus["+lsStatus+"]");
lsStr1 = "Cash discount credit check failed for customer " + lsCustName;
//Changed By PriyankaC on 03June2019 [Start].
//lsStr1 = "Cash discount credit check failed for customer " + lsCustName;
lsStr1 = "Cash discount credit check failed for Sold to "+lsCustNameSoldTo +" Bill to "+lsCustNameBillTo ;
//Changed By PriyankaC on 03June2019 [END]
lsStr2 = " , Total over due O/S Amt: " + mTotOsAmt;
//To show the Invoice/SO amt in credit chek fail description, Added Ruchira 21/08/2k6
......@@ -2810,8 +2868,10 @@ public class PostOrdCreditChk
}
//System.out.println("@@@@@ lsCrPolicy["+lsCrPolicy+"]lcCheckAmt["+lcCheckAmt+"]lsStatus["+lsStatus+"]");
lsStr1 = "Advance credit check failed for customer " + lsCustName;
//Changed By PriyankaC on 03June2019 [Start].
//lsStr1 = "Advance credit check failed for customer " + lsCustName;
lsStr1 = "Advance credit check failed for Sold to "+lsCustNameSoldTo +" Bill to "+lsCustNameBillTo ;
//Changed By PriyankaC on 03June2019 [END]
lsStr2 = " , Total Advance Amt: " + mTotOsAmt + " exceeds order amount: " + lcPendOrd;
//To show the Invoice/SO amt in credit chek fail description, Added Ruchira 21/08/2k6
if ("I".equals(asApplyTime))
......
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