Commit 5b529f48 authored by vkadam's avatar vkadam

Add validation for line_no__ord==0 and update two fields while confirm.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96849 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7269eeaf
...@@ -534,7 +534,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -534,7 +534,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
{ {
System.out.println("@@@@@@ inside cnt " + cnt); System.out.println("@@@@@@ inside cnt " + cnt);
sql1 = " select purc_order,line_no__ord,site_code,ind_no,item_code,quantity,rate,tax_amt,tot_amt,req_date," + " conv__qty_stduom,conv__rtuom_stduom,quantity__stduom,rate__stduom,line_no,unit,discount," + " discount_type,tax_class,tax_chap,tax_env,remarks,work_order,pack_code,pack_instr,acct_code__dr," + " cctr_code__dr,acct_code__cr,cctr_code__cr,no_art,unit__std,unit__rate,dlv_date,loc_code,status," + " specific_instr,supp_code_mnfr,rate__clg,special_instr,benefit_type,licence_no,duty_paid,form_no" + " from poamd_det where amd_no = ? "; sql1 = " select purc_order,line_no__ord,site_code,ind_no,item_code,quantity,rate,tax_amt,tot_amt,req_date,"
+ " conv__qty_stduom,conv__rtuom_stduom,quantity__stduom,rate__stduom,line_no,unit,discount,"
+ " discount_type,tax_class,tax_chap,tax_env,remarks,work_order,pack_code,pack_instr,acct_code__dr,"
+ " cctr_code__dr,acct_code__cr,cctr_code__cr,no_art,unit__std,unit__rate,dlv_date,loc_code,status,"
+ " specific_instr,supp_code_mnfr,rate__clg,special_instr,benefit_type,licence_no,duty_paid,form_no"
+ " from poamd_det where amd_no = ? ";
pstmt1 = conn.prepareStatement(sql1); pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, amdNo); pstmt1.setString(1, amdNo);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
...@@ -677,7 +682,13 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -677,7 +682,13 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
errCode = itmDBAccessLocal.getErrorString("", errCode, ""); errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode; return errCode;
} }
sql = " update porddet set site_code = ?,quantity = ?,rate = ?,tax_amt = ?,tot_amt = ?," + " remarks = ?, discount_type = ?,discount = ?,req_date = ?,conv__qty_stduom = ?," + " conv__rtuom_stduom = ?,quantity__stduom = ?,rate__stduom = ?,tax_class = ?," + " tax_chap = ?, tax_env= ?,status = ?,status_date = ?, pack_instr = ?, specific_instr= ?," + " supp_code__mnfr = ?,rate__clg = ?,special_instr = ?,dlv_date = ?,benefit_type = ?," + " licence_no = ? where purc_order = ? and line_no = ? "; sql = " update porddet set site_code = ?,quantity = ?,rate = ?,tax_amt = ?,tot_amt = ?,"
+ " remarks = ?, discount_type = ?,discount = ?,req_date = ?,conv__qty_stduom = ?,"
+ " conv__rtuom_stduom = ?,quantity__stduom = ?,rate__stduom = ?,tax_class = ?,"
+ " tax_chap = ?, tax_env= ?,status = ?,status_date = ?, pack_instr = ?, specific_instr= ?,"
+ " supp_code__mnfr = ?,rate__clg = ?,special_instr = ?,dlv_date = ?,benefit_type = ?,"
+ " licence_no = ?,acct_code__ap_adv=?,cctr_code__ap_adv=?"
+ " where purc_order = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode); pstmt.setString(1, siteCode);
pstmt.setDouble(2, quantity); pstmt.setDouble(2, quantity);
...@@ -711,8 +722,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -711,8 +722,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
pstmt.setTimestamp(24, dlvDate); pstmt.setTimestamp(24, dlvDate);
pstmt.setString(25, benefitType); pstmt.setString(25, benefitType);
pstmt.setString(26, licenceNo); pstmt.setString(26, licenceNo);
pstmt.setString(27, purcOrder); pstmt.setString(27, acctCodeApAdv);
pstmt.setString(28, lineNoOrd); pstmt.setString(28, cctrCodeApAdv);
pstmt.setString(29, purcOrder);
pstmt.setString(30, lineNoOrd);
updCnt = pstmt.executeUpdate(); updCnt = pstmt.executeUpdate();
pstmt.close(); pstmt.close();
...@@ -736,7 +751,8 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -736,7 +751,8 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
lineNo = " " + lineNo; lineNo = " " + lineNo;
lineNo = lineNo.substring(lineNo.length() - 3, lineNo.length()); lineNo = lineNo.substring(lineNo.length() - 3, lineNo.length());
sql = " select count(*) from taxtran where tran_code = 'P-AMD'" + " and tran_id = ? and line_no = ? and taxable_amt <> 0 and tax_amt <> 0 "; sql = " select count(*) from taxtran where tran_code = 'P-AMD'"
+ " and tran_id = ? and line_no = ? and taxable_amt <> 0 and tax_amt <> 0 ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo); pstmt.setString(1, amdNo);
pstmt.setString(2, lineNo); pstmt.setString(2, lineNo);
...@@ -778,7 +794,11 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -778,7 +794,11 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
* System.out.println("@@@@1 cnt2["+cnt2+"]") * System.out.println("@@@@1 cnt2["+cnt2+"]")
* ; * ;
*//**/ *//**/
sql = " select line_no__tax,tax_code," + " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect," + " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to," + " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax " + " from taxtran where tran_code = ? and tran_id = ? and line_no = ? "; sql = " select line_no__tax,tax_code,"
+ " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,"
+ " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to,"
+ " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax "
+ " from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-AMD"); pstmt.setString(1, "P-AMD");
pstmt.setString(2, amdNo); pstmt.setString(2, amdNo);
...@@ -818,7 +838,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -818,7 +838,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
payTax = rs.getString("pay_tax"); payTax = rs.getString("pay_tax");
/** Insert taxtran rows */ /** Insert taxtran rows */
sql4 = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class," + " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , " + " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code," + " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term," + " posted,tax_form_date,pay_tax) " + " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) "; sql4 = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
+ " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
+ " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
+ " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
+ " posted,tax_form_date,pay_tax) "
+ " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
pstmt4 = conn.prepareStatement(sql4); pstmt4 = conn.prepareStatement(sql4);
pstmt4.setString(1, "P-ORD"); pstmt4.setString(1, "P-ORD");
pstmt4.setString(2, purcOrder); pstmt4.setString(2, purcOrder);
...@@ -944,8 +969,10 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -944,8 +969,10 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
+ " tax_class,tax_chap,tax_env,remarks,work_order,unit__rate,conv__qty_stduom,conv__rtuom_stduom," + " tax_class,tax_chap,tax_env,remarks,work_order,unit__rate,conv__qty_stduom,conv__rtuom_stduom,"
+ " unit__std,quantity__stduom,rate__stduom,pack_code,no_art,pack_instr,acct_code__dr," + " unit__std,quantity__stduom,rate__stduom,pack_code,no_art,pack_instr,acct_code__dr,"
+ " cctr_code__dr,acct_code__cr,cctr_code__cr,discount_type,supp_code__mnfr,order_opt,bom_code," + " cctr_code__dr,acct_code__cr,cctr_code__cr,discount_type,supp_code__mnfr,order_opt,bom_code,"
+ " specific_instr,rate__clg,special_instr,benefit_type,licence_no,duty_paid,form_no) " + " specific_instr,rate__clg,special_instr,benefit_type,licence_no,duty_paid,form_no,"
+ " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) "; + "acct_code__ap_adv,cctr_code__ap_adv) "
+ " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder); // v pstmt.setString(1, purcOrder); // v
...@@ -1008,6 +1035,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1008,6 +1035,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
pstmt.setString(44, licenceNo); // licence_no pstmt.setString(44, licenceNo); // licence_no
pstmt.setString(45, dutyPaid); // duty_paid pstmt.setString(45, dutyPaid); // duty_paid
pstmt.setString(46, formNo); // form_no pstmt.setString(46, formNo); // form_no
pstmt.setString(47, acctCodeApAdv);// Add column for
// insert VALLABH
// KADAM 19/NOV/14
pstmt.setString(48, cctrCodeApAdv);// Add column for
// insert VALLABH
// KADAM 19/NOV/14
cnt = pstmt.executeUpdate(); cnt = pstmt.executeUpdate();
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
...@@ -1034,7 +1067,11 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1034,7 +1067,11 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
* null; System.out.println("@@@@2 cnt["+cnt+"]"); * null; System.out.println("@@@@2 cnt["+cnt+"]");
*/ */
/**/{ /**/{
sql = " select line_no__tax,tax_code," + " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect," + " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to," + " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax " + " from taxtran where tran_code = 'P-AMD' and tran_id = ? and line_no = ? "; sql = " select line_no__tax,tax_code,"
+ " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,"
+ " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to,"
+ " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax "
+ " from taxtran where tran_code = 'P-AMD' and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo); pstmt.setString(1, amdNo);
pstmt.setString(2, lineNo); pstmt.setString(2, lineNo);
...@@ -1073,7 +1110,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1073,7 +1110,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
payTax = rs.getString("pay_tax"); payTax = rs.getString("pay_tax");
/** Insert taxtran rows */ /** Insert taxtran rows */
sql4 = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class," + " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , " + " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code," + " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term," + " posted,tax_form_date,pay_tax) " + " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) "; sql4 = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
+ " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
+ " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
+ " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
+ " posted,tax_form_date,pay_tax) "
+ " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
pstmt4 = conn.prepareStatement(sql4); pstmt4 = conn.prepareStatement(sql4);
pstmt4.setString(1, "P-ORD"); pstmt4.setString(1, "P-ORD");
pstmt4.setString(2, purcOrder); pstmt4.setString(2, purcOrder);
...@@ -1228,7 +1270,11 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1228,7 +1270,11 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
// VALLABH // VALLABH
// KADAM // KADAM
// 19/NOV/14 // 19/NOV/14
+ " values ( " + "?,?,?,?,?,?,?,?,?,?," + "?,?,?,?,?,?,?,?,?,?," + "?,?,?,?,?,?,?,?,?,?," + "?,?,?,?,?,?,?,?,?,?," + "?,?,?,?,?,?,?,? ) "; + " values ( " + "?,?,?,?,?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?,? ) ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder); pstmt.setString(1, purcOrder);
...@@ -1290,7 +1336,8 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1290,7 +1336,8 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) // if (cnt == 0)
if (cnt > 0) //Change condtion from if (cnt == 0) to if (cnt > 0) VALLABH KADAM 20/NOV/14
{ {
/* /*
* sql = * sql =
...@@ -1313,13 +1360,18 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1313,13 +1360,18 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
* pstmt.executeUpdate(); pstmt.close(); pstmt = * pstmt.executeUpdate(); pstmt.close(); pstmt =
* null; System.out.println("@@@@3 cnt["+cnt+"]"); * null; System.out.println("@@@@3 cnt["+cnt+"]");
*//**/ *//**/
sql = " select line_no__tax,tax_code," + " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect," + " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to," + " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax " + " from taxtran where tran_code = ? and tran_id = ? and line_no = ? "; sql = " select line_no__tax,tax_code,"
+ " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,"
+ " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to,"
+ " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax "
+ " from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-AMD"); pstmt.setString(1, "P-AMD");
pstmt.setString(2, amdNo); pstmt.setString(2, amdNo);
pstmt.setString(3, lineNo); pstmt.setString(3, lineNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) // if (rs.next())
while (rs.next()) // Change from if to while VALLABH KADAM 19/NOV/14
{ {
lineNoTax = rs.getString("line_no__tax"); lineNoTax = rs.getString("line_no__tax");
taxCode = rs.getString("tax_code"); taxCode = rs.getString("tax_code");
...@@ -1349,6 +1401,56 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1349,6 +1401,56 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
posted = rs.getString("posted"); posted = rs.getString("posted");
taxFormDate = rs.getTimestamp("tax_form_date"); taxFormDate = rs.getTimestamp("tax_form_date");
payTax = rs.getString("pay_tax"); payTax = rs.getString("pay_tax");
/** Insert tax tran row */
sql4 = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
+ " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
+ " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
+ " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
+ " posted,tax_form_date,pay_tax) "
+ " values ("
+ " ?,?,?,?,?,?,?,?,?,?,"
+ " ?,?,?,?,?,?,?,?,?,?,"
+ " ?,?,?,?,?,?,?,?,?,?,"
+ " ? ) ";
pstmt4 = conn.prepareStatement(sql4);
pstmt4.setString(1, "P-ORD");
pstmt4.setString(2, purcOrder);
pstmt4.setString(3, lineNoOrd); // lineNo change by
// cpatil on 17/10/13
pstmt4.setString(4, lineNoTax);
pstmt4.setString(5, taxCode);
pstmt4.setString(6, taxClass);
pstmt4.setString(7, taxChap);
pstmt4.setString(8, taxBase);
pstmt4.setString(9, taxEnv);
pstmt4.setDouble(10, taxableAmt);
pstmt4.setString(11, taxPerc);
pstmt4.setDouble(12, taxAmt);
pstmt4.setString(13, chgStat);
pstmt4.setString(14, taxSet);
pstmt4.setString(15, effect);
pstmt4.setString(16, acctCodeReco);
pstmt4.setString(17, cctrCodeReco);
pstmt4.setString(18, recoPerc);
pstmt4.setDouble(19, recoAmont);
pstmt4.setString(20, acctCode);
pstmt4.setString(21, cctrCode);
pstmt4.setString(22, rateType);
pstmt4.setString(23, round);
pstmt4.setString(24, roundTo);
pstmt4.setString(25, taxForm);
pstmt4.setTimestamp(26, chgDate);
pstmt4.setString(27, chgUser);
pstmt4.setString(28, chgTerm);
pstmt4.setString(29, posted);
pstmt4.setTimestamp(30, taxFormDate);
pstmt4.setString(31, payTax);
cnt = pstmt4.executeUpdate();
pstmt4.close();
pstmt4 = null;
/** Insert tax tran row END */
} }
rs.close(); rs.close();
...@@ -1356,44 +1458,53 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1356,44 +1458,53 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class," + " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , " + " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code," + " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term," + " posted,tax_form_date,pay_tax) " + " values (" + " ?,?,?,?,?,?,?,?,?,?," + " ?,?,?,?,?,?,?,?,?,?," + " ?,?,?,?,?,?,?,?,?,?," + " ? ) "; // sql = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
pstmt = conn.prepareStatement(sql); // + " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
pstmt.setString(1, "P-ORD"); // + " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
pstmt.setString(2, purcOrder); // + " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
pstmt.setString(3, lineNoOrd); // lineNo change by // + " posted,tax_form_date,pay_tax) "
// cpatil on 17/10/13 // + " values ("
pstmt.setString(4, lineNoTax); // + " ?,?,?,?,?,?,?,?,?,?,"
pstmt.setString(5, taxCode); // + " ?,?,?,?,?,?,?,?,?,?,"
pstmt.setString(6, taxClass); // + " ?,?,?,?,?,?,?,?,?,?,"
pstmt.setString(7, taxChap); // + " ? ) ";
pstmt.setString(8, taxBase); // pstmt = conn.prepareStatement(sql);
pstmt.setString(9, taxEnv); // pstmt.setString(1, "P-ORD");
pstmt.setDouble(10, taxableAmt); // pstmt.setString(2, purcOrder);
pstmt.setString(11, taxPerc); // pstmt.setString(3, lineNoOrd); // lineNo change by
pstmt.setDouble(12, taxAmt); // // cpatil on 17/10/13
pstmt.setString(13, chgStat); // pstmt.setString(4, lineNoTax);
pstmt.setString(14, taxSet); // pstmt.setString(5, taxCode);
pstmt.setString(15, effect); // pstmt.setString(6, taxClass);
pstmt.setString(16, acctCodeReco); // pstmt.setString(7, taxChap);
pstmt.setString(17, cctrCodeReco); // pstmt.setString(8, taxBase);
pstmt.setString(18, recoPerc); // pstmt.setString(9, taxEnv);
pstmt.setDouble(19, recoAmont); // pstmt.setDouble(10, taxableAmt);
pstmt.setString(20, acctCode); // pstmt.setString(11, taxPerc);
pstmt.setString(21, cctrCode); // pstmt.setDouble(12, taxAmt);
pstmt.setString(22, rateType); // pstmt.setString(13, chgStat);
pstmt.setString(23, round); // pstmt.setString(14, taxSet);
pstmt.setString(24, roundTo); // pstmt.setString(15, effect);
pstmt.setString(25, taxForm); // pstmt.setString(16, acctCodeReco);
pstmt.setTimestamp(26, chgDate); // pstmt.setString(17, cctrCodeReco);
pstmt.setString(27, chgUser); // pstmt.setString(18, recoPerc);
pstmt.setString(28, chgTerm); // pstmt.setDouble(19, recoAmont);
pstmt.setString(29, posted); // pstmt.setString(20, acctCode);
pstmt.setTimestamp(30, taxFormDate); // pstmt.setString(21, cctrCode);
pstmt.setString(31, payTax); // pstmt.setString(22, rateType);
// pstmt.setString(23, round);
cnt = pstmt.executeUpdate(); // pstmt.setString(24, roundTo);
pstmt.close(); // pstmt.setString(25, taxForm);
pstmt = null; // pstmt.setTimestamp(26, chgDate);
// pstmt.setString(27, chgUser);
// pstmt.setString(28, chgTerm);
// pstmt.setString(29, posted);
// pstmt.setTimestamp(30, taxFormDate);
// pstmt.setString(31, payTax);
//
// cnt = pstmt.executeUpdate();
// pstmt.close();
// pstmt = null;
System.out.println("@@@@3 cnt[" + cnt + "]"); System.out.println("@@@@3 cnt[" + cnt + "]");
/* */ /* */
sql = " update poamd_det set line_no__ord = ? where amd_no = ? and line_no = ? "; sql = " update poamd_det set line_no__ord = ? where amd_no = ? and line_no = ? ";
...@@ -1524,7 +1635,9 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1524,7 +1635,9 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
if (errCode == null || errCode.trim().length() == 0) if (errCode == null || errCode.trim().length() == 0)
{ {
sql = " select sum(case when tax_amt is null then 0 else tax_amt end), sum(case when tot_amt is null then 0 else tot_amt end), " + " sum(case when tot_amt is null then 0 else tot_amt end - case when tax_amt is null then 0 else tax_amt end) " + " from porddet where purc_order = ? "; sql = " select sum(case when tax_amt is null then 0 else tax_amt end), sum(case when tot_amt is null then 0 else tot_amt end), "
+ " sum(case when tot_amt is null then 0 else tot_amt end - case when tax_amt is null then 0 else tax_amt end) "
+ " from porddet where purc_order = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder); pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1541,7 +1654,8 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1541,7 +1654,8 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
if (errCode == null || errCode.trim().length() == 0) if (errCode == null || errCode.trim().length() == 0)
{ {
sql = " select sum(case when net_amt is null then 0 else net_amt end) from voucher where purc_order = ? " + " and vouch_type = ? and confirmed = ? "; sql = " select sum(case when net_amt is null then 0 else net_amt end) from voucher where purc_order = ? "
+ " and vouch_type = ? and confirmed = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder); pstmt.setString(1, purcOrder);
pstmt.setString(2, "A"); pstmt.setString(2, "A");
...@@ -1584,7 +1698,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca ...@@ -1584,7 +1698,12 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
// amendment approver // amendment approver
if (cnt > 0) if (cnt > 0)
{ {
sql = " update porder set amd_no = ?, amd_date=?, site_code__dlv=?, site_code__ord=?,site_code__bill=?,dept_code=?," + "supp_code=?,emp_code=?,item_ser=?,tax_opt=?,cr_term=?,ord_amt=?,tax_amt=?,tot_amt=?,curr_code=?,exch_rate=?," + "tax_chap=?,tax_class=?,tax_env=?,remarks=?,tax_date=?,proj_code=?,sales_pers=?,comm_perc=?,comm_perc__on=?," + "curr_code__comm=?,quot_no=?,tran_code=?,frt_amt=?,curr_code__frt=?,frt_term=?,dlv_term=?,insurance_amt =?," + "curr_code__ins =?,ref_date=?,advance=?, " + "frt_type = ?, frt_rate=?, frt_amt__qty=? , frt_amt__fixed = ? " + " where purc_order = ? "; sql = " update porder set amd_no = ?, amd_date=?, site_code__dlv=?, site_code__ord=?,site_code__bill=?,dept_code=?,"
+ "supp_code=?,emp_code=?,item_ser=?,tax_opt=?,cr_term=?,ord_amt=?,tax_amt=?,tot_amt=?,curr_code=?,exch_rate=?,"
+ "tax_chap=?,tax_class=?,tax_env=?,remarks=?,tax_date=?,proj_code=?,sales_pers=?,comm_perc=?,comm_perc__on=?,"
+ "curr_code__comm=?,quot_no=?,tran_code=?,frt_amt=?,curr_code__frt=?,frt_term=?,dlv_term=?,insurance_amt =?,"
+ "curr_code__ins =?,ref_date=?,advance=?, " + "frt_type = ?, frt_rate=?, frt_amt__qty=? , frt_amt__fixed = ? "
+ " where purc_order = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo); pstmt.setString(1, amdNo);
pstmt.setTimestamp(2, amdDate); pstmt.setTimestamp(2, amdDate);
......
...@@ -589,6 +589,14 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde ...@@ -589,6 +589,14 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
{ {
lineNoOrd = checkNull(genericUtility.getColumnValue("line_no__ord", dom)); lineNoOrd = checkNull(genericUtility.getColumnValue("line_no__ord", dom));
if( lineNoOrd != null && lineNoOrd.length() > 0 ) if( lineNoOrd != null && lineNoOrd.length() > 0 )
{
if((lineNoOrd.trim().equalsIgnoreCase("0")))// VALLABH KADAM Add validation for line_no__ord==0 20/NOV/14
{
errCode = "VTINVPOLIN";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{ {
purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom)); purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom));
lineNoOrd = " "+lineNoOrd ; lineNoOrd = " "+lineNoOrd ;
...@@ -615,6 +623,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde ...@@ -615,6 +623,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
}
if( errCode == null || errCode.trim().length()==0 ) if( errCode == null || errCode.trim().length()==0 )
{ {
...@@ -2669,6 +2678,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde ...@@ -2669,6 +2678,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
break; break;
// case 2 start // case 2 start
case 2 : case 2 :
System.out.println("**********************In case 2 ***********************8");
parentNodeList = dom.getElementsByTagName("Detail2"); parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
...@@ -2689,7 +2699,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde ...@@ -2689,7 +2699,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
ctr++; ctr++;
} }
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn)); while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'"); System.out.println("IN DETAILS column name is %%%%%%%%%%%%%[" + currentColumn + "] ==> '" + columnValue + "'");
if( currentColumn.trim().equalsIgnoreCase( "itm_defaultedit" ) ) if( currentColumn.trim().equalsIgnoreCase( "itm_defaultedit" ) )
...@@ -3432,7 +3442,9 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde ...@@ -3432,7 +3442,9 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
} }
else if( currentColumn.trim().equalsIgnoreCase("rate") ) else if( currentColumn.trim().equalsIgnoreCase("rate") )
{ {
String rateStr = genericUtility.getColumnValue("rate", dom); String rateStr = genericUtility.getColumnValue("rate", dom);
System.out.println("In Rate itemchange Rate value by dom ["+rateStr+"]");
rate = rateStr==null?0:Double.parseDouble(rateStr); rate = rateStr==null?0:Double.parseDouble(rateStr);
unitRate = genericUtility.getColumnValue("unit__rate", dom); unitRate = genericUtility.getColumnValue("unit__rate", dom);
unitStd = genericUtility.getColumnValue("unit__std", dom); unitStd = genericUtility.getColumnValue("unit__std", dom);
......
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