Commit 4c8a54d7 authored by Ajit Deshmukh's avatar Ajit Deshmukh

Replace ReqForQuotationIC.java

parent 3ca68f8f
......@@ -11,6 +11,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.w3c.dom.Document;
......@@ -481,6 +482,24 @@ public class ReqForQuotationIC extends ValidatorEJB {
case 1:
{
valueXmlString.append("<Detail1>");
if ("itm_default".equalsIgnoreCase(currentColumn.trim())) {
BaseLogger.log("3", null, null, "ReqForQuotationIC in itm_default case 1");
// Set tran_date to current date
SimpleDateFormat dtFormat = new SimpleDateFormat(getApplDateFormat());
String currDate = dtFormat.format(Calendar.getInstance().getTime());
valueXmlString.append("<tran_date>").append("<![CDATA[" + currDate + "]]>").append("</tran_date>\r\n");
// Set req_date to current date
valueXmlString.append("<req_date>").append("<![CDATA[" + currDate + "]]>").append("</req_date>\r\n");
// Set site_code to logged in user's site code
valueXmlString.append("<site_code>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>\r\n");
valueXmlString.append("<quot_type>").append("<![CDATA[C]]>").append("</quot_type>");
// Set sales_pers to logged in user's code
valueXmlString.append("<sales_pers>").append("<![CDATA[" + userCode + "]]>").append("</sales_pers>\r\n");
}
if ("cust_code".equalsIgnoreCase(currentColumn.trim())) {
BaseLogger.log("3", null, null, "ReqForQuotationIC in item change case 1 cust_code condition");
......@@ -889,12 +908,14 @@ public class ReqForQuotationIC extends ValidatorEJB {
if (rateApprvVal.compareTo(rateQuotVal) > 0) {
BaseLogger.log("3", null, null, "in rateApprvVal greater condition");
BaseLogger.log("3", null, null, "in rateApprvVal greater condition valueXmlString::"+ valueXmlString);
String detail1Xml = "<mgmnt_apprv><![CDATA[Y]]></mgmnt_apprv><wf_status><![CDATA[P]]></wf_status>";
int pos = valueXmlString.indexOf("<Detail1>");
int pos = valueXmlString.indexOf("<header>");
if (pos != -1) {
pos += "<Detail1>".length(); // move after </header>
pos += "<header>".length(); // move after </header>
valueXmlString.insert(pos, detail1Xml);
}
......
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