Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Component Sharing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gagandeep Singh Bhatia
Component Sharing
Commits
4b03806e
Commit
4b03806e
authored
Apr 01, 2026
by
Mohammed Dohadwala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected for loop to include all the quotation details in every iteration.
parent
4f2a8e1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
414 additions
and
19 deletions
+414
-19
Mohammed/Sales Contract1/SalesContractFromSalesQuot.java
Mohammed/Sales Contract1/SalesContractFromSalesQuot.java
+414
-19
No files found.
Mohammed/Sales Contract1/SalesContractFromSalesQuot.java
View file @
4b03806e
package
ibase
.
webitm
.
ejb
.
dis
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
javax.naming.InitialContext
;
import
ibase.system.config.AppConnectParm
;
import
ibase.system.config.ConnDriver
;
import
ibase.utility.BaseLogger
;
import
ibase.utility.E12GenericUtility
;
import
ibase.utility.UserInfoBean
;
import
ibase.webitm.ejb.ActionHandlerEJB
;
import
ibase.webitm.ejb.DBAccessEJB
;
import
ibase.webitm.ejb.MasterStatefulLocal
;
import
ibase.webitm.utility.ITMException
;
/*
* Author : Mohammed D
* Date : 09-03-2026
* Purpose : Follow Up Action on Sales Quote
*/
public
class
SalesContractFromSalesQuot
extends
ActionHandlerEJB
{
public
String
confirmCreateSalesContract
(
String
tranID
,
String
xtraParam
,
Connection
conn
)
throws
ITMException
{
String
result
=
""
;
DBAccessEJB
dbAccessEJB
=
new
DBAccessEJB
();
public
String
confirmCreateSalesContract
(
String
tranID
,
String
xtraParam
,
Connection
conn
)
throws
ITMException
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"=== SalesContractFromSalesQuot START ==="
);
String
result
=
""
;
PreparedStatement
pstmt
=
null
;
ResultSet
rs
=
null
;
try
{
if
(
conn
==
null
)
{
ConnDriver
connDriver
=
new
ConnDriver
();
conn
=
connDriver
.
getConnectDB
(
getUserInfo
().
getTransDB
());
}
String
sql
=
"SELECT LINE_NO, CUST_CODE__STK, CUST_CODE__DIST "
+
"FROM SALES_QUOT_STOCKIST WHERE QUOT_NO=? ORDER BY LINE_NO"
;
pstmt
=
conn
.
prepareStatement
(
sql
);
pstmt
.
setString
(
1
,
tranID
);
rs
=
pstmt
.
executeQuery
();
int
iteration
=
0
;
while
(
rs
.
next
())
// Loop
{
iteration
++;
String
lineNo
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"LINE_NO"
));
String
custCodeStk
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"CUST_CODE__STK"
));
String
custCodeDist
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"CUST_CODE__DIST"
));
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Iteration="
+
iteration
+
" LINE_NO="
+
lineNo
+
" STK="
+
custCodeStk
+
" DIST="
+
custCodeDist
);
// Header
String
headerXML
=
generateTransXMLForHeader
(
tranID
,
custCodeStk
,
custCodeDist
,
getUserInfo
(),
conn
);
// Detail
String
detailXML
=
generateTransXMLForDetail
(
tranID
,
custCodeDist
,
getUserInfo
(),
conn
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"DEBUG: Iter="
+
iteration
+
" | tranID="
+
tranID
+
" | lineNo="
+
lineNo
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"\n\n===\n"
+
"ITERATION: "
+
iteration
+
"\n"
+
"DETAIL1 \n"
+
"===\n"
+
headerXML
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"\n\n===\n"
+
"ITERATION: "
+
iteration
+
"\n"
+
"DETAIL2 \n"
+
"===\n"
+
detailXML
);
// Create transaction
result
=
createSalesContract
(
headerXML
,
detailXML
,
getUserInfo
(),
conn
,
tranID
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"\n\n===\n"
+
"ITERATION: "
+
iteration
+
"\n"
+
"Result \n"
+
"===\n"
+
result
);
}
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Total transactions created = "
+
iteration
);
}
catch
(
Exception
e
)
{
throw
new
ITMException
(
e
);
}
finally
{
try
{
if
(
rs
!=
null
)
rs
.
close
();
}
catch
(
Exception
e
){}
try
{
if
(
pstmt
!=
null
)
pstmt
.
close
();
}
catch
(
Exception
e
){}
}
BaseLogger
.
log
(
"3"
,
null
,
null
,
"=== SalesContractFromSalesQuot END ==="
);
return
result
;
}
public
String
generateTransXMLForHeader
(
String
tranID
,
String
custCodeStk
,
String
custCodeDist
,
UserInfoBean
userInfo
,
Connection
conn
)
{
StringBuffer
transXML
=
new
StringBuffer
();
String
siteCode
=
""
;
String
quotType
=
""
;
String
currCode
=
""
;
String
exchRate
=
""
;
String
salesPers
=
""
;
String
itemSer
=
""
;
String
priceList
=
""
;
String
udfStr1
=
""
;
String
udfNum1
=
""
;
String
taxClass
=
""
;
String
taxChap
=
""
;
String
taxEnv
=
""
;
String
crTerm
=
""
;
String
dlvTerm
=
""
;
String
remarks
=
""
;
String
dlvTo
=
""
;
String
validUptoFromSalesQuot
=
""
;
String
effDate
=
""
;
try
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"generateTransXMLForHeader called. tranID=["
+
tranID
+
"] custCodeStk=["
+
custCodeStk
+
"] custCodeDist=["
+
custCodeDist
+
"]"
);
if
(
tranID
==
null
||
tranID
.
trim
().
length
()
==
0
)
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"generateTransXMLForHeader: tranID is blank. Skipping header mapping."
);
return
""
;
}
quotType
=
getDbValueWithLog
(
"SALES_QUOT"
,
"QUOT_TYPE"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
currCode
=
getDbValueWithLog
(
"SALES_QUOT"
,
"CURR_CODE"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
exchRate
=
getDbValueWithLog
(
"SALES_QUOT"
,
"EXCH_RATE"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
salesPers
=
getDbValueWithLog
(
"SALES_QUOT"
,
"SALES_PERS"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
itemSer
=
getDbValueWithLog
(
"SALES_QUOT"
,
"ITEM_SER"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
priceList
=
getDbValueWithLog
(
"SALES_QUOT"
,
"PRICE_LIST"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
udfStr1
=
getDbValueWithLog
(
"SALES_QUOT"
,
"UDF_STR1"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
udfNum1
=
getDbValueWithLog
(
"SALES_QUOT"
,
"UDF_NUM1"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
taxClass
=
getDbValueWithLog
(
"SALES_QUOT"
,
"TAX_CLASS"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
taxChap
=
getDbValueWithLog
(
"SALES_QUOT"
,
"TAX_CHAP"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
taxEnv
=
getDbValueWithLog
(
"SALES_QUOT"
,
"TAX_ENV"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
crTerm
=
getDbValueWithLog
(
"SALES_QUOT"
,
"CR_TERM"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
dlvTerm
=
getDbValueWithLog
(
"SALES_QUOT"
,
"DLV_TERM"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
remarks
=
getDbValueWithLog
(
"SALES_QUOT"
,
"REMARKS"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
dlvTo
=
getDbValueWithLog
(
"SALES_QUOT"
,
"STOCKIST_CODE__DLV"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
effDate
=
getDbValueWithLog
(
"SALES_QUOT"
,
"FROM_DATE"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
validUptoFromSalesQuot
=
getDbValueWithLog
(
"SALES_QUOT"
,
"VALID_UPTO"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
siteCode
=
getDbValueWithLog
(
"CUSTOMER"
,
"SITE_CODE__PBUS"
,
"CUST_CODE='"
+
custCodeDist
+
"'"
,
userInfo
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Header values fetched -> custCodeStk:["
+
custCodeStk
+
"] custCodeDist:["
+
custCodeDist
+
"] siteCode:["
+
siteCode
+
"]"
+
" quotType:["
+
quotType
+
"] itemSer:["
+
itemSer
+
"] salesPers:["
+
salesPers
+
"] currCode:["
+
currCode
+
"] exchRate:["
+
exchRate
+
"]"
+
" priceList:["
+
priceList
+
"] taxClass:["
+
taxClass
+
"] taxChap:["
+
taxChap
+
"] taxEnv:["
+
taxEnv
+
"] crTerm:["
+
crTerm
+
"]"
+
" dlvTerm:["
+
dlvTerm
+
"] udfStr1:["
+
udfStr1
+
"] udfNum1:["
+
udfNum1
+
"] dlvTo:["
+
dlvTo
+
"]"
+
" effDate:["
+
effDate
+
"] validUpto:["
+
validUptoFromSalesQuot
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"effDate:["
+
dateFormatter
(
effDate
)
+
"] validUptoFromSalesQuot:["
+
dateFormatter
(
validUptoFromSalesQuot
)
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Building Header XML"
);
transXML
.
append
(
"<quot_no><![CDATA["
+
tranID
+
"]]></quot_no>"
);
transXML
.
append
(
"<contract_type><![CDATA["
+
quotType
+
"]]></contract_type>"
);
transXML
.
append
(
"<cust_code><![CDATA["
+
custCodeStk
+
"]]></cust_code>"
);
transXML
.
append
(
"<cust_code__dlv><![CDATA["
+
custCodeStk
+
"]]></cust_code__dlv>"
);
transXML
.
append
(
"<cust_code__bil><![CDATA["
+
custCodeStk
+
"]]></cust_code__bil>"
);
transXML
.
append
(
"<site_code><![CDATA["
+
siteCode
+
"]]></site_code>"
);
transXML
.
append
(
"<item_ser><![CDATA["
+
itemSer
+
"]]></item_ser>"
);
transXML
.
append
(
"<sales_pers><![CDATA["
+
salesPers
+
"]]></sales_pers>"
);
transXML
.
append
(
"<sales_pers__1><![CDATA["
+
salesPers
+
"]]></sales_pers__1>"
);
transXML
.
append
(
"<curr_code><![CDATA["
+
currCode
+
"]]></curr_code>"
);
transXML
.
append
(
"<exch_rate><![CDATA["
+
exchRate
+
"]]></exch_rate>"
);
transXML
.
append
(
"<price_list><![CDATA["
+
priceList
+
"]]></price_list>"
);
transXML
.
append
(
"<tax_class><![CDATA["
+
taxClass
+
"]]></tax_class>"
);
transXML
.
append
(
"<tax_chap><![CDATA["
+
taxChap
+
"]]></tax_chap>"
);
transXML
.
append
(
"<tax_env><![CDATA["
+
taxEnv
+
"]]></tax_env>"
);
transXML
.
append
(
"<cr_term><![CDATA["
+
crTerm
+
"]]></cr_term>"
);
transXML
.
append
(
"<dlv_term><![CDATA["
+
dlvTerm
+
"]]></dlv_term>"
);
transXML
.
append
(
"<eff_from><![CDATA["
+
dateFormatter
(
effDate
)
+
"]]></eff_from>"
);
transXML
.
append
(
"<valid_upto><![CDATA["
+
dateFormatter
(
validUptoFromSalesQuot
)
+
"]]></valid_upto>"
);
transXML
.
append
(
"<remarks><![CDATA["
+
remarks
+
"]]></remarks>"
);
transXML
.
append
(
"<udf__str1><![CDATA["
+
udfStr1
+
"]]></udf__str1>"
);
transXML
.
append
(
"<udf__num1><![CDATA["
+
udfNum1
+
"]]></udf__num1>"
);
transXML
.
append
(
"<dlv_to><![CDATA["
+
dlvTo
+
"]]></dlv_to>"
);
transXML
.
append
(
"<site_code__ship><![CDATA["
+
siteCode
+
"]]></site_code__ship>"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Header XML Generated"
);
}
catch
(
Exception
e
)
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Header XML error : "
+
E12GenericUtility
.
getStackTrace
(
e
));
}
return
transXML
.
toString
();
}
public
static
String
dateFormatter
(
String
inputDateString
)
{
String
result
=
""
;
if
(
inputDateString
==
null
||
inputDateString
.
trim
().
length
()
==
0
)
{
return
result
;
}
String
inputFormat
=
"yyyy-MM-dd HH:mm:ss"
;
String
outputFormat
=
"dd/MM/yy HH:mm:ss"
;
try
{
Date
date
=
null
;
SimpleDateFormat
inputFormatter
=
new
SimpleDateFormat
(
inputFormat
);
try
{
date
=
inputFormatter
.
parse
(
inputDateString
);
}
catch
(
Exception
e
)
{
String
[]
altFormats
=
new
String
[]{
"yyyy-MM-dd"
,
"dd-MM-yy"
,
"dd/MM/yy"
,
"dd-MM-yyyy"
,
"dd/MM/yyyy"
,
"yyyy-MM-dd'T'HH:mm:ss"
};
for
(
String
fmt
:
altFormats
)
{
try
{
date
=
new
SimpleDateFormat
(
fmt
).
parse
(
inputDateString
);
break
;
}
catch
(
Exception
ignore
){}
}
if
(
date
==
null
)
{
throw
e
;
}
}
SimpleDateFormat
outputFormatter
=
new
SimpleDateFormat
(
outputFormat
);
String
outputDateString
=
outputFormatter
.
format
(
date
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Input Date: "
+
inputDateString
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Formatted Date: "
+
outputDateString
);
result
=
outputDateString
;
}
catch
(
Exception
e
)
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Exception in dateFormatter. ["
+
E12GenericUtility
.
getStackTrace
(
e
)
+
"]"
);
}
return
result
;
}
public
String
generateTransXMLForDetail
(
String
tranID
,
String
custCodeDist
,
UserInfoBean
userInfo
,
Connection
conn
)
{
StringBuffer
transXML
=
new
StringBuffer
();
PreparedStatement
pstmt
=
null
;
ResultSet
rs
=
null
;
try
{
String
siteCode
=
getDbValueWithLog
(
"CUSTOMER"
,
"SITE_CODE__PBUS"
,
"CUST_CODE='"
+
custCodeDist
+
"'"
,
userInfo
);
String
effFrom
=
getDbValueWithLog
(
"SALES_QUOT"
,
"FROM_DATE"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
String
validUpto
=
getDbValueWithLog
(
"SALES_QUOT"
,
"VALID_UPTO"
,
"QUOT_NO='"
+
tranID
+
"'"
,
userInfo
);
String
sql
=
"SELECT Q.LINE_NO, Q.ITEM_CODE, Q.QUANTITY, Q.UNIT, Q.RATE, Q.DISCOUNT, "
+
"Q.TAX_CLASS, Q.TAX_CHAP, Q.TAX_ENV, Q.REMARKS, Q.UNIT__RATE, Q.RATE__CLG, "
+
"Q.PACK_CODE, I.DESCR ITEM_DESCR "
+
"FROM SALES_QUOTDET Q LEFT JOIN ITEM I ON Q.ITEM_CODE = I.ITEM_CODE "
+
"WHERE Q.QUOT_NO=? ORDER BY Q.LINE_NO"
;
pstmt
=
conn
.
prepareStatement
(
sql
);
pstmt
.
setString
(
1
,
tranID
);
rs
=
pstmt
.
executeQuery
();
int
domID
=
1
;
while
(
rs
.
next
())
{
String
itemCode
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"ITEM_CODE"
));
String
qty
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"QUANTITY"
));
String
unit
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"UNIT"
));
String
rate
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"RATE"
));
String
discount
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"DISCOUNT"
));
String
taxClass
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"TAX_CLASS"
));
String
taxChap
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"TAX_CHAP"
));
String
taxEnv
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"TAX_ENV"
));
String
remarks
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"REMARKS"
));
String
unitRate
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"UNIT__RATE"
));
String
rateClg
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"RATE__CLG"
));
String
packCode
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"PACK_CODE"
));
String
itemDescr
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"ITEM_DESCR"
));
String
rsLineNo
=
E12GenericUtility
.
checkNull
(
rs
.
getString
(
"LINE_NO"
));
transXML
.
append
(
"<Detail2 dbID='' domID='"
+
domID
+
"' objContext='2' objName='scontract'>"
);
transXML
.
append
(
"<attribute selected='N' status='N' updateFlag='A'/>"
);
transXML
.
append
(
"<line_no><![CDATA["
+
rsLineNo
+
"]]></line_no>"
);
transXML
.
append
(
"<item_code><![CDATA["
+
itemCode
+
"]]></item_code>"
);
transXML
.
append
(
"<quantity><![CDATA["
+
qty
+
"]]></quantity>"
);
transXML
.
append
(
"<unit><![CDATA["
+
unit
+
"]]></unit>"
);
transXML
.
append
(
"<rate><![CDATA["
+
rate
+
"]]></rate>"
);
transXML
.
append
(
"<discount><![CDATA["
+
discount
+
"]]></discount>"
);
transXML
.
append
(
"<tax_class><![CDATA["
+
taxClass
+
"]]></tax_class>"
);
transXML
.
append
(
"<tax_chap><![CDATA["
+
taxChap
+
"]]></tax_chap>"
);
transXML
.
append
(
"<tax_env><![CDATA["
+
taxEnv
+
"]]></tax_env>"
);
transXML
.
append
(
"<remarks><![CDATA["
+
remarks
+
"]]></remarks>"
);
transXML
.
append
(
"<unit__rate><![CDATA["
+
unitRate
+
"]]></unit__rate>"
);
transXML
.
append
(
"<rate__clg><![CDATA["
+
rateClg
+
"]]></rate__clg>"
);
transXML
.
append
(
"<pack_code><![CDATA["
+
packCode
+
"]]></pack_code>"
);
transXML
.
append
(
"<eff_from><![CDATA["
+
dateFormatter
(
effFrom
)
+
"]]></eff_from>"
);
transXML
.
append
(
"<valid_upto><![CDATA["
+
dateFormatter
(
validUpto
)
+
"]]></valid_upto>"
);
transXML
.
append
(
"<item_descr><![CDATA["
+
itemDescr
+
"]]></item_descr>"
);
transXML
.
append
(
"<site_code><![CDATA["
+
siteCode
+
"]]></site_code>"
);
transXML
.
append
(
"</Detail2>"
);
domID
++;
}
}
catch
(
Exception
e
)
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Detail XML Error : "
+
E12GenericUtility
.
getStackTrace
(
e
));
}
finally
{
try
{
if
(
rs
!=
null
)
rs
.
close
();
}
catch
(
Exception
e
){}
try
{
if
(
pstmt
!=
null
)
pstmt
.
close
();
}
catch
(
Exception
e
){}
}
return
transXML
.
toString
();
}
private
String
getDbValueWithLog
(
String
tableName
,
String
columnName
,
String
whereClause
,
UserInfoBean
userInfo
)
{
try
{
String
query
=
"SELECT "
+
columnName
+
" FROM "
+
tableName
+
" WHERE "
+
whereClause
;
BaseLogger
.
log
(
"3"
,
null
,
null
,
"DB Fetch: "
+
query
);
return
E12GenericUtility
.
checkNull
(
dbAccessEJB
.
getDBColumnValue
(
tableName
,
columnName
,
whereClause
,
userInfo
.
getTransDB
()));
}
catch
(
Exception
e
)
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Exception in getDbValueWithLog. ["
+
E12GenericUtility
.
getStackTrace
(
e
)
+
"]"
);
return
""
;
}
}
public
String
createSalesContract
(
String
headerXML
,
String
detailXML
,
UserInfoBean
userInfo
,
Connection
conn
,
String
tranID
)
throws
Exception
{
String
result
=
""
;
AppConnectParm
appConnect
=
new
AppConnectParm
();
InitialContext
initialContext
=
new
InitialContext
(
appConnect
.
getProperty
());
StringBuffer
processXML
=
new
StringBuffer
();
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Constructing Process XML"
);
processXML
.
append
(
"<DocumentRoot><group0><Header0>"
);
processXML
.
append
(
"<objName><![CDATA[scontract]]></objName>"
);
processXML
.
append
(
"<pageContext><![CDATA[1]]></pageContext>"
);
processXML
.
append
(
"<objContext><![CDATA[1]]></objContext>"
);
processXML
.
append
(
"<editFlag><![CDATA[A]]></editFlag>"
);
processXML
.
append
(
"<action><![CDATA[SAVE]]></action>"
);
processXML
.
append
(
"<Detail1 dbID='' domID='1' objContext='1' objName='scontract'>"
);
processXML
.
append
(
"<attribute selected='N' status='N' updateFlag='A'/>"
);
processXML
.
append
(
headerXML
);
processXML
.
append
(
"</Detail1>"
);
processXML
.
append
(
detailXML
);
processXML
.
append
(
"</Header0></group0></DocumentRoot>"
);
String
xmlString
=
processXML
.
toString
();
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Final Process XML : "
+
xmlString
);
MasterStatefulLocal
masterStateful
=
(
MasterStatefulLocal
)
initialContext
.
lookup
(
"ibase/MasterStatefulEJB/local"
);
E12GenericUtility
genericUtility
=
new
E12GenericUtility
(
);
String
objName
=
genericUtility
.
getValueFromXTRA_PARAMS
(
xtraParam
,
"objName"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Calling processRequest"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"SalesContractFromSalesQuot class called"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Method confirmCreateSalesContract executed"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"TranID: "
+
tranID
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Object Name: "
+
objName
);
result
=
masterStateful
.
processRequest
(
userInfo
,
xmlString
,
false
,
conn
,
"B"
,
true
);
return
result
;
}
BaseLogger
.
log
(
"3"
,
null
,
null
,
"AFTER processRequest - RAW RESULT: "
+
result
);
}
\ No newline at end of file
// String scNo = "";
// PreparedStatement scPstmt = null;
// ResultSet scRs = null;
// try
// {
// String scSql = "SELECT CONTRACT_NO FROM SCONTRACT WHERE QUOT_NO=? ORDER BY CONTRACT_NO DESC";
// BaseLogger.log("3", null, null, "DB Fetch: " + scSql + " [QUOT_NO=" + tranID + "]");
// scPstmt = conn.prepareStatement(scSql);
// scPstmt.setString(1, tranID);
// scRs = scPstmt.executeQuery();
// if(scRs.next())
// {
// scNo = E12GenericUtility.checkNull(scRs.getString("CONTRACT_NO"));
// }
// }
// finally
// {
// try { if(scRs != null) scRs.close(); } catch(Exception e){}
// try { if(scPstmt != null) scPstmt.close(); } catch(Exception e){}
// }
//
// if(scNo != null && scNo.trim().length() > 0)
// {
// BaseLogger.log("3", null, null, "SUCCESS: CONTRACT CREATED -> " + scNo);
// }
// else
// {
// BaseLogger.log("3", null, null, "WARNING: CONTRACT NOT FOUND IN DB");
// }
//
return
result
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment