Commit 020295ed authored by Mohammed Dohadwala's avatar Mohammed Dohadwala

Added item code logic. auto populates unit and pack code.

parent d40c7c2a
......@@ -1088,17 +1088,23 @@ public class ReqForQuotationIC extends ValidatorEJB {
}
if ("item_code".equalsIgnoreCase(currentColumn.trim())) {
String itemDescr = "";
String unit = "";
String packCode = "";
BaseLogger.log("3", null, null, "ReqForQuotationIC in item_code ");
String itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
String itemDescrSql = "select descr from item where item_code = ?";
String itemDescrSql = "select descr,unit,pack_code from item where item_code = ?";
PreparedStatement itemDescrPs = con.prepareStatement(itemDescrSql);
itemDescrPs.setString(1, itemCode);
ResultSet itemDescrRs = itemDescrPs.executeQuery();
while(itemDescrRs.next()) {
itemDescr = itemDescrRs.getString("descr");
itemDescr = checkNull(itemDescrRs.getString("descr"));
unit = checkNull(itemDescrRs.getString("unit"));
packCode = checkNull(itemDescrRs.getString("pack_code"));
}
valueXmlString.append("<descr>").append("<![CDATA["+itemDescr+"]]>").append("</descr>\r\n");
valueXmlString.append("<descr>").append("<![CDATA["+itemDescr+"]]>").append("</descr>\r\n");
valueXmlString.append("<unit protect='1'>").append("<![CDATA["+unit+"]]>").append("</unit>\r\n");
valueXmlString.append("<pack_code protect='1'>").append("<![CDATA["+packCode+"]]>").append("</pack_code>\r\n");
}
if ("ptr_flag".equalsIgnoreCase(currentColumn.trim())) {
......@@ -1127,6 +1133,27 @@ public class ReqForQuotationIC extends ValidatorEJB {
String itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
String rateApprv = checkNull(genericUtility.getColumnValue("rate_apprv", dom));
String ratePtr = checkNull(genericUtility.getColumnValue("ptr", dom));
String qtyStr = checkNull(genericUtility.getColumnValue("qty_quot", dom));
String rateQuotStr = checkNull(genericUtility.getColumnValue("rate_quot", dom));
int qty = 0;
int rateQuotInt = 0;
int value = 0;
BaseLogger.log("3", null, null, "ReqForQuotationWiz in qty_quot condition qtyStr:: " + qtyStr);
BaseLogger.log("3", null, null,
"ReqForQuotationWiz in qty_quot condition rateQuotStr:: " + rateQuotStr);
try {
qty = (qtyStr != null && qtyStr.trim().length() > 0) ? Integer.parseInt(qtyStr.trim()) : 0;
rateQuotInt = (rateQuotStr != null && rateQuotStr.trim().length() > 0)
? Integer.parseInt(rateQuotStr.trim())
: 0;
value = qty*rateQuotInt;
BaseLogger.log("3", null, null, "ReqForQuotationWiz in qty:: " + qty + " rateQuotInt::"
+ rateQuotInt + " value::" + value);
} catch (Exception e) {
BaseLogger.log("3", null, null, "Error parsing margin values");
}
BaseLogger.log("3", null, null, "ReqForQuotationIC in rate_quot:: "+rateQuot+" rateApprv::"+rateApprv+ " ratePtr::"+ratePtr+" itemCode::"+itemCode);
BaseLogger.log("3", null, null, "ReqForQuotationIC in rate_quot:: "+rateQuot+" rateApprv::"+rateApprv+ " ratePtr::"+ratePtr+" itemCode::"+itemCode);
......@@ -1136,8 +1163,6 @@ public class ReqForQuotationIC extends ValidatorEJB {
BigDecimal rateQuotVal = new BigDecimal(rateQuot);
BigDecimal ratePtrVal = new BigDecimal(ratePtr);
BaseLogger.log("3", null, null, "ReqForQuotationIC after conversion rateQuotVal:: "+rateQuotVal+" rateApprvVal::"+rateApprvVal+ " ratePtrVal::"+ratePtrVal);
// added condition when ptr and rate_quot is same direct approval without management
if (ratePtrVal.compareTo(rateQuotVal) == 0) {
......@@ -1244,6 +1269,7 @@ public class ReqForQuotationIC extends ValidatorEJB {
valueXmlString.append("<revised_ptr>").append("<![CDATA[" + revisedPtr + "]]>").append("</revised_ptr>\r\n");
valueXmlString.append("<revised_pts>").append("<![CDATA[" + revisedPts + "]]>").append("</revised_pts>\r\n");
valueXmlString.append("<revised_ptd>").append("<![CDATA[" + revisedPtd + "]]>").append("</revised_ptd>\r\n");
valueXmlString.append("<value>").append("<![CDATA[" + value + "]]>").append("</value>\r\n");
}
......
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