Commit c6e19a63 authored by SABURI PATEKAR's avatar SABURI PATEKAR

Fixed issue of when the Quotation Number is clear on item change, the

corresponding records are not cleared.
parent 4b03806e
...@@ -916,6 +916,7 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal, ...@@ -916,6 +916,7 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal,
valueXmlString.append("<inq_date>").append("<![CDATA["+currentDateTime+"]]>").append("</inq_date>"); valueXmlString.append("<inq_date>").append("<![CDATA["+currentDateTime+"]]>").append("</inq_date>");
valueXmlString.append("<valid_upto>").append("<![CDATA["+currentDateTime+"]]>").append("</valid_upto>"); valueXmlString.append("<valid_upto>").append("<![CDATA["+currentDateTime+"]]>").append("</valid_upto>");
valueXmlString.append("<status_date>").append("<![CDATA["+currentDateTime+"]]>").append("</status_date>"); valueXmlString.append("<status_date>").append("<![CDATA["+currentDateTime+"]]>").append("</status_date>");
valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>");
} }
else if(currentColumn.equalsIgnoreCase("cust_code")) else if(currentColumn.equalsIgnoreCase("cust_code"))
{ {
...@@ -1197,7 +1198,7 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal, ...@@ -1197,7 +1198,7 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal,
quotDateTs = rs.getTimestamp("quot_date"); quotDateTs = rs.getTimestamp("quot_date");
quotType = checkNull(rs.getString("quot_type")); quotType = checkNull(rs.getString("quot_type"));
custCode = checkNull(rs.getString("cust_code")); custCode = checkNull(rs.getString("cust_code"));
inqDateTs = checkNull(rs.getTimestamp("inq_date")); inqDateTs = rs.getTimestamp("inq_date");
inqSource = checkNull(rs.getString("inq_source")); inqSource = checkNull(rs.getString("inq_source"));
validUptoTs = rs.getTimestamp("valid_upto"); validUptoTs = rs.getTimestamp("valid_upto");
empCodeConf1 = checkNull(rs.getString("emp_code__conf")); empCodeConf1 = checkNull(rs.getString("emp_code__conf"));
...@@ -1288,6 +1289,7 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal, ...@@ -1288,6 +1289,7 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal,
valueXmlString.append("<quot_type>").append("<![CDATA["+quotType+"]]>").append("</quot_type>"); valueXmlString.append("<quot_type>").append("<![CDATA["+quotType+"]]>").append("</quot_type>");
valueXmlString.append("<cust_code>").append("<![CDATA["+custCode+"]]>").append("</cust_code>"); valueXmlString.append("<cust_code>").append("<![CDATA["+custCode+"]]>").append("</cust_code>");
valueXmlString.append("<cust_name>").append("<![CDATA["+custName+"]]>").append("</cust_name>"); valueXmlString.append("<cust_name>").append("<![CDATA["+custName+"]]>").append("</cust_name>");
BaseLogger.log("3", getUserInfo(), null, "inqDateTs 1293>>"+inqDateTs);
if(inqDateTs != null) if(inqDateTs != null)
{ {
valueXmlString.append("<inq_date>").append("<![CDATA["+sdf.format(inqDateTs)+"]]>").append("</inq_date>"); valueXmlString.append("<inq_date>").append("<![CDATA["+sdf.format(inqDateTs)+"]]>").append("</inq_date>");
...@@ -1333,6 +1335,51 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal, ...@@ -1333,6 +1335,51 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal,
valueXmlString.append("<quotation_cost>").append("<![CDATA["+quotationCost1+"]]>").append("</quotation_cost>"); valueXmlString.append("<quotation_cost>").append("<![CDATA["+quotationCost1+"]]>").append("</quotation_cost>");
valueXmlString.append("<oppr_id>").append("<![CDATA["+opprId+"]]>").append("</oppr_id>"); valueXmlString.append("<oppr_id>").append("<![CDATA["+opprId+"]]>").append("</oppr_id>");
valueXmlString.append("<orig_quot_ref>").append("<![CDATA["+origQuotRed+"]]>").append("</orig_quot_ref>"); valueXmlString.append("<orig_quot_ref>").append("<![CDATA["+origQuotRed+"]]>").append("</orig_quot_ref>");
valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>");
}
else
{
BaseLogger.log("3", getUserInfo(), null, "quot_no cleared, resetting fields");
valueXmlString.append("<quot_no><![CDATA[]]></quot_no>");
valueXmlString.append("<quot_date><![CDATA[]]></quot_date>");
valueXmlString.append("<quot_type><![CDATA[]]></quot_type>");
valueXmlString.append("<cust_code><![CDATA[]]></cust_code>");
valueXmlString.append("<cust_name><![CDATA[]]></cust_name>");
valueXmlString.append("<inq_date><![CDATA[]]></inq_date>");
valueXmlString.append("<inq_source><![CDATA[]]></inq_source>");
valueXmlString.append("<valid_upto><![CDATA[]]></valid_upto>");
valueXmlString.append("<valid_upto_o><![CDATA[]]></valid_upto_o>");
valueXmlString.append("<emp_code__conf><![CDATA[]]></emp_code__conf>");
valueXmlString.append("<status><![CDATA[]]></status>");
valueXmlString.append("<status_date><![CDATA[]]></status_date>");
valueXmlString.append("<curr_code><![CDATA[]]></curr_code>");
valueXmlString.append("<exch_rate><![CDATA[]]></exch_rate>");
valueXmlString.append("<cont_pers><![CDATA[]]></cont_pers>");
valueXmlString.append("<sales_pers><![CDATA[]]></sales_pers>");
valueXmlString.append("<sp_name><![CDATA[]]></sp_name>");
valueXmlString.append("<enq_no><![CDATA[]]></enq_no>");
valueXmlString.append("<sample_ref><![CDATA[]]></sample_ref>");
valueXmlString.append("<freight><![CDATA[]]></freight>");
valueXmlString.append("<cr_term><![CDATA[]]></cr_term>");
valueXmlString.append("<dlv_term><![CDATA[]]></dlv_term>");
valueXmlString.append("<term_table><![CDATA[]]></term_table>");
valueXmlString.append("<stockist_code__dlv><![CDATA[]]></stockist_code__dlv>");
valueXmlString.append("<dlv_location><![CDATA[]]></dlv_location>");
valueXmlString.append("<site_code><![CDATA[]]></site_code>");
valueXmlString.append("<price_list><![CDATA[]]></price_list>");
valueXmlString.append("<supply_leadtime><![CDATA[]]></supply_leadtime>");
valueXmlString.append("<item_ser><![CDATA[]]></item_ser>");
valueXmlString.append("<tax_class><![CDATA[]]></tax_class>");
valueXmlString.append("<tax_chap><![CDATA[]]></tax_chap>");
valueXmlString.append("<tax_env><![CDATA[]]></tax_env>");
valueXmlString.append("<parent_quot_no><![CDATA[]]></parent_quot_no>");
valueXmlString.append("<prnp_quot><![CDATA[]]></prnp_quot>");
valueXmlString.append("<vat><![CDATA[]]></vat>");
valueXmlString.append("<quotation_cost><![CDATA[]]></quotation_cost>");
valueXmlString.append("<oppr_id><![CDATA[]]></oppr_id>");
valueXmlString.append("<orig_quot_ref><![CDATA[]]></orig_quot_ref>");
valueXmlString.append("<confirmed><![CDATA[N]]></confirmed>");
} }
} }
...@@ -1350,6 +1397,17 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal, ...@@ -1350,6 +1397,17 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal,
valueXmlString.append("<amd_no protect=\"1\">").append("<![CDATA[" + amdNo1 + "]]>").append("</amd_no>"); valueXmlString.append("<amd_no protect=\"1\">").append("<![CDATA[" + amdNo1 + "]]>").append("</amd_no>");
valueXmlString.append("</Detail3>"); valueXmlString.append("</Detail3>");
} }
else
{
valueXmlString.append("<Detail2>");
valueXmlString.append("<quot_no protect=\"1\">").append("<![CDATA[]]>").append("</quot_no>");
valueXmlString.append("<amd_no protect=\"1\">").append("<![CDATA[]]>").append("</amd_no>");
valueXmlString.append("</Detail2>");
valueXmlString.append("<Detail3>");
valueXmlString.append("<quot_no protect=\"1\">").append("<![CDATA[]]>").append("</quot_no>");
valueXmlString.append("<amd_no protect=\"1\">").append("<![CDATA[]]>").append("</amd_no>");
valueXmlString.append("</Detail3>");
}
} }
break; break;
...@@ -1610,6 +1668,35 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal, ...@@ -1610,6 +1668,35 @@ public class SalesQuotationAmdIC extends ValidatorEJB implements ValidatorLocal,
valueXmlString.append("<dlv_at>").append("<![CDATA["+detDlvAt+"]]>").append("</dlv_at>"); valueXmlString.append("<dlv_at>").append("<![CDATA["+detDlvAt+"]]>").append("</dlv_at>");
valueXmlString.append("<spec_ref>").append("<![CDATA["+detSpecRef+"]]>").append("</spec_ref>"); valueXmlString.append("<spec_ref>").append("<![CDATA["+detSpecRef+"]]>").append("</spec_ref>");
} }
if(itemCode == null || itemCode.trim().length() == 0)
{
valueXmlString.append("<item_code><![CDATA[]]></item_code>");
valueXmlString.append("<item_descr><![CDATA[]]></item_descr>");
valueXmlString.append("<unit><![CDATA[]]></unit>");
valueXmlString.append("<unit__rate><![CDATA[]]></unit__rate>");
valueXmlString.append("<unit__sampl><![CDATA[]]></unit__sampl>");
valueXmlString.append("<item_spec><![CDATA[]]></item_spec>");
valueXmlString.append("<quantity><![CDATA[0]]></quantity>");
valueXmlString.append("<quantity_o><![CDATA[0]]></quantity_o>");
valueXmlString.append("<rate><![CDATA[0]]></rate>");
valueXmlString.append("<rate__clg><![CDATA[0]]></rate__clg>");
valueXmlString.append("<sampl_qty><![CDATA[0]]></sampl_qty>");
valueXmlString.append("<pack_qty><![CDATA[0]]></pack_qty>");
valueXmlString.append("<remarks><![CDATA[]]></remarks>");
valueXmlString.append("<pack_instr><![CDATA[]]></pack_instr>");
valueXmlString.append("<cr_term><![CDATA[]]></cr_term>");
valueXmlString.append("<dlv_term><![CDATA[]]></dlv_term>");
valueXmlString.append("<pack_code><![CDATA[]]></pack_code>");
valueXmlString.append("<dlv_at><![CDATA[]]></dlv_at>");
valueXmlString.append("<spec_ref><![CDATA[]]></spec_ref>");
valueXmlString.append("<tax_class><![CDATA[]]></tax_class>");
valueXmlString.append("<tax_chap><![CDATA[]]></tax_chap>");
valueXmlString.append("<tax_env><![CDATA[]]></tax_env>");
}
//Added by Sakshi.P on 27/Oct/2025 //Added by Sakshi.P on 27/Oct/2025
String lsTaxChapHdr="",lsTaxClassHdr="",lsTaxEnvHdr="",lsSiteCode="",stanCodeFr="",stanCodeTo="",lsItemser=""; String lsTaxChapHdr="",lsTaxClassHdr="",lsTaxEnvHdr="",lsSiteCode="",stanCodeFr="",stanCodeTo="",lsItemser="";
......
...@@ -1814,7 +1814,22 @@ public class SalesQuotationIC extends ValidatorEJB implements ValidatorLocal,Val ...@@ -1814,7 +1814,22 @@ public class SalesQuotationIC extends ValidatorEJB implements ValidatorLocal,Val
BaseLogger.log("3", getUserInfo(), null, "custCodeStk [" + custCodeStk + "]"); BaseLogger.log("3", getUserInfo(), null, "custCodeStk [" + custCodeStk + "]");
BaseLogger.log("3", getUserInfo(), null, "custCode [" + custCode + "]"); BaseLogger.log("3", getUserInfo(), null, "custCode [" + custCode + "]");
if(custCodeStk.trim().length() > 0 && custCode.trim().length() > 0) if(custCodeStk.trim().length() == 0)
{
BaseLogger.log("3", getUserInfo(), null, "Detail3 cust_code__stk triggered 1820");
setNodeValue(dom, "cust_code__stk", "");
setNodeValue(dom, "cust_code__dist", "");
setNodeValue(dom, "site_code__pbus", "");
setNodeValue(dom, "distributor_name", "");
valueXmlString.append("<cust_code__stk><![CDATA[]]></cust_code__stk>");
valueXmlString.append("<stockist_name><![CDATA[]]></stockist_name>");
valueXmlString.append("<cust_code__dist><![CDATA[]]></cust_code__dist>");
valueXmlString.append("<distributor_name><![CDATA[]]></distributor_name>");
valueXmlString.append("<site_code__pbus><![CDATA[]]></site_code__pbus>");
valueXmlString.append("<city><![CDATA[]]></city>");
}
else if(custCodeStk.trim().length() > 0 && custCode.trim().length() > 0)
{ {
sql = "SELECT CUST_CODE__DIST FROM CUSTOMER_PREF_DIST WHERE CUST_CODE__STK = ? AND CUST_CODE = ?"; sql = "SELECT CUST_CODE__DIST FROM CUSTOMER_PREF_DIST WHERE CUST_CODE__STK = ? AND CUST_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1832,9 +1847,6 @@ public class SalesQuotationIC extends ValidatorEJB implements ValidatorLocal,Val ...@@ -1832,9 +1847,6 @@ public class SalesQuotationIC extends ValidatorEJB implements ValidatorLocal,Val
custCodeDist = checkNull(custCodeDist); custCodeDist = checkNull(custCodeDist);
setNodeValue(dom, "cust_code__dist", custCodeDist);
}
if(custCodeDist.trim().length() > 0) if(custCodeDist.trim().length() > 0)
{ {
sql = "SELECT CUST_NAME, SITE_CODE__PBUS FROM CUSTOMER WHERE CUST_CODE = ?"; sql = "SELECT CUST_NAME, SITE_CODE__PBUS FROM CUSTOMER WHERE CUST_CODE = ?";
...@@ -1848,24 +1860,23 @@ public class SalesQuotationIC extends ValidatorEJB implements ValidatorLocal,Val ...@@ -1848,24 +1860,23 @@ public class SalesQuotationIC extends ValidatorEJB implements ValidatorLocal,Val
siteCode = rs.getString("site_code__pbus"); siteCode = rs.getString("site_code__pbus");
} }
rs.close(); rs = null; rs.close(); pstmt.close();
pstmt.close(); pstmt = null;
distributorName = checkNull(distributorName); distributorName = checkNull(distributorName);
siteCode = checkNull(siteCode); siteCode = checkNull(siteCode);
setNodeValue(dom, "site_code__pbus", siteCode); setNodeValue(dom, "site_code__pbus", siteCode);
setNodeValue(dom, "distributor_name", distributorName); setNodeValue(dom, "distributor_name", distributorName);
setNodeValue(dom, "cust_code__dist", custCodeDist);
} }
valueXmlString.append("<cust_code__dist>").append("<![CDATA["+custCodeDist+"]]>").append("</cust_code__dist>"); valueXmlString.append("<cust_code__dist>").append("<![CDATA["+custCodeDist+"]]>").append("</cust_code__dist>");
valueXmlString.append("<stockist_name>").append("<![CDATA["+checkNull(stockistName)+"]]>").append("</stockist_name>"); valueXmlString.append("<stockist_name>").append("<![CDATA["+checkNull(stockistName)+"]]>").append("</stockist_name>");
valueXmlString.append("<city>").append("<![CDATA["+checkNull(cityName)+"]]>").append("</city>"); valueXmlString.append("<city>").append("<![CDATA["+checkNull(cityName)+"]]>").append("</city>");
valueXmlString.append("<site_code__pbus>").append("<![CDATA["+checkNull(siteCode)+"]]>").append("</site_code__pbus>"); valueXmlString.append("<site_code__pbus>").append("<![CDATA["+checkNull(siteCode)+"]]>").append("</site_code__pbus>");
BaseLogger.log("3", getUserInfo(), null, "siteCode 1826 [" + siteCode + "]"); BaseLogger.log("3", getUserInfo(), null, "siteCode 1877 [" + siteCode + "]");
setNodeValue(dom, "site_code__pbus", siteCode);
valueXmlString.append("<distributor_name>").append("<![CDATA["+checkNull(distributorName)+"]]>").append("</distributor_name>"); valueXmlString.append("<distributor_name>").append("<![CDATA["+checkNull(distributorName)+"]]>").append("</distributor_name>");
} }
}
valueXmlString.append("</Detail3>"); valueXmlString.append("</Detail3>");
} }
break; break;
......
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