Commit 2bfd42b6 authored by rtiwari's avatar rtiwari

Validation added- Debit Note cannot be generate less than 100 Debit amount


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98358 ce508802-f39f-4f6c-b175-0d175dae99d5
parent afeb72b1
...@@ -245,14 +245,15 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -245,14 +245,15 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
pstmt.setString(2, "Y"); pstmt.setString(2, "Y");
pstmt.setString(3, invType); pstmt.setString(3, invType);
} else { } else {
//sql = "select invoice_id from invoice where cust_code__bil between ? and ? and site_code = ? and confirmed = ?" // sql = "select invoice_id from invoice where
// + " and sysdate - conf_date > 45 and inv_type =?"; // cust_code__bil between ? and ? and site_code = ? and
// confirmed = ?"
// + " and sysdate - conf_date > 45 and inv_type =?";
sql = "select invoice_id from invoice where cust_code__bil between ? and ? and site_code = ? and confirmed = ?" sql = "select invoice_id from invoice where cust_code__bil between ? and ? and site_code = ? and confirmed = ?"
+ " and conf_date > '" + " and conf_date > '"
+ disDate + disDate
+ "' and inv_type = ?"; + "' and inv_type = ?";
// [13-JUL-15] CHANGED BY // [13-JUL-15] CHANGED BY
// SANKET GIRME TO GET THE // SANKET GIRME TO GET THE
// INVOICE_DATE GRETTER THAN // INVOICE_DATE GRETTER THAN
...@@ -389,9 +390,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -389,9 +390,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
ArrayList<String> podProcessInvIDListL, String priceListL, ArrayList<String> podProcessInvIDListL, String priceListL,
String xtraParams, String siteCode, String invType) { String xtraParams, String siteCode, String invType) {
invdoneCnt = 0; invdoneCnt = 0;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null, rs2 = null;
Connection conn1 = null; Connection conn1 = null;
PreparedStatement pstmt = null, pstmt1 = null; PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null;
ProofOfDelivery pod = null; ProofOfDelivery pod = null;
ProofOfDeliveryConf podC = null; ProofOfDeliveryConf podC = null;
Map<String, Object> invoiceDetailsMap = null; Map<String, Object> invoiceDetailsMap = null;
...@@ -405,12 +406,13 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -405,12 +406,13 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
String custCode = "", currCode = "", partial = "N", QtyInvTrace = "", scheme = "N", errCode = "", sreturnTranID = "", sql1 = ""; String custCode = "", currCode = "", partial = "N", QtyInvTrace = "", scheme = "N", errCode = "", sreturnTranID = "", sql1 = "";
double invRate = 0, invQty = 0, discount = 0, priceListRate = 0, detail3Amt = 0, detail3AmtT = 0, debitNoteAmtDetail = 0; double invRate = 0, invQty = 0, discount = 0, priceListRate = 0, detail3Amt = 0, detail3AmtT = 0, debitNoteAmtDetail = 0;
double debitNoteAmtHdr = 0, ExchRate = 0, actualRate = 0, chargQty = 0, freeQty = 0, netPTS = 0, sreturnQuantity = 0, partialQty = 0; double debitNoteAmtHdr = 0, ExchRate = 0, actualRate = 0, chargQty = 0, freeQty = 0, netPTS = 0, sreturnQuantity = 0, partialQty = 0;
int lineNotrace = 0, lineNo = 0, noOfInvoicePrc = 0, totalInvoice = 0; int lineNotrace = 0, lineNo = 0, noOfInvoicePrc = 0, totalInvoice = 0, sumDebitNote = 0;
pod = ProofOfDelivery.getInstance(); pod = ProofOfDelivery.getInstance();
podC = ProofOfDeliveryConf.getInstance(); podC = ProofOfDeliveryConf.getInstance();
ITMDBAccessEJB itmdbAccess1 = new ITMDBAccessEJB(); ITMDBAccessEJB itmdbAccess1 = new ITMDBAccessEJB();
ConnDriver connDriver1 = new ConnDriver(); ConnDriver connDriver1 = new ConnDriver();
DecimalFormat df = new DecimalFormat("#.###"); DecimalFormat df = new DecimalFormat("#.###");
boolean invstatus;
try { try {
conn1 = connDriver1.getConnectDB("DriverITM"); conn1 = connDriver1.getConnectDB("DriverITM");
...@@ -434,7 +436,7 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -434,7 +436,7 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
System.out.println("invoice ID in for loop------->>[" System.out.println("invoice ID in for loop------->>["
+ invoiceId + "]"); + invoiceId + "]");
sql = "select rate,quantity,lot_no,lot_sl,item_code,inv_line_no,discount,item_code__ord,invoice_id " sql = " select rate,quantity,lot_no,lot_sl,item_code,inv_line_no,discount,item_code__ord,invoice_id "
+ "from invoice_trace where invoice_id = ? order by inv_line_no"; + "from invoice_trace where invoice_id = ? order by inv_line_no";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -442,6 +444,7 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -442,6 +444,7 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { while (rs.next()) {
invRate = rs.getDouble(1); invRate = rs.getDouble(1);
invQty = rs.getDouble(2); invQty = rs.getDouble(2);
lotNo = rs.getString(3); lotNo = rs.getString(3);
...@@ -517,8 +520,10 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -517,8 +520,10 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
// partialQty=actualQtyPODProcessPartial(conn,invoiceId,itemCode,lineNotrace); // partialQty=actualQtyPODProcessPartial(conn,invoiceId,itemCode,lineNotrace);
// System.out.println("partial // System.out.println("partial
// qty---->>["+partialQty+"]"); // qty---->>["+partialQty+"]");
// partialMap.put(invoiceId+","+itemCode, partial); // partialMap.put(invoiceId+","+itemCode,
// Check if item code Active or not."N" or null then // partial);
// Check if item code Active or not."N" or
// null then
// return error message. // return error message.
itemActive = pod.getColumnDescr(conn, "active", itemActive = pod.getColumnDescr(conn, "active",
"item", "item_code", itemCode); "item", "item_code", itemCode);
...@@ -526,12 +531,14 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -526,12 +531,14 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
.trim(); .trim();
if (itemActive.equalsIgnoreCase("N") if (itemActive.equalsIgnoreCase("N")
|| itemActive.length() <= 0) { || itemActive.length() <= 0) {
errCode = "VTITMCNAC"; // Item code not active errCode = "VTITMCNAC"; // Item code not
// active
errString = itmdbAccess1.getErrorString("", errString = itmdbAccess1.getErrorString("",
errCode, "", "", conn); errCode, "", "", conn);
errString = newErrorMessage(errString, errString = newErrorMessage(errString,
invoiceId); invoiceId);
return errString; // item code not active return errString; // item code not
// active
} }
java.util.Date tranDate = new Date(); java.util.Date tranDate = new Date();
priceListRate = getPriceListRate(priceListL, priceListRate = getPriceListRate(priceListL,
...@@ -555,7 +562,8 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -555,7 +562,8 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
System.out.println("multipleScheme--->>[" System.out.println("multipleScheme--->>["
+ multipleScheme + "]"); + multipleScheme + "]");
if ("FOUND".equalsIgnoreCase(multipleScheme)) { if ("FOUND".equalsIgnoreCase(multipleScheme)) {
errCode = "VTITEM10"; // Multiple Scheme errCode = "VTITEM10"; // Multiple
// Scheme
// Code ! // Code !
errString = itmdbAccess1.getErrorString("", errString = itmdbAccess1.getErrorString("",
errCode, "", "", conn); errCode, "", "", conn);
...@@ -605,18 +613,34 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -605,18 +613,34 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
netPTS = chargQty netPTS = chargQty
/ (chargQty + freeQty) / (chargQty + freeQty)
* priceListRate; * priceListRate;
System.out.println("chargQty ---> ["+chargQty+"]"); System.out.println("chargQty ---> ["
System.out.println("freeQty ----> ["+freeQty+"]"); + chargQty + "]");
System.out.println("priceListRate>["+priceListRate+"]"); System.out.println("freeQty ----> ["
System.out.println("Equation ==> netPTS = ("+chargQty+"/ ("+chargQty+" + "+freeQty+") *"+priceListRate+" )"); + freeQty + "]");
System.out.println("priceListRate>["
+ priceListRate + "]");
System.out
.println("Equation ==> netPTS = ("
+ chargQty
+ "/ ("
+ chargQty
+ " + "
+ freeQty
+ ") *"
+ priceListRate + " )");
System.out System.out
.println("Net PTS rate----->>[" .println("Net PTS rate----->>["
+ netPTS + "]"); + netPTS + "]");
actualRate = netPTS - invRate; actualRate = netPTS - invRate;
System.out.println("invRate == > "+invRate); System.out.println("invRate == > "
System.out.println("Second Equation ==> actualRate = "+netPTS+" - "+invRate+" "); + invRate);
System.out
.println("Second Equation ==> actualRate = "
+ netPTS
+ " - "
+ invRate + " ");
System.out System.out
.println("actualRate-------->>[" .println("actualRate-------->>["
+ actualRate + "]"); + actualRate + "]");
...@@ -633,16 +657,16 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -633,16 +657,16 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
} }
detail3Amt = actualRate * invQty; detail3Amt = actualRate * invQty;
System.out System.out
.println("Debit note amount-------->>[" .println("Debit note amount-->>["
+ detail3Amt + "]"); + detail3Amt + "]");
detail3AmtT = detail3AmtT + detail3Amt; detail3AmtT = detail3AmtT + detail3Amt;
/* /*
* [START][17-JUL-15] Sanket Girme To * [START][17-JUL-15] Sanket Girme To
* ROunding of the Debit Note Example if * Rounding off the Debit Note Example
* Debit Note Amount is 0.49 then Round * if Debit Note Amount is 0.49 then
* off to 0.490 * Round off to 0.490
* *
*/ */
String debitnt = df.format(detail3Amt) == null ? "0" String debitnt = df.format(detail3Amt) == null ? "0"
...@@ -653,7 +677,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -653,7 +677,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
.println("Formated Approved Rate---->>[" .println("Formated Approved Rate---->>["
+ detail3Amt + "]"); + detail3Amt + "]");
/* [END] [17-JUL-15] Sanket Girme */ /*
* [END] [17-JUL-15] Sanket Girme
*/
lineNo++; lineNo++;
detail2xmlString = detail2xmlString detail2xmlString = detail2xmlString
...@@ -675,7 +701,8 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -675,7 +701,8 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
System.out.println("actualRate-------->>[" System.out.println("actualRate-------->>["
+ actualRate + "]"); + actualRate + "]");
if (actualRate <= 0) { if (actualRate <= 0) {
errCode = "VTNGAMTE"; // negative rate errCode = "VTNGAMTE"; // negative
// rate
errString = itmdbAccess1.getErrorString("", errString = itmdbAccess1.getErrorString("",
errCode, "", "", conn); errCode, "", "", conn);
errString = newErrorMessage(errString, errString = newErrorMessage(errString,
...@@ -715,8 +742,8 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -715,8 +742,8 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
actualRate, invQty, lotNo, actualRate, invQty, lotNo,
lotSl, itemCode, detail3Amt); lotSl, itemCode, detail3Amt);
} // end isSchemeApply }
} // end while invoice trace }// End while Loop rs2
if (rs != null) { if (rs != null) {
rs.close(); rs.close();
rs = null; rs = null;
...@@ -725,6 +752,7 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -725,6 +752,7 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
System.out.println("Detail2 xml-------->>[[" System.out.println("Detail2 xml-------->>[["
+ detail2xmlString + "]"); + detail2xmlString + "]");
if (detail3AmtT > 0) { if (detail3AmtT > 0) {
...@@ -736,47 +764,71 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -736,47 +764,71 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
"curr_code").toString()); // xmlStringAll "curr_code").toString()); // xmlStringAll
ExchRate = Double.parseDouble(invoiceDetailsMap ExchRate = Double.parseDouble(invoiceDetailsMap
.get("exch_rate").toString()); .get("exch_rate").toString());
errString = podC.genDebitNote("PRC", invoiceId, // END OF IF DB AMT CONDTION START
custCode, siteCode, xtraParams, currCode,
ExchRate, detail2xmlString, detail3AmtT, invstatus = checkDebitAmt(invoiceId, conn);
conn);
System.out System.out.println("For Invoce ID = > " + invoiceId
.println("------Error string after DN save--->>[" + "invstatus =>" + invstatus);
+ errString + "]"); if (invstatus) {
if (errString.indexOf("Success") > -1) { errString = podC.genDebitNote("PRC", invoiceId,
System.out custCode, siteCode, xtraParams,
.println("Tran id for Misc. debit note------->>[" currCode, ExchRate, detail2xmlString,
+ (podC.debitNoteTranID).trim() detail3AmtT, conn);
+ "]");
MiscDrCrRcpConf confDebitNote = new MiscDrCrRcpConf();
errString = confDebitNote.confirm(
(podC.debitNoteTranID).trim(),
xtraParams, "", conn);
System.out System.out
.println("Error String on DB Confirmation: " .println("------Error string after DN save--->>["
+ errString); + errString + "]");
if ((errString != null) // }else{
&& errString.indexOf("CONFSUCCES") > -1) { // errString="Invalid Debit";
int cnt = insertDataInPodTrace(conn1, // }
invoiceId, podC.xmlStringAll,
scheme, "N", "Y"); if (errString.indexOf("Success") > -1) {
noOfInvoicePrc++; System.out
if (noOfInvoicePrc == totalInvoice) { .println("Tran id for Misc. debit note------->>["
invdoneCnt = 1; + (podC.debitNoteTranID)
.trim() + "]");
MiscDrCrRcpConf confDebitNote = new MiscDrCrRcpConf();
errString = confDebitNote.confirm(
(podC.debitNoteTranID).trim(),
xtraParams, "", conn);
System.out
.println("Error String on DB Confirmation: "
+ errString);
if ((errString != null)
&& errString.indexOf("CONFSUCCES") > -1) {
int cnt = insertDataInPodTrace(conn1,
invoiceId, podC.xmlStringAll,
scheme, "N", "Y");
noOfInvoicePrc++;
if (noOfInvoicePrc == totalInvoice) {
invdoneCnt = 1;
/*
* errCode="VTPRCCSF"; errString =
* itmdbAccess1.getErrorString("",
* errCode, "", "", conn); return
* errString;
*/
}
if (cnt > 0) {
conn1.commit();
}
// conn.commit();------------commited
// when
// partial invoice end
} else {
conn.rollback();
/* /*
* errCode="VTPRCCSF"; errString = * int cnt=insertDataInPodTrace(conn1,
* itmdbAccess1.getErrorString("", * invoiceId, podC.xmlStringAll,
* errCode, "", "", conn); return * schemeMap, partialMap,"N"); if(cnt >
* errString; * 1) conn1.commit();
*/ */
errString = newErrorMessage(errString,
invoiceId);
return errString;
} }
if (cnt > 0) {
conn1.commit();
}
// conn.commit();------------commited when
// partial invoice end
} else { } else {
conn.rollback(); conn.rollback();
/* /*
...@@ -790,15 +842,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -790,15 +842,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
return errString; return errString;
} }
} else { } else {
conn.rollback(); System.out
/* .println("The debit Note Not generated for the Invoice Id=> "
* int cnt=insertDataInPodTrace(conn1, + invoiceId+" Due to total debil amt below then 100!");
* invoiceId, podC.xmlStringAll, schemeMap,
* partialMap,"N"); if(cnt > 1) conn1.commit();
*/
errString = newErrorMessage(errString,
invoiceId);
return errString;
} }
} else {// end detail3AmtT > 0 condition } else {// end detail3AmtT > 0 condition
...@@ -994,6 +1040,51 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -994,6 +1040,51 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
} }
// Created By Sanket Girme to Check the debit note amount is greater than
// 100 or not
public boolean checkDebitAmt(String InvId, Connection conn) throws SQLException {
PreparedStatement pstmt2 = null;
ResultSet rs2 = null;
int sumDebitNote = 0;
boolean errFlag = false;
String sql2 = "SELECT SUM(D.DEBIT_NOTE_AMT) from spl_sales_por_hdr h,spl_sales_por_det d WHERE H.TRAN_ID = D.TRAN_ID AND H.INVOICE_ID =?";
try {
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1, InvId);
rs2 = pstmt2.executeQuery();
if (rs2.next()) {
System.out
.println(" **** Inside checkDebitAmt While loop **** ");
sumDebitNote = rs2.getInt(1);
System.out.println(" FOr invoice ID => " + InvId
+ "sumDebitNote is ==> " + sumDebitNote);
if (sumDebitNote >= 100) {
errFlag = true;
}
}
} catch (Exception e) {
System.out.println("Exception in checkDebitAmt!!> " + e);
e.printStackTrace();
}
finally
{
if (rs2 != null) {
rs2.close();
rs2 = null;
}
if (pstmt2 != null) {
pstmt2.close();
pstmt2 = null;
}
}
return false;
}
private ArrayList<String> getDoneInvoiceIdHDR(Connection conn, private ArrayList<String> getDoneInvoiceIdHDR(Connection conn,
ArrayList<String> inv45dayListL) { ArrayList<String> inv45dayListL) {
System.out System.out
...@@ -1502,6 +1593,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -1502,6 +1593,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
pstmt.setString(1, id); pstmt.setString(1, id);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { while (rs.next()) {
System.out
.println("Inside 1st while Loop of generateDebitNote!!!");
// lineNoTrace=rs.getInt(1); // lineNoTrace=rs.getInt(1);
qty = rs.getDouble(1); qty = rs.getDouble(1);
itemCode = rs.getString(2); itemCode = rs.getString(2);
...@@ -1536,72 +1630,51 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -1536,72 +1630,51 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
// Ingnore the invoice having Debit Note less than // Ingnore the invoice having Debit Note less than
// 100 // 100
String sql2 = "SELECT SUM(D.DEBIT_NOTE_AMT) from spl_sales_por_hdr h,spl_sales_por_det d WHERE H.TRAN_ID = D.TRAN_ID AND H.INVOICE_ID =?"; System.out
pstmt2 = conn.prepareStatement(sql1); .println("*** Generating Debit Note for Invoice having debit Amount greater than 100/-!");
pstmt2.setString(1, id);
rs2 = pstmt2.executeQuery();
while (rs2.next()) {
sumDebitNote = rs2.getInt(1);
if (sumDebitNote > 100) {
qtyM = rs1.getDouble(1);
itemCodeM = rs1.getString(2);
lotNoM = rs1.getString(3);
lotSlM = rs1.getString(4);
itemCodeM = itemCodeM == null ? ""
: itemCodeM.trim();
lotNoM = lotNoM == null ? "" : lotNoM
.trim();
lotSlM = lotSlM == null ? "" : lotSlM
.trim();
System.out.println("itemCode-->>["
+ itemCode + "] itemCodeM-->["
+ itemCodeM + "]");
System.out.println("lotNo-->>[" + lotNo
+ "] lotNoM-->[" + lotNoM + "]");
System.out.println("lotSl-->>[" + lotSl
+ "] lotSlM-->[" + lotSlM + "]");
System.out.println("qty-->>[" + qty
+ "] qtyM-->[" + qtyM + "]");
if (qtyM < qty
&& itemCode
.equalsIgnoreCase(itemCodeM)
&& lotNoM.equalsIgnoreCase(lotNo)
&& lotSlM.equalsIgnoreCase(lotSl)) {
InvIDTemp.add(id);
partialInvoiceMapG.put(id + ":"
+ itemCode + ":" + lotNoM + ":"
+ lotSlM, qty - qtyM);
System.out
.println("partial map11111----->>["
+ partialInvoiceMapG
+ "]");
} else {
System.out
.println("deleted ID--------->>["
+ deleteId + "]");
if (deleteId == 1) {
System.out
.println("----in remove iterator condition--------");
it.remove();
// break;
}
deleteId++;
// inv45dayListL.remove(id);
} qtyM = rs1.getDouble(1);
// ENF OF IF DR_AMT<100 itemCodeM = rs1.getString(2);
lotNoM = rs1.getString(3);
lotSlM = rs1.getString(4);
itemCodeM = itemCodeM == null ? "" : itemCodeM
.trim();
lotNoM = lotNoM == null ? "" : lotNoM.trim();
lotSlM = lotSlM == null ? "" : lotSlM.trim();
System.out.println("itemCode-->>[" + itemCode
+ "] itemCodeM-->[" + itemCodeM + "]");
System.out.println("lotNo-->>[" + lotNo
+ "] lotNoM-->[" + lotNoM + "]");
System.out.println("lotSl-->>[" + lotSl
+ "] lotSlM-->[" + lotSlM + "]");
System.out.println("qty-->>[" + qty + "] qtyM-->["
+ qtyM + "]");
if (qtyM < qty
&& itemCode.equalsIgnoreCase(itemCodeM)
&& lotNoM.equalsIgnoreCase(lotNo)
&& lotSlM.equalsIgnoreCase(lotSl)) {
InvIDTemp.add(id);
partialInvoiceMapG.put(id + ":" + itemCode
+ ":" + lotNoM + ":" + lotSlM, qty
- qtyM);
System.out.println("partial map11111----->>["
+ partialInvoiceMapG + "]");
} else { } else {
System.out.println("deleted ID--------->>["
+ deleteId + "]");
if (deleteId == 1) {
System.out System.out
.println("Debit_Note Amount is less than 100 =>" .println("----in remove iterator condition--------");
+ sumDebitNote); it.remove();
// break;
} }
}// End of While rs2 deleteId++;
// inv45dayListL.remove(id);
}
// ENF OF IF DR_AMT<100
} // end while 3 } // end while 3
if (rs1 != null) { if (rs1 != null) {
...@@ -1886,6 +1959,7 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -1886,6 +1959,7 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
ProofOfDeliveryConf podC = ProofOfDeliveryConf.getInstance(); ProofOfDeliveryConf podC = ProofOfDeliveryConf.getInstance();
int count = 0, cnt1 = 0, cnt2 = 0, itemCnt = 0; int count = 0, cnt1 = 0, cnt2 = 0, itemCnt = 0;
Connection conn1 = null; Connection conn1 = null;
boolean invstatus;
ConnDriver connDriver1 = new ConnDriver(); ConnDriver connDriver1 = new ConnDriver();
try { try {
conn1 = connDriver1.getConnectDB("DriverITM"); conn1 = connDriver1.getConnectDB("DriverITM");
...@@ -2044,8 +2118,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -2044,8 +2118,9 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
netPTS = chargQty / (chargQty + freeQty) netPTS = chargQty / (chargQty + freeQty)
* priceListRate; * priceListRate;
System.out.println("Net PTS rate----->>[" System.out
+ netPTS + "]"); .println("Net PchangeEditable(this)TS rate----->>["
+ netPTS + "]");
actualRate = netPTS - invRate; actualRate = netPTS - invRate;
detail3Amt = actualRate * invQty; detail3Amt = actualRate * invQty;
detail3AmtT = detail3AmtT + detail3Amt; detail3AmtT = detail3AmtT + detail3Amt;
...@@ -2105,11 +2180,23 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal, ...@@ -2105,11 +2180,23 @@ public class PODProcess extends ProcessEJB implements PODProcessLocal,
.toString()); // xmlStringAll .toString()); // xmlStringAll
ExchRate = Double.parseDouble(invoiceDetailsMap.get( ExchRate = Double.parseDouble(invoiceDetailsMap.get(
"exch_rate").toString()); "exch_rate").toString());
errString = podC.genDebitNote("PRC", invIdPartial,
custCode, siteCodeG, xtraParamsG, currCode, // check the debit note is greater than 100 or not
ExchRate, detail2xmlString, detail3AmtT, conn); invstatus = checkDebitAmt(invIdPartial, conn);
System.out.println("------Error string after DN save--->>["
+ errString + "]"); System.out.println("invstatus invIdPartial =>"
+ invIdPartial);
if (invstatus) {
errString = podC.genDebitNote("PRC", invIdPartial,
custCode, siteCodeG, xtraParamsG, currCode,
ExchRate, detail2xmlString, detail3AmtT, conn);
System.out
.println("------Error string after DN save--->>["
+ errString + "]");
} else {
errString = "Invalid Debit";
}
if (errString.indexOf("Success") > -1) { if (errString.indexOf("Success") > -1) {
System.out System.out
.println("Tran id for Misc. debit note------->>[" .println("Tran id for Misc. debit note------->>["
......
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