Commit fcf75d6d authored by mmhatre's avatar mmhatre

cr_term_np set when enter the order type=NP

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@206411 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d82ec47e
......@@ -4542,6 +4542,10 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
String billAddr1 = "",billAddr2 = "",billAddr3 = "",billCity = "",stateCode1 = "",billPin = "",
cstNoBill = "",drugLicNo = "",drugLicNo1 = "",drugLicNo2 = "",lstNoBill = "";
//Added by mayur on 26-July-2018---[end]
//added by manish mhatre on 28-aug-2019[start]
String ordTypePrd="";
boolean ordTypeFlag = false;
//added by manish mhatre on 28-aug-2019[End]
Timestamp ldPromDate = null, ldPordDate = null, ldUdfDate1 = null, ldPorderDate = null;
Timestamp TranDateDet = null;
String dlvCity = "", state = "", countryCode = ""; // Added By PriyankaC on 27 JUNE 2017
......@@ -4881,8 +4885,25 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
{
custTaxOpt = "0";
}
//added by manish mhatre on 28-aug-2019[For set cr_term_np when enter order type ]
//start manish
ordTypePrd = distCommon.getDisparams("999999","ORD_TYPE_NEWPRD",conn);
ordTypePrd = ordTypePrd == null || ordTypePrd.trim().length()== 0 || "NULLFOUND".equalsIgnoreCase(ordTypePrd) ? " " :ordTypePrd.trim();
if (ordTypePrd.trim().length() > 0 )
{
String ordTypeArr[] = ordTypePrd.split(",");
for(int i = 0; i<ordTypeArr.length; i++)
{
if (lsOrderType.trim().equals(ordTypeArr[i].trim()))
{
ordTypeFlag=true;
}
}
}
System.out.println("Inside OrderType itemchanged..."+lsOrderType);
if (lsOrderType != null && lsOrderType.equalsIgnoreCase("NP")) {
// if (lsOrderType != null && lsOrderType.equalsIgnoreCase("NP")) { //commented by manish mhatre on 28-aug-2019
if(lsOrderType != null && ordTypeFlag) { //end manish
sql = "select cr_term__np from customer_series where cust_code =? and item_ser = ? ";
pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, lsCustCode); //changed by Pavan R on 16aug18 [to set cr_term on billto/dlvto]
......@@ -18655,6 +18676,8 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
String retVal = "";
String ordTypePrd=""; //addded by manish mhatre on 28-aug-2019
boolean ordTypeFlag = false; //addded by manish mhatre on 28-aug-2019
try {
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
......@@ -18727,7 +18750,98 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.close();
pstmt = null;
//addded by manish mhatre on 28-aug-2019 [For set cr_term_np when enter order type ]
//start manish
lsOrderType=checkNull(genericUtility.getColumnValue("order_type",dom));
ordTypePrd = distCommon.getDisparams("999999","ORD_TYPE_NEWPRD",conn);
ordTypePrd = ordTypePrd == null || ordTypePrd.trim().length()== 0 || "NULLFOUND".equalsIgnoreCase(ordTypePrd) ? " " :ordTypePrd.trim();
if (ordTypePrd.trim().length() > 0 )
{
String ordTypeArr[] = ordTypePrd.split(",");
for(int i = 0; i<ordTypeArr.length; i++)
{
if (lsOrderType.trim().equals(ordTypeArr[i].trim()))
{
ordTypeFlag=true;
}
}
}
System.out.println("Inside OrderType itemchanged..."+lsOrderType);
System.out.println("Inside OrderType itemchanged flag"+ordTypeFlag);
if(lsOrderType != null && ordTypeFlag) {
sql = "select cr_term__np from customer_series where cust_code =? and item_ser = ? ";
pstmt = conn.prepareStatement(sql);
if((crTermSource != null ) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, mbillto);
}
else if((crTermSource != null ) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
}
else
{
pstmt.setString(1, custCode);
}
pstmt.setString(2, lsItemser);
rs = pstmt.executeQuery();
if (rs.next()) {
mcrTerm = rs.getString("cr_term__np");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (mcrTerm == null || mcrTerm.trim().length() == 0) {
sql = "select cr_term__np from customer where cust_code = ? ";
pstmt = conn.prepareStatement(sql);
if((crTermSource != null ) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, mbillto);
}
else if((crTermSource != null ) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
}
else
{
pstmt.setString(1, custCode);
}
rs = pstmt.executeQuery();
if (rs.next()) {
mcrTerm = rs.getString("cr_term__np");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
else
{ //end manish
lsDisIndOrdtypeList = distCommon.getDisparams("999999", "IND_ORD_TYPE", conn);
boolean lbOrdFlag = false;
String lsDisIndOrdtypeListArr[] = lsDisIndOrdtypeList.split(",");
......@@ -18740,6 +18854,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
System.out.println("lbOrdFlag...6353["+lbOrdFlag+"]");
if (lbOrdFlag) {
sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?";
pstmt = conn.prepareStatement(sql);
......@@ -18802,6 +18917,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt = null;
}
} else {
sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?";
pstmt = conn.prepareStatement(sql);
......@@ -18855,6 +18971,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt = null;
}
}
}
if (mslpers == null || mslpers.trim().length() == 0) {
sql = "select sales_pers from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -19081,7 +19198,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
boolean lbOrdFlag=false; //added by manish mhatre on 29-aug-2019
lsTypeAllowCrLmtList = distCommon.getDisparams("999999", "TYPE_ALLOW_CR_LMT", conn);
if (lsTypeAllowCrLmtList == null || lsTypeAllowCrLmtList.trim().length() == 0
|| lsTypeAllowCrLmtList.equalsIgnoreCase("NULLFOUND")) {
......
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