Commit df2b909e authored by ssalve's avatar ssalve

NULL check for variable stkOpt in if block of method getFromAcctDetr & getAcctDetrTtype method


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@105003 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 08dab32b
...@@ -3303,7 +3303,7 @@ public class FinCommon ...@@ -3303,7 +3303,7 @@ public class FinCommon
System.out.println("In getFromAcctDetr --> purpose :: " + purpose + " itemCode :: " + itemCode); System.out.println("In getFromAcctDetr --> purpose :: " + purpose + " itemCode :: " + itemCode);
System.out.println(" itemSer :: " + itemSer); System.out.println(" itemSer :: " + itemSer);
try try
{ {
if (purpose.equalsIgnoreCase("IN")) if (purpose.equalsIgnoreCase("IN"))
{ {
...@@ -3318,7 +3318,9 @@ public class FinCommon ...@@ -3318,7 +3318,9 @@ public class FinCommon
pstmt.close(); pstmt = null; pstmt.close(); pstmt = null;
// IF STK_OPT OF ITEM IS 'N' NO INVENTORY // IF STK_OPT OF ITEM IS 'N' NO INVENTORY
if (stkOpt.equalsIgnoreCase("0")) //changed by sarita Dtd 17-03-2017
//if (stkOpt.equalsIgnoreCase("0"))
if (stkOpt != null && stkOpt.equalsIgnoreCase("0"))
{ {
sql = " SELECT ACCT_CODE__PH,CCTR_CODE__PH FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' " sql = " SELECT ACCT_CODE__PH,CCTR_CODE__PH FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' "
+ " AND ITEM_SER = '" + itemSer + "' AND TRAN_TYPE = ' '"; + " AND ITEM_SER = '" + itemSer + "' AND TRAN_TYPE = ' '";
...@@ -3395,6 +3397,7 @@ public class FinCommon ...@@ -3395,6 +3397,7 @@ public class FinCommon
} }
} }
} }
else else
{ {
sql = " SELECT ACCT_CODE__IN,CCTR_CODE__IN FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' " sql = " SELECT ACCT_CODE__IN,CCTR_CODE__IN FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' "
...@@ -5221,7 +5224,7 @@ public class FinCommon ...@@ -5221,7 +5224,7 @@ public class FinCommon
String sql = null; String sql = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
System.out.println("In getAcctDetrTtype --> purpose :: " + purpose + " itemCode :: " + itemCode); System.out.println("In getAcctDetrTtype --> purpose :: " + purpose + " itemCode :: " + itemCode);
System.out.println(" itemSer :: " + itemSer + " tranType :: " + tranType); System.out.println(" itemSer :: " + itemSer + " tranType :: " + tranType);
try try
...@@ -5239,7 +5242,9 @@ public class FinCommon ...@@ -5239,7 +5242,9 @@ public class FinCommon
pstmt.close(); pstmt = null; pstmt.close(); pstmt = null;
// IF STK_OPT OF ITEM IS 'N' NO INVENTORY // IF STK_OPT OF ITEM IS 'N' NO INVENTORY
if (stkOpt.equalsIgnoreCase("0")) //changed by sarita Dtd 17-03-2017
//if (stkOpt.equalsIgnoreCase("0"))
if (stkOpt != null && stkOpt.equalsIgnoreCase("0"))
{ {
sql = " SELECT ACCT_CODE__PH,CCTR_CODE__PH FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' " sql = " SELECT ACCT_CODE__PH,CCTR_CODE__PH FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' "
+ " AND ITEM_SER = '" + itemSer + "' AND TRAN_TYPE = '" + tranType + "'"; + " AND ITEM_SER = '" + itemSer + "' AND TRAN_TYPE = '" + tranType + "'";
...@@ -10857,7 +10862,7 @@ public class FinCommon ...@@ -10857,7 +10862,7 @@ public class FinCommon
String sql = null; String sql = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
System.out.println("In getAcctDetrTtype --> purpose :: " + purpose + " itemCode :: " + itemCode); System.out.println("In getAcctDetrTtype --> purpose :: " + purpose + " itemCode :: " + itemCode);
System.out.println(" itemSer :: " + itemSer + " tranType :: " + tranType); System.out.println(" itemSer :: " + itemSer + " tranType :: " + tranType);
try try
......
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