Commit 91148df2 authored by manohar's avatar manohar

bug fix multipl line sql statement with out spaces corrected


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96730 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5e503a96
...@@ -1021,8 +1021,8 @@ public class CalculateCommission ...@@ -1021,8 +1021,8 @@ public class CalculateCommission
if("SR".equalsIgnoreCase(calledFrom) ||"P".equalsIgnoreCase(commCalc)) if("SR".equalsIgnoreCase(calledFrom) ||"P".equalsIgnoreCase(commCalc))
{ {
sql = "select exch_rate from drcr_inv where tran_ser = 'CRNINV' and drcr_flag = 'C'" + sql = "select exch_rate from drcr_inv where tran_ser = 'CRNINV' and drcr_flag = 'C' " +
"and sundry_code = ? and invoice_id = ? and curr_code = ?"; " and sundry_code = ? and invoice_id = ? and curr_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, salesPers); pstmt.setString(1, salesPers);
pstmt.setString(2, invoiceId); pstmt.setString(2, invoiceId);
...@@ -1046,7 +1046,7 @@ public class CalculateCommission ...@@ -1046,7 +1046,7 @@ public class CalculateCommission
if(!"SR".equalsIgnoreCase(calledFrom) && "P".equalsIgnoreCase(commCalc)) if(!"SR".equalsIgnoreCase(calledFrom) && "P".equalsIgnoreCase(commCalc))
{ {
rcpRefser = "R-IBCA"; rcpRefser = "R-IBCA";
sql = "Select distinct h.site_code from receipt h, rcpdet d where h.tran_id = d.tran_id" + sql = "Select distinct h.site_code from receipt h, rcpdet d where h.tran_id = d.tran_id " +
"and d.ref_ser = ? and d.ref_no = ? and " + "and d.ref_ser = ? and d.ref_no = ? and " +
"(case when h.confirmed is null then 'N' else h.confirmed end) = 'Y'"; "(case when h.confirmed is null then 'N' else h.confirmed end) = 'Y'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1124,7 +1124,7 @@ public class CalculateCommission ...@@ -1124,7 +1124,7 @@ public class CalculateCommission
pstmt = null; pstmt = null;
sql = "Select distinct h.tran_id from receipt h, rcpdet d where h.tran_id = d.tran_id " + sql = "Select distinct h.tran_id from receipt h, rcpdet d where h.tran_id = d.tran_id " +
"and d.ref_ser = ? and d.ref_no = ? and (case when h.confirmed is null then 'N' else h.confirmed end) = 'Y'"; " and d.ref_ser = ? and d.ref_no = ? and (case when h.confirmed is null then 'N' else h.confirmed end) = 'Y'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, rcpRefser); pstmt.setString(1, rcpRefser);
pstmt.setString(2, invoiceNo); pstmt.setString(2, invoiceNo);
...@@ -1146,8 +1146,8 @@ public class CalculateCommission ...@@ -1146,8 +1146,8 @@ public class CalculateCommission
}else }else
{ {
sql = " Select h.exch_rate from receipt h, rcpdet d where h.tran_id = d.tran_id and d.ref_ser = ?" + sql = " Select h.exch_rate from receipt h, rcpdet d where h.tran_id = d.tran_id and d.ref_ser = ? " +
" and d.ref_no = ? and (case when h.confirmed is null then 'N' else h.confirmed end) = 'Y'" + " and d.ref_no = ? and (case when h.confirmed is null then 'N' else h.confirmed end) = 'Y' " +
"order by h.tran_date, h.tran_id desc"; "order by h.tran_date, h.tran_id desc";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, rcpRefser); pstmt.setString(1, rcpRefser);
...@@ -1263,7 +1263,7 @@ public class CalculateCommission ...@@ -1263,7 +1263,7 @@ public class CalculateCommission
else else
{ {
sql = "select sum(case when drcr_flag = 'C' then net_amt else -net_amt end) from drcr_inv, drcr_invdet " + sql = "select sum(case when drcr_flag = 'C' then net_amt else -net_amt end) from drcr_inv, drcr_invdet " +
"where drcr_inv.tran_id = drcr_invdet.tran_id and drcr_inv.invoice_id = ? and drcr_inv.sundry_code = ?" + "where drcr_inv.tran_id = drcr_invdet.tran_id and drcr_inv.invoice_id = ? and drcr_inv.sundry_code = ? " +
" and drcr_inv.curr_code = ? and (case when line_no__inv is null then 0 else line_no__inv end) = ? "; " and drcr_inv.curr_code = ? and (case when line_no__inv is null then 0 else line_no__inv end) = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,invoiceId ); pstmt.setString(1,invoiceId );
...@@ -1318,7 +1318,7 @@ public class CalculateCommission ...@@ -1318,7 +1318,7 @@ public class CalculateCommission
if(day >0 ) if(day >0 )
{ {
sql = "select fin_chg,fchg_type from crtermfc " + sql = "select fin_chg,fchg_type from crtermfc " +
"where (min_day <= ? and max_day >= ? ) and cr_term = ?"; "where (min_day <= ? and max_day >= ? ) and cr_term = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, crTerm); pstmt.setString(1, crTerm);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1427,9 +1427,9 @@ public class CalculateCommission ...@@ -1427,9 +1427,9 @@ public class CalculateCommission
autoTranId = tg.generateTranSeqID("CRNINV", "tran_id", keyString, conn); autoTranId = tg.generateTranSeqID("CRNINV", "tran_id", keyString, conn);
//ls_auto_tran_id = lds_drcr_inv_hdr.getitemstring(ll_cnt,'tran_id') //ls_auto_tran_id = lds_drcr_inv_hdr.getitemstring(ll_cnt,'tran_id')
sql = "select tran_date , curr_code , exch_rate , sundry_code , sundry_type , acct_code ," + sql = "select tran_date , curr_code , exch_rate , sundry_code , sundry_type , acct_code, " +
" cctr_code , due_date , cr_term , site_code , invoice_id , fin_entity" + " cctr_code , due_date , cr_term , site_code , invoice_id , fin_entity " +
"from drcr_inv where tran_id = ? "; " from drcr_inv where tran_id = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, autoTranId); pstmt.setString(1, autoTranId);
...@@ -1627,7 +1627,7 @@ public class CalculateCommission ...@@ -1627,7 +1627,7 @@ public class CalculateCommission
pstmt.executeUpdate(); pstmt.executeUpdate();
sql = "INSERT INTO pay_ibca_det (tran_id, ref_ser, ref_no, ref_date, curr_code, exch_rate, acct_code, cctr_code, due_date, tot_amt, discount, tax_amt," + sql = "INSERT INTO pay_ibca_det (tran_id, ref_ser, ref_no, ref_date, curr_code, exch_rate, acct_code, cctr_code, due_date, tot_amt, discount, tax_amt," +
"bank_code, ref_type, cr_term, ref_ser__org, sundry_type, sundry_code ) VALUES (?, ?, ?, ? ,?,? ,?, ?, ?, ?, ?, ? , ? , ?, ? , ? , ?, ?, ?, ? )"; " bank_code, ref_type, cr_term, ref_ser__org, sundry_type, sundry_code ) VALUES (?, ?, ?, ? ,?,? ,?, ?, ?, ?, ?, ? , ? , ?, ? , ? , ?, ?, ?, ? )";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ibcaId); pstmt.setString(1, ibcaId);
pstmt.setString(2, "CRNINV"); pstmt.setString(2, "CRNINV");
......
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