Commit c7c5fb93 authored by manohar's avatar manohar

updated with latest source


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91391 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6f5a12cb
......@@ -141,7 +141,7 @@ public class BenefitDisItm extends ValidatorEJB implements BenefitDisItmLocal,Be
benefitType = benefitType == null ?"":benefitType;
if(benefitType.trim().equalsIgnoreCase("AL"))
{
valueXmlString.append("<exchange_rate>").append("<![CDATA[.000000]]>").append("</exchange_rate>");
valueXmlString.append("<exchange_rate protect =\"1\">").append("<![CDATA[.000000]]>").append("</exchange_rate>");
}
else
{
......
......@@ -976,6 +976,8 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
}
valueXmlString.append("<site_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr>");
valueXmlString.append("<site_code__cr>").append("<![CDATA[" + ( siteCode )+ "]]>").append("</site_code__cr>");
valueXmlString.append("<site_descr2>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr2>");
}
if (currentColumn.trim().equals( "site_code__log" ))
{
......@@ -1004,7 +1006,6 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
valueXmlString.append("<site_descr1>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr1>");
}
if (currentColumn.trim().equals( "site_code__cr" ))
if (currentColumn.trim().equals( "site_code__cr" ))
{
siteCode = genericUtility.getColumnValue( "site_code__cr", dom );
System.out.println("site_code__cr is==>"+siteCode);
......@@ -1341,7 +1342,7 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
}
valueXmlString.append("<item_descr>").append("<![CDATA[" + ( itemDescr )+ "]]>").append("</item_descr>");
valueXmlString.append("<item_ser>").append("<![CDATA[" + ( itemSer )+ "]]>").append("</item_ser>");
if( lotNo != null && lotNo.trim().length() > 0 )
if( lotNo != null && lotNo.trim().length() > 0 && itemCode != null && itemCode.trim().length() > 0)
{
sql = "select sum(b.quantity) as saleQty from invoice a, invoice_trace b "
+" where a.invoice_id = b.invoice_id "
......@@ -1591,6 +1592,7 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
{
System.out.println("Exception ::"+ e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
......@@ -1616,11 +1618,12 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
{
System.out.println("Exception ::" + e);
e.printStackTrace();
throw new ITMException(e);
}
}
return valueXmlString.toString();
}//END OF ITEMCHANGE
private String getCurrdateAppFormat()
private String getCurrdateAppFormat() throws Exception,ITMException
{
String s = "";
GenericUtility genericUtility = GenericUtility.getInstance();
......@@ -1637,10 +1640,11 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
catch(Exception exception)
{
System.out.println("Exception in getCurrdateAppFormat " + exception.getMessage());
throw new ITMException(exception);
}
return s;
}
private Timestamp getCurrdateTsFormat()
private Timestamp getCurrdateTsFormat() throws Exception,ITMException
{
String s = "";
Timestamp timestamp = null;
......@@ -1657,6 +1661,7 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
catch(Exception exception)
{
System.out.println("Exception in getCurrdateAppFormat " + exception.getMessage());
throw new ITMException(exception);
}
return timestamp;
}
......@@ -2243,7 +2248,7 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
for( int detIdx = 0; detIdx < detLen ; detIdx++ )
{
currDet = detailNodes.item( detIdx );
System.out.println("manohar 10/12/10 got currDet [" + currDet + "]");
currNodes = currDet.getChildNodes();
currNodeLen = currNodes.getLength();
domQty = 0;
......@@ -2251,6 +2256,7 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
{
currNode = currNodes.item( curNodeIdx );
nodeName = currNode.getNodeName();
System.out.println("manohar 10/12/10 got nodeName [" + nodeName + "]");
if ( nodeName.equalsIgnoreCase( "attribute" ) )
{
updateFlag = currNode.getAttributes().getNamedItem( "updateFlag" ).getNodeValue();
......@@ -2272,6 +2278,7 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
domLotNo = currNode.getFirstChild() != null ? currNode.getFirstChild().getNodeValue().trim() : "";
}
}
System.out.println("manohar updateFlag [" + updateFlag + "] lineNoStr [" + lineNoStr + "] curLineNo [" + curLineNo+ "] domItemCode [" + domItemCode + "] itemCode [ " + itemCode + "] domLotNo [" + domLotNo + "] lotNo [ " + lotNo + "] qtyStr[" + qtyStr + "]");
if( !"D".equalsIgnoreCase( updateFlag ) && (!lineNoStr.trim().equals( curLineNo.trim() )) && (domItemCode.trim().equalsIgnoreCase( itemCode.trim() )) && (domLotNo.trim().equalsIgnoreCase( lotNo.trim() )))
{
System.out.println("manohar found lineNoStr [" + lineNoStr + "] curLineNo [" + curLineNo+ "] domItemCode [" + domItemCode + "] domLotNo [" + domLotNo + "] qtyStr[" + qtyStr + "]");
......
......@@ -879,6 +879,23 @@ public class CustStockTransit extends ValidatorEJB //implements SessionBean
stmt.close();
stmt = null;
}
/*// 04/06/09 manoharan set cust_stockmode
selQuery = "SELECT VAR_VALUE FROM DISPARM WHERE PRD_CODE = '999999' AND VAR_NAME = 'CUST_STOCK_MODE'";
//System.out.println("Executing Query .............\n" +selQuery);
stmt = conn.prepareStatement( selQuery );
rs = stmt.executeQuery();
if (rs.next())
{
stockMode = rs.getString(1);
}
else
{
stockMode = "S";
}
rs.close();
rs = null;
valueXmlString.append("<cust_stock_mode>").append( stockMode ).append("</cust_stock_mode>\r\n");
// end 04/06/09 manoharan set cust_stockmode*/
}
else if ( currentColumn.trim().equals("cust_code") )
{
......
......@@ -504,6 +504,10 @@ public class DissOrderDmgItmChg extends ValidatorEJB implements DissOrderDmgItmC
{
valueXmlString.append("<policy_no protect =\"1\">").append("<![CDATA["+policyNo+"]]>").append("</policy_no>");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
priceListAcct = distCommon.setPlistTaxClassEnv(siteCodeShip,siteCodeDlv,itemCode,tranType,"","PRICE_LIST",conn);
valueXmlString.append("<price_list protect =\"0\">").append("<![CDATA["+priceListAcct+"]]>").append("</price_list>");
......@@ -524,7 +528,7 @@ public class DissOrderDmgItmChg extends ValidatorEJB implements DissOrderDmgItmC
}
else
{
valueXmlString.append("<sundry_type protect =\"0\">").append("<![CDATA[]]>").append("</sundry_type>");
valueXmlString.append("<sundry_type protect =\"0\">").append("<![CDATA[C]]>").append("</sundry_type>");
valueXmlString.append("<sundry_code protect =\"0\">").append("<![CDATA[]]>").append("</sundry_code>");
}
......@@ -608,6 +612,10 @@ public class DissOrderDmgItmChg extends ValidatorEJB implements DissOrderDmgItmC
priceListClg = rs.getString("price_list__clg")==null ? "":rs.getString("price_list__clg");
priceList = rs.getString("price_list")==null ? "":rs.getString("price_list");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
priceListAcct = distCommon.setPlistTaxClassEnv(siteCodeShip,siteCodeDlv,itemCode,tranType,"","PRICE_LIST",conn);
if(priceListAcct.trim().length()==0||priceListAcct ==null )
{
......@@ -681,6 +689,10 @@ public class DissOrderDmgItmChg extends ValidatorEJB implements DissOrderDmgItmC
priceListClg = rs.getString("price_list__clg")==null ? "":rs.getString("price_list__clg");
priceList = rs.getString("price_list")==null ? "":rs.getString("price_list");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
priceListAcct = distCommon.setPlistTaxClassEnv(siteCodeShip,siteCodeDlv,itemCode,tranType,"","PRICE_LIST",conn);
if(priceListAcct.trim().length()==0||priceListAcct ==null )
{
......
......@@ -575,43 +575,16 @@ public class DissOrderDmgPrc extends ProcessEJB implements DissOrderDmgPrcLocal,
pstmtHeader.setString(27,currCode);
pstmtHeader.setDouble(28,exchRate);
//pstmtHeader.setString(29,totAmt);
if( taxAmt == null || "".equalsIgnoreCase(taxAmt.trim())|| taxAmt.trim().length()==0 )
{
pstmtHeader.setNull(30,java.sql.Types.NUMERIC);
}
else
{
pstmtHeader.setString(30,taxAmt);
}
// pstmtHeader.setString(30,taxAmt); set null if "" value
//pstmtHeader.setString(31,netAmt);
pstmtHeader.setString(32,siteCodeBil);
pstmtHeader.setString(33,projCode);
// pstmtHeader.setString(34,tranSer);
pstmtHeader.setNull(34,java.sql.Types.CHAR); // set null if "" in db on 10/09/09
pstmtHeader.setString(34,tranSer);
pstmtHeader.setString(35,salesPers);
pstmtHeader.setString(36,autoReceipt);
pstmtHeader.setString(37,avaliableYn);
if( targetWgt == null || "".equalsIgnoreCase(targetWgt.trim())|| targetWgt.trim().length()==0 )
{
pstmtHeader.setNull(38,java.sql.Types.NUMERIC);
}
else
{
pstmtHeader.setString(38,targetWgt);
}
if( targetVol == null || "".equalsIgnoreCase(targetVol.trim())|| targetVol.trim().length()==0 )
{
pstmtHeader.setNull(39,java.sql.Types.NUMERIC);
}
else
{
pstmtHeader.setString(39,targetVol);
}
//pstmtHeader.setString(39,targetVol);
pstmtHeader.setString(40,custOrderNo);
pstmtHeader.setString(41,chgUser);
pstmtHeader.setTimestamp(42,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(chgDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......@@ -995,28 +968,22 @@ public class DissOrderDmgPrc extends ProcessEJB implements DissOrderDmgPrcLocal,
// end of code
double totAmtDet =qtyOrder*rateDec ;
netAmtDec = totAmtDet - (totAmtDet* discount)/100 + taxAmtDec ;
//pstmtDetail.setDouble(1,lineNoSord); //for Db use on 09/09/09
pstmtDetail.setString(1,"1"); //for Db use on 09/09/09
pstmtDetail.setDouble(1,lineNoSord);
pstmtDetail.setDouble(2,discount);
pstmtDetail.setString(3,taxClass);
pstmtDetail.setDouble(4,totAmtDet);
pstmtDetail.setDouble(5,rateClgDec);
pstmtDetail.setDouble(6,shipQty);
pstmtDetail.setString(7,remarks);
// pstmtDetail.setString(8,received); //use for DB on 09/09/09
pstmtDetail.setNull(8,java.sql.Types.NUMERIC);
//pstmtDetail.setString(9,overShipRec); //use for DB on 09/09/09
pstmtDetail.setNull(9,java.sql.Types.NUMERIC);
pstmtDetail.setString(8,received);
pstmtDetail.setString(9,overShipRec);
pstmtDetail.setString(10,taxEnv);
pstmtDetail.setString(11,itemCode);
pstmtDetail.setString(12,saleOrder);
pstmtDetail.setString(13,packInstr);
pstmtDetail.setString(14,tranIdDemand);
pstmtDetail.setString(15,unit);
//pstmtDetail.setString(16,qtyReturn); //use for DB on 09/09/09
pstmtDetail.setNull(16,java.sql.Types.NUMERIC);
pstmtDetail.setString(16,qtyReturn);
pstmtDetail.setDouble(17,qtyOrder);
pstmtDetail.setString(18,tranIdG);
pstmtDetail.setTimestamp(19,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(shipDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......@@ -1024,15 +991,7 @@ public class DissOrderDmgPrc extends ProcessEJB implements DissOrderDmgPrcLocal,
pstmtDetail.setTimestamp(21,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(dueDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmtDetail.setDouble(22,netAmtDec);
pstmtDetail.setDouble(23,qtyOrder);
//pstmtDetail.setString(24,taxAmt); // for db use on 09/09/09
if( taxAmt == null || "".equalsIgnoreCase(taxAmt.trim())|| taxAmt.trim().length()==0 )
{
pstmtDetail.setNull(24,java.sql.Types.NUMERIC);
}
else
{
pstmtDetail.setString(24,taxAmt);
}
pstmtDetail.setDouble(25,fact);
pstmtDetail.setString(26,unitSal);
pstmtDetail.setDouble(27,lineNo);
......
......@@ -967,7 +967,7 @@ public class DistDemandMatrixPrc extends ProcessEJB implements DistDemandMatrixP
priceList = dstCmn.setPlistTaxClassEnv(hdrItem, destSite, sourceCode, tranType, " ", "PRICE_LIST", conn);
if( flag )
if(flag)
{
distOrder = generateTranId("W_DIST_ORDER", getCurrdateInAppFormat(), loginSite, loginCode, tranType );
//distOrder = "00000000"+z;
......
......@@ -67,7 +67,7 @@ public class FeedBackPos extends ValidatorEJB implements FeedBackPosLocal,FeedBa
{
return "";
}
public String postSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, String windowName, Connection conn)throws RemoteException,ITMException
public String postSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
String returnVal = "";
Document dom = null;
......
......@@ -14,6 +14,6 @@ import javax.ejb.Remote; // added for ejb3
public interface FeedBackPosLocal extends ValidatorLocal //, EJBObject
{
public String postSave() throws RemoteException,ITMException;
public String postSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, String windowName, Connection conn)throws RemoteException,ITMException;
public String postSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
......@@ -14,6 +14,6 @@ import javax.ejb.Remote; // added for ejb3
public interface FeedBackPosRemote extends ValidatorRemote //, EJBObject
{
public String postSave() throws RemoteException,ITMException;
public String postSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, String windowName, Connection conn)throws RemoteException,ITMException;
public String postSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
......@@ -17,7 +17,7 @@ public class InvAllocTraceBean
{
try
{
f = new FileWriter("C:\\invalloc.log", true);
f = new FileWriter("invalloc.log", true);
}
catch(Exception e)
{
......
......@@ -3364,6 +3364,10 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
priceListParent = rs.getString(1) == null ? "" : rs.getString(1);
}
else // 29/07/10 manoharan this else condition added as was going in loop
{
break;
}
//System.out.println("priceListParent .." + priceListParent);
rs.close();
pstmt.close();
......
......@@ -59,8 +59,8 @@ public class SRetPostSave extends ValidatorEJB implements SRetPostSaveLocal, SRe
{
sql = "update sreturndet set "
+ " net_amt = (quantity__stduom * rate__stduom) - ( (quantity__stduom * rate__stduom * discount) / 100) + tax_amt,"
+ " eff_net_amt = ( case when ret_rep_flag = 'R' then (quantity__stduom * rate__stduom) - ( (quantity__stduom * rate__stduom * discount) / 100) + tax_amt else (-1 * ((quantity__stduom * rate__stduom) - ( (quantity__stduom * rate__stduom * discount) / 100) + tax_amt)) end )"
+ " net_amt = (quantity__stduom * rate__stduom) - ( (quantity__stduom * rate__stduom * case when discount is null then 0 else discount end ) / 100) + case when tax_amt is null then 0 else tax_amt end ,"
+ " eff_net_amt = ( case when ret_rep_flag = 'R' then (quantity__stduom * rate__stduom) - ( (quantity__stduom * rate__stduom * case when discount is null then 0 else discount end ) / 100) + case when tax_amt is null then 0 else tax_amt end else (-1 * ((quantity__stduom * rate__stduom) - ( (quantity__stduom * rate__stduom * case when discount is null then 0 else discount end ) / 100) + case when tax_amt is null then 0 else tax_amt end )) end )"
+ " where tran_id = ? ";
pstmt= conn.prepareStatement(sql);
//System.out.println("First sql ["+ sql + "] tranId [" + tranId + "]");
......
......@@ -44,6 +44,9 @@ public class SReturnPos extends ValidatorEJB implements SReturnPosLocal, SReturn
Document dom = null;
try
{
System.out.println("SReturnPos xmlString1 [" + xmlString1 + "]");
System.out.println("SReturnPos domId [" + domId + "]");
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom = GenericUtility.getInstance().parseString(xmlString1);
......@@ -68,8 +71,8 @@ public class SReturnPos extends ValidatorEJB implements SReturnPosLocal, SReturn
DistStkUpdLocal distStkUpd = null;
NodeList hdrDom = null;
Node currDetail = null;
Statement stmt = null;
ResultSet rs = null;
//Statement stmt = null;
//ResultSet rs = null;
HashMap strAllocate = new HashMap();
try
{
......@@ -86,7 +89,11 @@ public class SReturnPos extends ValidatorEJB implements SReturnPosLocal, SReturn
if (currDetail != null && !updateStatus.equalsIgnoreCase("D"))
{
stmt = conn.createStatement();
//stmt = conn.createStatement();
if (conn == null)
{
System.out.println("<-----------Connection is null----------------------->");
}
retFlg = GenericUtility.getInstance().getColumnValueFromNode("ret_rep_flag",currDetail);
if (retFlg.equalsIgnoreCase("P"))
......@@ -133,7 +140,7 @@ public class SReturnPos extends ValidatorEJB implements SReturnPosLocal, SReturn
e.printStackTrace();
throw new ITMException(e);
}
finally
/*finally
{
try
{
......@@ -149,7 +156,7 @@ public class SReturnPos extends ValidatorEJB implements SReturnPosLocal, SReturn
e.printStackTrace();
throw new ITMException(e);
}
}
}*/
return "";
}
private Node getCurrentDetailFromDom(Document dom,String domId)
......
......@@ -45,6 +45,8 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
Document dom = null;
try
{
System.out.println("SReturnPrs xmlString1 [" + xmlString1 + "]");
System.out.println("SReturnPrs domId [" + domId + "]");
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom = GenericUtility.getInstance().parseString(xmlString1);
......@@ -87,7 +89,11 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
if (currDetail != null && !updateStatus.equalsIgnoreCase("A"))
{
stmt = conn.createStatement();
if (conn == null)
{
System.out.println("<-----------Connection is null----------------------->");
}
retFlg = GenericUtility.getInstance().getColumnValueFromNode("ret_rep_flag",currDetail);
if (retFlg.equalsIgnoreCase("P"))
......@@ -98,6 +104,7 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
lotNo = GenericUtility.getInstance().getColumnValueFromNode("lot_no",currDetail);
lotSl = GenericUtility.getInstance().getColumnValueFromNode("lot_sl",currDetail);
stmt = conn.createStatement();
sqlStr = "SELECT QUANTITY FROM SRETURNDET WHERE TRAN_ID = '"+tranId+"'" +
" AND LINE_NO = "+lineNo+""; //Omited the single quotes as it is not working in DB2 //Gulzar 09-01-07
System.out.println("sqlStr :: " + sqlStr);
......@@ -106,6 +113,11 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
{
qtyStr = rs.getString(1);
}
rs.close();
rs = null;
stmt.close();
stmt = null;
lineNo =" " + lineNo;
System.out.println("Line No : lineNo := "+lineNo);
quantity = Double.parseDouble(qtyStr);
......
......@@ -276,31 +276,31 @@ public class TaxInputCrtXmlPrc extends ProcessEJB implements TaxInputCrtXmlPrcLo
{
String subDirs[] = taxInputCerdStr.split( "\\\\" );
subDirName = subDirs[0];
//System.out.println("windows stype path");
System.out.println("windows stype path");
for( int idx = 1; idx < subDirs.length; idx++ )
{
subDirName = subDirName + File.separator + subDirs[ idx ];
//System.out.println("subDirs[ idx ] [" + subDirs[ idx ] + "]");
System.out.println("subDirs[ idx ] [" + subDirs[ idx ] + "]");
}
}
else
{
String subDirs[] = taxInputCerdStr.split( "/" );
subDirName = subDirs[0];
//System.out.println("Unix style path");
System.out.println("Unix style path");
for( int idx = 1; idx < subDirs.length; idx++ )
{
subDirName = subDirName + File.separator + subDirs[ idx ];
//System.out.println("subDirs[ idx ] [" + subDirs[ idx ] + "]");
System.out.println("subDirs[ idx ] [" + subDirs[ idx ] + "]");
}
}
subDirFile = new File( subDirName );
//System.out.println("File path [" + subDirName + "]");
System.out.println("File path [" + subDirName + "]");
if( !subDirFile.exists() )
{
//System.out.println("creating folders [" + subDirName + "]");
subDirFile.mkdir();
System.out.println("creating folders [" + subDirName + "]");
subDirFile.mkdirs();
}
}
// end 19/01/10 manoharan both on linux and windows should work
......
......@@ -141,6 +141,7 @@ public class TaxSch extends ProcessEJB implements TaxSchLocal, TaxSchRemote
String siteCodeShip = null;
ITMDBAccessLocal itmDBAccess = null;
ConnDriver connDriver = new ConnDriver();
Connection conn = null;
try
{
......@@ -149,9 +150,18 @@ public class TaxSch extends ProcessEJB implements TaxSchLocal, TaxSchRemote
setGlobalVarMap(xtraParams);
String dataStr = null;
System.out.println("global var map :"+this.globalVarMap+":");
itmDBAccess = getITMAccess();
conn = itmDBAccess.getConnection(); //This function is to connect with oracle.ejb..ejb.
// 16/03/10 manoharan
//itmDBAccess = getITMAccess();
//conn = itmDBAccess.getConnection(); //This function is to connect with oracle.ejb..ejb.
//conn.setAutoCommit(false);
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver=null;
// end 16/03/10 manoharan
StringBuffer retTabSepStrBuff = new StringBuffer();
StringBuffer inSqlBuff =new StringBuffer();
StringBuffer sqlBuff =new StringBuffer();
......@@ -748,12 +758,68 @@ public class TaxSch extends ProcessEJB implements TaxSchLocal, TaxSchRemote
//sqlExprRSMetaData.close();
sqlExprRSMetaData = null;
resultString = retTabSepStrBuff.toString();
//System.out.println("resultString :"+resultString);
System.out.println("resultString [" + resultString + "]");
// 28-06-2007 manoharan
partyNameRS = null;
// 16/03/10 manoharan
if (partyNamePstmt != null && !partyNamePstmt.isClosed())
{
partyNamePstmt.close();
}
partyNamePstmt = null;
if (taxBalSelPstmt != null && !taxBalSelPstmt.isClosed())
{
taxBalSelPstmt.close();
}
taxBalSelPstmt = null;
if (sundryCodeSelPstmt != null && !sundryCodeSelPstmt.isClosed())
{
sundryCodeSelPstmt.close();
}
sundryCodeSelPstmt = null;
if (exciseRefSelPstmt != null && !exciseRefSelPstmt.isClosed())
{
exciseRefSelPstmt.close();
}
exciseRefSelPstmt = null;
if (taxChapterSelPstmt != null && !taxChapterSelPstmt.isClosed())
{
taxChapterSelPstmt.close();
}
taxChapterSelPstmt = null;
if (chapterHeadingSelPstmt != null && !chapterHeadingSelPstmt.isClosed())
{
chapterHeadingSelPstmt.close();
}
chapterHeadingSelPstmt = null;
if (countTaxChapSelPstmt != null && !countTaxChapSelPstmt.isClosed())
{
countTaxChapSelPstmt.close();
}
countTaxChapSelPstmt = null;
if (matCategorySelPstmt != null && !matCategorySelPstmt.isClosed())
{
matCategorySelPstmt.close();
}
matCategorySelPstmt = null;
if (sqlExprSelPstmt != null && !sqlExprSelPstmt.isClosed())
{
sqlExprSelPstmt.close();
}
sqlExprSelPstmt = null;
if (siteCodeShipPstmt != null && !siteCodeShipPstmt.isClosed())
{
siteCodeShipPstmt.close();
}
siteCodeShipPstmt = null;
if (sundryTypePstmt != null && !sundryTypePstmt.isClosed())
{
sundryTypePstmt.close();
}
sundryTypePstmt = null;
// end 16/03/10 manoharan
// end 28/-06-2007 manoharan
// added by manazir on 26/11/09 since conn was not close
// added by manazir on 26/11/09 since conn is not close
if(conn != null)
{
conn.close();
......
......@@ -3,7 +3,6 @@ import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ActionHandler;
import ibase.webitm.ejb.ActionHandlerLocal;
import javax.ejb.Local; // added for ejb3
......
......@@ -1659,7 +1659,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
valueXmlString.append("<loc_code isSrvCallOnChg='0'>").append("<![CDATA[").append( (tLocCode == null ? "" : tLocCode.trim()) ).append("]]>").append("</loc_code>\r\n");
valueXmlString.append("<rate isSrvCallOnChg='0'>").append("<![CDATA[").append(rate1).append("]]>").append("</rate>\r\n");
//next line commented by mslam on 031108 as it gets set from item change on lot no
//valueXmlString.append("<rate__clg isSrvCallOnChg='0'>").append("<![CDATA[").append(rateClg).append("]]>").append("</rate__clg>\r\n"); //Commented - jiten - 05/04/06 - as set in itemChange of lot_no
// 27/10/10 manoharan commented as itemchanged is disabled
valueXmlString.append("<rate__clg isSrvCallOnChg='0'>").append("<![CDATA[").append(rateClg).append("]]>").append("</rate__clg>\r\n"); //Commented - jiten - 05/04/06 - as set in itemChange of lot_no
//for test this line being taken next to lot no
//valueXmlString.append("<quantity isSrvCallOnChg='0'>").append("<![CDATA[").append(minputQty).append("]]>").append("</quantity>\r\n");
valueXmlString.append("<amount isSrvCallOnChg='0'>").append("<![CDATA[").append(minputQty*Double.parseDouble(rate1)).append("]]>").append("</amount>\r\n");
......
......@@ -357,7 +357,7 @@ public class DistOrderAmdConf extends ActionHandlerEJB implements DistOrderAmdCo
genEDIRemote = ( GenerateEDILocal )ctx.lookup( "ibase/GenerateEDI/local" );// added for ejb3
//GenerateEDI genEDIRemote = (GenerateEDI)genEDIHome.create();//commented for ejb3
errCode = genEDIRemote.genEDI( "w_distordamd", tranId, xtraParams, conn );
errCode = genEDIRemote.genEDI( "w_distordamd", tranId, "E", xtraParams, conn );
if( "SUCCESS".equalsIgnoreCase( errCode ) )
{
errCode = null;
......
......@@ -463,7 +463,7 @@ public class SalesReturnAct extends ActionHandlerEJB implements SalesReturnActLo
System.out.println("parentNodeListLength====>"+parentNodeListLength);
for(int ptr = 0; ptr < parentNodeListLength; ptr++)
{
System.out.println("ptr====>"+ptr);
System.out.println("ptr ====>"+ptr);
parentNode = parentNodeList.item(ptr);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
......@@ -505,7 +505,7 @@ public class SalesReturnAct extends ActionHandlerEJB implements SalesReturnActLo
} */
if ( childNodeName.equalsIgnoreCase( "item_code" ) )
{
if(childNode.getFirstChild() != null)
if(childNode.getFirstChild() != null )
{
dtlPstFlag = true;
}
......
......@@ -6,15 +6,13 @@ public class BankTranBean
private double adjAmt= 0.0;
private double bal = 0.0;
public void setRefNo(String refNo)
{
this.refNo = refNo;
}
public String getRefNo()
{
return refNo;
return this.refNo;
}
public void setAdjAmt(double adjAmt)
{
......@@ -22,7 +20,7 @@ public class BankTranBean
}
public double getAdjAmt()
{
return adjAmt;
return this.adjAmt;
}
public void setAmt(double amt)
{
......@@ -30,7 +28,7 @@ public class BankTranBean
}
public double getAmt()
{
return amt;
return this.amt;
}
public void setBal(double bal)
{
......@@ -38,7 +36,7 @@ public class BankTranBean
}
public double getBal()
{
return bal;
return this.bal;
}
......
......@@ -176,14 +176,6 @@ public class JvYearEndClosingDtl extends ValidatorEJB implements JvYearEndClosin
break ;
}
}
if ( childNodeName.equalsIgnoreCase( "eff_date" ) )
{
if ( childNode.getFirstChild() == null )
{
errString =itmDBAccessEJB.getErrorString("eff_date","VTEFFDTNL",userId);
break ;
}
}
}
//END OF CASE1
break;
......
......@@ -84,6 +84,7 @@ public class JournalYearEndAct extends ActionHandlerEJB implements JournalYearEn
String detCnt = "0";
double amtDr = 0;
double amtCr = 0;
String accDescr = null;
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
String sql = "";
Connection conn = null;
......@@ -131,7 +132,7 @@ public class JournalYearEndAct extends ActionHandlerEJB implements JournalYearEn
siteCode = "";
siteCode = finalStr.substring(0,finalStr.length()-3);
sql = "SELECT A.ACCT_CODE, SUM(CASE WHEN A.DR_AMT__BASE IS NULL THEN 0 ELSE A.DR_AMT__BASE END) AMT_DR,"
+"SUM(CASE WHEN A.CR_AMT__BASE IS NULL THEN 0 ELSE A.CR_AMT__BASE END) AMT_CR, A.CCTR_CODE FROM ACCTBAL A, "
+"SUM(CASE WHEN A.CR_AMT__BASE IS NULL THEN 0 ELSE A.CR_AMT__BASE END) AMT_CR, A.CCTR_CODE, B.DESCR FROM ACCTBAL A, "
+"ACCOUNTS B, ACCTSGRP C, ACCTGRP D "
+"WHERE A.ACCT_CODE = B.ACCT_CODE "
+"AND B.SGROUP_CODE = C.SGROUP_CODE "
......@@ -142,7 +143,7 @@ public class JournalYearEndAct extends ActionHandlerEJB implements JournalYearEn
+"AND A.PRD_CODE <= '"+ prdCodeTo +"' "
+"AND A.ACCT_CODE >= '"+ acctCodeFrom +"' "
+"AND A.ACCT_CODE <= '"+ acctCodeTo +"' "
+"GROUP BY A.PRD_CODE, A.ACCT_CODE, A.CCTR_CODE "
+"GROUP BY A.PRD_CODE, A.ACCT_CODE, A.CCTR_CODE, B.DESCR "
+"HAVING SUM(CASE WHEN A.DR_AMT__BASE IS NULL THEN 0 ELSE A.DR_AMT__BASE END) <> SUM(CASE WHEN A.CR_AMT__BASE " +"IS NULL THEN 0 ELSE A.CR_AMT__BASE END)";
System.out.println("sql ::"+sql);
......@@ -151,21 +152,23 @@ public class JournalYearEndAct extends ActionHandlerEJB implements JournalYearEn
while (rs.next())
{
valueXmlString.append("<Detail>\r\n");
valueXmlString.append("<acct_code>").append("<![CDATA[").append(rs.getString(1)).append("]]>").append("</acct_code>\r\n");
valueXmlString.append("<cctr_code>").append("<![CDATA[").append(rs.getString(4)).append("]]>").append("</cctr_code>\r\n");
valueXmlString.append("<remarks>").append("<![CDATA[").append(reMarks).append("]]>").append("</remarks>\r\n");
valueXmlString.append("<acct_code isSrvCallOnChg='0'>").append("<![CDATA[").append(rs.getString(1)).append("]]>").append("</acct_code>\r\n");
valueXmlString.append("<cctr_code isSrvCallOnChg='0'>").append("<![CDATA[").append(rs.getString(4)).append("]]>").append("</cctr_code>\r\n");
valueXmlString.append("<remarks isSrvCallOnChg='0'>").append("<![CDATA[").append(reMarks).append("]]>").append("</remarks>\r\n");
amtDr = Double.parseDouble(rs.getString(2));
amtCr = Double.parseDouble(rs.getString(3));
accDescr = rs.getString(5);
if (amtDr >= amtCr)
{
valueXmlString.append("<drcr_flag>").append("<![CDATA[").append("C").append("]]>").append("</drcr_flag>\r\n");
valueXmlString.append("<amount>").append("<![CDATA[").append(amtDr - amtCr).append("]]>").append("</amount>\r\n");
valueXmlString.append("<drcr_flag isSrvCallOnChg='0'>").append("<![CDATA[").append("C").append("]]>").append("</drcr_flag>\r\n");
valueXmlString.append("<amount isSrvCallOnChg='0'>").append("<![CDATA[").append(amtDr - amtCr).append("]]>").append("</amount>\r\n");
}
else
{
valueXmlString.append("<drcr_flag>").append("<![CDATA[").append("D").append("]]>").append("</drcr_flag>\r\n");
valueXmlString.append("<amount>").append("<![CDATA[").append(amtCr - amtDr).append("]]>").append("</amount>\r\n");
valueXmlString.append("<drcr_flag isSrvCallOnChg='0'>").append("<![CDATA[").append("D").append("]]>").append("</drcr_flag>\r\n");
valueXmlString.append("<amount isSrvCallOnChg='0'>").append("<![CDATA[").append(amtCr - amtDr).append("]]>").append("</amount>\r\n");
}
valueXmlString.append("<accounts_descr isSrvCallOnChg='0'>").append("<![CDATA[").append(accDescr).append("]]>").append("</accounts_descr>\r\n");
valueXmlString.append("</Detail>\r\n");
}
stmt.close();
......
......@@ -214,16 +214,17 @@ public class ReceiptAdvAct extends ActionHandlerEJB implements ReceiptAdvActLoca
double balAmt = Double.parseDouble(chqAmt);//Changed from advAmt to chqAmt as changed in PB
double balAmt1 = Double.parseDouble(chqAmt);
System.out.println("BalAmt :=" +balAmt);
System.out.println("actionType [" +actionType + "] siteCode [" + siteCode + "] itemSer [" + itemSer + "] custCode [" + custCode + "]" );
if (objContext.equalsIgnoreCase("2"))
{
if(actionType.equalsIgnoreCase("actionDefaultSer"))
if(actionType.equals("actionDefaultSer"))
{
sql = "SELECT TRAN_SER, REF_NO, TOT_AMT, ADJ_AMT FROM RECEIVABLES "+
" WHERE SITE_CODE = '"+siteCode+"' AND ITEM_SER='"+itemSer+"' AND CUST_CODE = '"+custCode+"' AND CURR_CODE = '"+currCode+"' AND TOT_AMT - ADJ_AMT > 0 ORDER BY DUE_DATE";
}
else if(actionType.equalsIgnoreCase("default"))
else if(actionType.equals("default"))
{
sql = "SELECT TRAN_SER, REF_NO, TOT_AMT, ADJ_AMT FROM RECEIVABLES "+
" WHERE SITE_CODE = '"+siteCode+"' AND CUST_CODE = '"+custCode+"' AND CURR_CODE = '"+currCode+"' AND TOT_AMT - ADJ_AMT > 0 ORDER BY DUE_DATE";
......@@ -475,7 +476,31 @@ public class ReceiptAdvAct extends ActionHandlerEJB implements ReceiptAdvActLoca
// +" ( ( RECEIVABLES.TOT_AMT- RECEIVABLES.ADJ_AMT) <> 0 ) ) and "
// +" receivables.curr_code = currency.curr_code and "
// +" receivables.acct_code = accounts.acct_code ";
/*
SELECT receivables.ref_no , despatch.gp_no , receivables.due_date ,
receivables.tot_amt , receivables.adj_amt ,
((receivables.tot_amt) - (receivables.adj_amt)) Balance,
fn_remark(ref_no,tran_ser) remark, receivables.cust_code
FROM invoice , despatch , receivables , customer
WHERE ( invoice.desp_id = despatch.desp_id (+))
and ( invoice.invoice_id (+) = receivables.ref_no)
and ( receivables.cust_code = customer.cust_code )
and ( ( customer.group_code in ( select group_code from customer where cust_code = 'AD0108') )
and ( receivables.site_code = 'SA117' )
and ( receivables.tran_ser = 'R-IBCA' )
and ( ( RECEIVABLES.TOT_AMT- RECEIVABLES.ADJ_AMT) <> 0 ) )
SELECT r.ref_no, r.tran_ser, d.gp_no, r.due_date,r.tot_amt, r.adj_amt, ((r.tot_amt) - (r.adj_amt)) Balance,
fn_remark(ref_no, tran_ser) remark, r.tran_date, r.ref_no, r.ref_date, r.curr_code, c.descr as curr_descr,
r.exch_rate, r.acct_code, a.descr as acct_descr, r.cctr_code, r.discount, r.tax_amt, r.bad_debt_amt
FROM ((((invoice i left outer join despatch d on i.desp_id = d.desp_id)
left outer join receivables r on r.ref_no = i.invoice_id )
inner join customer cu on r.cust_code = cu.cust_code)
inner join currency c on r.curr_code = c.curr_code)
inner join accounts a on r.acct_code = a.acct_code
WHERE cu.group_code in ( select group_code from customer where cust_code = 'AD0108')
AND r.site_code = 'SA117' AND r.tran_ser = 'R-IBCA' AND ( r.TOT_AMT- r.ADJ_AMT <> 0 )
*/
sql= "SELECT r.ref_no, r.tran_ser, d.gp_no, r.due_date,r.tot_amt,"
+" r.adj_amt, ((r.tot_amt) - (r.adj_amt)) Balance, fn_remark(ref_no, tran_ser) remark, "
+" r.tran_date, r.ref_no, r.ref_date, r.curr_code, "
......@@ -483,7 +508,7 @@ public class ReceiptAdvAct extends ActionHandlerEJB implements ReceiptAdvActLoca
+" r.cctr_code, r.discount, r.tax_amt, r.bad_debt_amt "
+" FROM ((((invoice i "
+" left outer join despatch d on i.desp_id = d.desp_id) "
+" left outer join receivables r on r.ref_no = i.invoice_id ) "
+" right outer join receivables r on r.ref_no = i.invoice_id ) "
+" inner join customer cu on r.cust_code = cu.cust_code) "
+" inner join currency c on r.curr_code = c.curr_code) "
+" inner join accounts a on r.acct_code = a.acct_code "
......@@ -492,6 +517,7 @@ public class ReceiptAdvAct extends ActionHandlerEJB implements ReceiptAdvActLoca
+" AND r.tran_ser = '"+tranSer+"' "
+" AND ( r.TOT_AMT- r.ADJ_AMT <> 0 ) ";
System.out.println("[ReceiptAdvActEJB] sql==>"+sql);
pstmt = conn.prepareStatement(sql);
......
......@@ -40,7 +40,10 @@ class ADPElement
private double supply = 0;
private double planDemand = 0;
private double planSupply = 0;
// 12/04/10 manoharan MF90BHU001
private double stockQty = 0;
private double othSupply = 0;
// end 12/04/10 manoharan MF90BHU001
private double minOrderQty = 0;
private double integralQty = 0;
private double maxQty = 0;
......@@ -61,7 +64,10 @@ class ADPElement
private ArrayList timeMRPArr;
transient GenericUtility genericUtility = null;
// 22/06/10 manoharan mfg lead time based on batch size
private String mfgLeadBasis = "F";
private double batchSizeLead = 0;
// end 22/06/10 manoharan
public ADPElement()
{
//System.out.println("New ADPElement Created");
......@@ -195,7 +201,7 @@ class ADPElement
public void setDemand(java.sql.Timestamp dueDate, double demand)
{
this.demand += demand;
updateTimeMrp(dueDate, demand, 0);
updateTimeMrp(dueDate, demand, 0, 0, 0);
}
public double getDemand()
{
......@@ -204,16 +210,36 @@ class ADPElement
public void setSupply(java.sql.Timestamp dueDate, double supply)
{
this.supply += supply;
updateTimeMrp(dueDate, 0, supply);
updateTimeMrp(dueDate, 0, supply, 0, 0);
}
public double getSupply()
{
return this.supply;
}
// 12/04/10 manoharan MF90BHU001
public void setStockQty(java.sql.Timestamp dueDate, double stockQty)
{
this.stockQty += stockQty;
updateTimeMrp(dueDate, 0,0, stockQty,0);
}
public double getStockQty()
{
return this.stockQty;
}
public void setOthSupply(java.sql.Timestamp dueDate, double othSupply)
{
this.othSupply += othSupply;
updateTimeMrp(dueDate, 0,0, 0, othSupply);
}
public double getOthSupply()
{
return this.othSupply;
}
// end 12/04/10 manoharan MF90BHU001
public void setPlanSupply(java.sql.Timestamp dueDate, double supply)
{
this.planSupply += supply;
updateTimeMrp(dueDate, 0, supply);
updateTimeMrp(dueDate, 0, supply, 0, 0);
}
public double getPlanSupply()
{
......@@ -423,7 +449,27 @@ class ADPElement
{
return this.independentDemand;
}*/
private void updateTimeMrp(java.sql.Timestamp dueDate, double demand, double supply)
// 22/06/10 manoharan mfg lead time based on batch size
public void setMfgLeadBasis(String mfgLeadBasis)
{
this.mfgLeadBasis = mfgLeadBasis;
}
public String getMfgLeadBasis()
{
return this.mfgLeadBasis;
}
public void setBatchSizeLead(double batchSizeLead)
{
this.batchSizeLead = batchSizeLead;
}
public double getBatchSizeLead()
{
return this.batchSizeLead;
}
// end 22/06/10 manoharan
private void updateTimeMrp(java.sql.Timestamp dueDate, double demand, double supply, double stockQty, double othSupply)
{
String errString = "";
TimeMRP timeMRP = null;
......@@ -454,6 +500,10 @@ class ADPElement
timeMRP.setDueDate(dueDate);
timeMRP.setDemand(demand);
timeMRP.setSupply(supply);
// 12/04/10 manoharan MF90BHU001
timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply);
// end 12/04/10 manoharan MF90BHU001
this.timeMRPArr.add(timeMRP);
}
else
......@@ -461,6 +511,10 @@ class ADPElement
timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle);
timeMRP.setDemand(demand);
timeMRP.setSupply(supply);
// 12/04/10 manoharan MF90BHU001
timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply);
// end 12/04/10 manoharan MF90BHU001
this.timeMRPArr.set(timeEle,timeMRP);
}
updateRunningDemandSupply(dueDate);
......
......@@ -106,6 +106,9 @@ public class ExplodeBom
int iLeadTime = 0;
int iiLeadTime = 0;
String sqlLead = null;
String mfgLeadBasis = "F";
double batchSizeLead = 0;
try
{
conn = connDriver.getConnectDB("DriverITM");//Added by Jiten 13/11/06 -
......@@ -444,7 +447,8 @@ public class ExplodeBom
//}
//else
//{
sqlLead = "SELECT PUR_LEAD_TIME, QC_LEAD_TIME, MFG_LEAD_TIME "
// 22/06/10 manoharan to consider mfg lead time per batch
sqlLead = "SELECT PUR_LEAD_TIME, QC_LEAD_TIME, MFG_LEAD_TIME, mfg_lead_basis, batch_size_lead "
+ "FROM SITEITEM "
+ "WHERE SITE_CODE = ? "
+ "AND ITEM_CODE = ? ";
......@@ -458,6 +462,9 @@ public class ExplodeBom
dpurLeadTime = rsLead.getDouble(1);
dqcLeadTime = rsLead.getDouble(2);
dmfgLeadTime = rsLead.getDouble(3);
mfgLeadBasis = rsLead.getString(4);
batchSizeLead = rsLead.getDouble(5);
pstmtLead.close();
rsLead.close();
}
......@@ -465,6 +472,9 @@ public class ExplodeBom
{
mfgLeadBasis = "F";
batchSizeLead = 0;
sqlLead = "SELECT PUR_LEAD_TIME, QC_LEAD_TIME, MFG_LEAD "
+ "FROM ITEM "
+ "WHERE ITEM_CODE = ? ";
......@@ -519,6 +529,22 @@ public class ExplodeBom
if ( lineTypeInner.equals("B") )
{
// 22/06/10 manoharan mfg_lead_time to be calculated as per batch size
// 22/06/10 manoharan to calculate due_date based on batch size
// if configured as lead time per batch
if (mfgLeadBasis == null)
{
mfgLeadBasis = "F";
}
if ("B".equals(mfgLeadBasis) && quantityUpdate > batchSizeLead )
{
System.out.println("manohar dmfgLeadTime before [" + dmfgLeadTime + "]");
dmfgLeadTime = quantityUpdate * dmfgLeadTime / batchSizeLead;
System.out.println("manohar dmfgLeadTime after [" + dmfgLeadTime + "]");
}
// end 22/06/10 manoharan
simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
sDueDate = simpleDateFormat.format(dueDate);
StringBuffer tempXMLString = new StringBuffer("<Root>");
......
......@@ -83,6 +83,7 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
NodeList hdrDom = null;
Node currDetail = null;
InvAllocTraceBean invAllocTrace = new InvAllocTraceBean();
String qcReqd = "N", lotNoDet = "";
try
{
stmt = conn.createStatement();
......@@ -94,6 +95,7 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
tranType = GenericUtility.getInstance().getColumnValueFromNode("tran_type",hdrDom.item(0));
siteCodeReq = GenericUtility.getInstance().getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = GenericUtility.getInstance().getColumnValueFromNode("tran_id",hdrDom.item(0));
qcReqd = GenericUtility.getInstance().getColumnValueFromNode("qc_reqd",hdrDom.item(0));
System.out.println("\n tranId :"+tranId);
// 24/01/11 - Chandni Shah
......@@ -117,7 +119,7 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
if ("Y".equalsIgnoreCase(sumQtyDet))
{
sql = " select sum ( case when qty_doc is null then quantity else qty_doc end) as qty_doc "
sql = " select sum ( (case when CONV_QTY_DOC is null or CONV_QTY_DOC <= 0 then 1 else CONV_QTY_DOC end) * quantity )as qty_doc "
+" from receipt_backflush_det "
+" where tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
......@@ -148,7 +150,7 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
// 27/01/11 - Chandni Shah
if ("C".equalsIgnoreCase(backflushType))
{
sql = " select s.mfg_date,s.exp_date,r.loc_code from "
sql = " select s.mfg_date,s.exp_date,r.loc_code, r.lot_no from "
+" receipt_backflush_det r , stock s "
+" where r.item_code = s.item_code "
+" and r.site_code = s.site_code "
......@@ -165,12 +167,15 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
mfgDate = rs.getTimestamp ("mfg_date") ;
expDate = rs.getTimestamp ("exp_date");
locCodeDet = rs.getString ("loc_code");
lotNoDet = rs.getString ("lot_no");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if ("Y".equals(qcReqd) )
{
sql = " update receipt_backflush "
+" set mfg_date = ? , "
+" exp_date = ? , "
......@@ -181,6 +186,23 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
pstmt.setTimestamp(2,expDate);
pstmt.setString(3,locCodeDet);
pstmt.setString(4,tranId);
}
else
{
sql = " update receipt_backflush "
+" set mfg_date = ? , "
+" exp_date = ? , "
+" loc_code = ?, "
+ " lot_no = ? "
+" where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,mfgDate);
pstmt.setTimestamp(2,expDate);
pstmt.setString(3,locCodeDet);
pstmt.setString(4,lotNoDet);
pstmt.setString(5,tranId);
}
int upd = pstmt.executeUpdate();
pstmt.close();
......
......@@ -25,7 +25,6 @@ public class RunMRP extends ValidatorEJB implements RunMRPLocal,RunMRPRemote //
GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
Connection conn = null;
SimpleDateFormat simpleDateFormat = null;
/*public void ejbCreate() throws RemoteException, CreateException
......@@ -113,7 +112,7 @@ public class RunMRP extends ValidatorEJB implements RunMRPLocal,RunMRPRemote //
InitialContext ctx = new InitialContext(p);
itmDBAccess = (ITMDBAccessLocal)ctx.lookup("ibase/ITMDBAccessEJB/local");
//itmDBAccess = itmDBAccessHome.create();
connectionObject = itmDBAccess.getConnection();
//connectionObject = itmDBAccess.getConnection();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
columnValue = genericUtility.getColumnValue(currentColumn,dom);
......@@ -229,6 +228,8 @@ public class RunMRP extends ValidatorEJB implements RunMRPLocal,RunMRPRemote //
String itemcodeTo = "";
//String itemSerTo = "";
//String itemSerFrom = "";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
......@@ -372,8 +373,8 @@ public class RunMRP extends ValidatorEJB implements RunMRPLocal,RunMRPRemote //
try
{
//System.out.println("Closing Connection.....");
//conn.close();
//conn = null;
conn.close();
conn = null;
}catch(Exception se){}
}
return errString;
......
......@@ -15,6 +15,10 @@ public class TimeMRP
private double runningSupply = 0;
private double runningPlanSupply = 0;
private double independentDemand = 0;
// 12/04/10 manoharan MF90BHU001
private double stockQty = 0;
private double othSupply = 0;
// end 12/04/10 manoharan MF90BHU001
boolean createDemand = false;
public TimeMRP()
......@@ -50,7 +54,24 @@ public class TimeMRP
{
return this.supply;
}
// 12/04/10 manoharan MF90BHU001
public void setStockQty(double stockQty)
{
this.stockQty += stockQty;
}
public double getStockQty()
{
return this.stockQty;
}
public void setOthSupply(double othSupply)
{
this.othSupply += othSupply;
}
public double getOthSupply()
{
return this.othSupply;
}
// 12/04/10 manoharan MF90BHU001
public void setRunningDemand(double runningDemand)
{
this.runningDemand = runningDemand;
......
package ibase.webitm.ejb.mfg;
import java.rmi.RemoteException;
//import javax.ejb.CreateException;
//import javax.ejb.EJBHome;
//import ibase.webitm.ejb.ProcessHome;
//import ibase.webitm.ejb.Process;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.xml.parsers.*;
import ibase.webitm.ejb.ProcessLocal;
import javax.ejb.Local; // added for ejb3
import ibase.webitm.utility.ITMException;
@Local // added for ejb3`
public interface WorkCalendarPrcLocal extends ProcessLocal
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface WorkCalendarPrcLocal extends ProcessLocal//, EJBObject
{
//public ibase.webitm.ejb.Process create() throws RemoteException, CreateException;
public String process() throws RemoteException,ITMException;
public String process(String string1, String string2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
......@@ -6,14 +6,14 @@ import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.xml.parsers.*;
//import ibase.webitm.ejb.Process;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ProcessRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
import ibase.webitm.ejb.ValidatorRemote;// added for ejb3
@Remote // added for ejb3
public interface WorkCalendarPrcRemote extends ProcessRemote
public interface WorkCalendarPrcRemote extends ProcessRemote//, EJBObject
{
public String process() throws RemoteException,ITMException;
public String process(String string1, String string2, String windowName, String xtraParams) throws RemoteException,ITMException;
......
......@@ -239,7 +239,6 @@ public class QcOrderAct extends ActionHandlerEJB implements QcOrderActLocal , Q
valueXmlString.append("<quantity>").append("<![CDATA[").append(rs.getDouble(11)).append("]]>").append("</quantity>\r\n");
valueXmlString.append("</Detail>");
//valueXmlString.append("</ >\r\n");
counter++;
}
rs.close();
......@@ -493,7 +492,6 @@ public class QcOrderAct extends ActionHandlerEJB implements QcOrderActLocal , Q
//17-01-11 - chandni shah
valueXmlString.append("<cc_stkloc isSrvCallOnChg='0'>").append("<![CDATA[").append(loc).append("]]>").append("</cc_stkloc>\r\n");
valueXmlString.append("<cc_stkqty isSrvCallOnChg='0'>").append("<![CDATA[").append(quantity).append("]]>").append("</cc_stkqty>\r\n");
//
valueXmlString.append("</Detail>");
line++;
}// for end
......
......@@ -457,7 +457,7 @@ public class RcptBackflushAct extends ActionHandlerEJB implements RcptBackflush
PreparedStatement pstmt = null;
ResultSet rs = null;
String tranId = null, siteDescr = null, itemCode = null, itemDescr = null, unit = null;
String stkLocCode = null,stkLotNo = null, stkLotSl = null, locDescr = null,rate=null;;
String stkLocCode = null,stkLotNo = null, stkLotSl = null, locDescr = null,rate=null,unitDoc = "";
String siteCode = null;
double quantity = 0, remainingQty = 0, inputQty = 0, stkQty = 0;
Node currDetail = null, currDetail1 = null;
......@@ -465,6 +465,8 @@ public class RcptBackflushAct extends ActionHandlerEJB implements RcptBackflush
ConnDriver connDriver = new ConnDriver();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
GenericUtility genericUtility = GenericUtility.getInstance();
ArrayList unitList = null;
Object factOb = null,qtyOb = null;
try {
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
......@@ -475,7 +477,7 @@ public class RcptBackflushAct extends ActionHandlerEJB implements RcptBackflush
itemCode = genericUtility.getColumnValue("item_code", dom);
itemDescr = genericUtility.getColumnValue("item_descr", dom);
quantity = Double.parseDouble(genericUtility.getColumnValue("quantity", dom));
unitDoc = genericUtility.getColumnValue("unit", dom1);
NodeList detailList = selDataDom.getElementsByTagName("Detail");
int noOfDetails = detailList.getLength();
for (int ctr = 0; ctr < noOfDetails; ctr++) {
......@@ -550,18 +552,52 @@ public class RcptBackflushAct extends ActionHandlerEJB implements RcptBackflush
valueXmlString.append("<tran_id isSrvCallOnChg='0'>").append("<![CDATA[").append(tranId).append("]]>").append("</tran_id>\r\n");
valueXmlString.append("<site_code isSrvCallOnChg='0'>").append("<![CDATA[").append(siteCode).append("]]>").append("</site_code>\r\n");
valueXmlString.append("<site_descr isSrvCallOnChg='0'>").append("<![CDATA[").append(siteDescr).append("]]>").append("</site_descr>\r\n");
valueXmlString.append("<item_code isSrvCallOnChg='0'>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>\r\n");
valueXmlString.append("<item_code isSrvCallOnChg='1'>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>\r\n");
valueXmlString.append("<item_descr isSrvCallOnChg='0'>").append("<![CDATA[").append(itemDescr).append("]]>").append("</item_descr>\r\n");
valueXmlString.append("<unit isSrvCallOnChg='0'>").append("<![CDATA[").append(unit).append("]]>").append("</unit>\r\n");
valueXmlString.append("<loc_code isSrvCallOnChg='0'>").append("<![CDATA[").append(stkLocCode).append("]]>").append("</loc_code>\r\n");
valueXmlString.append("<location_descr isSrvCallOnChg='0'>").append("<![CDATA[").append(locDescr).append("]]>").append("</location_descr>\r\n");
valueXmlString.append("<unit__doc isSrvCallOnChg='0'>").append("<![CDATA[").append(unit).append("]]>").append("</unit__doc>\r\n");
valueXmlString.append("<unit__doc isSrvCallOnChg='1'>").append("<![CDATA[").append(unitDoc).append("]]>").append("</unit__doc>\r\n");
valueXmlString.append("<lot_no isSrvCallOnChg='0'>").append("<![CDATA[").append(stkLotNo).append("]]>").append("</lot_no>\r\n");
//changed by ALKA on 12/09/07 for no_art column added in the receipt_backflush_set and itemChange enabled for lot_sl for request id "MF78GIN014"
// valueXmlString.append("<lot_sl isSrvCallOnChg='0'>").append("<![CDATA[").append(stkLotSl).append("]]>").append("</lot_sl>\r\n");
valueXmlString.append("<lot_sl isSrvCallOnChg='1'>").append("<![CDATA[").append(stkLotSl).append("]]>").append("</lot_sl>\r\n");
valueXmlString.append("<quantity isSrvCallOnChg='0'>").append("<![CDATA[").append(inputQty).append("]]>").append("</quantity>\r\n");
valueXmlString.append("<rate isSrvCallOnChg='0'>").append("<![CDATA[").append(rate).append("]]>").append("</rate>\r\n");
// 29/01/10 manoharan
if (!unit.trim().equals(unitDoc.trim()))
{
unitList = null;
factOb = null;
qtyOb = null;
double conv = 0;
ibase.webitm.ejb.dis.DistCommon dist = new ibase.webitm.ejb.dis.DistCommon();
unitList = dist.getConvQuantityFact( unit,unitDoc, itemCode, inputQty, conv,conn);
factOb = unitList.get(0);
qtyOb = unitList.get(1);
System.out.println("manoharan 29/01/11 factOb [ " + factOb.toString() + "] qtyOb [" + qtyOb.toString() + "]");
valueXmlString.append("<conv_qty_doc protect =\"0\">").append("<![CDATA["+factOb.toString()+"]]>").append("</conv_qty_doc>");
valueXmlString.append("<qty_doc protect =\"0\">").append("<![CDATA["+qtyOb.toString()+"]]>").append("</qty_doc>");
unitList = null;
factOb = null;
qtyOb = null;
dist = new ibase.webitm.ejb.dis.DistCommon();
unitList = dist.getConvQuantityFact( unitDoc,unit, itemCode, Double.parseDouble(rate), conv,conn);
factOb = unitList.get(0);
qtyOb = unitList.get(1);
valueXmlString.append("<rate_doc protect =\"0\">").append("<![CDATA["+qtyOb.toString()+"]]>").append("</rate_doc>");
}
else
{
valueXmlString.append("<conv_qty_doc protect =\"0\">").append("<![CDATA[1]]>").append("</conv_qty_doc>");
valueXmlString.append("<qty_doc protect =\"0\">").append("<![CDATA["+inputQty+"]]>").append("</qty_doc>");
valueXmlString.append("<rate_doc protect =\"0\">").append("<![CDATA["+rate+"]]>").append("</rate_doc>");
}
// end 29/01/11 manoharan
valueXmlString.append("</Detail>");
System.out.println("remainingQty at the end of the forloop :::: " + remainingQty); //SOP ADDED BY ALKA TO CHECK THE REMAINING STOCK 19/07/07
if (remainingQty == 0)
......
......@@ -104,8 +104,10 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
{
System.out.println("Exception :WorkorderPrcEJB :getData(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
rtrStr = e.getMessage();
throw new ITMException(e);
}
return rtrStr;
}//END OF GETDATA(1)
......@@ -271,8 +273,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
return resultString;
}//END OF GETDATA(2)
public String process(String xmlString, String xmlString2, String windowName, String xtraParams)
throws RemoteException,ITMException
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException
{
Document detailDom = null;
Document headerDom = null;
......@@ -313,6 +314,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
System.out.println("Exception :WorkorderPrcEJB :process(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace();
retStr = e.getMessage();
throw new ITMException(e);
}
return retStr;
}//END OF PROCESS (1)
......@@ -444,11 +446,11 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
{
System.out.println("Exception : WorkorderPrcEJB =>"+d.toString());
d.printStackTrace();
}
System.out.println("Exception :WorkorderPrcEJB :process(String xmlString2, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace();
errString = e.getMessage();
return errString ;
throw new ITMException(e);
}
}
finally
{
......@@ -474,7 +476,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
return errString;
}//END OF PROCESS(2)
private String calWorkorderPrc(ArrayList tranList,Connection conn)
private String calWorkorderPrc(ArrayList tranList,Connection conn) throws Exception,ITMException
{
ResultSet rs1 = null,rsSql1=null,rsSql2=null;
PreparedStatement pstmt = null,pstmtInsert=null,pstmtUpdate=null,pstmtSql1=null,pstmtSql2=null;
......@@ -508,7 +510,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
StringTokenizer st=null;//for itemSeries
ArrayList ar=new ArrayList();
Timestamp chgDate=null;
String deptCodeMfg = "";
GenericUtility genericUtility = GenericUtility.getInstance();
String tranId1 = null; //blanknull(tranId1).trim();
......@@ -521,8 +523,8 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
String sqlInsert = "INSERT INTO WORKORDER(WORK_ORDER,ORDER_TYPE,QUANTITY,YIELD_PERC,ROUTE_CODE,BOM_CODE,"
+" UNIT,MRP_RUN_ID,ACCT_CODE__WP,CCTR_CODE__WP,ADDN_ORDER,PLAN_DUE_DATE,TRAN_ID,SITE_CODE,"
+" ITEM_CODE,ORD_DATE,DUE_DATE,STATUS,STATUS_DATE,FEEDBACK_REQD,CHG_DATE,CHG_USER,CHG_TERM,QUANTITY__RCVD,"
+" CURRENT_BATCH_QTY,UNIT__STD,STD_QTY,CONV__QTY_STDUOM,QUANTITY__MPS,TRAN_ID__MPS) "
+" VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+" CURRENT_BATCH_QTY,UNIT__STD,STD_QTY,CONV__QTY_STDUOM,QUANTITY__MPS,TRAN_ID__MPS, LOT_SL, DEPT_CODE) "
+" VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'1S',?)";
String sqlUpdate = " UPDATE MPS_ORDER SET STATUS = 'C' WHERE TRAN_ID =?" ;
......@@ -534,6 +536,9 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
try
{
// 30/06/10 manoharan
deptCodeMfg = itmDBAccessEJB.getEnvDis("999999", "DEPT_CODE_MFG",conn);
// end 30/06/10 manoharan
//=========Code to seperate tokens and add to array list===============
pstmtSql1=conn.prepareStatement(sql1);
rsSql1=pstmtSql1.executeQuery();
......@@ -712,6 +717,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
pstmtInsert.setDouble(28,1);//foR con__qty_stduom
pstmtInsert.setDouble(29,quantity);//for quantity__mps
pstmtInsert.setString(30,tranId_db);//for tran_id__mps
pstmtInsert.setString(31,deptCodeMfg); // 30/06/10 manoharan
pstmtInsert.addBatch();
......@@ -734,12 +740,14 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
System.out.println("SQLException in WorkorderPrcEJB:"+sqlInsert+"<====>"+sqlUpdate);
se.printStackTrace();
errorString=se.getMessage();
throw new ITMException(se);
}
catch(Exception e)
{
System.out.println("SQLException in WorkorderPrcEJB:"+sqlInsert+"<====>"+sqlUpdate);
e.printStackTrace();
errorString=e.getMessage();
throw new ITMException(e);
}
return errorString;
}//END OF Method
......@@ -753,7 +761,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
}//end of blanknull()
private String generateTranId(String windowName,String xmlValues)
private String generateTranId(String windowName,String xmlValues) throws Exception,ITMException
{
Statement stmt = null;
ResultSet rs = null;
......@@ -799,12 +807,14 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
tranId=null;
throw new ITMException(ex);
}
catch(Exception e)
{
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
tranId=null;
throw new ITMException(e);
}
return tranId;
}//generateTranTd()
......
......@@ -11,8 +11,8 @@ import javax.ejb.Local; // added for ejb3
public interface WorkorderPrcLocal extends ibase.webitm.ejb.ProcessLocal//, EJBObject
{
public String process() throws RemoteException,ITMException;
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
//public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document dom, Document dom2, String windowNamem, String xtraParams) throws RemoteException,ITMException;
//public String getData(Document dom, Document dom2, String windowNamem, String xtraParams) throws RemoteException,ITMException;
}//END OF REMOTE INTERFACE
\ No newline at end of file
......@@ -11,8 +11,8 @@ import javax.ejb.Remote; // added for ejb3
public interface WorkorderPrcRemote extends ibase.webitm.ejb.ProcessRemote//, EJBObject
{
public String process() throws RemoteException,ITMException;
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
//public String process(Document dom, Document dom2, String windowName, String xtraParams) throws Exception,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document dom, Document dom2, String windowNamem, String xtraParams) throws RemoteException,ITMException;
//public String getData(Document dom, Document dom2, String windowNamem, String xtraParams) throws RemoteException,ITMException;
}//END OF REMOTE INTERFACE
\ No newline at end of file
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