Commit 5385839a authored by prane's avatar prane

to set tax_env from supplier if not found in site_supplier and fix the bracket...

to set tax_env from supplier if not found in site_supplier and fix the bracket issue on bill_no validation

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@184784 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d3864eb8
......@@ -2141,77 +2141,77 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
rs = null;
pstmt.close();
pstmt = null;
}
}
if(cnt == 0)
{
if(billDate != null && billDate.trim().length() > 0)
{
sql = "SELECT COUNT(1) FROM misc_voucher WHERE sundry_code = ? and bill_no = ? and bill_date = ? and tran_id != ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCode);
pstmt.setString(2,billNo);
pstmt.setTimestamp(3,Timestamp.valueOf(dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()+ " 00:00:00.0"));
pstmt.setString(4,tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else
{
sql = "SELECT COUNT(1) FROM misc_voucher WHERE sundry_code = ? and bill_no = ? and sundry_type = ? and tran_id != ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCode);
pstmt.setString(2,billNo);
pstmt.setString(3,sundryType);
pstmt.setString(4,tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(cnt != 0)
{
errCode = "VTBILL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
}
if(cnt == 0)
{
if(billDate != null && billDate.trim().length() > 0)
{
sql = "SELECT COUNT(*) FROM porcp WHERE supp_code = ? and invoice_no = ? and invoice_date = ? ";
sql = "SELECT COUNT(1) FROM misc_voucher WHERE sundry_code = ? and bill_no = ? and bill_date = ? and tran_id != ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCodeFor);
pstmt.setString(1,sundryCode);
pstmt.setString(2,billNo);
pstmt.setTimestamp(3,Timestamp.valueOf(dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()+ " 00:00:00.0"));
pstmt.setString(4,tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
if(cnt != 0)
{
errCode = "VTBILL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else
{
sql = "SELECT COUNT(1) FROM misc_voucher WHERE sundry_code = ? and bill_no = ? and sundry_type = ? and tran_id != ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCode);
pstmt.setString(2,billNo);
pstmt.setString(3,sundryType);
pstmt.setString(4,tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(cnt != 0)
{
errCode = "VTBILL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
if(billDate != null && billDate.trim().length() > 0)
{
sql = "SELECT COUNT(*) FROM porcp WHERE supp_code = ? and invoice_no = ? and invoice_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCodeFor);
pstmt.setString(2,billNo);
pstmt.setTimestamp(3,Timestamp.valueOf(dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()+ " 00:00:00.0"));
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
if(cnt != 0)
{
errCode = "VTBILL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
}
}
}
......@@ -3275,7 +3275,13 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
stanCode = findValue(conn, "stan_code" , "supplier", "supp_code", sundryCode);
taxClass = findValue(conn, "tax_class" , "supplier", "supp_code", sundryCode);
taxChap = findValue(conn, "tax_chap" , "supplier", "supp_code", sundryCode);
taxEnv = findValue(conn, "tax_env" , "supplier", "supp_code", sundryCode);
//Added by Pavan R [to set tax_env from supplier if not found in site_supplier]
taxEnv = findValue(conn, "tax_env", "site_supplier", "site_code", "supp_code", siteCode, sundryCode);
if(taxEnv == null || taxEnv.trim().length() == 0 || "null".equals(taxEnv))
{
taxEnv = findValue(conn, "tax_env" , "supplier", "supp_code", sundryCode);
}
//Added by Pavan R end
descrType = findValue(conn, "supp_type" , "supplier", "supp_code", sundryCode);
payMode = findValue(conn, "pay_mode" , "supplier", "supp_code", sundryCode);
crTerm = findValue(conn, "cr_term" , "site_supplier", "supp_code", "site_code", sundryCode, siteCode);
......
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