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
062a6f75
Commit
062a6f75
authored
Mar 20, 2026
by
ajit.deshmukh@proteustech.in
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the logic to Create the Sales Quotation Detail 3 form on click of
Acknowledgement button.
parent
2fd9914b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
66 deletions
+105
-66
Ajit/VHB/Deployments/Acknowledgement Button Deployment/SalesQuotationAcknowledge.java
...edgement Button Deployment/SalesQuotationAcknowledge.java
+105
-66
No files found.
Ajit/VHB/Deployments/Acknowledgement Button Deployment/SalesQuotationAcknowledge.java
View file @
062a6f75
...
...
@@ -8,6 +8,7 @@ import java.sql.ResultSet;
import
javax.naming.InitialContext
;
import
ibase.system.config.AppConnectParm
;
import
ibase.system.config.ConnDriver
;
import
ibase.utility.BaseLogger
;
import
ibase.utility.UserInfoBean
;
import
ibase.webitm.ejb.ActionHandlerEJB
;
...
...
@@ -15,94 +16,132 @@ import ibase.webitm.ejb.ITMDBAccessEJB;
import
ibase.webitm.ejb.MasterStatefulLocal
;
import
ibase.webitm.utility.ITMException
;
public
class
SalesQuotationAcknowledge
extends
ActionHandlerEJB
{
public
String
updateStatus
(
String
tranID
,
String
xtraParams
,
String
forcedFlag
)
throws
RemoteException
,
ITMException
{
public
class
SalesQuotationAcknowledge
extends
ActionHandlerEJB
{
public
String
updateStatus
(
String
tranID
,
String
xtraParams
,
String
forcedFlag
)
throws
RemoteException
,
ITMException
{
Connection
conn
=
null
;
String
errString
=
""
;
ITMDBAccessEJB
itmDBAccessEJB
=
new
ITMDBAccessEJB
();
String
quotType
=
""
,
custCode
=
""
;
String
quotType
=
""
,
custCode
=
""
;
StringBuffer
processDynXmlString
=
new
StringBuffer
();
int
domId
=
0
;
int
lineNo
=
0
;
String
processRequestResult
=
""
;
UserInfoBean
userInfo
=
null
;
try
{
int
domId
=
0
;
int
lineNo
=
0
;
UserInfoBean
userInfo
=
null
;
ResultSet
fetchHospitalMappingRs
=
null
;
PreparedStatement
insertPs
=
null
;
try
{
userInfo
=
getUserInfo
();
AppConnectParm
appConnect
=
new
AppConnectParm
();
InitialContext
initialContext
=
new
InitialContext
(
appConnect
.
getProperty
());
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"SalesQuotationAcknowledge --> tranID MArch 9 2026["
+
tranID
+
"]"
);
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"SalesQuotationAcknowledge --> tranID ["
+
tranID
+
"]"
);
conn
=
getConnection
();
//Added by Ajit on 06-MARCH to update the status to "A" on click of Acknowledged button [Start]
// 🔹 Update status
String
updateStatusSql
=
"update sales_quot set status = 'A' where QUOT_NO = ?"
;
PreparedStatement
updateStatusPs
=
conn
.
prepareStatement
(
updateStatusSql
);
updateStatusPs
.
setString
(
1
,
tranID
);
int
updateStatusCnt
=
updateStatusPs
.
executeUpdate
();
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"SalesQuotationAcknowledge --> updateStatusCnt ["
+
updateStatusCnt
+
"]"
);
// 🔹 Fetch header data
String
fetchSQuotDetSql
=
"select quot_type, cust_code from sales_quot where quot_no = ?"
;
PreparedStatement
fetchSQuotDetPs
=
conn
.
prepareStatement
(
fetchSQuotDetSql
);
fetchSQuotDetPs
.
setString
(
1
,
tranID
);
ResultSet
fetchSQuotDetRs
=
fetchSQuotDetPs
.
executeQuery
();
while
(
fetchSQuotDetRs
.
next
())
{
while
(
fetchSQuotDetRs
.
next
())
{
quotType
=
checkNull
(
fetchSQuotDetRs
.
getString
(
"quot_type"
));
custCode
=
checkNull
(
fetchSQuotDetRs
.
getString
(
"cust_code"
));
}
processDynXmlString
.
append
(
"<DocumentRoot><description>Datawindow Root</description><group0>"
);
processDynXmlString
.
append
(
"<description>Group0 description</description><Header0><description>Header0 members</description>"
);
if
(
quotType
.
trim
().
equalsIgnoreCase
(
"G"
))
{
String
fetchHospitalMappingSql
=
"select CUST_CODE__STK, CUST_CODE__DIST from CUSTOMER_PREF_DIST where CUST_CODE = ?"
;
PreparedStatement
fetchHospitalMappingPs
=
conn
.
prepareStatement
(
fetchHospitalMappingSql
);
fetchHospitalMappingPs
.
setString
(
1
,
custCode
);
ResultSet
fetchHospitalMappingRs
=
fetchHospitalMappingPs
.
executeQuery
();
while
(
fetchHospitalMappingRs
.
next
())
{
domId
++;
lineNo
++;
processDynXmlString
.
append
(
"<Detail3 dbID=':' domID='"
+
domId
+
"' objName=\"salesquot\" objContext=\"3\">"
);
processDynXmlString
.
append
(
"<attribute pkNames=\"quot_no:line_no:\" selected=\"N\" updateFlag=\"A\" status=\"N\" />"
);
processDynXmlString
.
append
(
"<line_no><![CDATA["
).
append
(
lineNo
).
append
(
"]]></line_no>"
);
processDynXmlString
.
append
(
"<cust_code><![CDATA["
).
append
(
custCode
).
append
(
"]]></cust_code>"
);
processDynXmlString
.
append
(
"<cust_code__stk><![CDATA["
).
append
(
checkNull
(
fetchHospitalMappingRs
.
getString
(
"CUST_CODE__STK"
))).
append
(
"]]></cust_code__stk>"
);
processDynXmlString
.
append
(
"<cust_code__dist><![CDATA["
).
append
(
checkNull
(
fetchHospitalMappingRs
.
getString
(
"CUST_CODE__DIST"
))).
append
(
"]]></cust_code__dist>"
);
processDynXmlString
.
append
(
"</Detail3>"
);
}
if
(
quotType
.
trim
().
equalsIgnoreCase
(
"G"
))
{
String
fetchHospitalMappingSql
=
"select CUST_CODE__STK, CUST_CODE__DIST from CUSTOMER_PREF_DIST where CUST_CODE = ?"
;
PreparedStatement
fetchHospitalMappingPs
=
conn
.
prepareStatement
(
fetchHospitalMappingSql
);
fetchHospitalMappingPs
.
setString
(
1
,
custCode
);
fetchHospitalMappingRs
=
fetchHospitalMappingPs
.
executeQuery
();
// Get max line_no
String
lineSql
=
"SELECT NVL(MAX(line_no), 0) FROM sales_quot_stockist WHERE quot_no = ?"
;
PreparedStatement
linePs
=
conn
.
prepareStatement
(
lineSql
);
linePs
.
setString
(
1
,
tranID
);
ResultSet
lineRs
=
linePs
.
executeQuery
();
if
(
lineRs
.
next
())
{
lineNo
=
lineRs
.
getInt
(
1
);
}
String
insertSql
=
"INSERT INTO sales_quot_stockist (line_no, cust_code, cust_code__stk, cust_code__dist, quot_no) VALUES (?, ?, ?, ?, ?)"
;
insertPs
=
conn
.
prepareStatement
(
insertSql
);
while
(
fetchHospitalMappingRs
.
next
())
{
lineNo
++;
String
custCodeStk
=
fetchHospitalMappingRs
.
getString
(
"CUST_CODE__STK"
);
String
custCodeDist
=
fetchHospitalMappingRs
.
getString
(
"CUST_CODE__DIST"
);
insertPs
.
setInt
(
1
,
lineNo
);
insertPs
.
setString
(
2
,
custCode
);
insertPs
.
setString
(
3
,
custCodeStk
);
insertPs
.
setString
(
4
,
custCodeDist
);
insertPs
.
setString
(
5
,
tranID
);
insertPs
.
addBatch
();
}
insertPs
.
executeBatch
();
// close extra resources
if
(
lineRs
!=
null
)
lineRs
.
close
();
if
(
linePs
!=
null
)
linePs
.
close
();
if
(
fetchHospitalMappingPs
!=
null
)
fetchHospitalMappingPs
.
close
();
}
if
(
updateStatusCnt
>
0
)
{
conn
.
commit
();
return
itmDBAccessEJB
.
getErrorString
(
""
,
"SALESACK"
,
""
,
""
,
conn
);
}
if
(
fetchSQuotDetPs
!=
null
)
{
fetchSQuotDetPs
.
close
();
fetchSQuotDetPs
=
null
;
}
processDynXmlString
.
append
(
"</Header0></group0></DocumentRoot>"
);
String
salesQuotDet3Xml
=
processDynXmlString
.
toString
();
BaseLogger
.
log
(
"3"
,
null
,
null
,
"userInfo::"
+
userInfo
.
toString
()
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"salesQuotDet3Xml::"
+
salesQuotDet3Xml
.
toString
()
+
"]"
);
MasterStatefulLocal
masterStateful
=
(
MasterStatefulLocal
)
initialContext
.
lookup
(
"ibase/MasterStatefulEJB/local"
);
processRequestResult
=
masterStateful
.
processRequest
(
userInfo
,
salesQuotDet3Xml
,
false
,
conn
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"processRequest processRequestResultD"
+
processRequestResult
+
"]"
);
if
(
updateStatusCnt
>
0
)
{
conn
.
commit
();
return
errString
=
itmDBAccessEJB
.
getErrorString
(
""
,
"SALESACK"
,
""
,
""
,
conn
);
if
(
fetchSQuotDetRs
!=
null
)
{
fetchSQuotDetRs
.
close
();
fetchSQuotDetRs
=
null
;
}
}
catch
(
Exception
e
)
{
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"Exception from SalesQuotationAcknowledge updateStatus --["
+
e
.
getMessage
()+
"]"
);
e
.
printStackTrace
();
if
(
insertPs
!=
null
)
{
insertPs
.
close
();
insertPs
=
null
;
}
if
(
fetchHospitalMappingRs
!=
null
)
{
fetchHospitalMappingRs
.
close
();
fetchHospitalMappingRs
=
null
;
}
}
catch
(
Exception
e
)
{
if
(
conn
!=
null
)
{
try
{
conn
.
rollback
();
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
}
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"Exception in updateStatus: ["
+
e
.
getMessage
()
+
"]"
);
}
finally
{
try
{
if
(
insertPs
!=
null
)
insertPs
.
close
();
if
(
fetchHospitalMappingRs
!=
null
)
fetchHospitalMappingRs
.
close
();
}
catch
(
Exception
e
)
{}
}
return
" "
;
}
private
String
checkNull
(
String
input
)
{
if
(
input
==
null
)
{
private
String
checkNull
(
String
input
)
{
if
(
input
==
null
)
{
input
=
""
;
}
return
input
;
...
...
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