Commit 00311eb8 authored by nkhan's avatar nkhan

*** empty log message ***


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104334 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8d8a9d45
...@@ -23,7 +23,7 @@ public class CustomerDetails extends ValidatorEJB ...@@ -23,7 +23,7 @@ public class CustomerDetails extends ValidatorEJB
try try
{ {
conn = getConnection(); conn = getConnection();
sql = "SELECT CUSTOMER.CUST_NAME , CUSTOMER.CURR_CODE,(SELECT COUNT(*) FROM SORDER WHERE CUST_CODE = ? AND ORDER_DATE <= SYSDATE) AS TOTAL_ORDER_TILL_DATE, " /*sql = "SELECT CUSTOMER.CUST_NAME , CUSTOMER.CURR_CODE,(SELECT COUNT(*) FROM SORDER WHERE CUST_CODE = ? AND ORDER_DATE <= SYSDATE) AS TOTAL_ORDER_TILL_DATE, "
+ " CONTACT.TELE1 AS CONTACT, CONTACT.NAME AS CONTACT_NAME, CONTACT.EMAIL_ADDR , " + " CONTACT.TELE1 AS CONTACT, CONTACT.NAME AS CONTACT_NAME, CONTACT.EMAIL_ADDR , "
+ " (SELECT COUNT(*) FROM SORDER SORDER, DESPATCH DESPATCH WHERE SORDER.CUST_CODE = ? AND SORDER.STATUS NOT IN ('C','X','H') " + " (SELECT COUNT(*) FROM SORDER SORDER, DESPATCH DESPATCH WHERE SORDER.CUST_CODE = ? AND SORDER.STATUS NOT IN ('C','X','H') "
+ " AND DESPATCH.SORD_NO = SORDER.SALE_ORDER AND DESPATCH.CONFIRMED = 'N') AS OPENORDERS, CUSTOMER.CUST_PRIORITY AS RANK, " + " AND DESPATCH.SORD_NO = SORDER.SALE_ORDER AND DESPATCH.CONFIRMED = 'N') AS OPENORDERS, CUSTOMER.CUST_PRIORITY AS RANK, "
...@@ -34,12 +34,63 @@ public class CustomerDetails extends ValidatorEJB ...@@ -34,12 +34,63 @@ public class CustomerDetails extends ValidatorEJB
+ " AND CUSTOMER.CR_TERM = CRTERM.CR_TERM(+) " + " AND CUSTOMER.CR_TERM = CRTERM.CR_TERM(+) "
+ " AND CUSTOMER.DLV_TERM = DELIVERY_TERM.DLV_TERM(+) " + " AND CUSTOMER.DLV_TERM = DELIVERY_TERM.DLV_TERM(+) "
+ " AND SALES_PERS.SALES_PERS = CUSTOMER.SALES_PERS(+) " + " AND SALES_PERS.SALES_PERS = CUSTOMER.SALES_PERS(+) "
+ " AND CUSTOMER.CUST_CODE = ? " ; + " AND CUSTOMER.CUST_CODE = ? " ;*/
sql="SELECT CUSTOMER.CUST_NAME , " +
" CUSTOMER.CURR_CODE, " +
" (SELECT COUNT(*) " +
" FROM SORDER " +
" WHERE CUST_CODE = ? " +
" AND ORDER_DATE <= SYSDATE " +
" ) AS TOTAL_ORDER_TILL_DATE, " +
" CONTACT.TELE1 AS CONTACT, " +
" CONTACT.NAME AS CONTACT_NAME, " +
" CONTACT.EMAIL_ADDR , " +
" (SELECT COUNT(*) " +
" FROM SORDER SORDER, " +
" DESPATCH DESPATCH " +
" WHERE SORDER.CUST_CODE = ? " +
" AND SORDER.STATUS NOT IN ('C','X','H') " +
" AND DESPATCH.SORD_NO = SORDER.SALE_ORDER " +
" AND DESPATCH.CONFIRMED = 'N' " +
" ) AS OPENORDERS, " +
" CUSTOMER.CUST_PRIORITY AS RANK, " +
" CASE " +
" WHEN CRTERM.DESCR IS NULL " +
" THEN CUSTOMER.CR_TERM " +
" ELSE CRTERM.DESCR " +
" END AS CRTERM_DESC , " +
" CASE " +
" WHEN DELIVERY_TERM.DESCR IS NULL " +
" THEN CUSTOMER.DLV_TERM " +
" ELSE DELIVERY_TERM.DESCR " +
" END AS DLVTERM_DESC, " +
" SALES_PERS.SP_NAME , " +
" SALES_PERS.EMAIL_ADDR AS SALES_EMAIL, " +
" CUSTOMER.BLACK_LISTED, " +
" CUSTOMER.BLACK_LISTED_DATE, " +
" (SELECT FN_OUVERDUE_CHECK(?) FROM DUAL " +
" ) AS DUE_AMOUNT_TILL_DATE, " +
" CUSTOMER.CREDIT_LMT, " +
" CUSTOMER.WAVE_TYPE, " +
" (SELECT FN_PAYAMT_CHECK(?) FROM DUAL " +
" ) AS PAY_AMOUNT " +
" FROM CUSTOMER CUSTOMER, " +
" CONTACT CONTACT , " +
" CRTERM CRTERM, " +
" DELIVERY_TERM DELIVERY_TERM, " +
" SALES_PERS SALES_PERS " +
" WHERE CUSTOMER.CONTACT_CODE = CONTACT.CONTACT_CODE " +
" AND CUSTOMER.CR_TERM = CRTERM.CR_TERM(+) " +
" AND CUSTOMER.DLV_TERM = DELIVERY_TERM.DLV_TERM(+) " +
" AND SALES_PERS.SALES_PERS = CUSTOMER.SALES_PERS(+) " +
" AND CUSTOMER.CUST_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, checkNull(custCode)); pstmt.setString(1, checkNull(custCode));
pstmt.setString(2, checkNull(custCode)); pstmt.setString(2, checkNull(custCode));
pstmt.setString(3, checkNull(custCode)); pstmt.setString(3, checkNull(custCode));
pstmt.setString(4, checkNull(custCode)); pstmt.setString(4, checkNull(custCode));
pstmt.setString(5, checkNull(custCode));
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if ( rs.next()) if ( rs.next())
{ {
...@@ -62,6 +113,7 @@ public class CustomerDetails extends ValidatorEJB ...@@ -62,6 +113,7 @@ public class CustomerDetails extends ValidatorEJB
custList.add(checkNull(rs.getString("CREDIT_LMT"))); custList.add(checkNull(rs.getString("CREDIT_LMT")));
custList.add(checkNull(rs.getString("CONTACT_NAME"))); custList.add(checkNull(rs.getString("CONTACT_NAME")));
custList.add(checkNull(rs.getString("WAVE_TYPE"))); custList.add(checkNull(rs.getString("WAVE_TYPE")));
custList.add(checkNull(rs.getString("PAY_AMOUNT")));
isExists = true; isExists = true;
} }
if(!isExists) if(!isExists)
...@@ -83,7 +135,7 @@ public class CustomerDetails extends ValidatorEJB ...@@ -83,7 +135,7 @@ public class CustomerDetails extends ValidatorEJB
custList.add(""); custList.add("");
custList.add(""); custList.add("");
custList.add(""); custList.add("");
custList.add("");
} }
if (rs != null) if (rs != null)
{ {
......
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