Commit bb3f921a authored by pshinde's avatar pshinde

if the voucher being generated is against purchase return, not to validate duplicate bill number


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98847 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1027f182
...@@ -161,6 +161,7 @@ public class CreatePoRcpVoucher ...@@ -161,6 +161,7 @@ public class CreatePoRcpVoucher
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
System.out.println("***********************");
tranDate = rs.getTimestamp("TRAN_DATE"); tranDate = rs.getTimestamp("TRAN_DATE");
tranType = rs.getString("TRAN_TYPE"); tranType = rs.getString("TRAN_TYPE");
effectiveDate = rs.getTimestamp("EFF_DATE"); effectiveDate = rs.getTimestamp("EFF_DATE");
...@@ -190,6 +191,7 @@ public class CreatePoRcpVoucher ...@@ -190,6 +191,7 @@ public class CreatePoRcpVoucher
} }
else else
{ {
System.out.println("################");
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
...@@ -574,6 +576,14 @@ public class CreatePoRcpVoucher ...@@ -574,6 +576,14 @@ public class CreatePoRcpVoucher
//Added by Nilesh to check for duplicate bill no - 04/04/03. //Added by Nilesh to check for duplicate bill no - 04/04/03.
//*************************************************************************************** //***************************************************************************************
//from bill_no ltrim is removed by Tushar 20/03/09 //from bill_no ltrim is removed by Tushar 20/03/09
//adde condition here
if (!"P-RET".equals(tranSer))
{
System.out.println("Get invoiceNo===="+invoiceNo);
System.out.println("Get invoiceDate===="+invoiceDate);
System.out.println("Get tranId===="+tranId);
sql = "SELECT COUNT(1) FROM VOUCHER " sql = "SELECT COUNT(1) FROM VOUCHER "
+ " WHERE SUPP_CODE = ? " + " WHERE SUPP_CODE = ? "
+ " AND BILL_NO = ? " + " AND BILL_NO = ? "
...@@ -597,6 +607,7 @@ public class CreatePoRcpVoucher ...@@ -597,6 +607,7 @@ public class CreatePoRcpVoucher
//added by rajesh FI89SUN001 -23/04/2008 //added by rajesh FI89SUN001 -23/04/2008
if (count == 0) if (count == 0)
{ {
System.out.println("count == 0---------");
//from bill_no ltrim is removed by Tushar 20/03/09 //from bill_no ltrim is removed by Tushar 20/03/09
sql = "SELECT COUNT(1) FROM MISC_VOUCHER " sql = "SELECT COUNT(1) FROM MISC_VOUCHER "
+ " WHERE SUNDRY_CODE = ? " + " WHERE SUNDRY_CODE = ? "
...@@ -625,7 +636,8 @@ public class CreatePoRcpVoucher ...@@ -625,7 +636,8 @@ public class CreatePoRcpVoucher
{ {
//Check if message is defined at messages level, if not then check in messages, //Check if message is defined at messages level, if not then check in messages,
//if not in messages then return message type as 'Error'. //if not in messages then return message type as 'Error'.
sql = "SELECT MSG_TYPE FROM MESSAGES_LEVEL " sql = "SELECT MSG_TYPE FROM MESSAGES_LEVEL" +
" WHERE "
+ " PROFILE_ID = ? " // + " PROFILE_ID = ? " //
+ " AND MSG_NO = 'VTBILL1' " + " AND MSG_NO = 'VTBILL1' "
+ " AND WIN_NAME = ? " ; + " AND WIN_NAME = ? " ;
...@@ -645,7 +657,7 @@ public class CreatePoRcpVoucher ...@@ -645,7 +657,7 @@ public class CreatePoRcpVoucher
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "SELECT MSG_TYPE FROM MESSAGES " sql = "SELECT MSG_TYPE FROM MESSAGES "
+ " AND MSG_NO = 'VTBILL1' "; + " WHERE MSG_NO = 'VTBILL1' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
...@@ -666,6 +678,9 @@ public class CreatePoRcpVoucher ...@@ -666,6 +678,9 @@ public class CreatePoRcpVoucher
return errString; return errString;
} }
} }
}
//end here
//*************************************************************************************** //***************************************************************************************
// End Block // End Block
//*************************************************************************************** //***************************************************************************************
......
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