Commit 1f926ef7 authored by arawankar's avatar arawankar

Changes made in below components

1. porderIC.java
-Added condition to validate po date.
- po date should not be greater than sysdate

2.CreateVoucherAct.java
- Added connection commit and rollback in finally method.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@188525 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c7cd6090
......@@ -195,6 +195,18 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote,
genericUtility.getDBDateFormat())
+ " 00:00:00.0");
//Modified by Anjali R. on [31/07/2018][ System should not allow to enter future date in PO Date][Start]
Date date = new Date();
System.out.println("date--["+new SimpleDateFormat(genericUtility.getDBDateTimeFormat()).format(date));
if(sysDate.after(date))
{
System.out.println("Error purchase order date greater than sysdate");
errList.add("VTDATEINVD");
errFields.add(childNodeName.toLowerCase());
}
//Modified by Anjali R. on [31/07/2018][ System should not allow to enter future date in PO Date][End]
// sdf = new
// SimpleDateFormat(genericUtility.getApplDateFormat());
// sysDate=sdf.parse(ordDate);
......
......@@ -31,6 +31,9 @@ public class CreateVoucherAct extends ActionHandlerEJB implements CreateVoucherA
PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null;
ResultSet rs = null, rs1 = null;
Connection conn = null;boolean connStatus=false;
//Modified by Anjali R. on[31/07/2018][resultFlag is declare to indicate whether voucher is created succfully or not.][Start]
boolean resultFlag = false;
//Modified by Anjali R. on[31/07/2018][resultFlag is declare to indicate whether voucher is created succfully or not.][End]
try
{
......@@ -55,6 +58,10 @@ public class CreateVoucherAct extends ActionHandlerEJB implements CreateVoucherA
if(retString.indexOf("Success") != -1)
{
//Modified by Anjali R. on[31/07/2018][resultFlag set to true if voucher created successfully.][Start]
resultFlag = true;
System.out.println("resultFlag--["+resultFlag+"]");
//Modified by Anjali R. on[31/07/2018][resultFlag set to true if voucher created successfully.][End]
String tranIdVoucher=retString.substring( retString.indexOf("<TranID>")+8, retString.indexOf("</TranID>"));
System.out.println("tranIdVoucher is :"+tranIdVoucher);
retString = itmDBAccessEJB.getErrorString("", "VTVOUGEN", "Voucher No. " + tranIdVoucher + "","",conn);
......@@ -82,6 +89,16 @@ public class CreateVoucherAct extends ActionHandlerEJB implements CreateVoucherA
{
pstmt.close(); pstmt = null;
}
//Modified by Anjali R. on[31/07/2018][If voucher created successfully,then connection commit else rollback ][Start]
if(resultFlag == true)
{
conn.commit();
}
else
{
conn.rollback();
}
//Modified by Anjali R. on[31/07/2018][If voucher created successfully,then connection commit else rollback ][End]
if (conn != null && !conn.isClosed() && connStatus) // Gulzar -
// 25/11/11
{
......
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