Commit 14179c29 authored by ajadhav's avatar ajadhav

Changes in InvAcct Component method name acctDisRcptpost

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@178437 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fd3a7174
......@@ -20,6 +20,8 @@ import ibase.webitm.ejb.*;
import org.w3c.dom.*;
import com.itextpdf.text.log.SysoCounter;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.mfg.MfgCommon;
......@@ -5044,11 +5046,10 @@ public class InvAcct
}
return mainStr;
}
public String acctDisRcptPost(String tranId, Connection conn) throws ITMException, Exception
{
//////////// start gbf_dist_rcp_post
PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null;
ResultSet rs = null, rs1 = null;
......@@ -5080,6 +5081,7 @@ public class InvAcct
try
{
tranSer = "D-RCP";
finCommon = new FinCommon();
......@@ -5135,7 +5137,7 @@ public class InvAcct
if ("NULLFOUND".equals(distRcpPost))
{
errCode = "VTFINPARM";
errString = getMsg("FINPARM DIST_ISS_RCP_POST not defined",errCode, conn);
errString = getMsg("FINPARM not defined",errCode, conn);
return errString;
}
......@@ -5143,7 +5145,7 @@ public class InvAcct
{
// if posting is standard then cost price list should be defined.
errCode = "VTFINPARM";
errString = getMsg("Standard costing configured as per FINPARM variable DIST_ISS_RCP_POST, variable for cost price list DIST_STD_COST_PL not defined",errCode, conn);
errString = getMsg("Standard costing configured as per FINPARM variable , variable for cost price list DIST_STD_COST_PL not defined",errCode, conn);
return errString;
}
// end by amish 17-08-04 ///cost price list from disparm
......@@ -5286,13 +5288,14 @@ public class InvAcct
+ " loc_code, lot_no, lot_sl, (case when cost_rate is null then 0 else cost_rate end) as cost_rate, quantity, "
+ " (case when amount is null then 0 else amount end) as amount "// amish 17-08-04 cost rate added &
+" from distord_rcpdet where tran_id = ?" ;
System.out.println("execute sql");
// Loop to process the Accounting Effect
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, tranId);
rs1 = pstmt1.executeQuery();
while (rs.next())
while (rs1.next())
{
// 19/01/09 manoharan while sqlca.sqlcode = 0 creating problem as there
// are many other select statement within the loop
//fetch cur_dist_rcp_det into :itemCode, :lineNo, :netAmount,
......@@ -5404,6 +5407,8 @@ public class InvAcct
//commented by Jasmina 26/11/09-DI89UNI113, as addtional parameter tran type passed
//cctrCodeRcp = gbf_acct_detr_dist(siteCode, siteCode__dlv, itemSer, grpCode, itemCode, 'D-COGT')
cctrCodeCR = finCommon.getAcctDetrDistTtype(siteCodeShip,siteCode, itemSer,grpCode,itemCode, "D-COGT'", tranType, conn);
System.out.println("cctrCodeCR is["+cctrCodeCR+"]");
acctCctr = cctrCodeCR.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
......@@ -5429,6 +5434,7 @@ public class InvAcct
// Debit Account Code for Receiving Site
cctrCodeCR = finCommon.getAcctDetrDistTtype(siteCodeShip, siteCode, itemSer, grpCode, itemCode, "D-ISS",tranType, conn);
System.out.println("cctrCodeCR is["+cctrCodeCR+"]");
acctCctr = cctrCodeCR.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
......@@ -5488,6 +5494,7 @@ public class InvAcct
//first get the account/cctr from item account dete. dist. if not found than pick up from stock
cctrCodeDR = finCommon.getAcctDetrDistTtype(siteCodeShip, siteCode, itemSer, grpCode, itemCode, "D-INV",tranType, conn);
System.out.println("cctrCodeDR is="+cctrCodeDR);
acctCctr = cctrCodeDR.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
......@@ -5508,7 +5515,7 @@ public class InvAcct
cctrCodeDR = "";
}
if (acctCodeDR == null || cctrCodeDR.trim().length() == 0)
if (acctCodeDR == null || acctCodeDR.trim().length() == 0)
{
sql = "select acct_code__inv,cctr_code__inv from stock where item_code = ? and site_code = ? and loc_code = ? and lot_no = ? and lot_sl = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -5690,6 +5697,7 @@ public class InvAcct
analysis3Dr ="";
}
// end added by pravin 28/02/2013
System.out.println("amount ["+amount+"]");
if("Y".equals( invOnline) || "S".equals(invOnline))
{
......@@ -5869,7 +5877,8 @@ public class InvAcct
dRcpMap.put("D" + acctCodeBrTr + cctrCodeBrTr + analysis1Dr + analysis2Dr + analysis3Dr, tempMap);
}
// end added by pravin
if (errString != null || errString.trim().length() > 0 )
System.out.println("errString=["+errString+"]");
if (errString != null && errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
......@@ -5972,6 +5981,7 @@ public class InvAcct
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeReco);
System.out.println("cctrCodeReco is="+cctrCodeReco);
tempMap.put("cctr_code", cctrCodeReco);
tempMap.put("amount", "" + recoAmount);
// added by cpatil on 09-03-13 recoAmount
......@@ -5990,7 +6000,7 @@ public class InvAcct
pstmt.close();
pstmt = null;
if (errString != null || errString.trim().length() > 0 )
if (errString != null && errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
......@@ -5999,7 +6009,7 @@ public class InvAcct
// Cursor for non 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 "
+ " where a.tax_code = b.tax_code AND"
+ " a.tran_code = ? "
+ " and a.tran_id = ? "
+ " and a.line_no = ? "
......@@ -6059,9 +6069,9 @@ public class InvAcct
{
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeReco);
tempMap.put("cctr_code", cctrCodeReco);
tempMap.put("amount", "" + amountNP);
tempMap.put("acct_code", acctCodeNP);
tempMap.put("cctr_code", cctrCodeNP);
tempMap.put("amount", "" + amountNP);
// added by cpatil on 09-03-13 recoAmount
tempMap.put("analysis1",analysis1Cr);
tempMap.put("analysis2",analysis2Cr);
......@@ -6087,7 +6097,7 @@ public class InvAcct
pstmt1.close();
pstmt1 = null;
if (errString != null || errString.trim().length() > 0 )
if (errString != null && errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
......@@ -6097,7 +6107,7 @@ public class InvAcct
// 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 "
+ " where a.tax_code = b.tax_code AND "
+ " a.tran_code = ? "
+ " and a.tran_id = ? "
+ " and a.line_no = ? "
......@@ -6157,8 +6167,8 @@ public class InvAcct
{
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeReco);
tempMap.put("cctr_code", cctrCodeReco);
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);
......@@ -6220,6 +6230,7 @@ public class InvAcct
glTraceMap.put("sundry_type","O");
glTraceMap.put("sundry_code","");
glTraceMap.put("acct_code",acctCodeDR);
System.out.println("cctrCodeDR is="+cctrCodeDR);
glTraceMap.put("cctr_code",cctrCodeDR);
glTraceMap.put("emp_code","");
glTraceMap.put("anal_code","");
......@@ -6253,7 +6264,7 @@ public class InvAcct
netAmount = netAmount + grandAmount;
}
if (errString != null || errString.trim().length() > 0 )
if (errString != null && errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
......@@ -6293,13 +6304,19 @@ public class InvAcct
if (netAmount > 0 )
{
glTraceMap.put("dr_amt","" + (netAmount));
glTraceMap.put("cr_amt","0");
//changes and Commented By Ajay 16/01/2018:START
//glTraceMap.put("dr_amt","" + (netAmount));
//glTraceMap.put("cr_amt","0");
glTraceMap.put("dr_amt","0");
glTraceMap.put("cr_amt",""+ (netAmount));
}
else
{
glTraceMap.put("dr_amt","0");
glTraceMap.put("cr_amt", "" + (-1 * (netAmount)));
//glTraceMap.put("dr_amt","0");
//glTraceMap.put("cr_amt", "" + (-1 * (netAmount)));
glTraceMap.put("dr_amt","" + (-1 * (netAmount)));
glTraceMap.put("cr_amt", "0");
//changes and Commented By Ajay 16/01/2018:END
}
glTraceMap.put("ref_type","D");
glTraceMap.put("ref_ser",tranSer);
......@@ -6311,7 +6328,7 @@ public class InvAcct
System.out.println("manohar 07/11/13 glTraceCtr after gltrace update 2 [" + glTraceCtr + "] errString [" + errString + "]");
glTraceMap = null;
if (errString != null || errString.trim().length() > 0 )
if (errString != null && errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
......
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