Commit 279cc5f1 authored by cpatil's avatar cpatil

remove checknull and trim() as per sugestion


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93710 ce508802-f39f-4f6c-b175-0d175dae99d5
parent daac0ae2
......@@ -134,7 +134,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
amdDateStr = checkNull(genericUtility.getColumnValue("amd_date", dom));
siteCodeOrd = checkNull(genericUtility.getColumnValue("site_code__ord", dom));
System.out.println("@@@@ amd_date["+amdDateStr+"]");
if( amdDateStr == null || amdDateStr.trim().length() == 0 )
if( amdDateStr == null || amdDateStr.length() == 0 )
{
amdDate= Timestamp.valueOf(genericUtility.getValidDateString(amdDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
errCode = this.nfCheckPeriod("PUR", amdDate, siteCodeOrd);
......@@ -152,7 +152,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom));
siteCodeOrd = checkNull(genericUtility.getColumnValue("site_code__ord", dom));
System.out.println("@@@@ purc_order["+purcOrder+"]");
if( purcOrder != null && purcOrder.trim().length() > 0 )
if( purcOrder != null && purcOrder.length() > 0 )
{
sql = " select status, confirmed from porder where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -311,7 +311,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
System.out.println("@@@@ cr_term["+crTerm+"]");
if( crTerm!= null && crTerm.trim().length() > 0 )
if( crTerm!= null && crTerm.length() > 0 )
{
errCode = isExist("crterm","cr_term",crTerm,conn);
if( "FALSE".equalsIgnoreCase(errCode ))
......@@ -341,7 +341,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
else
{
suppCurrCode = setDescription("curr_code", "supplier", "supp_code", suppCode, conn);
if( suppCurrCode != null && suppCurrCode.trim().length() > 0 )
if( suppCurrCode != null && suppCurrCode.length() > 0 )
{
sql = "select curr_code from parameter ";
pstmt = conn.prepareStatement(sql);
......@@ -371,7 +371,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
exchRate = checkNull(genericUtility.getColumnValue("exch_rate", dom));
System.out.println("@@@@ exch_rate["+exchRate+"]");
if( exchRate != null && exchRate.trim().length() > 0 )
if( exchRate != null && exchRate.length() > 0 )
{
if( Double.parseDouble(exchRate) <= 0 )
{
......@@ -393,7 +393,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
{
taxChap = checkNull(genericUtility.getColumnValue("tax_chap", dom));
System.out.println("@@@@ tax_chap["+taxChap+"]");
if( taxChap!= null && taxChap.trim().length() > 0 )
if( taxChap!= null && taxChap.length() > 0 )
{
errCode = isExist("taxchap","tax_chap",taxChap,conn);
if( "FALSE".equalsIgnoreCase(errCode ))
......@@ -409,7 +409,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
{
taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom));
System.out.println("@@@@ tax_class["+taxClass+"]");
if( taxClass!= null && taxClass.trim().length() > 0 )
if( taxClass!= null && taxClass.length() > 0 )
{
errCode = isExist("taxclass","tax_class",taxClass,conn);
if( "FALSE".equalsIgnoreCase(errCode ))
......@@ -426,7 +426,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
taxEnv = checkNull(genericUtility.getColumnValue("tax_env", dom));
amdDateStr = checkNull(genericUtility.getColumnValue("amd_date", dom));
System.out.println("@@@@ tax_env["+taxEnv+"]");
if( taxEnv!= null && taxEnv.trim().length() > 0 )
if( taxEnv!= null && taxEnv.length() > 0 )
{
errCode = isExist("taxenv","tax_env",taxEnv,conn);
if( "FALSE".equalsIgnoreCase(errCode ))
......@@ -451,7 +451,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
{
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
System.out.println("@@@@ proj_code["+projCode+"]");
if( projCode!= null && projCode.trim().length() > 0 )
if( projCode!= null && projCode.length() > 0 )
{
errCode = isExist("project","proj_code",projCode,conn);
if( "FALSE".equalsIgnoreCase(errCode ))
......@@ -467,7 +467,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
{
quotNo = checkNull(genericUtility.getColumnValue("quot_no", dom));
System.out.println("@@@@ quot_no["+quotNo+"]");
if( quotNo!= null && quotNo.trim().length() > 0 )
if( quotNo!= null && quotNo.length() > 0 )
{
sql = "select count(*) from pquot_hdr where quot_no = ? and status = 'A' ";
pstmt = conn.prepareStatement(sql);
......@@ -497,7 +497,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
siteCodeOrd = checkNull(genericUtility.getColumnValue("site_code__ord", dom));
System.out.println("@@@@ sales_pers["+salesPers+"]");
if( salesPers!= null && salesPers.trim().length() > 0 && siteCodeOrd != null && siteCodeOrd.trim().length() > 0 )
if( salesPers!= null && salesPers.length() > 0 && siteCodeOrd != null && siteCodeOrd.length() > 0 )
{
varValue = this.getEnvDis("999999","SITE_SPECIFIC_SPERS",conn);
if("Y".equalsIgnoreCase(varValue)) // mvar_value = 'Y' then
......@@ -576,7 +576,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if ( childNodeName.equalsIgnoreCase("line_no__ord"))
{
lineNoOrd = checkNull(genericUtility.getColumnValue("line_no__ord", dom));
if( lineNoOrd != null && lineNoOrd.trim().length() > 0 )
if( lineNoOrd != null && lineNoOrd.length() > 0 )
{
purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom));
lineNoOrd = " "+lineNoOrd ;
......@@ -754,10 +754,10 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("work_order") )
{
workOrder = checkNull(genericUtility.getColumnValue("work_order", dom));
if( workOrder != null && workOrder.trim().length() > 0 )
if( workOrder != null && workOrder.length() > 0 )
{
Status = setDescription("status", "workorder", "work_order", workOrder, conn);
if ( Status == null || Status.trim().length() == 0 )
if ( Status == null || Status.length() == 0 )
{
errCode = "VTWORD1";
errList.add(errCode);
......@@ -775,7 +775,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("pack_code") )
{
packCode = checkNull(genericUtility.getColumnValue("pack_code", dom));
if( packCode != null && packCode.trim().length() > 0 )
if( packCode != null && packCode.length() > 0 )
{
errCode = isExist("packing", "pack_code", packCode, conn);
if ("FALSE".equalsIgnoreCase(errCode) )
......@@ -789,10 +789,10 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("acct_code__dr") )
{
acctCodeDr = checkNull(genericUtility.getColumnValue("acct_code__dr", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
acctCodeDr = genericUtility.getColumnValue("acct_code__dr", dom);
siteCode = genericUtility.getColumnValue("site_code", dom);
System.out.println("@@@@@ acctCodeDr ["+acctCodeDr+"]");
if( acctCodeDr != null && acctCodeDr.trim().length() > 0 )
if( acctCodeDr != null && acctCodeDr.length() > 0 )
{
errCode = fincommon.isAcctCode(siteCode, acctCodeDr, modName, conn);
//errCode = this.isAcctCode(siteCode, acctCodeDr, modName);
......@@ -813,10 +813,10 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("acct_code__cr") )
{
acctCodeCr = checkNull(genericUtility.getColumnValue("acct_code__cr", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
acctCodeCr = genericUtility.getColumnValue("acct_code__cr", dom);
siteCode = genericUtility.getColumnValue("site_code", dom);
System.out.println("@@@@@ acctCodeCr ["+acctCodeCr+"]");
if( acctCodeCr != null && acctCodeCr.trim().length() > 0 )
if( acctCodeCr != null && acctCodeCr.length() > 0 )
{
//errCode = this.isAcctCode(siteCode, acctCodeCr, modName);
errCode = fincommon.isAcctCode(siteCode, acctCodeCr, modName, conn);
......@@ -836,11 +836,11 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("cctr_code__dr") )
{
cctrCodeDr = checkNull(genericUtility.getColumnValue("cctr_code__dr", dom));
cctrCodeDr = genericUtility.getColumnValue("cctr_code__dr", dom);
System.out.println("@@@@@ cctrCodeDr ["+cctrCodeDr+"]");
if( cctrCodeDr != null && cctrCodeDr.trim().length() > 0 )
if( cctrCodeDr != null && cctrCodeDr.length() > 0 )
{
acctCodeDr = checkNull(genericUtility.getColumnValue("acct_code__dr", dom));
acctCodeDr = genericUtility.getColumnValue("acct_code__dr", dom);
//errCode = this.isCctrCode(acctCodeDr, cctrCodeDr, modName);
System.out.println("@@@@@ cctrCodeDr acctCodeDr ["+acctCodeDr+"]");
errCode = fincommon.isCctrCode(acctCodeDr, cctrCodeDr, modName, conn);
......@@ -861,11 +861,11 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("cctr_code__cr") )
{
cctrCodeCr = checkNull(genericUtility.getColumnValue("cctr_code__cr", dom));
cctrCodeCr = genericUtility.getColumnValue("cctr_code__cr", dom);
System.out.println("@@@@@ cctrCodeCr ["+cctrCodeCr+"]");
if( cctrCodeCr != null && cctrCodeCr.trim().length() > 0 )
if( cctrCodeCr != null && cctrCodeCr.length() > 0 )
{
acctCodeCr = checkNull(genericUtility.getColumnValue("acct_code__cr", dom));
acctCodeCr = genericUtility.getColumnValue("acct_code__cr", dom);
//errCode = this.isCctrCode(acctCodeCr, cctrCodeCr, modName);
System.out.println("@@@@@ cctrCodeCr acctCodeCr ["+acctCodeCr+"]");
errCode = fincommon.isCctrCode(acctCodeCr, cctrCodeCr, modName, conn);
......@@ -886,10 +886,10 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("req_date") )
{
reqDateStr = checkNull(genericUtility.getColumnValue("req_date", dom));
ordDateStr = checkNull(genericUtility.getColumnValue("ord_date", dom1));
reqDateStr = genericUtility.getColumnValue("req_date", dom);
ordDateStr = genericUtility.getColumnValue("ord_date", dom1);
if (( reqDateStr != null && reqDateStr.trim().length() > 0 ) && ( ordDateStr != null && ordDateStr.trim().length() > 0 ))
if (( reqDateStr != null && reqDateStr.trim().length() > 0 ) && ( ordDateStr != null && ordDateStr.length() > 0 ))
{
reqDate= Timestamp.valueOf(genericUtility.getValidDateString(reqDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
ordDate= Timestamp.valueOf(genericUtility.getValidDateString(ordDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
......@@ -909,7 +909,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
dlvDateStr = checkNull(genericUtility.getColumnValue("dlv_date", dom));
ordDateStr = checkNull(genericUtility.getColumnValue("ord_date", dom1));
if (( dlvDateStr != null && dlvDateStr.trim().length() > 0 ) && ( ordDateStr != null && ordDateStr.trim().length() > 0 ))
if (( dlvDateStr != null && dlvDateStr.length() > 0 ) && ( ordDateStr != null && ordDateStr.length() > 0 ))
{
dlvDate= Timestamp.valueOf(genericUtility.getValidDateString(dlvDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
ordDate= Timestamp.valueOf(genericUtility.getValidDateString(ordDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
......@@ -940,7 +940,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
varValue = this.getEnvDis("999999","REGULATED_PRICE_LIST",conn);
if( varValue != null && varValue.trim().length() > 0 )
if( varValue != null && varValue.length() > 0 )
{
rate1 = discommon.pickRate(varValue, ordDateStr, itemCode, "", "L", quantityStduom, conn);
......@@ -987,7 +987,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
{
indNo = checkNull(genericUtility.getColumnValue("ind_no", dom));
if ( indNo != null && indNo.trim().length() > 0 )
if ( indNo != null && indNo.length() > 0 )
{
sql = " select case when purc_rate is null then 0 else purc_rate end ," +
"case when max_rate is null then 0 else max_rate end " +
......@@ -1023,7 +1023,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("tax_class") )
{
taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom));
if( taxClass != null && taxClass.trim().length() > 0 )
if( taxClass != null && taxClass.length() > 0 )
{
errCode = isExist("taxclass", "tax_class", taxClass, conn);
if ( "FALSE".equalsIgnoreCase(errCode) )
......@@ -1039,7 +1039,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("tax_chap") )
{
taxChap = checkNull(genericUtility.getColumnValue("tax_chap", dom));
if( taxChap != null && taxChap.trim().length() > 0 )
if( taxChap != null && taxChap.length() > 0 )
{
errCode = isExist("taxchap", "tax_chap", taxChap, conn);
if ( "FALSE".equalsIgnoreCase(errCode) )
......@@ -1058,7 +1058,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
taxEnv = checkNull(genericUtility.getColumnValue("tax_env", dom));
amdDateStr = checkNull(genericUtility.getColumnValue("amd_date", dom));
if( taxEnv != null && taxEnv.trim().length() > 0 )
if( taxEnv != null && taxEnv.length() > 0 )
{
errCode = isExist("taxenv", "tax_env", taxEnv, conn);
if ( "FALSE".equalsIgnoreCase(errCode) )
......@@ -1105,7 +1105,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
convQtyStduom = convQtyStduomStr== null? 0:Double.parseDouble(convQtyStduomStr);
if( unitStd == null || unitStd.trim().length() == 0 )
if( unitStd == null || unitStd.length() == 0 )
{
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
unit = setDescription("unit", "item", "item_code", itemCode, conn);
......@@ -1140,7 +1140,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
convRtuomStduom = convRtuomStduomStr== null? 0:Double.parseDouble(convRtuomStduomStr);
if( unitStd == null || unitStd.trim().length() == 0 )
if( unitStd == null || unitStd.length() == 0 )
{
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
unit = setDescription("unit", "item", "item_code", itemCode, conn);
......@@ -1187,7 +1187,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
}
else
{
if ( indNo != null && indNo.trim().length() > 0 && (!"null".equalsIgnoreCase(indNo)))
if ( indNo != null && indNo.length() > 0 && (!"null".equalsIgnoreCase(indNo)))
{
sql = " select (case when quantity__stduom is null then 0 else quantity__stduom end) " +
" from indent where ind_no = ? ";
......@@ -1224,7 +1224,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
System.out.println("@@@@@tempindno["+tempindno+"]::templinenoord["+templinenoord+"]::templineno["+templineno+"]");
// if indent no is empty then skip the row
if (templinenoord != null && templinenoord.trim().length() > 0 )
if (templinenoord != null && templinenoord.length() > 0 )
{
linenoords.add(linenoords.size() , templinenoord );
}
......@@ -1403,7 +1403,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if("Y".equalsIgnoreCase(eou))
{
if( dutyPaid == null || dutyPaid.trim().length()==0 )
if( dutyPaid == null || dutyPaid.length()==0 )
{
errCode = "VTDUTYBK";
errList.add(errCode);
......@@ -1542,13 +1542,13 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
}
else if ( cnt == 0 ) //Means New Order Line
{
if ( "Y".equalsIgnoreCase(dutyPaid) && ( formNo != null && formNo.trim().length() > 0 ) )
if ( "Y".equalsIgnoreCase(dutyPaid) && ( formNo != null && formNo.length() > 0 ) )
{
errCode ="VTCT3DUTY"; // Has to be Blank
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if ("N".equalsIgnoreCase(dutyPaid) && ( formNo != null && formNo.trim().length() > 0 ) )
else if ("N".equalsIgnoreCase(dutyPaid) && ( formNo != null && formNo.length() > 0 ) )
{
sql = " select sum(case when b.quantity is null then 0 else b.quantity end) - sum(case when b.dlv_qty is null then 0 else b.dlv_qty end) " +
......@@ -1576,7 +1576,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
formNoTemp = genericUtility.getColumnValueFromNode( "form_no", detail2List.item(ctr1) );
lineNoTemp = genericUtility.getColumnValueFromNode( "line_no", detail2List.item(ctr1) );
if( amdNo.equalsIgnoreCase(amdNoTemp) && formNo.equalsIgnoreCase(formNoTemp) && ( lineNoBrow==null || lineNoBrow.trim().length()==0) && (!(lineNo == lineNoTemp )))
if( amdNo.equalsIgnoreCase(amdNoTemp) && formNo.equalsIgnoreCase(formNoTemp) && ( lineNoBrow==null || lineNoBrow.length()==0) && (!(lineNo == lineNoTemp )))
{
quantitybrow = genericUtility.getColumnValueFromNode( "quantity", detail2List.item(ctr1) );
qtybrow = quantitybrow==null?0:Double.parseDouble(quantitybrow);
......@@ -1653,7 +1653,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
{
lineNoOrd = checkNull(genericUtility.getColumnValue("line_no_ord", dom));
System.out.println("@@@@@1lineNoOrd["+lineNoOrd+"]");
if ( lineNoOrd != null && lineNoOrd.trim().length() > 0 )
if ( lineNoOrd != null && lineNoOrd.length() > 0 )
{
purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom));
System.out.println("@@@@@2purcOrder["+purcOrder+"]");
......@@ -1695,7 +1695,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
{
lineNoOrd = checkNull(genericUtility.getColumnValue("line_no_ord", dom));
System.out.println("@@@@@4lineNoOrd["+lineNoOrd+"]");
if ( lineNoOrd == null || lineNoOrd.trim().length() == 0 )
if ( lineNoOrd == null || lineNoOrd.length() == 0 )
{
purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom));
System.out.println("@@@@@5purcOrder["+purcOrder+"]");
......@@ -1925,7 +1925,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
//isnull(ld_mastfact) then ld_mastfact = 0
if( variencetype == null || variencetype.trim().length() == 0 )
if( variencetype == null || variencetype.length() == 0 )
{
variencetype="";
}
......@@ -2397,7 +2397,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
valueXmlString.append("<ref_date>").append("<![CDATA["+refDateStr+"]]>").append("</ref_date>");
valueXmlString.append("<ref_date__o>").append("<![CDATA["+refDateStr+"]]>").append("</ref_date__o>");
if ( suppCode!= null && suppCode.trim().length() > 0 )
if ( suppCode!= null && suppCode.length() > 0 )
{
sql = "select supp_name, addr1, addr2, city, stan_code from supplier where supp_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -3699,10 +3699,12 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
private String checkNull(String input)
{
/*
if(input == null)
{
input = "";
}
*/
return input;
}
......
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