Commit 974dc9be authored by ajadhav's avatar ajadhav

add if condition inside the main while() from line no 6090 to 6178

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@178863 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ad468b12
...@@ -6087,6 +6087,96 @@ public class InvAcct ...@@ -6087,6 +6087,96 @@ public class InvAcct
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
//Add by Ajay Jadhav on 22-01-2018:START
if (errString != null && errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
}
///////////////////////////////////////////////////////////////////////////
// this is added as per new requirement of Pitambari
// Cursor for payable taxes to be removed from the effect to unbooked purchases
sql = "select a.acct_code as acct_code, a.cctr_code as cctr_code , sum(a.tax_amt) as tax_amt "
+ " from taxtran a, tax b "
+ " where a.tax_code = b.tax_code AND "
+ " a.tran_code = ? "
+ " and a.tran_id = ? "
+ " and a.line_no = ? "
+ " and a.tax_amt <> 0 "
+ " and b.non_payable = 'N' "
+ " group by a.acct_code, a.cctr_code ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranSer);
pstmt.setString(2, tranId);
pstmt.setString(3, lineNoStr);
rs = pstmt.executeQuery();
while (rs.next())
{
acctCodeTP = rs.getString("acct_code");
cctrCodeTP = rs.getString("cctr_code");
amountTP = rs.getDouble("tax_amt");
// If ACCT Code is NULL/SPACE Then Exit
if (acctCodeTP == null || acctCodeTP.trim().length() == 0 )
{
// If ACCT Code is NULL/SPACE Then Exit
errCode = "VMACCT1";
errString = getMsg("Tax account is not defined for branch transfer posting",errCode, conn);
break;
}
// If CCTR Code is NULL/SPACE Then set to inventory cost centre
if (cctrCodeTP == null || cctrCodeTP.trim().length() == 0 )
{
cctrCodeTP = cctrCodeDR;
}
// If CCTR Code is still NULL/SPACE Then set to blank
if (cctrCodeTP == null || cctrCodeTP.trim().length() == 0 )
{
cctrCodeTP = " ";
}
// before changing sign subtract from credit amount to go to unbooked purchases
amountCR = amountCR + amountTP;
// chnage sign so that it goes as credit
amountTP = amountTP;
if (dRcpMap.containsKey("X" + acctCodeTP + cctrCodeTP + analysis1Cr + analysis2Cr + analysis3Cr ))
{
tempMap = (HashMap) dRcpMap.get("X" + acctCodeTP + cctrCodeTP + analysis1Cr + analysis2Cr + analysis3Cr );
grandAmount = Double.parseDouble(tempMap.get("amount").toString());
System.out.println("tempMap[old] ==================== ["+tempMap+"]");
//System.out.println("grandAmount[old] ==================== ["+grandAmount+"]");
//System.out.println("netAmount[new] ==================== ["+netAmount+"]");
tempMap.put("amount", "" + (grandAmount + amountTP));
System.out.println("tempMap[new] ==================== ["+tempMap+"]");
// 07/11/13 manoharan added as this has to be updated in the dRcpMap
}
else
{
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeTP);
tempMap.put("cctr_code", cctrCodeTP);
tempMap.put("amount", "" + amountTP);
// added by cpatil on 09-03-13 recoAmount
tempMap.put("analysis1",analysis1Cr);
tempMap.put("analysis2",analysis2Cr);
tempMap.put("analysis3",analysis3Cr);
// added by cpatil on 09-03-13 end
}
dRcpMap.put("X" + acctCodeTP + cctrCodeTP + analysis1Cr + analysis2Cr + analysis3Cr, tempMap); // there was abug in this line, instead of analysis3Cr wronly analysis3Dr used
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//Add by Ajay Jadhav on 22-01-2018: END
} // amish 17-08-04 postTax = 'Y' } // amish 17-08-04 postTax = 'Y'
// 19/01/09 manoharan as was creating problem while sqlca.sqlcode = 0 // 19/01/09 manoharan as was creating problem while sqlca.sqlcode = 0
// fetch cur_dist_rcp_det into :itemCode, :lineNo, :netAmount, // fetch cur_dist_rcp_det into :itemCode, :lineNo, :netAmount,
......
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