Commit 7140d73f authored by cpatil's avatar cpatil

modify for last line not deleted


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101629 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 12cfbc96
...@@ -138,7 +138,53 @@ public class GenRcpPostSave extends ValidatorEJB implements GenRcpPostSaveLocal, ...@@ -138,7 +138,53 @@ public class GenRcpPostSave extends ValidatorEJB implements GenRcpPostSaveLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
// cpatil test
int cnt8 =0;
sql = "select count(1) from rcpdet_form WHERE tran_id= ? and ( ref_ser is not null or ref_no is not null or rcp_amt > 0 ) " ;
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,tranId);
rs1 = pstmt1.executeQuery();
if( rs1.next())
{
cnt8=rs1.getInt(1);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
System.out.println("@@@@@@ cnt8["+cnt8+"]");
//sql = "DELETE FROM rcpdet_form WHERE tran_id= ? and ref_ser is null and ref_no is null and rcp_amt = 0 ";
int cnt9=0;
if( cnt8 == 0)
{
sql = " DELETE FROM rcpdet_form " +
" WHERE tran_id= ? and ref_ser is null and ref_no is null and rcp_amt = 0 " +
" and line_no > ( select min(line_no) from rcpdet_form " +
" WHERE tran_id= ? and ref_ser is null and ref_no is null and rcp_amt = 0 ) ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,tranId);
pstmt1.setString(2,tranId);
cnt9 = pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
else
{
sql = " DELETE FROM rcpdet_form " +
" WHERE tran_id= ? " +
" and ref_ser is null and ref_no is null " ;
//"and rcp_amt = 0 ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,tranId);
cnt9 = pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
System.out.println("@@@@@@ cnt9["+cnt9+"]");
// end
} }
catch(Exception e) catch(Exception e)
{ {
......
...@@ -840,12 +840,12 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -840,12 +840,12 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
} }
if (isDulplicateFrmDom()) /*if (isDulplicateFrmDom())
{ {
errCode = "VTDUPREFNO"; errCode = "VTDUPREFNO";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
/**************************/ /**************************/
/* if(isAmountExceed(domAll,dom1,conn)) /* if(isAmountExceed(domAll,dom1,conn))
...@@ -1208,6 +1208,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1208,6 +1208,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
} }
//added checkAmtvalidation by mahendra on dated 03-09-2015 //added checkAmtvalidation by mahendra on dated 03-09-2015
/* // commented and added validation in java script by cpatil on 13/05/16
if(checkAmtvalidation(dom2)) if(checkAmtvalidation(dom2))
{ {
errCode = "VTCHQATINV"; errCode = "VTCHQATINV";
...@@ -1215,7 +1216,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1215,7 +1216,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
*/
} }
......
...@@ -811,7 +811,8 @@ ...@@ -811,7 +811,8 @@
<xsl:for-each select="//Detail2"> <xsl:for-each select="//Detail2">
<xsl:variable name="domIDDetail"> <xsl:variable name="domIDDetail">
<xsl:value-of select="@domID" /> <xsl:value-of select="line_no" />
<!-- <xsl:value-of select="@domID" /> -->
</xsl:variable> </xsl:variable>
<xsl:variable name="updateFlagDetail"> <xsl:variable name="updateFlagDetail">
<xsl:value-of select="attribute/@updateFlag" /> <xsl:value-of select="attribute/@updateFlag" />
...@@ -820,7 +821,8 @@ ...@@ -820,7 +821,8 @@
<xsl:value-of select="attribute/@status" /> <xsl:value-of select="attribute/@status" />
</xsl:variable> </xsl:variable>
<xsl:variable name="dbIDDetail"> <xsl:variable name="dbIDDetail">
<xsl:value-of select="@dbID" /> <xsl:value-of select="line_no" />
<!-- <xsl:value-of select="@dbID" /> -->
</xsl:variable> </xsl:variable>
<xsl:variable name="pkNamesDetail"> <xsl:variable name="pkNamesDetail">
<xsl:value-of select="attribute/@pkNames" /> <xsl:value-of select="attribute/@pkNames" />
......
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