Commit 2898aae0 authored by asikarwar's avatar asikarwar

change for check bill disc amt is not set automatically


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93438 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9a46e826
...@@ -2652,6 +2652,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2652,6 +2652,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
billDisc = "N"; billDisc = "N";
refNo = genericUtility.getColumnValue("ref_no", dom); refNo = genericUtility.getColumnValue("ref_no", dom);
refSer = genericUtility.getColumnValue("ref_ser", dom); refSer = genericUtility.getColumnValue("ref_ser", dom);
sql = "select count(*) from receivables where tran_ser = ? and ref_no = ?"; sql = "select count(*) from receivables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refSer); pstmt.setString(1, refSer);
...@@ -2667,6 +2668,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2667,6 +2668,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
} }
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if ((lineNoRef != null) || (lineNoRef.trim().length() > 0)) if ((lineNoRef != null) || (lineNoRef.trim().length() > 0))
{ {
if (!refSer.equals("E-FUND")) if (!refSer.equals("E-FUND"))
...@@ -2696,6 +2702,10 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2696,6 +2702,10 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
adjAmt = rs.getDouble(14); adjAmt = rs.getDouble(14);
badDebtAmt = rs.getDouble(15); badDebtAmt = rs.getDouble(15);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} }
hexchRate = doublevalue(genericUtility.getColumnValue("exch_rate", dom1)); hexchRate = doublevalue(genericUtility.getColumnValue("exch_rate", dom1));
sql = "select descr from currency where currency.curr_code = ?"; sql = "select descr from currency where currency.curr_code = ?";
...@@ -2706,6 +2716,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2706,6 +2716,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{ {
currDescr = rs.getString(1); currDescr = rs.getString(1);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select descr from accounts where accounts.acct_code = ?"; sql = "select descr from accounts where accounts.acct_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCode); pstmt.setString(1, acctCode);
...@@ -2714,6 +2729,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2714,6 +2729,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{ {
accDescr = rs.getString(1); accDescr = rs.getString(1);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select receivables.bill_disc from receivables where tran_ser = ? and ref_no = ? "; sql = "select receivables.bill_disc from receivables where tran_ser = ? and ref_no = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refSer); pstmt.setString(1, refSer);
...@@ -2723,8 +2743,17 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2723,8 +2743,17 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{ {
billDisc = rs.getString(1); billDisc = rs.getString(1);
} }
if ((billDisc == null) || (billDisc.trim().length() == 0)) rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(billDisc == null || billDisc.trim().length() == 0)
{
billDisc = "N"; billDisc = "N";
}
System.out.println("bill disc ------ > "+billDisc);
if (billDisc.trim().equalsIgnoreCase("Y")) if (billDisc.trim().equalsIgnoreCase("Y"))
{ //added by ritesh { //added by ritesh
sql = "select export_fund.exch_rate,export_fundet.amount from export_fund, export_fundet where ( export_fund.tran_id = export_fundet.tran_id ) and ( export_fund.confirmed = 'Y' ) and ( ( export_fundet.ref_ser = ? ) and ( export_fundet.ref_no = ? ) )"; sql = "select export_fund.exch_rate,export_fundet.amount from export_fund, export_fundet where ( export_fund.tran_id = export_fundet.tran_id ) and ( export_fund.confirmed = 'Y' ) and ( ( export_fundet.ref_ser = ? ) and ( export_fundet.ref_no = ? ) )";
...@@ -2738,6 +2767,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2738,6 +2767,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
discExchRate = rs.getDouble(1); // change by ritesh on 25/05/13 discExchRate = rs.getDouble(1); // change by ritesh on 25/05/13
lcBillDescAmt = rs.getString(2); lcBillDescAmt = rs.getString(2);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("bill disc 1 ------ > "+billDisc);
valueXmlString.append("<bill_disc_amt>").append("<![CDATA[" + lcBillDescAmt + "]]>").append("</bill_disc_amt>"); //added by ritesh as per discussion with pravin valueXmlString.append("<bill_disc_amt>").append("<![CDATA[" + lcBillDescAmt + "]]>").append("</bill_disc_amt>"); //added by ritesh as per discussion with pravin
} }
valueXmlString.append("<bill_disc>").append("<![CDATA[" + billDisc + "]]>").append("</bill_disc>"); valueXmlString.append("<bill_disc>").append("<![CDATA[" + billDisc + "]]>").append("</bill_disc>");
...@@ -2811,6 +2845,12 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2811,6 +2845,12 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{ {
ctr = rs.getInt(1); ctr = rs.getInt(1);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if ((tranSer == "S-INV") || (ctr == 1)) if ((tranSer == "S-INV") || (ctr == 1))
{ {
sql = "select due_date,cr_term from invoice where invoice_id = ?"; sql = "select due_date,cr_term from invoice where invoice_id = ?";
...@@ -2822,6 +2862,13 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2822,6 +2862,13 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
dueDate = rs.getDate(1); dueDate = rs.getDate(1);
crTrem = rs.getString(2); crTrem = rs.getString(2);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom)); tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom));
if (tranDate.before(dueDate)) if (tranDate.before(dueDate))
{ {
...@@ -2853,6 +2900,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2853,6 +2900,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
discountLc = Math.round(discountLc) * -1L; discountLc = Math.round(discountLc) * -1L;
valueXmlString.append("<fin_chg>").append("<![CDATA[" + discountLc + "]]>").append("</fin_chg>"); valueXmlString.append("<fin_chg>").append("<![CDATA[" + discountLc + "]]>").append("</fin_chg>");
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
} }
} }
} }
...@@ -2860,6 +2912,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2860,6 +2912,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
} }
else if ((currentColumn.trim().equalsIgnoreCase("exch_rate")) || (currentColumn.trim().equalsIgnoreCase("rcp_amt"))) else if ((currentColumn.trim().equalsIgnoreCase("exch_rate")) || (currentColumn.trim().equalsIgnoreCase("rcp_amt")))
{ {
System.out.println("exch_rate ::::::::");
billDisc = "N"; billDisc = "N";
refNo = genericUtility.getColumnValue("ref_no", dom); refNo = genericUtility.getColumnValue("ref_no", dom);
refSer = genericUtility.getColumnValue("ref_ser", dom); refSer = genericUtility.getColumnValue("ref_ser", dom);
...@@ -2873,7 +2926,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2873,7 +2926,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
billDisc = rs.getString(1); billDisc = rs.getString(1);
} }
if (billDisc == null) billDisc = "N"; if (billDisc == null) billDisc = "N";
if (billDisc == "Y") if ("Y".equals(billDisc))
{ {
sql = "select export_fund.exch_rate from export_fund, export_fundet where ( export_fund.tran_id = export_fundet.tran_id ) and ( export_fund.confirmed = 'Y') and( ( export_fundet.ref_ser = ? ) and ( export_fundet.ref_no = ?) )"; sql = "select export_fund.exch_rate from export_fund, export_fundet where ( export_fund.tran_id = export_fundet.tran_id ) and ( export_fund.confirmed = 'Y') and( ( export_fundet.ref_ser = ? ) and ( export_fundet.ref_no = ?) )";
...@@ -2885,6 +2938,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2885,6 +2938,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{ {
exchRate = rs.getDouble(1); exchRate = rs.getDouble(1);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
rcpAmt = Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom)); rcpAmt = Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom));
hexchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate", dom)); hexchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate", dom));
exchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate__rcv", dom)); exchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate__rcv", dom));
...@@ -2905,10 +2963,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2905,10 +2963,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + diffAmtExch + "]]>").append("</diff_amt__exch>"); valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + diffAmtExch + "]]>").append("</diff_amt__exch>");
} }
valueXmlString.append("<site_code protect = \"1\">").append("<![CDATA[" + siteCode + "]]>").append("</site_code>"); //valueXmlString.append("<site_code protect = \"1\">").append("<![CDATA[" + siteCode + "]]>").append("</site_code>");
valueXmlString.append("<cust_code protect = \"1\">").append("<![CDATA[" + custCode + "]]>").append("</cust_code>"); //valueXmlString.append("<cust_code protect = \"1\">").append("<![CDATA[" + custCode + "]]>").append("</cust_code>");
valueXmlString.append("<curr_code protect = \"1\">").append("<![CDATA[" + currCode + "]]>").append("</curr_code>"); //valueXmlString.append("<curr_code protect = \"1\">").append("<![CDATA[" + currCode + "]]>").append("</curr_code>");
valueXmlString.append("<sale_order protect = \"1\">").append("<![CDATA[" + saleOrder + "]]>").append("</sale_order>"); //valueXmlString.append("<sale_order protect = \"1\">").append("<![CDATA[" + saleOrder + "]]>").append("</sale_order>");
errCode = checkBadDebtAmt(0, conn, dom); errCode = checkBadDebtAmt(0, conn, dom);
if(errCode == null && errCode.trim().length() == 0) if(errCode == null && errCode.trim().length() == 0)
{ {
...@@ -2932,6 +2991,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2932,6 +2991,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{ {
ctr = rs.getInt(1); ctr = rs.getInt(1);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
rcpAmt = Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom)); rcpAmt = Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom));
if ((tranSer == "S-INV") || (ctr == 1)) if ((tranSer == "S-INV") || (ctr == 1))
{ {
...@@ -2944,6 +3008,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2944,6 +3008,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
dueDate = rs.getDate(1); dueDate = rs.getDate(1);
crTrem = rs.getString(2); crTrem = rs.getString(2);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom)); tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom));
if (tranDate.before(dueDate)) if (tranDate.before(dueDate))
{ {
...@@ -2962,6 +3031,12 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2962,6 +3031,12 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
finChg = rs.getDouble(1); finChg = rs.getDouble(1);
fchgType = rs.getString(2); fchgType = rs.getString(2);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (finChg == 0.0D) finChg = 0.0D; if (finChg == 0.0D) finChg = 0.0D;
if (discountLc == 0.0D) discountLc = 0.0D; if (discountLc == 0.0D) discountLc = 0.0D;
if (fchgType == "P") if (fchgType == "P")
...@@ -2974,17 +3049,14 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -2974,17 +3049,14 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
} }
discountLc = Math.round(discountLc) * -1L; discountLc = Math.round(discountLc) * -1L;
valueXmlString.append("<fin_chg>").append("<![CDATA[" + discountLc + "]]>").append("</fin_chg>"); valueXmlString.append("<fin_chg>").append("<![CDATA[" + discountLc + "]]>").append("</fin_chg>");
} }
} }
} }
} }
} }
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
}
else if (currentColumn.trim().equalsIgnoreCase("bad_debt_amt")) else if (currentColumn.trim().equalsIgnoreCase("bad_debt_amt"))
{ {
errCode = checkBadDebtAmt(1, conn, dom); errCode = checkBadDebtAmt(1, conn, 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