Commit b92eab7b authored by dpawar's avatar dpawar

*** empty log message ***


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95179 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 40e703dc
...@@ -688,7 +688,7 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci ...@@ -688,7 +688,7 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci
rs = null; rs = null;
} else if ("CallByManually".equalsIgnoreCase(callBy)) { } else if ("CallByManually".equalsIgnoreCase(callBy)) {
System.out.println("In CallByManually"); System.out.println("In CallByManually");
String refId = "",tranDate = "",gpNo = "",gpDate = "", amtStr = ""; String refId = "",tranDate = "",gpNo = "",gpDate = "", amtStr = "",billNo = "",billDate = "";
double dramt = 0,cramt = 0,tempAmt = 0,lamt = 0,ramt = 0; double dramt = 0,cramt = 0,tempAmt = 0,lamt = 0,ramt = 0;
if("Automatically".equalsIgnoreCase(reconcileType)){ if("Automatically".equalsIgnoreCase(reconcileType)){
System.out.println("In Automatically"); System.out.println("In Automatically");
...@@ -719,7 +719,7 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci ...@@ -719,7 +719,7 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci
lamt += tempAmt; lamt += tempAmt;
} }
} else if(gpNo != null && gpDate != null) { } else if (gpNo != null && gpDate != null) {
gpNo = gpNo.trim(); gpNo = gpNo.trim();
gpDate = gpDate.trim(); gpDate = gpDate.trim();
if(issueSiteMap.containsKey(siteCodeFr+":"+gpNo+":"+gpDate)) { if(issueSiteMap.containsKey(siteCodeFr+":"+gpNo+":"+gpDate)) {
...@@ -731,15 +731,19 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci ...@@ -731,15 +731,19 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci
} }
} }
} else if(siteCodeTo.equalsIgnoreCase(rs.getString("SITE_CODE"))) { } else if(siteCodeTo.equalsIgnoreCase(rs.getString("SITE_CODE"))) {
refId = rs.getString("BL_NO"); refId = rs.getString("REF_ID");
tranDate = rs.getString("BL_DATE"); tranDate = rs.getString("TRAN_DATE");
billNo = rs.getString("BL_NO");
billDate = rs.getString("BL_DATE");
dramt = rs.getDouble("DR_AMT"); dramt = rs.getDouble("DR_AMT");
cramt = rs.getDouble("CR_AMT"); cramt = rs.getDouble("CR_AMT");
tempAmt = dramt + cramt; tempAmt = dramt + cramt;
System.out.println("refId["+refId+"],tranDate["+tranDate+"],dramt["+dramt+"],cramt["+cramt+"]"); System.out.println("refId["+refId+"],tranDate["+tranDate+"],BillNo["+billNo+"],BillDate["+billDate+"],dramt["+dramt+"],cramt["+cramt+"]");
refId = refId == null ? null : ("".equalsIgnoreCase(refId.trim()) ? null : refId); refId = refId == null ? null : ("".equalsIgnoreCase(refId.trim()) ? null : refId);
tranDate = tranDate == null ? null : ("".equalsIgnoreCase(tranDate.trim()) ? null : tranDate); tranDate = tranDate == null ? null : ("".equalsIgnoreCase(tranDate.trim()) ? null : tranDate);
billNo = billNo == null ? null : ("".equalsIgnoreCase(billNo.trim()) ? null : billNo);
billDate = billDate == null ? null : ("".equalsIgnoreCase(billDate.trim()) ? null : billDate);
if(refId != null && tranDate != null) { if(refId != null && tranDate != null) {
refId = refId.trim(); refId = refId.trim();
tranDate = tranDate.trim(); tranDate = tranDate.trim();
...@@ -750,7 +754,17 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci ...@@ -750,7 +754,17 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci
reseiverSiteMap.put(siteCodeTo+":"+refId+":"+tranDate, tempAmt); reseiverSiteMap.put(siteCodeTo+":"+refId+":"+tranDate, tempAmt);
ramt += tempAmt; ramt += tempAmt;
} }
} } else if (billNo != null && billDate != null) {
billNo = billNo.trim();
billDate = billDate.trim();
if(reseiverSiteMap.containsKey(siteCodeFr+":"+billNo+":"+billDate)) {
reseiverSiteMap.put(siteCodeFr+":"+billNo+":"+billDate,reseiverSiteMap.get(siteCodeFr+":"+billNo+":"+billDate) + tempAmt);
ramt += tempAmt;
} else {
reseiverSiteMap.put(siteCodeFr+":"+billNo+":"+billDate, tempAmt);
ramt += tempAmt;
}
}
} }
} }
pstmt = null; pstmt = null;
...@@ -787,7 +801,7 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci ...@@ -787,7 +801,7 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci
tranDate = tranDate == null ? null : ("".equalsIgnoreCase(tranDate.trim()) ? null : tranDate); tranDate = tranDate == null ? null : ("".equalsIgnoreCase(tranDate.trim()) ? null : tranDate);
gpNo = gpNo == null ? null : ("".equalsIgnoreCase(gpNo.trim()) ? null : gpNo); gpNo = gpNo == null ? null : ("".equalsIgnoreCase(gpNo.trim()) ? null : gpNo);
gpDate = gpDate == null ? null : ("".equalsIgnoreCase(gpDate.trim()) ? null : gpDate); gpDate = gpDate == null ? null : ("".equalsIgnoreCase(gpDate.trim()) ? null : gpDate);
if(refId != null && tranDate != null) { if (refId != null && tranDate != null) {
refId = refId.trim(); refId = refId.trim();
tranDate = tranDate.trim(); tranDate = tranDate.trim();
if(issueSiteMap.containsKey(siteCodeFr+":"+refId+":"+tranDate)) { if(issueSiteMap.containsKey(siteCodeFr+":"+refId+":"+tranDate)) {
...@@ -798,7 +812,7 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci ...@@ -798,7 +812,7 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci
lamt += tempAmt; lamt += tempAmt;
} }
} else if(gpNo != null && gpDate != null) { } else if (gpNo != null && gpDate != null) {
gpNo = gpNo.trim(); gpNo = gpNo.trim();
gpDate = gpDate.trim(); gpDate = gpDate.trim();
if(issueSiteMap.containsKey(siteCodeFr+":"+gpNo+":"+gpDate)) { if(issueSiteMap.containsKey(siteCodeFr+":"+gpNo+":"+gpDate)) {
...@@ -810,17 +824,21 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci ...@@ -810,17 +824,21 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci
} }
} }
} else if(siteCodeTo.equalsIgnoreCase(siteCode)) { } else if(siteCodeTo.equalsIgnoreCase(siteCode)) {
refId = eElement.getElementsByTagName("BIL_NO").item(0).getTextContent(); refId = eElement.getElementsByTagName("REF_ID").item(0).getTextContent();
tranDate = eElement.getElementsByTagName("BIL_DATE").item(0).getTextContent(); tranDate = eElement.getElementsByTagName("TRAN_DATE").item(0).getTextContent();
billNo = eElement.getElementsByTagName("BIL_NO").item(0).getTextContent();
billDate = eElement.getElementsByTagName("BIL_DATE").item(0).getTextContent();
amtStr = eElement.getElementsByTagName("DR_AMT").item(0).getTextContent(); amtStr = eElement.getElementsByTagName("DR_AMT").item(0).getTextContent();
dramt = amtStr == null ? 0.0 : Double.parseDouble(amtStr.trim()); dramt = amtStr == null ? 0.0 : Double.parseDouble(amtStr.trim());
amtStr = eElement.getElementsByTagName("CR_AMT").item(0).getTextContent(); amtStr = eElement.getElementsByTagName("CR_AMT").item(0).getTextContent();
cramt = amtStr == null ? 0.0 : Double.parseDouble(amtStr.trim()); cramt = amtStr == null ? 0.0 : Double.parseDouble(amtStr.trim());
tempAmt = dramt + cramt; tempAmt = dramt + cramt;
System.out.println("refId["+refId+"],tranDate["+tranDate+"],dramt["+dramt+"],cramt["+cramt+"]"); System.out.println("refId["+refId+"],tranDate["+tranDate+"],BillNo["+billNo+"],BillDate["+billDate+"],dramt["+dramt+"],cramt["+cramt+"]");
refId = refId == null ? null : ("".equalsIgnoreCase(refId.trim()) ? null : refId); refId = refId == null ? null : ("".equalsIgnoreCase(refId.trim()) ? null : refId);
tranDate = tranDate == null ? null : ("".equalsIgnoreCase(tranDate.trim()) ? null : tranDate); tranDate = tranDate == null ? null : ("".equalsIgnoreCase(tranDate.trim()) ? null : tranDate);
billNo = billNo == null ? null : ("".equalsIgnoreCase(billNo.trim()) ? null : billNo);
billDate = billDate == null ? null : ("".equalsIgnoreCase(billDate.trim()) ? null : billDate);
if(refId != null && tranDate != null) { if(refId != null && tranDate != null) {
refId = refId.trim(); refId = refId.trim();
tranDate = tranDate.trim(); tranDate = tranDate.trim();
...@@ -831,7 +849,17 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci ...@@ -831,7 +849,17 @@ public class InterCompReconcile extends ValidatorEJB implements InterCompReconci
reseiverSiteMap.put(siteCodeTo+":"+refId+":"+tranDate, tempAmt); reseiverSiteMap.put(siteCodeTo+":"+refId+":"+tranDate, tempAmt);
ramt += tempAmt; ramt += tempAmt;
} }
} } else if (billNo != null && billDate != null) {
billNo = billNo.trim();
billDate = billDate.trim();
if(reseiverSiteMap.containsKey(siteCodeFr+":"+billNo+":"+billDate)) {
reseiverSiteMap.put(siteCodeFr+":"+billNo+":"+billDate,reseiverSiteMap.get(siteCodeFr+":"+billNo+":"+billDate) + tempAmt);
ramt += tempAmt;
} else {
reseiverSiteMap.put(siteCodeFr+":"+billNo+":"+billDate, tempAmt);
ramt += tempAmt;
}
}
} }
} }
if(lamt == ramt) { if(lamt == ramt) {
......
...@@ -166,8 +166,45 @@ public class InterCompReconcileProcess extends ProcessEJB implements InterCompRe ...@@ -166,8 +166,45 @@ public class InterCompReconcileProcess extends ProcessEJB implements InterCompRe
adpQuery = adpQuery.replaceAll("@sitecodeto@", toSiteCode); adpQuery = adpQuery.replaceAll("@sitecodeto@", toSiteCode);
adpQuery = adpQuery.replaceAll("@trandateupto@", toTranDate); adpQuery = adpQuery.replaceAll("@trandateupto@", toTranDate);
adpQuery = adpQuery.replaceAll("@trandatefrom@", fromTranDate); adpQuery = adpQuery.replaceAll("@trandatefrom@", fromTranDate);
System.out.println("sundryTypeFrDB2----->>["+sundryTypeFr+"]");
if(sundryTypeFr.length() > 0){
if("customer".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="C";
else if("supplier".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="S";
else if("employee".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="E";
else if("loan_party".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="L";
else if("tax_authority".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="X";
else if("transporter".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="T";
else if("sales_pers".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="P";
else if("strg_customer".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="R";
}
System.out.println("sundryTypeFr After DB2----->>["+sundryTypeFr+"]");
System.out.println("sundryTypeTo----->>["+sundryTypeTo+"]");
if(sundryTypeFr.length() > 0){
if("customer".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="C";
else if("supplier".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="S";
else if("employee".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="E";
else if("loan_party".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="L";
else if("tax_authority".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="X";
else if("transporter".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="T";
else if("sales_pers".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="P";
else if("strg_customer".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="R";
}
adpQuery = adpQuery.replaceAll("@sundrytypefrom@", sundryTypeFr); adpQuery = adpQuery.replaceAll("@sundrytypefrom@", sundryTypeFr);
adpQuery = adpQuery.replaceAll("@sundrytypeto@", sundryTypeTo); adpQuery = adpQuery.replaceAll("@sundrytypeto@", sundryTypeTo);
adpQuery = adpQuery.replaceAll("@sundrycodefrom@", sundryCodeFr); adpQuery = adpQuery.replaceAll("@sundrycodefrom@", sundryCodeFr);
...@@ -183,6 +220,46 @@ public class InterCompReconcileProcess extends ProcessEJB implements InterCompRe ...@@ -183,6 +220,46 @@ public class InterCompReconcileProcess extends ProcessEJB implements InterCompRe
adpQuery = adpQuery.replaceAll("@trandateupto@", toTranDate); adpQuery = adpQuery.replaceAll("@trandateupto@", toTranDate);
adpQuery = adpQuery.replaceAll("@trandatefrom@", fromTranDate); adpQuery = adpQuery.replaceAll("@trandatefrom@", fromTranDate);
System.out.println("sundryTypeFr Oracle----->>["+sundryTypeFr+"]");
if(sundryTypeFr.length() > 0 && sundryTypeTo.length() > 0){
if("customer".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="C";
else if("supplier".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="S";
else if("employee".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="E";
else if("loan_party".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="L";
else if("tax_authority".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="X";
else if("transporter".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="T";
else if("sales_pers".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="P";
else if("strg_customer".equalsIgnoreCase(sundryTypeFr))
sundryTypeFr="R";
}
System.out.println("sundryTypeFr After Oracle----->>["+sundryTypeFr+"]");
System.out.println("sundryTypeTo----->>["+sundryTypeTo+"]");
if(sundryTypeTo.length() > 0){
if("customer".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="C";
else if("supplier".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="S";
else if("employee".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="E";
else if("loan_party".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="L";
else if("tax_authority".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="X";
else if("transporter".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="T";
else if("sales_pers".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="P";
else if("strg_customer".equalsIgnoreCase(sundryTypeTo))
sundryTypeTo="R";
}
adpQuery = adpQuery.replaceAll("@sundrytypefrom@", sundryTypeFr); adpQuery = adpQuery.replaceAll("@sundrytypefrom@", sundryTypeFr);
adpQuery = adpQuery.replaceAll("@sundrytypeto@", sundryTypeTo); adpQuery = adpQuery.replaceAll("@sundrytypeto@", sundryTypeTo);
adpQuery = adpQuery.replaceAll("@sundrycodefrom@", sundryCodeFr); adpQuery = adpQuery.replaceAll("@sundrycodefrom@", sundryCodeFr);
......
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