Commit bc542f32 authored by manohar's avatar manohar

Exchange rate initialised to 1 if 0


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96846 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0793ee97
......@@ -1180,6 +1180,10 @@ public class CalculateCommission
{
remarks = "Agst Sales Return No"+ sretId+"";
}
if (crntExchrate == 0 )
{
crntExchrate = 1;
}
xmlBuff.append("<exch_rate><![CDATA["+ crntExchrate +"]]></exch_rate>");
if ("SR".equalsIgnoreCase(calledFrom) || "P".equalsIgnoreCase(calledFrom))
{
......@@ -1237,6 +1241,10 @@ public class CalculateCommission
xmlBuff.append("<tax_env><![CDATA["+ taxEnv +"]]></tax_env>");
xmlBuff.append("<acct_code><![CDATA["+ acctcodeExp +"]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA["+ cctrcodeExp +"]]></cctr_code>");
if (jvExchrate == 0 )
{
jvExchrate = 1;
}
xmlBuff.append("<exch_rate__inv><![CDATA["+ jvExchrate +"]]></exch_rate__inv>");
xmlBuff.append("</Detail2>");
if(lineNoInv == 0)
......@@ -1385,6 +1393,10 @@ public class CalculateCommission
xmlBuff.append("<cctr_code><![CDATA["+ cctrcodeDeduct +"]]></cctr_code>");
xmlBuff.append("<net_amt><![CDATA["+ expAmt * -1 +"]]></net_amt>");
xmlBuff.append("<drcr_amt><![CDATA["+ (expAmt * -1) * (exchRate/crntExchrate) +"]]></drcr_amt>");
if (jvExchrate == 0 )
{
jvExchrate = 1;
}
xmlBuff.append("<exch_rate__inv><![CDATA["+ jvExchrate +"]]></exch_rate__inv>");
xmlBuff.append("</Detail2>");
}
......@@ -2762,6 +2774,10 @@ public class CalculateCommission
xmlBuff.append("<cctr_code><![CDATA["+ cctrCodeAp +"]]></cctr_code>");
xmlBuff.append("<eff_date><![CDATA["+ sdf.format(date).toString() +"]]></eff_date>");
xmlBuff.append("<curr_code><![CDATA["+ currCodeSp +"]]></curr_code>");
if (crntExchrate == 0 )
{
crntExchrate = 1;
}
xmlBuff.append("<exch_rate><![CDATA["+ crntExchrate +"]]></exch_rate>");
xmlBuff.append("<tran_type><![CDATA["+ tranType +"]]></tran_type>");
// 05-12-02 Arif to set the remarks
......@@ -2803,6 +2819,10 @@ public class CalculateCommission
xmlBuff.append("<tax_env><![CDATA["+ taxEnv +"]]></tax_env>");
xmlBuff.append("<acct_code><![CDATA["+ acctcodeExp +"]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA["+ cctrcodeExp +"]]></cctr_code>");
if (jvExchrate == 0 )
{
jvExchrate = 1;
}
xmlBuff.append("<exch_rate__inv><![CDATA["+ jvExchrate +"]]></exch_rate__inv>");
xmlBuff.append("<drcr_amt><![CDATA["+ commAmt +"]]></drcr_amt>");
xmlBuff.append("<net_amt><![CDATA["+ commAmt +"]]></net_amt>");
......@@ -2918,6 +2938,10 @@ public class CalculateCommission
xmlBuff.append("<tax_env><![CDATA["+ taxEnv +"]]></tax_env>");
xmlBuff.append("<acct_code><![CDATA["+ acctcodeDeduct +"]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA["+ cctrcodeDeduct +"]]></cctr_code>");
if (jvExchrate == 0 )
{
jvExchrate = 1;
}
xmlBuff.append("<exch_rate__inv><![CDATA["+ jvExchrate +"]]></exch_rate__inv>");
xmlBuff.append("<net_amt><![CDATA["+ (expAmt * -1) +"]]></net_amt>");
xmlBuff.append("<drcr_amt><![CDATA["+ ((expAmt * -1) * (exchRate/crntExchrate)) +"]]></drcr_amt>");
......
......@@ -235,7 +235,7 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
double recoAmount = 0,diffExchAmt = 0,roundAdj = 0,amountMap = 0, exchRateInv = 0 ;
double recoAmount = 0,diffExchAmt = 0,roundAdj = 0,amountMap = 0, exchRateInv = 0, exchRatehdr = 0 ;
PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null;
ResultSet rs = null;
......@@ -344,7 +344,12 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
HdrMap.put("invoice_id",rs.getString("invoice_id"));
HdrMap.put("amount",rs.getDouble("amount"));
HdrMap.put("curr_code",rs.getString("curr_code"));
HdrMap.put("exch_rate",rs.getDouble("exch_rate"));
exchRatehdr = rs.getDouble("exch_rate");
if (exchRatehdr == 0 )
{
exchRatehdr = 1;
}
HdrMap.put("exch_rate",exchRatehdr);
HdrMap.put("remarks",rs.getString("remarks"));
HdrMap.put("site_code",rs.getString("site_code"));
HdrMap.put("anal_code",rs.getString("anal_code"));
......
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