Commit bb644b02 authored by kshinde's avatar kshinde

Tax chap insert in sorditem and carry forward to despatch.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@177733 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 931ddb79
......@@ -1162,9 +1162,6 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
}
//Changed by Kunal on 4/01/18 for adding tax chapter in sorditem[Start]
taxChapFr = disCommon.getTaxChap(itemCode, itemSer, "C", custCode, siteCodeCr,conn);
System.out.println("taxChapFr["+taxChapFr+"]");
sql="insert into sorditem "
+ " (sale_order, line_no, site_code, item_code__ord, item_code__ref,"
......@@ -1288,7 +1285,7 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
lineNo = rs1.getString("line_no");
if(!"I".equalsIgnoreCase(lineType))
{
if(explodeBomDs(saleOrder,itemCode,expLev,lineNo,lineType,taxChapFr,conn) !=1)
if(explodeBomDs(saleOrder,itemCode,expLev,lineNo,lineType,conn) !=1)
{
errString = itmDBAccessLocal.getErrorString("","DS000","");
return errString;
......@@ -2390,11 +2387,11 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
//need to return error code....
return commPercSalesMap;
}
public int explodeBomDs(String saleOrder, String itemCode, String expLev, String lineNo, String lineType,String taxChapFr,Connection conn) throws ITMException
public int explodeBomDs(String saleOrder, String itemCode, String expLev, String lineNo, String lineType,Connection conn) throws ITMException
{
String sql="",sql1="",sql2="",mapplicable = "Y",mitemCode="" ,mitemRef="";
String itemRef="";
String siteCode="",unit="",itemCodeOrd="",itemFlag="",unitOrd="";
String siteCode="",unit="",itemCodeOrd="",itemFlag="",unitOrd="",itemSer="",siteCodeCr="",taxChapsord="";
String munit="",mreqtype="",mnature="",mexptype="",merrstr="",itemStru="";
String custCode="",orderType="",nearExpShelfLife="",round="",roundToStr="";
String mlevel = "";
......@@ -2407,6 +2404,7 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
int returnValue=0;
PreparedStatement pstmt = null ,pstmt1=null,pstmt2=null;
ResultSet rs = null,rs1=null,rs2=null;
String taxChap=null;
DistCommon distCommon = new DistCommon();
try
{
......@@ -2425,6 +2423,8 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
mitemCode = rs.getString(1) == null ? "" : rs.getString(1);
mitemRef = rs.getString(2) == null ? "" : rs.getString(2);
sql1 = "select site_code,unit,quantity,item_code__ord,item_flag,unit__ord, " +
" qty_ord,order_date,dsp_date ,rate from sorditem where sale_order=? and exp_lev=? and line_no=? ";
pstmt1 = conn.prepareStatement(sql1);
......@@ -2434,7 +2434,6 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
rs1 = pstmt1.executeQuery();
while (rs1.next())
{
siteCode = rs1.getString("site_code");
unit = rs1.getString("unit");
quantity = rs1.getDouble("quantity");
......@@ -2446,18 +2445,7 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
dspDate = rs1.getTimestamp("dsp_date");
rate = rs1.getDouble("rate");
sql2="select cust_code from sorder where sale_order = ?";
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1, saleOrder);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
custCode = rs2.getString("cust_code");
}
rs2.close();
rs2 = null;
pstmt2.close();
pstmt2 = null;
if("B".equalsIgnoreCase(lineType))
{
......@@ -2705,6 +2693,53 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
}
mqty=geRndamt(mqty,round,roundTo);
sql="Select tax_chap from sorditem where exp_lev= ? and sale_order= ? ";
pstmt2=conn.prepareStatement(sql);
pstmt2.setString(1,expLev);
pstmt2.setString(2,saleOrder);
rs2=pstmt2.executeQuery();
if(rs2.next())
{
taxChapsord=rs2.getString(1);
}
pstmt2.close();
pstmt2=null;
rs2.close();
rs2=null;
sql="Select item_ser,site_code__ship,cust_code from sorder where sale_order= ?";
pstmt2=conn.prepareStatement(sql);
pstmt2.setString(1,saleOrder);
rs2=pstmt2.executeQuery();
if(rs2.next())
{
itemSer=rs2.getString(1);
siteCodeCr=rs2.getString(2);
custCode=rs2.getString(2);
}
pstmt2.close();
pstmt2=null;
rs2.close();
rs2=null;
if("C".equalsIgnoreCase(mnature))
{
taxChap=taxChapsord;
}
else
{
taxChap = distCommon.getTaxChap(mitemCode, itemSer, "C", custCode, siteCodeCr,conn);
System.out.println("taxChap["+taxChap+"]");
}
incrmlevel++;
mlevel=String.valueOf(incrmlevel)+".";
sql="insert into sorditem "
......@@ -2745,7 +2780,7 @@ public class SorderConf extends ActionHandlerEJB implements SorderConfLocal, Sor
pstmt2.setString(24,"0");
pstmt2.setString(25,"0");
//Changed by Manish on 12/09/16 for allocated quantity and despatch quantity[end]
pstmt2.setString(26,taxChapFr);
pstmt2.setString(26,taxChap);
insertCnt= pstmt2.executeUpdate();
pstmt2.close();
pstmt2=null;
......
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