Commit d4988cd3 authored by mjadhav's avatar mjadhav

add cust_type as input parameter


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97475 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 111faa76
...@@ -109,7 +109,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -109,7 +109,7 @@ public class GenInvoiceSchedule implements Schedule {
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
String sql = "",retString="",finParamTranType="",filePath="",updResult=""; String sql = "",retString="",finParamTranType="",filePath="",updResult="",custTypeList="",custType="",invoiceSql="";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String siteCodeList="",siteCode="",invoiceId=""; String siteCodeList="",siteCode="",invoiceId="";
...@@ -161,16 +161,40 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -161,16 +161,40 @@ public class GenInvoiceSchedule implements Schedule {
{ {
siteCode = childNode.getFirstChild().getNodeValue(); siteCode = childNode.getFirstChild().getNodeValue();
} }
if(ctr==1)
{
custTypeList = childNode.getFirstChild().getNodeValue();
}
} }
} }
System.out.println("site code parameter "+siteCode); System.out.println("site code parameter "+siteCode);
System.out.println("custTypeList "+custTypeList);
invoiceIdList.clear(); invoiceIdList.clear();
System.out.println(">>>>>>>>>>>>>>>For Invoice.....");
String[] arrCustType =custTypeList.split(",");
System.out.println("arrCustType "+arrCustType);
int len =arrCustType.length;
System.out.println("length of suppCodeList: "+len);
for(int k =0;k<len;k++)
{
custType=arrCustType[k];
System.out.println("custType is : "+custType);
System.out.println("For Invoice.....");
//pstmt = conn.prepareStatement("SELECT INVOICE_ID FROM invoice WHERE CONFIRMED='Y' AND DOWNLOAD_FLAG ='Y' AND SITE_CODE=?"); //pstmt = conn.prepareStatement("SELECT INVOICE_ID FROM invoice WHERE CONFIRMED='Y' AND DOWNLOAD_FLAG ='Y' AND SITE_CODE=?");
pstmt = conn.prepareStatement("SELECT INVOICE_ID FROM invoice WHERE CONFIRMED='Y' AND CASE WHEN DOWNLOAD_FLAG IS NULL THEN 'N' ELSE DOWNLOAD_FLAG END='N' AND SITE_CODE=? "); //pstmt = conn.prepareStatement("SELECT INVOICE_ID FROM invoice WHERE CONFIRMED='Y' AND CASE WHEN DOWNLOAD_FLAG IS NULL THEN 'N' ELSE DOWNLOAD_FLAG END='N' AND SITE_CODE=? ");
invoiceSql=" SELECT i.INVOICE_ID FROM invoice i,customer c WHERE i.cust_code__bil=c.cust_code and i.CONFIRMED='Y' AND " +
" CASE WHEN i.DOWNLOAD_FLAG IS NULL THEN 'N' ELSE i.DOWNLOAD_FLAG END='N' AND i.SITE_CODE=? and c.cust_type=? ";
pstmt = conn.prepareStatement(invoiceSql);
pstmt.setString(1,siteCode); pstmt.setString(1,siteCode);
pstmt.setString(2,custType);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
...@@ -182,6 +206,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -182,6 +206,7 @@ public class GenInvoiceSchedule implements Schedule {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}//end of for loop
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder(); DocumentBuilder db = dbf.newDocumentBuilder();
...@@ -691,7 +716,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -691,7 +716,7 @@ public class GenInvoiceSchedule implements Schedule {
sql = "select ADDR1,ADDR2,CITY,STATE_CODE,PIN,cust_type,CUST_NAME,COUNT_CODE,CUST_CODE__BIL,TAX_REG_1,REGISTR_1,REGISTR_2,REGISTR_3 from customer where CUST_CODE=?" ; sql = "select ADDR1,ADDR2,CITY,STATE_CODE,PIN,cust_type,CUST_NAME,COUNT_CODE,CUST_CODE__BIL,REGISTR_1,REGISTR_2,REGISTR_3 from customer where CUST_CODE=?" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode); pstmt.setString(1, custCode);
...@@ -703,7 +728,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -703,7 +728,7 @@ public class GenInvoiceSchedule implements Schedule {
custCity = rs.getString("CITY"); custCity = rs.getString("CITY");
custState = rs.getString("STATE_CODE"); custState = rs.getString("STATE_CODE");
custPin = rs.getString("PIN"); custPin = rs.getString("PIN");
custTaxreg = rs.getString("TAX_REG_1"); //custTaxreg = rs.getString("TAX_REG_1");
custType = rs.getString("cust_type"); custType = rs.getString("cust_type");
custName = rs.getString("CUST_NAME"); custName = rs.getString("CUST_NAME");
custCountrtCode = rs.getString("COUNT_CODE"); custCountrtCode = rs.getString("COUNT_CODE");
...@@ -727,7 +752,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -727,7 +752,7 @@ public class GenInvoiceSchedule implements Schedule {
//select cust_name from tarodev.customer where cust_code=? //select cust_name from tarodev.customer where cust_code=?
sql = "select cust_name,ADDR1,ADDR2,ADDR3,CITY,STATE_CODE,PIN,COUNT_CODE,REGISTR_1,REGISTR_2,REGISTR_3 from customer where CUST_CODE=?" ; sql = "select cust_name,ADDR1,ADDR2,ADDR3,CITY,STATE_CODE,PIN,COUNT_CODE,REGISTR_1,REGISTR_2,REGISTR_3,TAX_REG_1 from customer where CUST_CODE=?" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCodeBill); pstmt.setString(1, custCodeBill);
...@@ -745,6 +770,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -745,6 +770,7 @@ public class GenInvoiceSchedule implements Schedule {
custBillreg_1 = rs.getString("REGISTR_1"); custBillreg_1 = rs.getString("REGISTR_1");
custBillreg_2 = rs.getString("REGISTR_2"); custBillreg_2 = rs.getString("REGISTR_2");
custBillreg_3 = rs.getString("REGISTR_3"); custBillreg_3 = rs.getString("REGISTR_3");
custTaxreg = rs.getString("TAX_REG_1");
} }
......
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