Commit d00d47b6 authored by rbhogale's avatar rbhogale

Changed by Rohan on 28-06-13 for ADSI source as said by pragyan


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93274 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b188d7ad
......@@ -203,6 +203,24 @@ public class CheckSheetIC extends ValidatorEJB implements CheckSheetICLocal,Chec
errFields.add( childNodeName.toLowerCase() );
}*/
//Changed by sumit on 04/10/12 written this code above end.
//Changed by sumit on 04/06/13 adding validation in case of label not reprinted. start.
String printStatus = "";
sql = "SELECT WSO.PRINT_STATUS FROM SHIP_DOCS SD, WAVE_STATUS_ORG WSO WHERE SD.SHIPMENT_ID = ? AND SD.PTCN = WSO.PTCN";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, shipmentId );
rs = pstmt.executeQuery();
while( rs.next() )
{
printStatus = rs.getString("PRINT_STATUS");
if("N".equalsIgnoreCase(printStatus))
{
errList.add( "INVPRINTST" );
errFields.add( childNodeName.toLowerCase() );
}
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
//Changed by sumit on 04/06/13 adding validation in case of label not reprinted. end.
}
}
//Changed by sumit on 16/11/12 validating printer service name with existing printer in system start.
......
/*
authored by Pawan 10/7/2010 to confirm the transaction
*/
package ibase.webitm.ejb.wms;
......
......@@ -273,6 +273,7 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
" AND POH.PICK_ORDER = POD.PICK_ORDER " +
" AND CM.LINE_NO__PICK = POD.LINE_NO AND WTD.PTCN = CM.PTCN " +
" AND WTD.REF_ID = CM.PICK_ORDER " +
" AND POH.PICK_TYPE IN ('C','M') " +
" AND SORDER.SITE_CODE__SHIP = ? "+
" AND SORDER.SALE_ORDER >= ? AND SORDER.SALE_ORDER <= ? " +
......
/**
* PURPOSE : DefaultItemChanged for wave generation process
* AUTHOR : Changed By Sumit On 28/11/2012 WM1ESUN006
* Obj_name : w_wavegen
*/
package ibase.webitm.ejb.wms;
//changed by sumit on 03/10/12 imported class to find printer in system. start.
import java.awt.print.PrinterJob;
import java.io.File;
import javax.print.PrintService;
//changed by sumit on 03/10/12 imported class to find printer in system. end.
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.dis.SaleOrdItmGen;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
@javax.ejb.Stateless
public class GenerateLabelsIC extends ValidatorEJB implements GenerateLabelsICRemote, GenerateLabelsICLocal{
/**
* The method defined with no parameter and returns nothing
*/
public String itemChanged() throws RemoteException, ITMException
{
return "";
}
/**
* The public method is used for itemchange of required fields which return called overloaded method
* Returns itemchange string in XML format
* @param currXmlDataStr contains the current form data in XML format
* @param hdrXmlDataStr containspoic_wavegen_default_data always header form data in XML format
* @param allXmlDataStr contains all forms data in XML format
* @param objContext represents form no
* @param currentColumn represent Current COlumn
* @param editFlag the mode of the transaction(A-Add or E-Edit)
* @param xtraParams contains additional information such as loginEmpCode,loginCode,chgTerm
etc
*/
public String itemChanged(String currXmlDataStr, String hdrXmlDataStr, String allXmlDataStr, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
Document currDom = null;
Document hdrDom = null;
Document allDom = null;
String errString = null;
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
if (currXmlDataStr != null && currXmlDataStr.trim().length()!=0)
{
currDom = genericUtility.parseString(currXmlDataStr);
}
if (hdrXmlDataStr != null && hdrXmlDataStr.trim().length()!=0)
{
hdrDom = genericUtility.parseString(hdrXmlDataStr);
}
if (allXmlDataStr != null && allXmlDataStr.trim().length()!=0)
{
allDom = genericUtility.parseString(allXmlDataStr);
}
errString = defaultItemChanged( currDom, hdrDom, allDom, objContext, currentColumn, editFlag, xtraParams );
System.out.println ( "ErrString :" + errString);
}
catch (Exception e)
{
System.out.println ( "Exception :WaveGenerationIC :itemChanged(String,String):" + e.getMessage() + ":" );
errString = genericUtility.createErrorString(e);
}
System.out.println ( "returning from WaveGenerationIC itemChanged" );
return errString;
}// end ItemChanged Method
/**
* The public overloaded method is used for itemchange of required fields
* Returns itemchange string in XML format
* @param currDom contains the current form data
* @param hdrDom contains always header form data
* @param allDom contains all forms data
* @param objContext represents form no
* @param editFlag the mode of the transaction(A-Add or E-Edit)
* @param xtraParams contains additional information such as loginEmpCode,loginCode,chgTerm etc
*/
public String defaultItemChanged( Document currDom, Document hdrDom, Document allDom, String objContext, String currentColumn, String editFlag, String xtraParams ) throws RemoteException,ITMException
{
String siteCode = "";
String errString = "";
int currentFormNo = 0;
String columnValue = "";
String sql = "";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
StringBuffer valueXmlString = new StringBuffer( "<?xml version=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n" );
GenericUtility genericUtility = GenericUtility.getInstance();
java.sql.Date dateFrom = null;
String waveId ="";
try
{
String applDateFmt = genericUtility.getApplDateFormat();
String dbDateFmt = genericUtility.getDBDateFormat();
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
System.out.println("site code ->["+siteCode+"]");
System.out.println("Current Column> > > > ->["+currentColumn+"]");
if( objContext != null && objContext.trim().length() > 0 )
{
currentFormNo = Integer.parseInt( objContext );
}
valueXmlString.append("</Header>\r\n" );
switch ( currentFormNo )
{
case 1:
{
if ( currentColumn.trim().equalsIgnoreCase( "itm_default" ))
{
System.out.println("--------------item default --------------");
valueXmlString.append( "<Detail1>\r\n" );
valueXmlString.append( "</Detail1>\r\n" );
}
else if ( currentColumn.trim().equalsIgnoreCase( "wave_id" ))
{
columnValue = genericUtility.getColumnValue("wave_id",currDom);
System.out.println("wave_id ["+columnValue+"] ");
valueXmlString.append( "<Detail1>\r\n" );
if( (columnValue !=null && columnValue.trim().length() > 0) )
{
sql = " SELECT WAVE_ID FROM WAVE_TASK WHERE WAVE_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, waveId);
rs = pstmt.executeQuery();
/*if(rs.next())
{
valueXmlString.append( "<ptcn protect ='1' ><![CDATA[" ).append( "" ).append( "]]></ptcn>\r\n" );
}
else
{
valueXmlString.append( "<ptcn protect ='0' ><![CDATA[" ).append( "" ).append( "]]></ptcn>\r\n" );
}*/
}
/*else
{
valueXmlString.append( "<ptcn protect ='0' ><![CDATA[" ).append( "" ).append( "]]></ptcn>\r\n" );
}*/
rs.close(); rs = null;
pstmt.close(); pstmt = null;
valueXmlString.append( "</Detail1>\r\n" );
}
else if ( currentColumn.trim().equalsIgnoreCase( "ptcn" ))
{
columnValue = genericUtility.getColumnValue("ptcn",currDom);
System.out.println("ptcn ["+columnValue+"] ");
valueXmlString.append( "<Detail1>\r\n" );
if( (columnValue !=null && columnValue.trim().length() > 0) )
{
sql = " SELECT PTCN FROM WAVE_TASK_DET WHERE PTCN = ? ";
System.out.println("queryString="+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,columnValue);
rs =pstmt.executeQuery();
if(rs.next())
{
valueXmlString.append( "<wave_id protect ='1' ><![CDATA[" ).append( "" ).append( "]]></wave_id>\r\n" );
}
else
{
valueXmlString.append( "<wave_id protect ='0' ><![CDATA[" ).append( "" ).append( "]]></wave_id>\r\n" );
}
}
else
{
valueXmlString.append( "<wave_id protect ='0' ><![CDATA[" ).append( "" ).append( "]]></wave_id>\r\n" );
}
valueXmlString.append( "</Detail1>\r\n" );
}
}
break;
}
valueXmlString.append( "</Root>\r\n" );
}
catch(Exception e)
{
System.out.println("Exception: WaveGenerationIC: defaultItemChanged(Document dom): " + e.getMessage() + ":");
e.printStackTrace();
errString = genericUtility.createErrorString(e);
}
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception es)
{
es.printStackTrace();
errString = genericUtility.createErrorString(es);
}
}
//Changed by sumit on 13/05/13 closing connection end.
return valueXmlString.toString();
}
private String checkNull( String inputVal )
{
if ( inputVal == null )
{
inputVal = "";
}
return inputVal;
}
/**
* The method is defined without any parameter and returns blank string
*/
@Override
public String wfValData() throws RemoteException, ITMException
{
return "";
}
/**
* The public method is used for converting the current form data into a document(DOM)
* The dom is then given as argument to the overloaded function wfValData to perform validation
* Returns validation string if exists else returns null in XML format
* @param xmlString contains the current form data in XML format
* @param xmlString1 contains all the header information in the XML format
* @param xmlString2 contains the data of all the forms in XML format
* @param objContext represents the form number
* @param editFlag represents the mode of transaction(A-Add or E-Edit)
* @param xtraParams contains additional information such as loginEmpCode,loginCode,chgTerm etc
*/
@Override
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext,String editFlag, String xtraParams) throws RemoteException, ITMException
{
Document currFormDataDom = null;
Document hdrDataDom = null;
Document allFormDataDom = null;
String errString = null;
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
System.out.println( "xmlString ::" + xmlString);
System.out.println( "xmlString1 ::" + xmlString1);
System.out.println( "xmlString2 ::" + xmlString2);
if(xmlString != null && xmlString.trim().length()!=0)
{
currFormDataDom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length()!=0)
{
hdrDataDom = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
allFormDataDom = genericUtility.parseString(xmlString2);
}
errString = wfValData( currFormDataDom, hdrDataDom, allFormDataDom, objContext, xtraParams);
System.out.println( "ErrString: " + errString);
}
catch(Exception e)
{
errString = genericUtility.createErrorString(e);
e.printStackTrace();
throw new ITMException(e);
}
return (errString);
}
/**
* The public overloaded method takes a document as input and is used for the validation of required fields
* Returns validation string if exist otherwise returns null in XML format
* @param currFormDataDom contains the current form data as a document object model
* @param hdrDataDom contains all the header information
* @param allFormDataDom contains the field data of all the forms
* @param objContext represents form number
* @param editFlag represents the mode of transaction(A-Add or E-Edit)
* @param xtraParams contains additional information such as loginEmpCode,loginCode,chgTerm etc
*/
@Override
public String wfValData(Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String xtraParams) throws RemoteException, ITMException
{
System.out.println("GenerateLabelsIC.wfValData()");
String columnValue ="";
String errString = "";
String sql ="";
String waveId ="";
String ptcn = "";
String printer = "";
String printLabel = "";
String printStatus = "";
String tranCode = "";
String imagePath = "";
int count = 0, cnt = 0;
//int rowCount = 0;
int noOfChilds = 0;
int noOfParent = 0;
GenericUtility genericUtility = GenericUtility.getInstance();
Connection conn = null;
PreparedStatement pstmt = null,pstmt1 = null;
ResultSet rs = null, rs1 = null;
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
String errorType = "", errCode = "";
ArrayList errList = new ArrayList();
ArrayList errFields = new ArrayList();
Set errSet = null;
DistCommon discommon = new DistCommon();
try
{
int currentFormNo = 0;
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB( "DriverITM" );
connDriver = null;
String userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
if ( objContext != null && objContext.trim().length() > 0 )
{
currentFormNo = Integer.parseInt( objContext );
}
NodeList parentList = currFormDataDom.getElementsByTagName( "Detail" + currentFormNo );
NodeList childList = null;
noOfParent = parentList.getLength();
switch ( currentFormNo ) // Switch Case for form number
{
case 1:
{
childList = parentList.item(0).getChildNodes();
noOfChilds = childList.getLength();
for ( int ctr = 0; ctr < noOfChilds; ctr++ ) //Loop for each node of current detail
{
Node childNode = childList.item( ctr );
if( childNode.getNodeType() != Node.ELEMENT_NODE )
{
continue;
}
String childNodeName = childNode.getNodeName();
if ( childNode != null && childNode.getFirstChild() != null )
{
columnValue = childNode.getFirstChild().getNodeValue();
}
System.out.println(" columnName [" + childNodeName + "] columnValue [" + columnValue + "]");
if ( "wave_id".equalsIgnoreCase( childNodeName ) )
{
waveId = checkNull(genericUtility.getColumnValue( "wave_id", currFormDataDom ));
ptcn = checkNull(genericUtility.getColumnValue( "ptcn", currFormDataDom ));
System.out.println(" wave_id ["+waveId+"]");
if(waveId.trim().length() > 0 )
{
sql = " SELECT HOLD_STATUS,CANCEL FROM WAVE_TASK WHERE WAVE_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, waveId);
rs = pstmt.executeQuery();
if( rs.next())
{
if( "Y".equalsIgnoreCase(rs.getString("HOLD_STATUS")) || "Y".equalsIgnoreCase(rs.getString("CANCEL")))
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "WAVECAORHO" );
}
else if( ptcn.trim().length() > 0 )
{
sql = "SELECT DISTINCT WAVE_ID FROM WAVE_TASK_DET WHERE PTCN = ?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, ptcn);
rs1 = pstmt1.executeQuery();
if( rs1.next())
{
System.out.println(" wave_id ["+rs1.getString("WAVE_ID"));
if( !waveId.trim().equalsIgnoreCase(rs1.getString("WAVE_ID").trim()))
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "WAVEAPTNSM" );
}
}
rs1.close(); rs1 = null;
pstmt1.close(); pstmt1 = null;
}
if( "N".equalsIgnoreCase(rs.getString("HOLD_STATUS")) && "N".equalsIgnoreCase(rs.getString("CANCEL")))
{
sql = "SELECT REF_TYPE FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_TYPE IN (?,?)";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, waveId);
pstmt1.setString(2, "M");
pstmt1.setString(3, "P");
rs1 = pstmt1.executeQuery();
if( !rs1.next())
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "INVAWAVE11" );
}
rs1.close(); rs1 = null;
pstmt1.close(); pstmt1 = null;
/*sql = "SELECT COUNT(DISTINCT PTCN) FROM WAVE_TASK_DET WHERE WAVE_ID = ?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, waveId);*/
}
}
else
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "INVAWAVEID" );
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
}
else
{
ptcn = checkNull(genericUtility.getColumnValue( "ptcn", currFormDataDom ));
if( (ptcn ==null || ptcn.trim().length() == 0) && (waveId ==null || waveId.trim().length() == 0) )
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "NULLBOTHFD" );
/*errString = itmDBAccessEJB.getErrorString("","NULLBOTHFD","","",conn);
return errString;*/
}
}
}
else if ( "ptcn".equalsIgnoreCase( childNodeName ) )
{
ptcn = checkNull(genericUtility.getColumnValue( "ptcn", currFormDataDom ));
waveId = checkNull(genericUtility.getColumnValue( "wave_id", currFormDataDom ));
System.out.println(" ptcn ["+ptcn+"] waveId ["+waveId+"]");
if(ptcn.trim().length() > 0 )
{
sql = " SELECT CARTON_TYPE FROM CARTON_MASTER WHERE PTCN = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
boolean isRecordExist = false;
boolean isMasterOrParcelPresent = false;
while( rs.next())
{
isRecordExist = true;
if( "P".equalsIgnoreCase(rs.getString("CARTON_TYPE")) || "M".equalsIgnoreCase(rs.getString("CARTON_TYPE")))
{
isMasterOrParcelPresent = true;
continue;
}
}
if( !isRecordExist)
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "INVAPTCN09" );
}
else if( isRecordExist && !isMasterOrParcelPresent )
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "INVAPTCN10" );
}
rs.close();rs = null;
pstmt.close();pstmt = null;
imagePath = discommon.getDisparams("999999","SHIP_WITH_PATH",conn);
System.out.println("imagePath -->"+imagePath);
File file = new File(imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+"Ship"+".ser" );
if(!file.exists())
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "FILENFOUND" );
}
sql = "SELECT DISTINCT PRINT_STATUS FROM WAVE_STATUS_ORG WHERE PTCN = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
if(rs.next())
{
printStatus = rs.getString("PRINT_STATUS");
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
tranCode = isTranCodeChanged(ptcn, conn);
System.out.println("printStatus ["+printStatus+"] tranCode ["+tranCode+"]");
if( "Y".equalsIgnoreCase(printStatus) && "NO".equalsIgnoreCase(tranCode))
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "ALLREPRINT" );
}
if(isRecordExist)
{
sql = " SELECT D.CONFIRMED FROM DESPATCH D, WAVE_TASK_DET WTD WHERE WTD.PTCN = ? AND WTD.WAVE_ID = D.WAVE_ID " +
" AND WTD.SALE_ORDER = D.SORD_NO AND WTD.REF_ID = D.DESP_ID ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
//pstmt.setString(2, "N");
rs = pstmt.executeQuery();
if(rs.next())
{
if( "Y".equalsIgnoreCase(rs.getString("CONFIRMED")))
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "DESPCONFIR" );
}
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
}
}
else
{
if( (ptcn ==null || ptcn.trim().length() == 0) && (waveId ==null || waveId.trim().length() == 0) )
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "NULLBOTHFD" );
/*errString = itmDBAccessEJB.getErrorString("","NULLBOTHFD","","",conn);
return errString;*/
}
}
}
else if ( "printer_name".equalsIgnoreCase( childNodeName ) )
{
printer = checkNull(genericUtility.getColumnValue( "printer_name", currFormDataDom ));
printLabel = checkNull(genericUtility.getColumnValue( "print_label", currFormDataDom ));
System.out.println(" printer from input parameter ["+printer+"] and print label ->["+printLabel+"]");
PrintService[] printServices = PrinterJob.lookupPrintServices();
ArrayList<String> arry = new ArrayList<String>();
if(printer.trim().length() == 0 )
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "NLLPRINTER" );
}
else
{
System.out.println(" in inside if");
for (PrintService printService : printServices)
{
String name = printService.getName();
System.out.println("printer service name --> "+name);
arry.add(name);
}
if( !arry.contains(printer.trim()))
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "INVPRINTER" );
}
arry.clear();
}
}
}
} //End of case 1 Validation
break;
}//End of switch statement
errSet = new HashSet(errList);
errList = new ArrayList(errSet);
int errListSize = errList.size();
cnt =0;
String errFldName = null;
if ( errList != null && errListSize > 0 )
{
for (cnt = 0; cnt < errListSize; cnt++ )
{
errCode = (String)errList.get(cnt);
errFldName = (String)errFields.get(cnt);
System.out.println("errCode .........."+errCode);
errString = getErrorString( errFldName, errCode, userId );
errorType = errorType( conn , errCode );
if ( errString.length() > 0)
{
String bifurErrString = errString.substring( errString.indexOf("<Errors>") + 8,errString.indexOf("<trace>"));
bifurErrString =bifurErrString;//+"<trace>"+errMsg+"</trace>";
bifurErrString =bifurErrString+errString.substring( errString.indexOf("</trace>") + 8,errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString);
System.out.println("errStringXml .........."+errStringXml);
errString = "";
}
if ( errorType.equalsIgnoreCase("E"))
{
break;
}
}
errList.clear();
errList = null;
errFields.clear();
errFields = null;
errStringXml.append("</Errors></Root>\r\n");
}
else
{
errStringXml = new StringBuffer( "" );
}
errString = errStringXml.toString();
}
catch ( Exception e )
{
System.out.println ( "Exception: WaveGenerationIC: wfValData( Document currFormDataDom ): " + e.getMessage() + ":" );
//throw new ITMException(e);
e.printStackTrace();
}
finally
{
try
{
if (rs!=null)
{
rs.close();
rs = null;
}
if( conn != null )
{
conn.close(); conn = null;
}
}
catch(Exception e)
{
System.out.println( "Exception : WaveGenerationIC:wfValData : " + e.getMessage() );
throw new ITMException(e);
}
}
System.out.println( "errString>>>>>>>::"+errString );
return errString;
}
private String errorType( Connection conn , String errorCode )
{
String msgType = "";
PreparedStatement pstmt = null ;
ResultSet rs = null;
try
{
String sql = " SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1, errorCode);
rs = pstmt.executeQuery();
while( rs.next() )
{
msgType = rs.getString("MSG_TYPE");
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
finally
{
try
{
if ( rs != null )
{
rs.close();
rs = null;
}
if ( pstmt != null )
{
pstmt.close();
pstmt = null;
}
}
catch ( Exception e )
{
e.printStackTrace();
}
}
return msgType;
}
private HashMap getItemVoumeMap(String itemCode,String lotNo,Connection con)throws Exception
{
double packSize = 0,itemSize = 0,lotSize = 0;
PreparedStatement pstmt = null;
String sql="";
ResultSet rs = null;
double itmLen = 0,itmWidth = 0,itmHeight = 0,itemWeight = 0,lotLen = 0 ,lotHeight = 0,lotWidth = 0,lotWeight = 0;
HashMap dataVolumeMap = new HashMap();
try {
sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_WEIGHT,"
+" L.LENGTH LITEM_LEN,L.WIDTH LITEM_WID,L.HEIGHT LITEM_HEIGHT,L.SHIPPER_SIZE SHIPSIZE,L.GROSS_WEIGHT LOT_WEIGHT FROM"
+" ITEM I,ITEM_LOT_PACKSIZE L"
+" WHERE I.ITEM_CODE = L.ITEM_CODE"
+" AND L.LOT_NO__FROM <= ? AND L.LOT_NO__TO >= ?"
+" AND I.ITEM_CODE = ?";
pstmt = con.prepareStatement(sql);
if(lotNo != null && lotNo.length() > 0)
{
pstmt.setString(1, lotNo);
pstmt.setString(2, lotNo);
}
else
{
pstmt.setString(1, "00");
pstmt.setString(2, "ZZ");
}
pstmt.setString(3, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itmLen = rs.getDouble("ITEM_LEN");
itmWidth = rs.getDouble("ITEM_WID");
itmHeight = rs.getDouble("ITEM_HEIGHT");
itemWeight = rs.getDouble("ITEM_WEIGHT");
lotLen = rs.getDouble("LITEM_LEN");
lotWidth = rs.getDouble("LITEM_WID");
lotHeight = rs.getDouble("LITEM_HEIGHT");
packSize = rs.getDouble("SHIPSIZE");
lotWeight = rs.getDouble("LOT_WEIGHT");
}
//packSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight);
/*itemSize = Math.floor(itmLen * itmWidth * itmHeight);
lotSize = Math.floor((lotHeight * lotWidth * lotLen));*/
itemSize = itmLen * itmWidth * itmHeight;
lotSize = lotHeight * lotWidth * lotLen;
dataVolumeMap.put("PACK_SIZE", packSize);
dataVolumeMap.put("ITEM_SIZE", itemSize);
dataVolumeMap.put("LOT_SIZE", lotSize);
dataVolumeMap.put("ITEM_WEIGHT", itemWeight);
dataVolumeMap.put("PACK_WEIGHT", lotWeight);
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
} catch (Exception e) {
// TODO: handle exception
throw e;
}
finally
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
return dataVolumeMap;
}
public String isTranCodeChanged(String ptcn, Connection conn) throws ITMException
{
String sql = "";
String shipTranCode = "",cartonMasterTranCode = "";
String errString = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
sql = "SELECT TRAN_CODE FROM WAVE_STATUS_ORG WHERE PTCN = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
if(rs.next())
{
cartonMasterTranCode = rs.getString("TRAN_CODE");
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
sql = "SELECT S.TRAN_CODE FROM SHIPMENT S , SHIP_DOCS SD WHERE SD.PTCN = ? AND S.SHIPMENT_ID = SD.SHIPMENT_ID ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
if(rs.next())
{
shipTranCode = rs.getString("TRAN_CODE");
}
else
{
return "NO";
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
if( cartonMasterTranCode.equalsIgnoreCase(shipTranCode))
{
return "NO";
}
else
{
return cartonMasterTranCode;
}
}
catch(Exception e)
{
errString = e.getMessage();
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null )
{
rs.close(); rs = null;
}
if(pstmt != null )
{
pstmt.close(); pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
///return cartonMasterTranCode;
}
}
/*
Author: Sumit Sarkar 07/03/12 of Req: WM1ESUN006
Reason: Interface Local for EJB Component WaveGenerationIC
*/
package ibase.webitm.ejb.wms;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Local
public interface GenerateLabelsICLocal extends ibase.webitm.ejb.ValidatorLocal
{
public String itemChanged() throws RemoteException, ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
//Changed by sumit on 18/09/12 adding validation start.
public String wfValData() throws RemoteException, ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext,String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String xtraParams) throws RemoteException, ITMException;
//Changed by sumit on 18/09/12 adding validation end.
}
/**
* Author: Sumit Sarkar 07/03/12 of Req: WM1ESUN006
* Reason: Interface Local for EJB Component WaveGenerationIC
*/
package ibase.webitm.ejb.wms;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Remote
public interface GenerateLabelsICRemote extends ibase.webitm.ejb.ValidatorRemote
{
public String itemChanged() throws RemoteException, ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
//Changed by sumit on 18/09/12 adding validation start.
public String wfValData() throws RemoteException, ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext,String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String xtraParams) throws RemoteException, ITMException;
//Changed by sumit on 18/09/12 adding validation end.
}
\ No newline at end of file
/*
Window Name : w_gen_label
Author: Sumit Sarkar
Purpose: To generate new label if require.
*/
package ibase.webitm.ejb.wms;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.awt.image.BufferedImage;
import java.awt.print.PrinterJob;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.URL;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.TreeMap;
import javax.imageio.ImageIO;
import javax.print.PrintService;
import org.omg.CORBA.Object;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.adsionline.ADSIShippingWS.*;
import org.w3c.dom.Element;
import org.apache.axis.Constants;
import org.apache.axis.description.ParameterDesc;
import org.xml.sax.helpers.DefaultHandler;
import sun.misc.BASE64Decoder;
@javax.ejb.Stateless
public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLocal, GenerateLabelsPrcRemote //SessionBean
{
GenericUtility genericUtility = GenericUtility.getInstance();
CommonConstants commonConstants = new CommonConstants();
DistCommon discommon = new DistCommon();
String chgUser = null;
public String process() throws RemoteException,ITMException
{
return "";
}
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException
{
String retStr = "";
Document detailDom = null;
Document headerDom = null;
GenericUtility genericUtility = GenericUtility.getInstance();
System.out.println("below genericUtility--------------->>>>>>>>>");
try
{
if(xmlString != null && xmlString.trim().length()!=0)
{
headerDom = genericUtility.parseString(xmlString);
System.out.println("headerDom" + headerDom);
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
detailDom = genericUtility.parseString(xmlString2);
System.out.println("detailDom" + detailDom);
}
retStr = process(headerDom, detailDom, windowName, xtraParams);
}
catch (Exception e)
{
System.out.println("Exception :GenerateLabels :process(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace();
retStr = e.getMessage();
throw new ITMException(e);
}
return retStr;
}
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{
System.out.println("detailDom------------------->"+detailDom);
String childNodeName = "";
String errCode = "";
String errString = "";
String ptcn = "",waveId = "";
String sql = "",upddCartonsql = "" ,sqlChgStatus = "",sqlPrintStatus = "",
sqlMaster = "",sqlCrtnChg = "",sqlGetTrack = "";
String printStatus = "";
String confirmed = "";
String adsiShippingURL = "",imagePath = "";
String masterCarton = "",itemCode = "",trackingNo = "",parcelCartonNo = "",cartonStatus = "";
String tempItemCode = "";
String value = "",outerCartonNo = "",trackNo = "",pckgId = "";
long msnNo = 0;
String packTranId = "",serviceCode = "",saleOrder = "";
String printer = "";
long oldMsnNo = 0;
String oldCarrierSymbol = "",carrierSymbol ="";
String oldCarrierFriendlyName = "",carrierFriendlyName = "";
String response = "",refType = "";
Connection conn = null;
int parentNodeListLength = 0;
int childNodeListLength = 0;
int count = 0,noArt = 0;
int package2ArrSize = 0;
double packSize = 0.0;
double weight = 0.0;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
PreparedStatement pstmt = null,pstmt1 = null,ptcnPSTMT = null,
pstmtUpdCarton = null,pstmtChg = null, pstmtPrintStatus = null,
pstmtMaster = null,pstmtCrtnChg = null,pstmtGetTrack = null;
ResultSet rs = null,rs1 = null,ptcnRS = null ,rsPrintStatus = null,
rsMaster = null,rsGetTrack = null;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
ADSIShippingLocator locator = null;
ADSIShippingSoap soap = null;
List arryOuterCartonNo = new ArrayList();
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
ptcn = checkNull(genericUtility.getColumnValue("ptcn",headerDom));
waveId = checkNull(genericUtility.getColumnValue("wave_id",headerDom));
printer = checkNull(genericUtility.getColumnValue("printer_name",headerDom));
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println(" ptcn ["+ptcn+"] chgUser["+chgUser+"]");
upddCartonsql = "UPDATE CARTON_MASTER SET TRACKING_NO = ?,MSN_NO = ? ,CARRIER_SYMBOL = ?,CARRIER_FRIENDLYNAME = ? WHERE CARTON_NO = ?";
pstmtUpdCarton = conn.prepareStatement(upddCartonsql);
sqlChgStatus = "UPDATE WAVE_STATUS_ORG SET PRINT_STATUS = ? WHERE PTCN = ?";
pstmtChg = conn.prepareStatement(sqlChgStatus);
sqlPrintStatus = "SELECT DISTINCT PRINT_STATUS FROM WAVE_STATUS_ORG WHERE PTCN = ?";
pstmtPrintStatus = conn.prepareStatement(sqlPrintStatus);
sqlMaster = "SELECT MASTER_CARTON,TRACKING_NO,CARTON_NO,STATUS FROM CARTON_MASTER WHERE PTCN = ? AND CARTON_TYPE <> ? ORDER BY CARTON_NO,MASTER_CARTON";
pstmtMaster = conn.prepareStatement(sqlMaster);
sqlCrtnChg = "UPDATE CARTON_MASTER SET CHANGE_STATUS = ? WHERE PTCN = ?";
pstmtCrtnChg = conn.prepareStatement(sqlCrtnChg);
sqlGetTrack = " SELECT TRACKING_NO,MSN_NO,CARRIER_SYMBOL , CARRIER_FRIENDLYNAME FROM CARTON_MASTER WHERE CARTON_NO = ?";
pstmtGetTrack = conn.prepareStatement(sqlGetTrack);
long timeBefore = System.currentTimeMillis();
adsiShippingURL = discommon.getDisparams("999999","WMS_ADSI_SOAP_URL",conn);
imagePath = discommon.getDisparams("999999","SHIP_WITH_PATH",conn);
System.out.println("adsiShippingURL -->"+adsiShippingURL);
System.out.println("imagePath -->"+imagePath);
locator = new ADSIShippingLocator();
System.out.println(" Connecting ADSI server ................");
soap = locator.getADSIShippingSoap(new URL(adsiShippingURL));
long timeAfter = System.currentTimeMillis();
System.out.println(" is server active ["+soap.testADSIServer()+"]");
if(!soap.testADSIServer())
{
errString = itmDBAccessEJB.getErrorString("","ADSISRVERR","","",conn);
return errString;
}
if( ptcn.trim().length() > 0 && waveId.trim().length() == 0)
{
sql = "SELECT WAVE_ID FROM WAVE_TASK_DET WHERE PTCN = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
if( rs.next())
{
waveId = rs.getString("WAVE_ID");
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
}
if( waveId.trim().length() > 0 && ptcn.trim().length() == 0)
{
sql = " SELECT DISTINCT PTCN,SALE_ORDER,REF_TYPE FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_TYPE IN (?,?)";
ptcnPSTMT = conn.prepareStatement(sql);
ptcnPSTMT.setString(1, waveId);
ptcnPSTMT.setString(2, "M");
ptcnPSTMT.setString(3, "P");
ptcnRS = ptcnPSTMT.executeQuery();
}
else if( waveId.trim().length() > 0 && ptcn.trim().length() > 0)
{
sql = " SELECT DISTINCT PTCN,SALE_ORDER,REF_TYPE FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND PTCN = ? AND REF_TYPE IN (?,?) ";
ptcnPSTMT = conn.prepareStatement(sql);
ptcnPSTMT.setString(1, waveId);
ptcnPSTMT.setString(2, ptcn);
ptcnPSTMT.setString(3, "M");
ptcnPSTMT.setString(4, "P");
ptcnRS = ptcnPSTMT.executeQuery();
}
while(ptcnRS.next())
{
saleOrder = ptcnRS.getString("SALE_ORDER");
ptcn = ptcnRS.getString("PTCN");
refType = ptcnRS.getString("REF_TYPE");
//This check is not required for testing.start
/*sql = " SELECT D.CONFIRMED FROM DESPATCH D, WAVE_TASK_DET WTD WHERE WTD.PTCN = ? AND WTD.WAVE_ID = D.WAVE_ID " +
" AND WTD.SALE_ORDER = D.SORD_NO AND WTD.REF_ID = D.DESP_ID AND D.CONFIRMED = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
pstmt.setString(2, "N");
rs = pstmt.executeQuery();
if(!rs.next())
{
errString = itmDBAccessEJB.getErrorString("","DESPCONFIR","","",conn);
return errString;
continue;
}
rs.close(); rs = null;
pstmt.close(); pstmt = null; */
//This check is not required for testing.end
pstmtPrintStatus.setString(1, ptcn);
rsPrintStatus = pstmtPrintStatus.executeQuery();
if(rsPrintStatus.next())
{
printStatus = rsPrintStatus.getString("PRINT_STATUS");
}
serviceCode = isTranCodeChanged(ptcn, conn);
//serviceCode = "UPSGND";
System.out.println("printStatus ["+printStatus+"] serviceCode ["+serviceCode+"]");
if( "Y".equalsIgnoreCase(printStatus) && "NO".equalsIgnoreCase(serviceCode))
{
/*errString = itmDBAccessEJB.getErrorString("","ALLREPRINT","","",conn);
return errString;*/
continue;
}
File file = new File(imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+"Ship"+".ser" );
if(!file.exists())
{
errString = itmDBAccessEJB.getErrorString("","FILENFOUND","");
return errString;
}
FileInputStream fis = new FileInputStream(imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+"Ship"+".ser" );
ObjectInputStream ois = new ObjectInputStream(fis);
System.out.println(" file loaded ");
Shipment2 shipment2 = (Shipment2) ois.readObject();
System.out.println("objReturn2 ["+shipment2.getPackages2().length+"]" );
package2ArrSize = shipment2.getPackages2().length;
System.out.println("package2ArrSize ["+package2ArrSize+"]");
Package2[] packages2 = new Package2[package2ArrSize];
packages2 = shipment2.getPackages2();
com.adsionline.ADSIShippingWS.Service service = new com.adsionline.ADSIShippingWS.Service();
service = shipment2.getService();
if( !"NO".equalsIgnoreCase(serviceCode))
{
System.out.println(" old service code ["+service.getFriendlyName());
System.out.println(" new service code ["+serviceCode+"]");
service.setFriendlyName(serviceCode);
}
if( "N".equalsIgnoreCase(printStatus) || !"NO".equalsIgnoreCase(serviceCode) )
{
pstmtMaster.setString(1, ptcn);
pstmtMaster.setString(2, "C");
rsMaster = pstmtMaster.executeQuery();
while(rsMaster.next())
{
masterCarton = rsMaster.getString("MASTER_CARTON");
System.out.println("masterCarton ["+masterCarton+"]");
parcelCartonNo = rsMaster.getString("CARTON_NO");
cartonStatus = rsMaster.getString("STATUS");
System.out.println("parcelCartonNo ["+parcelCartonNo+"]");
if("M".equalsIgnoreCase(refType))
{
boolean isExist = false;
tempItemCode = "";
int itemCount = 0;
LinkedList liklist = new LinkedList();
if( !"NO".equalsIgnoreCase(serviceCode) )
{
sql = " SELECT CM.ITEM_CODE,WOD.WEIGHT FROM CARTON_MASTER CM, WAVE_STATUS_ORG_DET WOD WHERE CM.PTCN = WOD.PTCN " +
" AND CM.CARTON_NO = WOD.CARTON_NO AND CM.MASTER_CARTON = ? AND CM.CARTON_TYPE = ? AND CM.STATUS <> ? " +
" ORDER BY CM.ITEM_CODE";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, masterCarton);
pstmt1.setString(2, "C");
pstmt1.setString(3, "R");
}
else
{
sql = " SELECT CM.ITEM_CODE,WOD.WEIGHT FROM CARTON_MASTER CM, WAVE_STATUS_ORG_DET WOD WHERE CM.PTCN = WOD.PTCN " +
" AND CM.CARTON_NO = WOD.CARTON_NO AND CM.MASTER_CARTON = ? AND CM.CARTON_TYPE = ? AND CM.STATUS <> ? " +
" AND CM.CHANGE_STATUS = ? ORDER BY CM.ITEM_CODE";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, masterCarton);
pstmt1.setString(2, "C");
pstmt1.setString(3, "R");
pstmt1.setString(4, "Y");
}
rs1 = pstmt1.executeQuery();
while( rs1.next())
{
isExist = true;
packSize = rs1.getDouble("WEIGHT");
itemCode = rs1.getString("ITEM_CODE");
if( !tempItemCode.equalsIgnoreCase(itemCode))
{
tempItemCode = itemCode;
liklist.add(tempItemCode);
}
weight = weight + packSize;
}
rs1.close(); rs1 = null;
pstmt1.close(); pstmt1 = null;
if(!isExist)
{
packages2[count] = null;
count++;
continue;
}
else
{
arryOuterCartonNo.add(masterCarton);
CommodityInfo[] comInfo = new CommodityInfo[liklist.size()];
comInfo = setCommodityInfos(liklist, masterCarton, saleOrder, soap, conn);
System.out.println("old weight ["+packages2[count].getWeight()+"]");
System.out.println("new weight ["+weight+"]");
packages2[count].setWeight(weight);
System.out.println("old comodity info length ["+packages2[count].getCommodityInfos().length+"]");
System.out.println("new comodity info length ["+comInfo.length+"]");
packages2[count].setCommodityInfos(comInfo);
count++;
}
weight = 0;
System.out.println(" arryOuterCartonNo.size ["+arryOuterCartonNo.size()+"]");
}
else
{
sql = " SELECT CM.ITEM_CODE,WOD.WEIGHT,CM.MSN_NO,CM.CARRIER_SYMBOL , CM.CARRIER_FRIENDLYNAME FROM CARTON_MASTER CM, " +
" WAVE_STATUS_ORG_DET WOD WHERE CM.PTCN = WOD.PTCN " +
" AND CM.CARTON_NO = WOD.CARTON_NO AND CM.CARTON_NO = ? AND CM.CARTON_TYPE = ? AND CM.STATUS = ? " +
" ORDER BY CM.ITEM_CODE";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, parcelCartonNo);
pstmt1.setString(2, "P");
pstmt1.setString(3, "R");
rs1 = pstmt1.executeQuery();
if( rs1.next())
{
packages2[count] = null;
packSize = rs1.getDouble("WEIGHT");
itemCode = rs1.getString("ITEM_CODE");
oldMsnNo = rs1.getLong("MSN_NO");
oldCarrierSymbol = rs1.getString("CARRIER_SYMBOL");
oldCarrierFriendlyName = rs1.getString("CARRIER_FRIENDLYNAME");
StringReturn testReturn = soap.voidPackage(oldCarrierSymbol,oldMsnNo);
response = testReturn.getResponse();
System.out.println("response Parcel void----["+response+"]");
}
else
{
arryOuterCartonNo.add(parcelCartonNo);
}
oldMsnNo = 0;oldCarrierSymbol = "";
oldCarrierFriendlyName = "";
rs1.close(); rs1 = null;
pstmt1.close(); pstmt1 = null;
count++;
}
}
pstmtMaster.clearParameters();
if( rsMaster != null)
{
rsMaster.close();
rsMaster = null;
}
}
if( arryOuterCartonNo.size() == 0)
{
errString = itmDBAccessEJB.getErrorString("","NOTHING2PR","");
return errString;
}
Collections.sort(arryOuterCartonNo);
shipment2.setPackages2(packages2);
ShipmentResultReturn2 objReturn2=soap.shipWithLabel(shipment2, ShipWithLabelType.PNG, ImageRotation.Rotation_180);
System.out.println("Is successfully Executed ["+objReturn2.isSuccess()+"]");
System.out.println("Return Messages ["+objReturn2.getMessage()+"]");
if(!objReturn2.isSuccess())
{
//errString = itmDBAccessEJB.getErrorString(objReturn2.getMessage(),"SOAPURLUAL","");
errString = getError(objReturn2.getMessage(),"SOAPURLUAL", conn);
return errString;
}
else
{
//Updating ADSI getting the images.start
ShipmentResult2 objShipResult = objReturn2.getShipmentResultResponse2();
int lenPacakges = objShipResult.getPackageResults2().length;
carrierSymbol= objShipResult.getServiceSymbol();
System.out.println("serviceSymbol["+carrierSymbol+"]");
carrierSymbol = carrierSymbol.substring(0,carrierSymbol.lastIndexOf(".") );
System.out.println("Carrier Symbol ["+carrierSymbol+"]");
Carrier[] carr = soap.getCarriers().getCarrierList();
for(int j = 0;j<carr.length;j++)
{
Carrier carr1 = carr[j];
System.out.println("Carrier Symbol["+carr1.getSymbol());
System.out.println("Friendly Name["+carr1.getFriendlyName());
System.out.println("Short Name["+carr1.getShortName());
if(carr1.getSymbol().equalsIgnoreCase(carrierSymbol))
{
carrierFriendlyName = carr1.getFriendlyName();
break;
}
}
for(int pCtr=0;pCtr < lenPacakges;pCtr++)
{
PackageResult2 pkg2frm = (PackageResult2)objShipResult.getPackageResults2()[pCtr];
value = pkg2frm.getBase64Label();
pckgId = pkg2frm.getPackageID();
//change by rekha on 23-05-13.start
pkg2frm.getAdditionalFields();
trackNo = pkg2frm.getTrackingNumber();
msnNo = pkg2frm.getMSN();
for(int Cadd=0;Cadd<pkg2frm.getAdditionalFields().length;Cadd++)
{
System.out.println("additional fields are Name:"+pkg2frm.getAdditionalFields()[Cadd].getName());
System.out.println("additional fields are Value:"+pkg2frm.getAdditionalFields()[Cadd].getValue());
}
//change by rekha on 23-05-13. end
String cnumber = arryOuterCartonNo.get(pCtr).toString();
System.out.println("cnumber is :"+cnumber);
System.out.println("Package ID["+pckgId+"]");
System.out.println("New Tracking No --------------["+pkg2frm.getTrackingNumber()+"]");
System.out.println("NeW MSN No -------------------["+msnNo+"]");
System.out.println("BASE64lABEL Length["+value.length()+"]");
BASE64Decoder decoder = new BASE64Decoder();
System.out.println("Package id for carton no is :[" +decoder.decodeBuffer(pckgId) +"]");
byte[] imgBytes = decoder.decodeBuffer(value);
System.out.println("IMAGE Byte Length ["+imgBytes.length+"]");
BufferedImage bufImg = ImageIO.read(new ByteArrayInputStream(imgBytes));
File imgOutFile = new File(imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+cnumber +".png");
File file1 = new File(imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+cnumber +".png");
//Renaming existing file
if(!file1.exists())
{
//errString = itmDBAccessEJB.getErrorString("","FILENFOUND","");
//return errString;
}
else
{
File oldFile = new File(imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+cnumber +"_old.png");
if(!oldFile.exists())
{
file1.renameTo(oldFile);
}
}
String path = imgOutFile.getPath();
System.out.println("Get Path ["+path+"]");
path = path.substring(0,path.lastIndexOf(File.separator));
System.out.println("after Path ["+path+"]");
File createFolder = new File(path);
if(!createFolder.exists())
{
createFolder.mkdirs();
}
pstmtGetTrack.setString(1, cnumber);
rsGetTrack = pstmtGetTrack.executeQuery();
if( rsGetTrack.next() )
{
oldMsnNo = rsGetTrack.getLong("MSN_NO");
oldCarrierSymbol = rsGetTrack.getString("CARRIER_SYMBOL");
oldCarrierFriendlyName = rsGetTrack.getString("CARRIER_FRIENDLYNAME");
if(oldMsnNo != 0 && oldMsnNo != msnNo)
{
StringReturn testReturn = soap.voidPackage(oldCarrierSymbol,oldMsnNo);
response = testReturn.getResponse();
System.out.println("response delete not old msn as new msn["+response+"]");
if(!response.contains("No Error"))
{
//errString = itmDBAccessEJB.getErrorString(response,"NTVOIDPKGS","");
//errString = getError(response, "NTVOIDPKGS", conn);
//return errString;
}
}
}
pstmtGetTrack.clearParameters();
//UPDATE CARTON MASTER TRACKING NO , IMAGENAME PATH,
//sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? WHERE CARTON_NO = ?";
pstmtUpdCarton.setString(1, trackNo);
pstmtUpdCarton.setLong(2, msnNo);
pstmtUpdCarton.setString(3, carrierSymbol);
pstmtUpdCarton.setString(4, carrierFriendlyName);
pstmtUpdCarton.setString(5, cnumber);
int test = pstmtUpdCarton.executeUpdate();
System.out.println("update statement is :"+test);
if(test==1)
{
System.out.println("updated");
}
else
{
System.out.println("not updated");
}
//cartonNoarr.get(masterCartonNo);
imgOutFile.createNewFile();
ImageIO.write(bufImg, "png", imgOutFile);
System.out.println("Write File Complete----");
}
pstmtChg.setString(1, "Y");
pstmtChg.setString(2, ptcn);
int test = pstmtChg.executeUpdate();
if( test > 0)
{
System.out.println(" WAVE_STATUS_ORG table updated ");
}
else
{
throw new Exception("WAVE_STATUS_ORG table table updated");
}
pstmtCrtnChg.setString(1, "N");
pstmtCrtnChg.setString(2, ptcn);
test = pstmtCrtnChg.executeUpdate();
if( test > 0)
{
System.out.println("Carton Master table updated ");
}
else
{
throw new Exception("Carton Master updated");
}
}
/*}
else
{
}*/
}
if(ptcnRS != null)
{
ptcnRS.close();
ptcnRS = null;
}
if(ptcnPSTMT != null)
{
ptcnPSTMT.close();
ptcnPSTMT = null;
}
if(pstmtUpdCarton != null)
{
pstmtUpdCarton.close();
pstmtUpdCarton = null;
}
if(pstmtChg != null)
{
pstmtChg.close();
pstmtChg = null;
}
if(rsPrintStatus != null)
{
rsPrintStatus.close();
rsPrintStatus = null;
}
if(pstmtPrintStatus != null)
{
pstmtPrintStatus.close();
pstmtPrintStatus = null;
}
if( rsMaster != null)
{
rsMaster.close();
rsMaster = null;
}
if(pstmtCrtnChg != null)
{
pstmtCrtnChg.close();
pstmtCrtnChg = null;
}
if(pstmtMaster != null)
{
pstmtMaster.close();
pstmtMaster = null;
}
if(pstmtGetTrack != null)
{
pstmtGetTrack.close();
pstmtGetTrack = null;
}
if(rsGetTrack != null)
{
rsGetTrack.close();
rsGetTrack = null;
}
// errString = generatedLabelPrint(waveId, printer, conn);
}//try end
catch(Exception e)
{
try
{
conn.rollback();
}
catch(Exception es)
{
es.printStackTrace();
errString = es.getMessage();
throw new ITMException(es);
}
e.printStackTrace();
System.out.println("Exception :GenerateLabels :process(String xmlString2, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
errString = e.getMessage();
throw new ITMException(e);
}
finally
{
//System.out.println("Closing Connection....");
try
{
if(rs1 != null)
{
rs1.close(); rs1 = null;
}
if(pstmt1 != null)
{
pstmt1.close(); pstmt1 = null;
}
if( rs != null)
{
rs.close(); rs = null;
}
if( pstmt != null)
{
pstmt.close(); pstmt = null;
}
if(ptcnRS != null)
{
ptcnRS.close();
ptcnRS = null;
}
if(ptcnPSTMT != null)
{
ptcnPSTMT.close();
ptcnPSTMT = null;
}
if(pstmtUpdCarton != null)
{
pstmtUpdCarton.close();
pstmtUpdCarton = null;
}
if(pstmtChg != null)
{
pstmtChg.close();
pstmtChg = null;
}
if(rsPrintStatus != null)
{
rsPrintStatus.close();
rsPrintStatus = null;
}
if(pstmtPrintStatus != null)
{
pstmtPrintStatus.close();
pstmtPrintStatus = null;
}
if( rsMaster != null)
{
rsMaster.close();
rsMaster = null;
}
if(pstmtCrtnChg != null)
{
pstmtCrtnChg.close();
pstmtCrtnChg = null;
}
if(pstmtMaster != null)
{
pstmtMaster.close();
pstmtMaster = null;
}
if (errString != null && errString.trim().length() > 0)
{
conn.rollback();
System.out.println("errString ::::::::::::::::::::"+errString);
return errString;
}
else
{
conn.commit();
}
if( conn != null )
{
conn.close(); conn = null;
}
}
catch(Exception e)
{
errString = e.getMessage();
e.printStackTrace();
throw new ITMException(e);
}
finally
{
if( errString.trim().length() == 0 )
{
errString="VTCOMPL";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
}
//return errString;
}
}
return errString;
}
private String getError(String saleOrder,String Code,Connection conn) throws ITMException, Exception
{
String mainStr ="";
try
{
String errString = "";
errString = new ITMDBAccessEJB().getErrorString("",Code,"","",conn);
String begPart = errString.substring(0,errString.indexOf("<message>")+9);
String endDesc = errString.substring(errString.indexOf("</description>"));
mainStr= begPart+"Invalid Data"+"</message><description>";
mainStr= mainStr+"Sale Order ="+saleOrder+""+endDesc;
System.out.println("mainStr:::::::::::::::::: "+mainStr);
begPart = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return mainStr;
}
private String checkNull( String input )
{
if( input == null )
{
input = "";
}
return input;
}
public String isTranCodeChanged(String ptcn, Connection conn) throws ITMException
{
String sql = "";
String shipTranCode = "",cartonMasterTranCode = "";
String errString = "";
String serviceCode = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
sql = "SELECT TRAN_CODE FROM WAVE_STATUS_ORG WHERE PTCN = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
if(rs.next())
{
cartonMasterTranCode = rs.getString("TRAN_CODE");
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
sql = "SELECT S.TRAN_CODE,T.SERVICE_CODE FROM SHIPMENT S , SHIP_DOCS SD, TRANSPORTER T WHERE SD.PTCN = ? " +
" AND S.SHIPMENT_ID = SD.SHIPMENT_ID AND S.TRAN_CODE = T.TRAN_CODE ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
if(rs.next())
{
shipTranCode = rs.getString("TRAN_CODE");
serviceCode = rs.getString("SERVICE_CODE");
}
else
{
return "NO";
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
if( cartonMasterTranCode.equalsIgnoreCase(shipTranCode))
{
return "NO";
}
else
{
return serviceCode;
}
}
catch(Exception e)
{
errString = e.getMessage();
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null )
{
rs.close(); rs = null;
}
if(pstmt != null )
{
pstmt.close(); pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
///return cartonMasterTranCode;
}
private CommodityInfo[] setCommodityInfos(LinkedList list,String masterCarton,String saleOrder,ADSIShippingSoap soap,Connection conn) throws ITMException
{
String itemCode = "";
String harmonizDescr = "";
String harmonizCode = "";
String originCountry = "";
String nafFlag = "";
String shipCountry = "";
double unitValue = 0,caseWeight = 0;
double packSizeCase = 0,noArt =0;
CommodityInfo[] commoList;
try
{
System.out.println("GenerateLabelsPrc.setCommodityInfos()");
System.out.println("list.size ["+list.size()+"]");
commoList = new CommodityInfo[list.size()];
nafFlag = discommon.getDisparams("999999","NAFTA_FLAG_COUNT",conn);
CommodityInfo comInfo = new CommodityInfo();
for( int i = 0 ; i < list.size() ; i++)
{
itemCode = (String) list.get(i);
comInfo = new CommodityInfo();
System.out.println(" item_code ["+itemCode+"]");
HashMap itmVolumeMap = getItemVoumeMap(itemCode, "", conn);
harmonizDescr = (String)itmVolumeMap.get("HARMONIZATION_DESCR");
harmonizCode = (String)itmVolumeMap.get("HARMONIZATION_NO");
caseWeight = (Double)itmVolumeMap.get("PACK_WEIGHT");
originCountry = (String)itmVolumeMap.get("ORIGIN_COUNTRY");
packSizeCase = (Double)itmVolumeMap.get("PACK_SIZE");
unitValue = getRateStdoum(saleOrder, itemCode, conn);
comInfo.setDescription(harmonizDescr);//As per taro Harmonization description
noArt = getItemCount(masterCarton, itemCode, conn);
comInfo.setQuantity(noArt * packSizeCase);
//comInfo.setQuantity();
comInfo.setHarmonizedCode(harmonizCode);//As per Taro Haromonization code
comInfo.setUnitValue(unitValue);
comInfo.setUnitWeight(caseWeight);
Country originCountryMfg = soap.getCountry("ISO3", originCountry).getResponseCountry();
comInfo.setOriginCountry(originCountryMfg);
//comInfo.setNaftaFlag(false);//False as Per Taro Need To change canda/Mexico as true.
HashMap sordMap = getSordInfo(saleOrder,conn);
shipCountry = sordMap.get("COUNT_CODE").toString();
System.out.println(" shipCountry ["+shipCountry+"]");
if(nafFlag.indexOf(shipCountry) != -1)
{
comInfo.setNaftaFlag(true);
System.out.println("available in disparm");
}
else
{
System.out.println("not in disparm");
comInfo.setNaftaFlag(false);
}
Calendar calendar = Calendar.getInstance();
comInfo.setExportNumberExpireDate(calendar);
comInfo.setUnitOfMeasure(EnumUnitOfMeasure.uomPCS);
commoList[i] = comInfo;
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return commoList;
}
private HashMap getItemVoumeMap(String itemCode,String lotNo,Connection con)throws Exception
{
double packSize = 0,itemSize = 0,lotSize = 0;
PreparedStatement pstmt = null;
String sql="",hazardous = "";
String harmonizCode = "",harmonizDescr = "",originCountry = "";
ResultSet rs = null;
double itmLen = 0,itmWidth = 0,itmHeight = 0,itemWeight = 0,lotLen = 0 ,lotHeight = 0,lotWidth = 0,lotWeight = 0;
HashMap dataVolumeMap = new HashMap();
try {
sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_WEIGHT,I.HAZARDOUS HAZARD, "
+" I.HARMONIZATION_NO HARMONIZATION_NO,I.HARMONIZATION_DESCR HARMONIZATION_DESCR,I.COUNT_CODE__MFG ORIGIN_COUNTRY,"
+" L.LENGTH LITEM_LEN,L.WIDTH LITEM_WID,L.HEIGHT LITEM_HEIGHT,L.SHIPPER_SIZE SHIPSIZE,L.GROSS_WEIGHT LOT_WEIGHT FROM"
+" ITEM I,ITEM_LOT_PACKSIZE L"
+" WHERE I.ITEM_CODE = L.ITEM_CODE"
+" AND L.LOT_NO__FROM <= ? AND L.LOT_NO__TO >= ?"
+" AND I.ITEM_CODE = ?";
pstmt = con.prepareStatement(sql);
if(lotNo != null && lotNo.length() > 0)
{
pstmt.setString(1, lotNo);
pstmt.setString(2, lotNo);
}
else
{
pstmt.setString(1, "00");
pstmt.setString(2, "ZZ");
}
pstmt.setString(3, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itmLen = rs.getDouble("ITEM_LEN");
itmWidth = rs.getDouble("ITEM_WID");
itmHeight = rs.getDouble("ITEM_HEIGHT");
itemWeight = rs.getDouble("ITEM_WEIGHT");
//Changed By Pragyan 12/03/13 To set hazardous item check
hazardous = rs.getString("HAZARD");
lotLen = rs.getDouble("LITEM_LEN");
lotWidth = rs.getDouble("LITEM_WID");
lotHeight = rs.getDouble("LITEM_HEIGHT");
packSize = rs.getDouble("SHIPSIZE");
lotWeight = rs.getDouble("LOT_WEIGHT");
harmonizCode = rs.getString("HARMONIZATION_NO");
harmonizDescr = rs.getString("HARMONIZATION_DESCR");
originCountry = rs.getString("ORIGIN_COUNTRY");
}
//packSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight);
/*itemSize = Math.floor(itmLen * itmWidth * itmHeight);
lotSize = Math.floor((lotHeight * lotWidth * lotLen));*/
itemSize = itmLen * itmWidth * itmHeight;
lotSize = lotHeight * lotWidth * lotLen;
dataVolumeMap.put("PACK_SIZE", packSize);
dataVolumeMap.put("ITEM_SIZE", itemSize);
dataVolumeMap.put("LOT_SIZE", lotSize);
//Changed By Pragyan 12/03/13 To set hazardous item check
dataVolumeMap.put("HAZARDOUS", hazardous);
dataVolumeMap.put("ITEM_WEIGHT", itemWeight);
dataVolumeMap.put("PACK_WEIGHT", lotWeight);
dataVolumeMap.put("HARMONIZATION_NO", harmonizCode);
dataVolumeMap.put("HARMONIZATION_DESCR", harmonizDescr);
dataVolumeMap.put("ORIGIN_COUNTRY", originCountry);
dataVolumeMap.put("ITEM_LEN", itmLen);
dataVolumeMap.put("ITEM_WID", itmWidth);
dataVolumeMap.put("ITEM_HEIGHT", itmHeight);
dataVolumeMap.put("LITEM_LEN", lotLen);
dataVolumeMap.put("LITEM_WID", lotWidth);
dataVolumeMap.put("LITEM_HEIGHT", lotHeight);
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
} catch (Exception e) {
// TODO: handle exception
throw e;
}
finally
{
try
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
catch(Exception e)
{
throw e;
}
}
return dataVolumeMap;
}
private double getRateStdoum(String saleOrder,String itemCode,Connection conn) throws ITMException
{
String sql = "";
double rateStdOum = 0.0;
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
sql = " SELECT RATE__STDUOM FROM SORDDET WHERE SALE_ORDER = ? AND ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, saleOrder);
pstmt.setString(2, itemCode);
rs = pstmt.executeQuery();
if( rs.next())
{
rateStdOum = rs.getDouble(1);
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
}
catch(Exception ex)
{
ex.printStackTrace();
throw new ITMException(ex);
}
return rateStdOum;
}
private double getItemCount(String masterCarton,String itemCode, Connection conn) throws ITMException
{
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
double count = 0;
try
{
sql = "SELECT COUNT(*) FROM CARTON_MASTER WHERE MASTER_CARTON = ? AND CARTON_TYPE = ? AND ITEM_CODE = ? AND STATUS <> ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, masterCarton);
pstmt.setString(2, "C");
pstmt.setString(3, itemCode);
pstmt.setString(4, "R");
rs = pstmt.executeQuery();
if( rs.next())
{
count = rs.getDouble(1);
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
System.out.println(" item count ["+count+"]");
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if( rs != null)
{
rs.close(); rs = null;
}
if( pstmt != null )
{
pstmt.close(); pstmt = null;
}
}
catch(Exception es)
{
es.printStackTrace();
throw new ITMException(es);
}
}
return count;
}
private HashMap getSordInfo(String saleOrder,Connection conn) throws ITMException
{
String sql = "";
ResultSet rs = null;
PreparedStatement pstmt = null;
HashMap sordInfoMap = new HashMap();
String custCode = "",stanCode = "",siteCodeShip = "",stateCodeDlv = "",shipConsGrp = ""
//Changed By Rekha to get additional fields for ADSI
,custName="",custShName = "",shipCity="",shipCountry = "",shipAdd1 = "",shipAdd2 = "",shipAdd3 = "",
shipPh="",shipFax ="",shipMailId = "",custPord = "";
try
{
//Change By Rekha To get the required rcpnt value from customer
//Changed By Pragyan To get customer ship consigee group
/*sql = "SELECT C.CUST_CODE AS CUST_CODE,C.STAN_CODE AS STAN_CODE,S.SITE_CODE__SHIP AS SHIP_CODE,C.STATE_CODE AS STATE_DLV FROM SORDER S,CUSTOMER C "
+ " WHERE S.CUST_CODE__DLV = C.CUST_CODE "
+ " AND S.SALE_ORDER = ? ";*/
/*sql = "SELECT C.CUST_CODE AS CUST_CODE,C.STAN_CODE AS STAN_CODE,S.SITE_CODE__SHIP AS SHIP_CODE,C.STATE_CODE AS STATE_DLV,C.SHIP_CONS_GRP AS SHIP_CONS_GRP FROM SORDER S,CUSTOMER C "
+ " WHERE S.CUST_CODE__DLV = C.CUST_CODE "
+ " AND S.SALE_ORDER = ? ";*/
sql = "SELECT C.CUST_CODE AS CUST_CODE,"
+" C.STAN_CODE AS STAN_CODE,"
+" S.SITE_CODE__SHIP AS SHIP_CODE,"
+" S.CUST_PORD AS CUST_PORD,"
+" C.STATE_CODE AS STATE_DLV,"
+" C.SHIP_CONS_GRP AS SHIP_CONS_GRP,"
+" C.CUST_NAME AS CUST_NAME,"
+" C.SH_NAME AS SH_NAME,"
+" C.ADDR1 AS ADDR1,"
+" C.ADDR2 AS ADDR2,"
+" C.ADDR3 AS ADDR3,"
+" C.CITY AS CITY,"
+" C.COUNT_CODE AS COUNT_CODE,"
+" C.TELE1 AS PHONE,"
+" C.FAX AS FAX,"
+" C.EMAIL_ADDR AS EMAIL_ID"
+" FROM SORDER S,CUSTOMER C "
+ " WHERE S.CUST_CODE__DLV = C.CUST_CODE "
+ " AND S.SALE_ORDER = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,saleOrder);
rs = pstmt.executeQuery();
if(rs.next())
{
custCode = rs.getString("CUST_CODE");
stanCode = rs.getString("STAN_CODE");
siteCodeShip = rs.getString("SHIP_CODE");
stateCodeDlv = rs.getString("STATE_DLV");
shipConsGrp = rs.getString("SHIP_CONS_GRP");
custName = rs.getString("CUST_NAME");
custShName = rs.getString("SH_NAME");
shipCity = rs.getString("CITY");
shipAdd1 = rs.getString("ADDR1");
shipAdd2 = rs.getString("ADDR2");
shipAdd3 = rs.getString("ADDR3");
shipCountry = rs.getString("COUNT_CODE");
shipPh = rs.getString("PHONE");
shipMailId = rs.getString("EMAIL_ID");
shipFax = rs.getString("FAX");
custPord = rs.getString("CUST_PORD");
}
sordInfoMap.put("CUST_CODE", custCode);
sordInfoMap.put("STAN_CODE", stanCode);
sordInfoMap.put("SHIP_CODE", siteCodeShip);
sordInfoMap.put("STATE_DLV", stateCodeDlv);
sordInfoMap.put("CUST_NAME", custName);
sordInfoMap.put("SH_NAME", custShName);
sordInfoMap.put("CITY", shipCity);
sordInfoMap.put("ADDR1", shipAdd1);
sordInfoMap.put("ADDR2", shipAdd2);
sordInfoMap.put("ADDR3", shipAdd3);
sordInfoMap.put("COUNT_CODE", shipCountry);
sordInfoMap.put("PHONE", shipPh);
sordInfoMap.put("EMAIL_ID", shipMailId);
sordInfoMap.put("FAX", shipFax);
sordInfoMap.put("CUST_PORD", custPord);
if(shipConsGrp != null && shipConsGrp.length() > 0 )
{
sordInfoMap.put("SHIP_CONS_GRP", shipConsGrp);
}
else
{
sordInfoMap.put("SHIP_CONS_GRP", custCode);
}
if( rs != null )
{
rs.close();
rs = null;
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
System.out.println("Exception in == >"+e);
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if( rs != null )
{
rs.close();
rs = null;
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e1)
{
throw new ITMException(e1);
}
}
return sordInfoMap;
}
private String generatedLabelPrint(String waveId, String printer, Connection conn) throws ITMException
{
String errString ="";
String printMode = "";
String outputFilename = "";
TreeMap argMap = null;
String isReplenishment = "N";
String saleOrder = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
String reportObjName = discommon.getDisparams("999999","WAVE_LABEL_OBJ_NAME",conn);
System.out.println("Printer *->["+printer.trim()+"] report_obj_name ["+reportObjName+"] wave id ->["+waveId+"]");
ibase.webitm.reports.utility.JasperReportGenerator jrGenerator = new ibase.webitm.reports.utility.JasperReportGenerator();
String xsdString ="<Arguments>" +
"<Argument id=\"WAVE_ID\" name=\"WAVE_ID\">" +
"<argType>java.lang.String</argType>" +
"<value>"+waveId+"</value>" +
"</Argument>" +
"<Argument id=\"PRINTVAL\" name=\"PRINTVAL\">" +
"<argType>java.lang.String</argType>" +
//"<value>"+ptcnList.get(i)+"</value>" +
"<value>"+isReplenishment+"</value>" +
"</Argument>" +
"<Argument id=\"x_path\" name=\"x_path\">" +
"<argType>java.lang.String</argType>" +
"<value>/DocumentRoot/pick_label</value>" +
"</Argument>" +
"<Argument id=\"design_source\" name=\"design_source\">" +
"<argType>java.lang.String</argType>" +
"<value>pick_label.jrxml</value>" +
"</Argument>" +
"<Argument id=\"data_source\" name=\"data_source\">" +
"<argType>java.lang.String</argType>" +
"<value>SQL</value>" +
"</Argument>" +
"<Argument id=\"bind_type\" name=\"bind_type\">" +
"<argType>java.lang.Integer</argType>" +
"<value>0</value>" +
"</Argument>" +
"<Argument id=\"report_type\" name=\"report_type\">" +
"<argType>java.lang.String</argType>" +
"<value>JASPER</value>" +
"</Argument>" +
"<Argument id=\"report_save_type\" name=\"report_save_type\">" +
"<argType>java.lang.String</argType>" +
"<value>NATIVE</value>" +
"</Argument>" +
"</Arguments>";
System.out.println(" XSD parser **->["+xsdString+"]");
errString = jrGenerator.printReport(reportObjName, xsdString, chgUser, printer.trim(), 1, conn);
System.out.println(" PRINTING task completed--------**------->");
//}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return errString;
}
}
package ibase.webitm.ejb.wms;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Local
public interface GenerateLabelsPrcLocal extends ProcessLocal
{
public String process() throws RemoteException,ITMException;
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.wms;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Remote
public interface GenerateLabelsPrcRemote extends ProcessRemote
{
public String process() throws RemoteException,ITMException;
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
......@@ -46,6 +46,7 @@ public class MasterPackPos extends ValidatorEJB implements MasterPackPosRemote,
String pickOrder = "";
//Change by Rohan on 25-02-12 for define variables
String outerCartonNo = "";
Set cartonSet = new HashSet();//Changed by sumit on 05/05/13
int cartonPack = 0;
int cartonPick = 0;
int cnt = 0;
......@@ -194,10 +195,17 @@ public class MasterPackPos extends ValidatorEJB implements MasterPackPosRemote,
}
outerCarton = genericUtility.getColumnValueFromNode("carton_no", node2.item(cnt));
System.out.println("-------->Carton ["+outerCarton+"] updateFlag ["+updateFlag+"]");
//Changed by sumit on 05/06/13
if( "A".equalsIgnoreCase(updateFlag) || "D".equalsIgnoreCase(updateFlag))
{
cartonSet.add(outerCarton);
}
//Changed by sumit on 08/12/12 changing input parameter as per sql start
//pstmt.setString(1,outerCarton);
if("E".equalsIgnoreCase(updateFlag) || "A".equalsIgnoreCase(updateFlag) )
{
pstmt.setString(1,"U");
......@@ -273,6 +281,8 @@ public class MasterPackPos extends ValidatorEJB implements MasterPackPosRemote,
pstmt.close(); pstmt = null;
}
//Ended By Mahesh Patidar
updateChangeStatus(cartonSet, conn);
}
}
//Changed by sumit on 08/02/13 updating pack_hdr start.
......@@ -330,4 +340,122 @@ public class MasterPackPos extends ValidatorEJB implements MasterPackPosRemote,
}
return input;
}
private int updateChangeStatus(Set cartonSet,Connection conn) throws ITMException
{
String sql = "";
String cartonNo = "";
String orgMasterCarton = "";
String newMasterCarton = "";
int update = 0;
PreparedStatement pstmt = null,pstmt1 = null;
ResultSet rs = null;
try
{
sql = "UPDATE CARTON_MASTER SET CHANGE_STATUS = ? WHERE MASTER_CARTON = ?";
pstmt1 = conn.prepareStatement(sql);
Iterator it = cartonSet.iterator();
while( it.hasNext())
{
cartonNo = it.next().toString();
System.out.println(" cartonNo ["+cartonNo+"]");
sql = "SELECT MASTER_CARTON FROM WAVE_STATUS_ORG_DET WHERE CARTON_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cartonNo);
rs = pstmt.executeQuery();
if( rs.next())
{
orgMasterCarton = rs.getString("MASTER_CARTON");
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
sql = "SELECT MASTER_CARTON FROM CARTON_MASTER WHERE CARTON_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cartonNo);
rs = pstmt.executeQuery();
if( rs.next())
{
newMasterCarton = rs.getString("MASTER_CARTON");
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
if( !orgMasterCarton.equalsIgnoreCase(newMasterCarton) )
{
update = 0;
pstmt1.setString(1, "Y");
pstmt1.setString(2, orgMasterCarton);
update = pstmt1.executeUpdate();
pstmt1.clearParameters();
if( update > 0 )
{
System.out.println("update successfully in WAVE_STATUS_ORG_DET ");
}
update = 0;
pstmt1.setString(1, "Y");
pstmt1.setString(2, newMasterCarton);
update = pstmt1.executeUpdate();
pstmt1.clearParameters();
if( update > 0 )
{
System.out.println("update successfully in WAVE_STATUS_ORG_DET ");
}
sql = "UPDATE WAVE_STATUS_ORG SET PRINT_STATUS = ? WHERE PTCN IN (SELECT PTCN FROM CARTON_MASTER WHERE CARTON_NO = ?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "N");
pstmt.setString(2, cartonNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println("update successfully in WAVE_STATUS_ORG ");
}
pstmt.close(); pstmt = null;
}
}
if(pstmt1 != null )
{
pstmt1.close(); pstmt1 = null;
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null )
{
rs.close(); rs = null;
}
if(pstmt1 != null )
{
pstmt1.close(); pstmt1 = null;
}
if(pstmt != null )
{
pstmt.close(); pstmt = null;
}
}
catch(Exception es)
{
es.printStackTrace();
throw new ITMException(es);
}
}
return 0;
}
}
......@@ -11,10 +11,12 @@ import ibase.utility.CommonConstants;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ITMDBAccessLocal;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
import java.net.URL;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
......@@ -23,6 +25,8 @@ import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -39,6 +43,10 @@ import org.w3c.dom.NodeList;
//Changed by sumit on 06/10/12
import org.w3c.dom.*;
import com.adsionline.ADSIShippingWS.ADSIShippingLocator;
import com.adsionline.ADSIShippingWS.ADSIShippingSoap;
import com.adsionline.ADSIShippingWS.StringDictionaryReturn;
@Stateless
public class ShipmentConf extends ActionHandlerEJB implements ShipmentConfLocal, ShipmentConfRemote
......@@ -267,6 +275,66 @@ public class ShipmentConf extends ActionHandlerEJB implements ShipmentConfLocal,
pstmt.close();
pstmt = null;
conn.commit();
//For Adsi start
DistCommon discommon = new DistCommon();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String adsiShippingURL = "",imagePath = "";
ADSIShippingLocator locator = null;
ADSIShippingSoap soap = null;
String PTCN = "";
String carrierFriendlyName = "";
java.util.Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy");
String strSmple = format.format(calendar.getTime());
adsiShippingURL = discommon.getDisparams("999999","WMS_ADSI_SOAP_URL",conn);
long timeBefore = System.currentTimeMillis();
locator = new ADSIShippingLocator();
System.out.println(" Connecting ADSI server ................");
soap = locator.getADSIShippingSoap(new URL(adsiShippingURL));
long timeAfter = System.currentTimeMillis();
System.out.println(" is server active ["+soap.testADSIServer()+"]");
if(!soap.testADSIServer())
{
errString = itmDBAccessEJB.getErrorString("","ADSISRVERR","","",conn);
return errString;
}
sql = " SELECT DISTINCT S.PTCN,G.CARRIER_FRIENDLYNAME FROM SHIP_DOCS S,WAVE_STATUS_ORG G WHERE S.SHIPMENT_ID = ? AND G.PTCN = S.PTCN";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
while( rs.next())
{
PTCN = rs.getString("PTCN");
carrierFriendlyName = rs.getString("CARRIER_FRIENDLYNAME");
System.out.println("PTCN["+PTCN+"]Carrier FriendlyName["+carrierFriendlyName+"]");
StringDictionaryReturn testStr = soap.closeOutEOD("Taro Commercial", carrierFriendlyName,strSmple, false, "");
System.out.println("Message for Close Out["+testStr.getMessage()+"]");
System.out.println("isSuccess["+testStr.isSuccess()+"]");
if(testStr.isSuccess())
{
}
else
{
errString =getError(testStr.getMessage(),"ADSCLOSEOD", conn);
return errString;
}
}
rs.close();rs = null;
pstmt.close();pstmt = null;
//For Adsi end
//Changed by sumit on 28/09/12 commented and written above.
//ITMDBAccessLocal itmDBAccessLocal = new ITMDBAccessEJB();
errString = itmDBAccessLocal.getErrorString("","VTCONFIRM","");
......@@ -303,6 +371,30 @@ public class ShipmentConf extends ActionHandlerEJB implements ShipmentConfLocal,
return errString;
}
private String getError(String message,String Code,Connection conn) throws ITMException, Exception
{
String mainStr ="";
try
{
String errString = "";
errString = new ITMDBAccessEJB().getErrorString("",Code,"","",conn);
String begPart = errString.substring(0,errString.indexOf("<message>")+9);
String endDesc = errString.substring(errString.indexOf("</description>"));
mainStr= begPart+"Invalid Data"+"</message><description>";
mainStr= mainStr+"ADSI ="+message+""+endDesc;
System.out.println("mainStr:::::::::::::::::: "+mainStr);
begPart = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return mainStr;
}
private String confirmShipment(String businessObj, String tranIdFr,String xtraParams, String forcedFlag , Connection conn) throws ITMException
{
String methodName = "gbf_post";
......@@ -532,6 +624,9 @@ public class ShipmentConf extends ActionHandlerEJB implements ShipmentConfLocal,
return isSame;
}
//Changed by sumit on 05/10/12 counting ship detail end.
//Changed by sumit on 05/10/12 update desp_confirmed in ship_docs ship detail start.
private String updateShipDocs ( String refId, HashMap error) throws ITMException
{
......
package ibase.webitm.ejb.wms;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.net.URL;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.ArrayList;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.adsionline.ADSIShippingWS.ADSIShippingLocator;
import com.adsionline.ADSIShippingWS.ADSIShippingSoap;
import com.adsionline.ADSIShippingWS.StringDictionaryReturn;
//import com.lowagie.text.pdf.hyphenation.TernaryTree.Iterator;
@javax.ejb.Stateless
public class ShipmentPrc extends ProcessEJB implements ShipmentPrcLocal,ShipmentPrcRemote
{
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException
{
GenericUtility genericUtility = GenericUtility.getInstance();
System.out.println("INSIDE GET DATA");
String rtrStr = "";
Document headerDom = null;
Document detailDom = null;
System.out.println("getData(xmlString,xmlString2,windowName,xtraParams CALLED..."+ xmlString);
try
{
if(xmlString != null && xmlString.trim().length()!=0)
{
System.out.println("XML String :"+xmlString);
headerDom = genericUtility.parseString(xmlString);
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
System.out.println("XML String :"+xmlString2);
detailDom = genericUtility.parseString(xmlString2);
}
rtrStr = getData(headerDom, detailDom, windowName, xtraParams);
}
catch (Exception e)
{
System.out.println("Exception :StockAllocationPrcEJB :getData(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
rtrStr = e.getMessage();
}
return rtrStr;
}
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{
String frdate = "";
String fromDate = "";
String tDate = "";
String toDate="";
String dateFrom = "";
String dateTo = "";
String transporterFrom = "";
String transporterTo = "";
String shipmentType = "";
String errCode = "";
String errString = "";
PreparedStatement pstmt=null;
String getDataSql=null;
String resultString = "";
Connection conn = null;
String studId=null;
ResultSet rs=null;
boolean rsflag=false;
StringBuffer test=new StringBuffer();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
try
{
test = new StringBuffer( "<?xml version='1.0' encoding='UTF-8'?>\r\n<DocumentRoot>\r\n<description>Datawindow Root</description>\r\n<group0>\r\n" +
"<description>Group0 description</description>\r\n<Header0>\r\n<description>Header0 members</description>\r\n");
int count = 0;
NodeList parentList = null;
NodeList childList = null;
int noOfChilds = 0;
String childNodeName = "";
String sql = "";
Node childNode = null;
GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
SimpleDateFormat sdf;
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
String userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
fromDate = checkNull(genericUtility.getColumnValue("from_date",headerDom));
System.out.println( "*********FROMDATE="+fromDate);
toDate = checkNull(genericUtility.getColumnValue("to_date",headerDom));
System.out.println( "*********TODATE="+toDate);
transporterFrom = checkNull(genericUtility.getColumnValue("tran_code_from",headerDom));
System.out.println( "*********TRANSPORTERFROM="+transporterFrom);
transporterTo = checkNull(genericUtility.getColumnValue("tran_code_to",headerDom));
System.out.println( "*********TRANSPORTERTO="+transporterTo);
shipmentType = checkNull(genericUtility.getColumnValue("shipment_type",headerDom));
System.out.println( "*********SHIPMENTTYPE="+shipmentType);
System.out.println("headerDom:"+headerDom);
System.out.println("detailDom:"+detailDom);
System.out.println("windowName:"+windowName);
System.out.println("xtraParams:"+xtraParams);
if ( fromDate == null || fromDate.trim().length() == 0 ) //from_date
{
System.out.println("*************DEF="+fromDate);
errCode = "BLKFROMDT";
errString = itmDBAccessEJB.getErrorString("","BLKFROMDT",userId);
return errString;
} //from_date
if ( toDate == null || toDate.trim().length() == 0 ) //to_date
{
System.out.println("*************GHI="+toDate);
errCode = "BLKTODT";
errString = itmDBAccessEJB.getErrorString("","BLKTODT",userId);
return errString;
} //to_date
if ( transporterFrom == null || transporterFrom.trim().length() == 0 ) //tran_code_from
{
System.out.println("TRANSPORTERFROM="+transporterFrom);
errCode = "BLKTRANFR";
errString = itmDBAccessEJB.getErrorString("","BLKTRANFR",userId);
return errString;
}
else if(transporterFrom != null || transporterFrom.trim().length() != 0)
{
if(!"00".equalsIgnoreCase(transporterFrom))
{
sql = " SELECT COUNT(*) FROM TRANSPORTER WHERE TRAN_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,transporterFrom);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "INVTRANPRT";
errString = itmDBAccessEJB.getErrorString("","INVTRANPRT",userId);
return errString;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
} //end of tran_code_from
if ( transporterTo == null || transporterTo.trim().length() == 0 ) //tran_code_to
{
System.out.println("TRANSPORTERTO="+transporterTo);
errCode = "BLKTRANTO";
errString = itmDBAccessEJB.getErrorString("","BLKTRANTO",userId);
return errString;
}
else if(transporterTo != null || transporterTo.trim().length() != 0)
{
if(!"ZZ".equalsIgnoreCase(transporterTo))
{
sql = " SELECT COUNT(*) FROM TRANSPORTER WHERE TRAN_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,transporterTo);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "INVTRANPRT";
errString = itmDBAccessEJB.getErrorString("","INVTRANPRT",userId);
return errString;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
} //end of supp_code_from
if ( shipmentType == null || shipmentType.trim().length() == 0 )
{
System.out.println("SHIPMENTTYPE="+shipmentType);
errCode = "BLKSHIPTYP";
errString = itmDBAccessEJB.getErrorString("","BLKSHIPTYP",userId);
return errString;
}
else if(shipmentType != null || shipmentType.trim().length() != 0)
{
sql = "SELECT COUNT(*) FROM GENCODES WHERE FLD_NAME = 'SHIPMENT_TYPE' AND MOD_NAME = 'W_TRANSPORTER' AND FLD_VALUE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,shipmentType);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "INVSHIPTYP";
errString = itmDBAccessEJB.getErrorString("","INVSHIPTYP",userId);
return errString;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} //end of supp_code_from
/* Date tempSysDate=new Date();
int day=tempSysDate.getDate();
int month=tempSysDate.getMonth();
int year=tempSysDate.getYear();
Date finalSysDate=new Date(year,month,day); */
int i =new java.util.Date(toDate).compareTo(new java.util.Date(fromDate));
// int sysDate=new java.util.Date(toDate).compareTo(finalSysDate);
if((i==-1) )
{
errCode = "INVLDATE";
errString = itmDBAccessEJB.getErrorString("","INVLDATE",userId);
return errString;
}
frdate = oracleFormatDate(fromDate);
System.out.println("FRDATE="+frdate);
tDate = oracleFormatDate(toDate);
System.out.println("TDATE="+tDate);
getDataSql = " SELECT D.PTCN, S.SHIPMENT_ID, T.TRAN_NAME FROM SHIP_DOCS D, SHIPMENT S,TRANSPORTER T WHERE D.SHIPMENT_ID = S.SHIPMENT_ID " +
" AND S.TRAN_CODE = T.TRAN_CODE AND D.REF_SER = 'S-DSP' AND S.CONFIRMED = 'Y' AND S.CONF_DATE BETWEEN ? AND ? AND S.TRAN_CODE BETWEEN ? AND ? " +
" AND T.SHIPMENT_TYPE = ? ";
System.out.println("**************getDataSql="+getDataSql);
pstmt = conn.prepareStatement(getDataSql);
pstmt.setString(1,frdate);
pstmt.setString(2,tDate);
pstmt.setString(3,transporterFrom);
pstmt.setString(4,transporterTo);
pstmt.setString(5,shipmentType);
rs = pstmt.executeQuery();
rsflag=false;
while(rs.next())
{
rsflag=true;
test.append( "<Detail2>\r\n" );
test.append( "<ptcn><![CDATA[" ).append(rs.getString(1)).append( "]]></ptcn>\r\n" );
test.append( "<shipment_id><![CDATA[" ).append(rs.getString(2)).append( "]]></shipment_id>\r\n" );
test.append( "<tran_name><![CDATA[" ).append(rs.getString(3)).append( "]]></tran_name>\r\n" );
test.append("\n");
test.append( "</Detail2>\r\n" );
}
test.append( "</Header0>\r\n</group0>\r\n</DocumentRoot>\r\n" );
resultString=test.toString();
if(rsflag == false)
{
errCode = "INVLDATA";
errString = itmDBAccessEJB.getErrorString("","INVLDATA",userId);
return errString;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch(Exception e)
{
System.out.println("Exception occured while getData()");
e.printStackTrace();
}
finally
{
try
{
if(conn != null)
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
}
conn = null;
}
catch(Exception ex)
{
System.out.println("Exception occured while getData()");
ex.printStackTrace();
}
}
return resultString;
} //get data method closed
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException
{
String retStr = "";
Document detailDom = null;
Document headerDom = null;
GenericUtility genericUtility = GenericUtility.getInstance();
System.out.println("*******************Testing Process Method**********************");
System.out.println("below genericUtility--------------->>>>>>>>>");
try
{
if(xmlString != null && xmlString.trim().length()!=0)
{
headerDom = genericUtility.parseString(xmlString);
System.out.println("headerDom" + headerDom);
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
detailDom = genericUtility.parseString(xmlString2);
System.out.println("detailDom" + detailDom);
}
retStr = process(headerDom, detailDom, windowName, xtraParams);
}
catch (Exception e)
{
System.out.println("Exception :StockAllocationPrcEJB :process(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace();
retStr = e.getMessage();
throw new ITMException(e);
}
return retStr;
}
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{
Connection conn = null;
ResultSet rs = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
PreparedStatement pstmt = null,pstmt1 = null;
String updateSql=null;
String sql=null;
int parentNodeListLength = 0;
int childNodeListLength = 0;
NodeList parentNodeList = null;
String childNodeName = null;
String ptcn = "";
String shipmentList []={};
String shipmentId = "";
String transporterName = "";
String tranId = "";
HashMap carrMap = new HashMap();
// Set shipmentSet = new java.util.TreeSet();
Set shipmentSet = new java.util.HashSet();
int count = 0;
int tcnt= 0;
String errCode = "";
String errString = "";
boolean isError = false;
GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
try
{
String userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
conn.setAutoCommit(false);
System.out.println("headerDom:"+headerDom);
System.out.println("detailDom:"+detailDom);
System.out.println("windowName:"+windowName);
System.out.println("xtraParams:"+xtraParams);
parentNodeList = detailDom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength();
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++)
{
parentNode = parentNodeList.item(selectedRow);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength---->>> "+ childNodeListLength);
for (int childRow = 0; childRow < childNodeListLength; childRow++)
{
childNode = childNodeList.item(childRow);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName---->>> "+ childNodeName);
if("ptcn".equalsIgnoreCase(childNodeName))
{
ptcn = checkNull(childNode.getFirstChild().getNodeValue());
}
if("shipment_id".equalsIgnoreCase(childNodeName))
{
shipmentId = checkNull(childNode.getFirstChild().getNodeValue());
}
if("tran_name".equalsIgnoreCase(childNodeName))
{
transporterName = checkNull(childNode.getFirstChild().getNodeValue());
}
shipmentSet.add(shipmentId);
}
}
System.out.println("INSIDE IF");
DistCommon discommon = new DistCommon();
itmDBAccessEJB = new ITMDBAccessEJB();
String adsiShippingURL = "",imagePath = "";
ADSIShippingLocator locator = null;
ADSIShippingSoap soap = null;
String PTCN = "";
String carrierFriendlyName = "";
java.util.Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy");
String strSmple = format.format(calendar.getTime());
adsiShippingURL = discommon.getDisparams("999999","WMS_ADSI_SOAP_URL",conn);
System.out.println("ADSISHIPPINGURL="+adsiShippingURL);
long timeBefore = System.currentTimeMillis();
locator = new ADSIShippingLocator();
System.out.println(" Connecting ADSI server ................");
if(shipmentSet != null && shipmentSet.size() >0)
{
soap = locator.getADSIShippingSoap(new URL(adsiShippingURL));
}
long timeAfter = System.currentTimeMillis();
if(soap == null || !soap.testADSIServer())
{
errString = itmDBAccessEJB.getErrorString("","ADSISRVERR","","",conn);
return errString;
}
System.out.println(" is server active ["+soap.testADSIServer()+"]");
Iterator it = shipmentSet.iterator();
ArrayList shipList = new ArrayList();
while(it.hasNext())
{
shipmentId = (String)it.next();
if(shipmentId != null && shipmentId.trim().length() > 0 )
{
sql = " SELECT CARRIER_FRIENDLYNAME FROM CARTON_MASTER WHERE PTCN IN (SELECT PTCN FROM SHIP_DOCS WHERE SHIPMENT_ID = ?) ORDER BY CARRIER_FRIENDLYNAME ";
pstmt = conn.prepareStatement(sql);
System.out.println("shipmentSet[i]"+shipmentId);
pstmt.setString(1,shipmentId);
rs = pstmt.executeQuery();
if( rs.next())
{
carrierFriendlyName = rs.getString("CARRIER_FRIENDLYNAME");
if(!carrMap.containsKey(carrierFriendlyName))
{
shipList = new ArrayList();
shipList.add(shipmentId);
System.out.println("ALINSIDEIF"+shipList);
}
else
{
shipList = (ArrayList)carrMap.get(carrierFriendlyName);
}
System.out.println("ARRAYLIST="+shipList);
carrMap.put(carrierFriendlyName, shipList);
}
}
}
updateSql= " UPDATE CARTON_MASTER SET SF_IDENTITY = ? WHERE PTCN IN (SELECT PTCN FROM SHIP_DOCS WHERE SHIPMENT_ID = ?)";
pstmt = conn.prepareStatement(updateSql);
if(carrMap != null && carrMap.size() > 0)
{
Set keySet = carrMap.keySet();
Iterator itCarrFnd = keySet.iterator();
String carrFndName = "";
ArrayList tempList = null;
String shipmentIDs = "";
int tmpListLen = 0;
String sfIdentity = "";
while(itCarrFnd.hasNext())
{
carrFndName = (String)itCarrFnd.next();
tempList = (ArrayList)carrMap.get(carrFndName);
tmpListLen = tempList.size();
System.out.println("Getting Sfidentity For Carriers services with ----["+carrFndName+"]----");
StringDictionaryReturn testStr = soap.closeOutEOD("Taro Commercial", carrFndName,strSmple, true, "Shipments");
System.out.println("isSuccess["+testStr.isSuccess()+"]");
System.out.println("Any Message["+testStr.getMessage()+"]");
if(testStr.isSuccess())
{
System.out.println("testStr.getResponseDictionary().get_any()"+testStr.getResponseDictionary().get_any());
if(testStr.getResponseDictionary().get_any() != null)
{
int len1 = testStr.getResponseDictionary().get_any().length;
System.out.println("Len Response recived from ADSI"+len1);
for ( int cCTR =0 ; cCTR <len1; cCTR++ )
{
System.out.println("Counter ["+cCTR+"]");
System.out.println("Name["+testStr.getResponseDictionary().get_any()[cCTR]);
if(testStr.getResponseDictionary().get_any()[cCTR].getElementsByTagName("string").item(0).getFirstChild()!= null)
{
System.out.println("ColumnName["+testStr.getResponseDictionary().get_any()[cCTR].getElementsByTagName("string").item(0).getFirstChild().getNodeValue()+"]");
}
if(testStr.getResponseDictionary().get_any()[cCTR].getElementsByTagName("string").item(1).getFirstChild()!= null)
{
System.out.println("Value["+testStr.getResponseDictionary().get_any()[cCTR].getElementsByTagName("string").item(1).getFirstChild().getNodeValue()+"]");
}
if(testStr.getResponseDictionary().get_any()[cCTR].getElementsByTagName("string").item(0).getFirstChild()!= null && testStr.getResponseDictionary().get_any()[cCTR].getElementsByTagName("string").item(0).getFirstChild().getNodeValue().equalsIgnoreCase("SF_Identity"))
{
if(testStr.getResponseDictionary().get_any()[cCTR].getElementsByTagName("string").item(1).getFirstChild() != null)
{
sfIdentity = testStr.getResponseDictionary().get_any()[cCTR].getElementsByTagName("string").item(1).getFirstChild().getNodeValue();
}
}
}
}
else
{
System.out.println("Need To Generate Erro as The Close OUT EOD Nothing to return for carrier ["+carrFndName+"]");
}
}
else
{
isError = false;
errString =getError(testStr.getMessage(),"ADSCLOSEOD", conn);
return errString;
}
System.out.println("Carrier Name ----["+carrFndName+"]----sfIdentity["+sfIdentity+"]");
for(int tmpCtr = 0;tmpCtr < tmpListLen; tmpCtr++)
{
shipmentIDs = (String)tempList.get(tmpCtr);
pstmt.setString(1,sfIdentity);
pstmt.setString(2,shipmentIDs);
count = pstmt.executeUpdate();
if(count > 0)
{
System.out.println("Update count ["+count+"]");
}
pstmt.clearParameters();
}
sfIdentity = "";
}
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
if(!isError)
{
System.out.println("******UPDATEDCOUNT="+count);
errCode = "PRCESSFUL";
errString = itmDBAccessEJB.getErrorString("","PRCESSFUL",userId);
}
}
catch (Exception e)
{
isError = true;
try
{
conn.rollback();
}
catch (Exception e1)
{
System.out.println("Gem Message as "+e.getCause());
System.out.println("Complete Messag by Sankara "+e.getMessage());
e1.printStackTrace();
}
e.printStackTrace();
System.out.println("******Exception"+e.getMessage());
}
finally
{
try
{
if(!isError)
{
conn.commit();
}
else
{
conn.rollback();
}
if(conn != null)
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
conn.close();
}
conn = null;
}
catch (Exception ex)
{
isError = true;
System.out.println("Exception is "+ex.getMessage());
}
}
return errString;
} //process method
/* public String getAdsiConnect(String ptcn, Connection conn) throws ITMException, Exception
{
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
String errString = "";
StringDictionaryReturn testStr =null;
HashMap hm = new HashMap();
GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
try
{
//For Adsi start
DistCommon discommon = new DistCommon();
itmDBAccessEJB = new ITMDBAccessEJB();
String adsiShippingURL = "",imagePath = "";
ADSIShippingLocator locator = null;
ADSIShippingSoap soap = null;
String PTCN = "";
String carrierFriendlyName = "";
java.util.Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy");
String strSmple = format.format(calendar.getTime());
adsiShippingURL = discommon.getDisparams("999999","WMS_ADSI_SOAP_URL",conn);
System.out.println("ADSISHIPPINGURL="+adsiShippingURL);
long timeBefore = System.currentTimeMillis();
locator = new ADSIShippingLocator();
System.out.println(" Connecting ADSI server ................");
soap = locator.getADSIShippingSoap(new URL(adsiShippingURL));
long timeAfter = System.currentTimeMillis();
System.out.println(" is server active ["+soap.testADSIServer()+"]");
if(!soap.testADSIServer())
{
errString = itmDBAccessEJB.getErrorString("","ADSISRVERR","","",conn);
return errString;
}
sql = " SELECT CARRIER_FRIENDLY_NAME FROM CARTON_MASTER WHERE PTCN = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
while( rs.next())
{
carrierFriendlyName = rs.getString("CARRIER_FRIENDLYNAME");
System.out.println("Carrier FriendlyName["+carrierFriendlyName+"]");
testStr = soap.closeOutEOD("Taro Commercial", carrierFriendlyName,strSmple, false, "");
System.out.println("Message for Close Out["+testStr.getMessage()+"]");
System.out.println("GET RESPONSE FROM ADSI["+testStr.getResponseDictionary() );
System.out.println("isSuccess["+testStr.isSuccess()+"]");
if(testStr.isSuccess())
{
}
else
{
errString =getError(testStr.getMessage(),"ADSCLOSEOD", conn);
return errString;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
throw new ITMException(ex);
}
finally
{
try
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if ( rs != null )
{
rs.close();
rs = null;
}
}
catch ( Exception e )
{
e.printStackTrace();
}
}
return testStr.toString();
} */
private String getError(String message,String Code,Connection conn) throws ITMException, Exception
{
String mainStr ="";
try
{
String errString = "";
errString = new ITMDBAccessEJB().getErrorString("",Code,"","",conn);
String begPart = errString.substring(0,errString.indexOf("<message>")+9);
String endDesc = errString.substring(errString.indexOf("</description>"));
mainStr= begPart+"Invalid Data"+"</message><description>";
mainStr= mainStr+"ADSI ="+message+""+endDesc;
System.out.println("mainStr:::::::::::::::::: "+mainStr);
begPart = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return mainStr;
}
public String oracleFormatDate(String dateStr) throws Exception
{
System.out.println("CONVERTED ORACLE DATE");
String strMonth = "";
String convertedDate = "";
strMonth = dateStr.substring(0, 2);
//System.out.println("strMonth = " + strMonth);
if (strMonth.equalsIgnoreCase("01"))
{
strMonth = "JAN";
}
else if (strMonth.equalsIgnoreCase("02"))
{
strMonth = "FEB";
}
else if (strMonth.equalsIgnoreCase("03"))
{
strMonth = "MAR";
}
else if (strMonth.equalsIgnoreCase("04"))
{
strMonth = "APR";
}
else if (strMonth.equalsIgnoreCase("05"))
{
strMonth = "MAY";
}
else if (strMonth.equalsIgnoreCase("06"))
{
strMonth = "JUN";
}
else if (strMonth.equalsIgnoreCase("07"))
{
strMonth = "JUL";
}
else if (strMonth.equalsIgnoreCase("08"))
{
strMonth = "AUG";
}
else if (strMonth.equalsIgnoreCase("09"))
{
strMonth = "SEP";
}
else if (strMonth.equalsIgnoreCase("10"))
{
strMonth = "OCT";
}
else if (strMonth.equalsIgnoreCase("11"))
{
strMonth = "NOV";
}
else if (strMonth.equalsIgnoreCase("12"))
{
strMonth = "DEC";
}
convertedDate = dateStr.substring(3, 5) + "-" + strMonth + "-"+ dateStr.substring(6);
System.out.println("Given Date Into ORACLE formate = " + convertedDate);
return convertedDate;
} // oracleFormatDate()
private String checkNull( String input )
{
if( input == null )
{
input = "";
}
else
{
input = input.trim();
}
return input;
}
} // class closed
package ibase.webitm.ejb.wms;
import ibase.webitm.ejb.ProcessLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import org.w3c.dom.Document;
@javax.ejb.Local
public interface ShipmentPrcLocal extends ProcessLocal
{
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.wms;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Remote
public interface ShipmentPrcRemote extends ProcessRemote
{
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
......@@ -14,6 +14,14 @@ import ibase.webitm.ejb.dis.DistStkUpdLocal;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.net.URL;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
......@@ -25,6 +33,13 @@ import java.util.HashMap;
import javax.ejb.Stateless;
import javax.naming.InitialContext;
import com.adsionline.ADSIShippingWS.ADSIShippingLocator;
import com.adsionline.ADSIShippingWS.ADSIShippingSoap;
import com.adsionline.ADSIShippingWS.Service;
import com.adsionline.ADSIShippingWS.ShipmentResult2;
import com.adsionline.ADSIShippingWS.ShipmentResultReturn2;
import com.adsionline.ADSIShippingWS.StringReturn;
@Stateless
public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLocal, WaveCancelEJBRemote
{
......@@ -162,7 +177,10 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
String invStatLoc = "";
String invPndReserve = "";
String sqlLoc = "";
//Changed by Rohan on 30-05-13 for
long msnNo = 0;
String response = "";
String serviceCode = "";
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.end
PreparedStatement pstmtTask = null;
ResultSet rsTask = null;
......@@ -254,12 +272,12 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
{
//if despachdet generate then not allow to cancle wave.start
waveId = checkNull(rsWave.getString("WAVE_ID"));
//waveId = checkNull(rsWave.getString("WAVE_ID"));
if(isDespatch)
{
pstmtDesp = conn.prepareStatement(sqlDesp);
pstmtDesp.setString(1,waveId);
pstmtDesp.setString(1,waveID);
pstmtDesp.setString(2,"S-DSP");
rsDesp = pstmtDesp.executeQuery();
if(rsDesp.next())
......@@ -290,7 +308,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
//if despachdet generate then not allow to cancle wave.start
refSer = checkNull( rsWave.getString("REF_SER".trim()));
refId = checkNull( rsWave.getString("REF_ID") );
//Changed by Rohan on 30-05-13 for get ptcn
ptcn = checkNull( rsWave.getString("PTCN") );
System.out.println("Curren refser:"+refSer+"REF_ID"+refId);
//if(refSer.equalsIgnoreCase("C-PICK") || refSer.equalsIgnoreCase("M-PICK") || refSer.equalsIgnoreCase("A-PICK") || refSer.trim().equalsIgnoreCase("S-DOC") || refSer.equalsIgnoreCase("RP-PND") || refSer.equalsIgnoreCase("RP-PSO"))
......@@ -690,13 +709,12 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
//if(!invStatLoc.trim().equals(invPndReserve.trim()))
//{
//Chnaged by Rohan on 20-06-13 for bug fixing.start
//Changed by Rohan on 21-06-13 for bug fixing.start
//lineNoSord = " " + lineNoSord;
lineNoSord = " " + lineNoSord;
lineNoSord = lineNoSord.substring(lineNoSord.length()-3);
//Chnaged by Rohan on 20-06-13 for bug fixing.end
System.out.println("Line No:["+lineNoSord+"]");
//Chnaged by Rohan on 21-06-13 for bug fixing.end
sql = "SELECT QTY_ALLOC AS COUNT FROM SORDALLOC "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
......@@ -708,7 +726,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
+"AND LOC_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,saleOrder);
pstmt.setString(2, lineNoSord);
pstmt.setString(2,lineNoSord);
pstmt.setString(3,expLev);
pstmt.setString(4,itemCode);
pstmt.setString(5,itemCode);
......@@ -862,10 +880,112 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
}
}
//Changed by Rohan on 30-05-13 for void packages duning master pick and parcel picking.start
System.out.println("RefSeries checking for void packages"+refSer+"}");
if(refSer.equalsIgnoreCase("M-PICK") || refSer.equalsIgnoreCase("P-PICK") )
{
System.out.println("GOing for VOid PAckage::::::");
String serviceSymbol = "";
String sqlSymbol = "";
PreparedStatement pstmt1 = null;
ResultSet rs1 = null;
ADSIShippingLocator locator = new ADSIShippingLocator();
ADSIShippingSoap soap = locator.getADSIShippingSoap(new URL("http://172.20.0.137/ADSIShippingWS/ADSIShipping.asmx"));
String imagePath = discommon.getDisparams("999999","SHIP_WITH_PATH",conn);
sqlSymbol = "SELECT CARRIER_SYMBOL FROM WAVE_STATUS_ORG WHERE PTCN = ?";
pstmt1 = conn.prepareStatement(sqlSymbol);
if(refSer.equalsIgnoreCase("M-PICK"))
{
sql = "SELECT MSN_NO FROM CARTON_MASTER WHERE PTCN = ? AND REF_SER = 'M-PACK' AND CARTON_TYPE = 'M'";
}
else
{
sql = "SELECT MSN_NO FROM CARTON_MASTER WHERE PTCN = ? AND REF_SER='P-PICK' AND CARTON_TYPE= 'P' ";
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcn);
rs = pstmt.executeQuery();
while(rs.next())
{
msnNo = rs.getLong("MSN_NO");
/*
//reading shipment result2 object.start
InputStream file2 = new FileInputStream( imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+"ShipRslt"+".ser" );
InputStream buffer2 = new BufferedInputStream( file2 );
ObjectInput input1 = new ObjectInputStream ( buffer2 );
ShipmentResultReturn2 shipReslt =(ShipmentResultReturn2)input1.readObject();
//reading shipment result2 object.end
ShipmentResult2 objShipResulttest = shipReslt.getShipmentResultResponse2();
serviceSymbol = objShipResulttest.getServiceSymbol();
System.out.println("Service Symbol original"+serviceSymbol);
serviceSymbol = serviceSymbol.substring(0,serviceSymbol.lastIndexOf(".") );
System.out.println("Service Symbol final"+serviceSymbol);
*/
pstmt1.setString(1, ptcn);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
serviceSymbol = checkNull(rs1.getString("CARRIER_SYMBOL"));
}
else
{
serviceSymbol = "";
}
System.out.println("Service Symbol original"+serviceSymbol);
/*
if(!"".equalsIgnoreCase(serviceSymbol) && serviceSymbol.trim().length() > 0)
{
serviceSymbol = serviceSymbol.substring(0,serviceSymbol.lastIndexOf(".") );
}
*/
System.out.println("Service Symbol final"+serviceSymbol);
System.out.println("Service Symbol for void packages:"+serviceSymbol+":MSN NO:"+msnNo);
StringReturn testReturn = soap.voidPackage(serviceSymbol,msnNo);
response = testReturn.getResponse();
System.out.println("response ["+response+"]");
if(!response.contains("No Error"))
{
//retString = itmDBAccess.getErrorString("","NTVOIDPKGS","");
retString = getError(response,"NTVOIDPKGS",conn);
return retString;
}
pstmt1.clearParameters();
}
if(rs != null)
{
rs.close();
rs = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
//Changed by Rohan on 30-05-13 for void packages duning master pick and parcel picking.end
}//while close
//changed by Rohan on 26/03/13 for updating wave status.start
System.out.println("Error in wave Cancel"+retString);
System.out.println("Retun string["+retString+"]");
if(("".equalsIgnoreCase(retString) || retString != null) && retString.trim().length() == 0)
{
sqlUpdate = "UPDATE WAVE_TASK SET CANCEL ='Y' WHERE WAVE_ID = ?" ;
......@@ -989,6 +1109,31 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
}
return comp;
}
private String getError(String saleOrder,String Code,Connection conn) throws ITMException, Exception
{
String mainStr ="";
try
{
String errString = "";
errString = new ITMDBAccessEJB().getErrorString("",Code,"","",conn);
String begPart = errString.substring(0,errString.indexOf("<message>")+9);
String endDesc = errString.substring(errString.indexOf("</description>"));
mainStr= begPart+"Invalid Data"+"</message><description>";
mainStr= mainStr+"Sale Order ="+saleOrder+""+endDesc;
System.out.println("mainStr:::::::::::::::::: "+mainStr);
begPart = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return mainStr;
}
private ArrayList isReplinshmentConfirm(String replOrder ,String replLineNo,Connection conn) throws Exception
{
......
......@@ -16,10 +16,18 @@ import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
import java.awt.image.BufferedImage;
import java.awt.print.PrinterJob;
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.URL;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
......@@ -38,20 +46,45 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import javax.imageio.ImageIO;
import javax.print.PrintService;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
//import net.sf.jasperreports.governors.GovernorException;
import sun.misc.BASE64Decoder;
import com.adsionline.ADSIShippingWS.ADSIShippingLocator;
import com.adsionline.ADSIShippingWS.ADSIShippingSoap;
import com.adsionline.ADSIShippingWS.Address;
import com.adsionline.ADSIShippingWS.Carrier;
import com.adsionline.ADSIShippingWS.CommodityInfo;
import com.adsionline.ADSIShippingWS.Country;
import com.adsionline.ADSIShippingWS.EnumManifestAction;
import com.adsionline.ADSIShippingWS.EnumPackageType;
import com.adsionline.ADSIShippingWS.EnumTerms;
import com.adsionline.ADSIShippingWS.EnumTimeInTransit;
import com.adsionline.ADSIShippingWS.EnumUnitOfMeasure;
import com.adsionline.ADSIShippingWS.ImageRotation;
import com.adsionline.ADSIShippingWS.NameValuePair;
import com.adsionline.ADSIShippingWS.Package2;
import com.adsionline.ADSIShippingWS.PackageResult2;
import com.adsionline.ADSIShippingWS.ShipResponse;
import com.adsionline.ADSIShippingWS.ShipWithLabelType;
import com.adsionline.ADSIShippingWS.Shipment2;
import com.adsionline.ADSIShippingWS.ShipmentResult2;
import com.adsionline.ADSIShippingWS.ShipmentResultReturn2;
@javax.ejb.Stateless
public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLocal,WaveGenerationPrcRemote //SessionBean
{
String new_trackingNo = null;
String siteCode = null;
String itemSerFr = null;
String itemSerTo = null;
......@@ -75,6 +108,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String saleOrderTo = null;
String postOrderFg = null;
String sql = null;
String sqlInsertData = null;
String sqlInsertData1 = null;
String sDateTo = null;
String sDateFr = null;
//Changed by sumit on 18/09/12 create single_lot, master_pack_allow, active_pick_allow, stock_to_dock_allow start.
......@@ -100,7 +135,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
ArrayList custCodeArr = new ArrayList();
ArrayList dueDateArr = new ArrayList();
MasterStatefulLocal masterStatefulLocal = null;
ArrayList F = new ArrayList();
InvAllocTraceBean invAllocTrace = new InvAllocTraceBean();
GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
......@@ -122,6 +157,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
DistCommon discommon = new DistCommon();
private HashMap itemInfoMapForRepl = new HashMap();
ArrayList replanismentInfoList = new ArrayList();
//ArrayList masterOrParclNoList = new ArrayList();
ArrayList masterOrParclNoList = null ;
double qtyActual=0.0;
//private Calendar mapWeightVolume;
//Changed by Rohan on 13-09-12 to generate only one Repalnishmement Header.start
......@@ -210,11 +247,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String deepStoreLoc = "";
String partialResrvLoc = "";
String packInstr ="";
PreparedStatement pstmtStock = null;
//PreparedStatement pstmtStock1 = null;
//Changed by Rohan on 29-12-11 as said by gulzar.end
double balStockQtyTemp = 0.0,sordItemQty=0.0,balStk=0.0; // added by Chandni 01-June-2012
//Changed by sumit sarkar on 22/06/12 start.
String partQtyValue = "", allocFlag = "";
......@@ -245,6 +280,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed By Pragyan 17/12/12 to get the standard UOM and order UOM.End
//Change by Rohan on 19/07/12 to get transporter Info.start
//Changed by sumit 22/08/12 to retrieve alloc_flag start.
PreparedStatement pstmt1 = null;
ResultSet rs2 = null;
//
......@@ -438,14 +475,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by sumit on 24/11/12 getting print label value
printLabel = genericUtility.getColumnValue("print_label",headerDom);
//changed by sankara on 19/06/2013 for due date validation[start...]
int i = dateFr.compareTo(dateTo);
if((i == 1))
{
errString = itmDBAccessEJB.getErrorString("","INVLDDATE","","",conn);
return errString;
}
//changed by sankara on 19/06/2013 for due date validation[End...]
//Changed by sumit on 03/10/12 getting value of printer end
//Changed by Sumit sarkar on 07/03/12 search on the basis of item_code too.
......@@ -1687,6 +1717,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed By Pragyan 31/12/12 To get Parcel Pack Flag
String isParcelPickChecked = "N";
String directPickLoc = "";
HashMap saleOrderWiseMapCopy = null;
HashMap saleOrderWiseMapCpy = null;
boolean isStockToDock = false;
ArrayList tempList = null;
HashMap tempMap = null;
String locCd = "";
//changed by Rohan 14-04-12 [WM1ESUN006] to add sql.end
//Changed by Rohan on 12-06-13 for defining variables.start
String resrvLoc = "";
String casePickLoc = "";
......@@ -1702,13 +1739,6 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String isRepl = "";
String replQuantity = "";
//Changed by Rohan on 12-06-13 for defining variables.end
HashMap saleOrderWiseMapCopy = null;
HashMap saleOrderWiseMapCpy = null;
boolean isStockToDock = false;
ArrayList tempList = null;
HashMap tempMap = null;
String locCd = "";
//changed by Rohan 14-04-12 [WM1ESUN006] to add sql.end
double allocQty = 0;
double quantity = 0;
double qtyAvailAlloc = 0;
......@@ -2374,7 +2404,6 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
deepStoreLoc = discommon.getDisparams("999999","DEEP_STORE_INVSTAT",conn);
partialResrvLoc = discommon.getDisparams("999999","PRSRV_INVSTAT",conn);
System.out.println("invStat checking"+invSt);
if(((invSt.trim().equalsIgnoreCase(resrvLoc) || invSt.trim().equalsIgnoreCase(deepStoreLoc)) && (qtyAllocate >= packSize)) || invSt.trim().equalsIgnoreCase(partialResrvLoc))
{
System.out.println("Inside For Creating Repelnishment packSizeActive:::::["+packSize+"]lotQtyToBeAllocated["+qtyAllocate+"]");
......@@ -2464,11 +2493,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
tempMap.put("sugg_loc", locCodeTo);
//Changed by Rohan on 12/06/13 for bug fixing for setting location code.end
//Changed By Pragyan 12/03/13 To add hazardous
tempMap.put("hazard", hazardous);
tempList.add(tempMap);
saleOrderWiseMap.put(saleOrder+":"+locTypeParent,tempList);
}
if(manualStock)
......@@ -2813,6 +2840,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String errCode = "";
//Connection conn = null;
PreparedStatement pstmtStock = null;
PreparedStatement pstmtStockInsertSordAlloc = null;
//Changed by Rohan on 13-04-12 To create prepared statement & result set.start
String manStockData = "";
......@@ -3224,7 +3252,6 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
/*Ashish */
//Chnaged by Rohan on 20-06-13 for not allocate stock from dso,pso,caspk location if actve quantity present & active pick is N.start
invStat = invStat != null?invStat.trim():"";
System.out.println("allocQty"+allocQty+"qtyAvailAlloc:::"+qtyAvailAlloc);
......@@ -3233,15 +3260,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
qtyAvailAlloc = Math.floor(qtyAvailAlloc/packSizeActive) * packSizeActive;
System.out.println("Only Case avilable Quantity["+qtyAvailAlloc+"]");
}
//Chnaged by Rohan on 20-06-13 for not allocate stock from dso,pso,caspk location if actve quantity present & active pick is N.end
System.out.println("allocQty"+allocQty+"qtyAvailAlloc:::"+qtyAvailAlloc);
if (allocQty >= qtyAvailAlloc)
{
lotQtyToBeAllocated = qtyAvailAlloc;
//Changed By Pragyan 09/11/12 To make the stock to dock if avilable quantity less then or equal to required quantity(only reserve locatio).start
invStat = invStat != null?invStat.trim():"";
if((invStat.equalsIgnoreCase(resrvLoc) || invStat.equalsIgnoreCase(deepStoreLoc)) && (lotQtyToBeAllocated > packSizeActive) && "Y".equalsIgnoreCase(isStockToDockChecked))
{
isStockToDock = true;
......@@ -4580,6 +4606,18 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//errString = updatePickOrdPartII(headerDom, detailDom,waveId, siteCode,saleOrder ,xtraParams, itemMapList,ptcnID,transPorterInfoMap,totActVolume,totActWeight,totCaseVolume,totCaseWeight,totCaseCount, conn);
//errString = updatePickOrdPartII(headerDom, detailDom,waveId, siteCode,saleOrder ,xtraParams, itemSortList,ptcnID,transPorterInfoMap,totActVolume,totActWeight,totCaseVolume,totCaseWeight,totCaseCount, conn);
//Changed by Rohan on 21-06-13 for bug fixing of return string.start
/*
if(itemSortList.size() > 0)
{
return errString = updatePickOrder(headerDom, detailDom,waveId, siteCode,saleOrder ,xtraParams, itemSortList,ptcnID,transPorterInfoMap,totActVolume,totActWeight,totCaseVolume,totCaseWeight,totCaseCount, conn);
}
if(itemHazSortList.size() > 0)
{
return errString = updatePickOrder(headerDom, detailDom,waveId, siteCode,saleOrder ,xtraParams, itemHazSortList,ptcnID,transPorterInfoMap,totActHazVolume,totActHazWeight,totCaseHazVolume,totCaseHazWeight,totHazCaseCount, conn);
}
*/
if(itemSortList.size() > 0)
{
errString = updatePickOrder(headerDom, detailDom,waveId, siteCode,saleOrder ,xtraParams, itemSortList,ptcnID,transPorterInfoMap,totActVolume,totActWeight,totCaseVolume,totCaseWeight,totCaseCount, conn);
......@@ -4602,7 +4640,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{
return errString;
}
//Changed by Rohan on 21-06-13 for bug fixing of return string.end
//System.out.println("replListPSO.size() ["+replListPSO.size()+"] replListDSO.size() ["+replListDSO.size()+"] pickList.size()"+pickList.size());
/*//if(replList.size() > 0)
......@@ -4648,9 +4686,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if (errString == null || errString.trim().length() == 0)
{
String dspRefId = updateWaveTaskDet(waveId,4,saleOrder,"","",ptcnID,conn);
errString = updateShipment(headerDom, detailDom,waveId,saleOrder,dspRefId,tranCode,transMode, xtraParams, conn);
//changed by Rohan on 20-06-13 for return errorstring
//return errString;
return errString = updateShipment(headerDom, detailDom,waveId,saleOrder,dspRefId,tranCode,transMode, xtraParams, conn);
}
else
......@@ -4735,6 +4771,19 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
//if(errString == null && !(errString.trim().length() > 0))
//Chnaged By Rohan on 21-06-13 for bug fixing.start
/*
if (errString == null || errString.trim().length() == 0)
{
//changed by sumit on 23/08/12 update wave_status
//errString = updateWaveSatus(waveId, conn);
errString = updateWaveSatus(waveId,directPickLoc, conn);
}
else
{
return errString;
}
*/
if (errString == null || errString.trim().length() == 0)
{
//changed by sumit on 23/08/12 update wave_status
......@@ -4747,20 +4796,19 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{
return errString;
}
//Chnaged By Rohan on 21-06-13 for bug fixing.end
}
catch(Exception e)
{
System.out.println("Exception :updateWaveTask :" + insertSql + "\n" +e.getMessage());
e.printStackTrace();
//Changed by Rohan on 20-06-13 to throw item exception.strat.start
//Changed by Rohan on 21-06-13 to throw item exception.strat.start
/*
errString = e.getMessage();
throw e;
*/
throw new ITMException(e);
//Changed by Rohan on 20-06-13 to throw item exception.strat.start
}
finally
{
......@@ -4775,17 +4823,16 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
catch(Exception e)
{
e.printStackTrace();
//Changed by Rohan on 20-06-13 to throw item exception.strat.start
//Changed by Rohan on 21-06-13 to throw item exception.strat.start
/*
errString = e.getMessage();
throw e;
*/
throw new ITMException(e);
//Changed by Rohan on 20-06-13 to throw item exception.end
}
}
//Changed by Rohan on 20-06-13 for retun errorstring above in code
//Changed by Rohan on 21-06-13 for retun errorstring above in code
//return errString;
}
//Changed by sumit sarkar on 28/08/2011 [ WM1ESUN006 ] for creating ref_id start.
......@@ -4899,6 +4946,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String expLevel = "";
java.sql.Date orderDate = new java.sql.Date( System.currentTimeMillis() );
PreparedStatement pstmt = null;
PreparedStatement pstmtCart = null;
PreparedStatement pstmtDet = null;
PreparedStatement pstmtRplHdr = null;
PreparedStatement pstmtRplDet = null;
......@@ -4907,8 +4955,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
PreparedStatement pstmtIssDet = null;
PreparedStatement pstmtUpdWave = null ;
PreparedStatement pstmtPickHdr = null;
//Changed By Pragyan 26/02/13 To insert Repl Iss Hdr & Detail.end
PreparedStatement pstmtInsertData = null;
PreparedStatement pstmtInsertData1 = null;
PreparedStatement pstmtInsertTran = null;
PreparedStatement pstmtDt = null;
ResultSet rsD = null;
ResultSet resSet = null ;
ResultSet rSet = null ;
Double quantity;
......@@ -4918,6 +4971,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
ArrayList allMasterList = new ArrayList();
ArrayList allStockToDockList = new ArrayList();
ArrayList allItemPickkList = null;
masterOrParclNoList = new ArrayList();
//ArrayList allParcelList=new ArrayList();
double palletVolume = 0.0;
double palletMaxWeight = 0.0;
......@@ -4976,7 +5031,23 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed By Pragyan 26/04/13 to store actve maps.start
TreeMap activeListItemWizMap = new TreeMap<String, ArrayList<HashMap>>();
ArrayList newTempActPickList = null;
//Changed By Rekha WM3BSUN006 20/05/13 To get the SOAP connection.start
ADSIShippingLocator locator = null;
ADSIShippingSoap soap = null;
Shipment2 shipment2 = null;
Address recipient = null;
Package2 pkg2 = null;
CommodityInfo comInfo = null;
Package2[] packgeList = null;
ArrayList<CommodityInfo> comodityInfoList = new ArrayList<CommodityInfo>();
String adsiShippingURL = "";
String siteCodeShip = "",stateCodeDlv = ""
,custName="",custShName = "",shipCity="",shipCountry = "",shipAdd1 = "",shipAdd2 = "",
shipAdd3 = "",shipPh="",shipFax ="",shipMailId = "",custPord = "",harmonizCode = "",harmonizDescr="",originCountry ="",serviceCode="",pin ="",shipmentType = "";
double unitValue = 0.0;
//Changed By Rekha WM3BSUN006 20/05/13 To get the SOAP connection.end
try
{
......@@ -5186,6 +5257,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("Finally mPackAllow["+mPackAllow+"]pPickAllow["+pPickAllow+"]");
//Changed By Pragyan 13/03/13.end
//double packSize = (Double)itmVolumeMap.get("PACK_SIZE");//How many item contains in the Case
packSize = (Double)itmVolumeMap.get("PACK_SIZE");//How many item contains in the Case
......@@ -5490,7 +5562,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
double packSize = 10;*/
//Logic stands clear.start
int allMasterListlen = allMasterList.size();
System.out.println("length of masterlistlen is"+allMasterListlen);
if(!"Y".equalsIgnoreCase(pPickAllow))
{
......@@ -5614,6 +5686,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
double caseToBeStore = Math.floor(remainingWeight / caseWeight);
double caseToBeStore1 = Math.floor(remainingVolume / caseVolume);
System.out.println("casetobestore is :"+Math.floor(remainingWeight / caseWeight));
System.out.println("caseToBeStore1 is :"+Math.floor(remainingVolume / caseVolume));
System.out.println("casetobestore in round :"+Math.round(remainingWeight / caseWeight));
System.out.println("casetobestore in round :"+Math.round(remainingVolume / caseVolume));
if(caseToBeStore > caseToBeStore1)
{
caseToBeStore = caseToBeStore1;
......@@ -6595,6 +6671,134 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by Rohan on 16/08/12 to generate error if customer to not accept actives.end
}
System.out.println("parcel pack value is :"+pPickAllow);
System.out.println("master pack value is :"+mPackAllow);
//Changed By Rekha WM3BSUN006 20/05/13 To get the SOAP connection Iff parcel pick 'Y' or Master Pack 'Y'.start
//if("Y".equalsIgnoreCase(mPackAllow) || "Y".equalsIgnoreCase(pPickAllow))
if( ("Y".equalsIgnoreCase(mPackAllow) || "Y".equalsIgnoreCase(pPickAllow)))
{
adsiShippingURL = discommon.getDisparams("999999","WMS_ADSI_SOAP_URL",conn);
long timeBefore = System.currentTimeMillis();
locator = new ADSIShippingLocator();
soap = locator.getADSIShippingSoap(new URL(adsiShippingURL));
long timeAfter = System.currentTimeMillis();
String defPh="";
System.out.println("Differance In Tme for connecting to ADSI Server time differance in seconds["+(timeAfter-timeBefore)/1000+"]");
if(soap.testADSIServer())
{
System.out.println("---ADSI Server Connected---");
shipment2 = new Shipment2();
recipient = new Address();//To set the Address
custName = (String)transportInfoMap.get("CUST_NAME");
custShName = (String)transportInfoMap.get("SH_NAME");
shipAdd1 = (String)transportInfoMap.get("ADDR1");
shipAdd2 = (String)transportInfoMap.get("ADDR2");
shipAdd3 = (String)transportInfoMap.get("ADDR3");
shipCity = (String)transportInfoMap.get("CITY");
stateCodeDlv = (String)transportInfoMap.get("STATE_DLV");
shipCountry = (String)transportInfoMap.get("COUNT_CODE");
shipPh = (String)transportInfoMap.get("PHONE");
shipMailId = (String)transportInfoMap.get("EMAIL_ID");
shipFax = (String)transportInfoMap.get("FAX");
custPord = (String)transportInfoMap.get("CUST_PORD");
serviceCode = (String)transportInfoMap.get("SERVICE_CODE");
pin = (String)transportInfoMap.get("PIN");
shipmentType = (String)transportInfoMap.get("SHIPMENT_TYPE");
//Setting Shipment ID
shipment2.setID(waveId);
recipient.setID(custCodeDlv);//Customer Code
recipient.setContact(custName);//Customer Name
recipient.setCompany(custShName);//Customer Company Name
recipient.setAddress1(shipAdd1);//Customer Adress1
recipient.setAddress2(shipAdd2);//Customer Adress2
recipient.setAddress3(shipAdd3);//Customer Adress3
recipient.setCity(shipCity);//Customer Adress City
recipient.setState(stateCodeDlv);//Customer Adress State
Country country = soap.getCountry("ISO3", shipCountry).getResponseCountry();
recipient.setCountry(country);//Customer Adress Country
defPh = discommon.getDisparams("999999","SHIPPER_DEFAULT_PH",conn);
if(shipPh == null || shipPh.trim().length()== 0)
{
recipient.setPhone(defPh);
}
else
{
recipient.setPhone(shipPh);
}
System.out.println("phone no is: "+recipient.getPhone());
recipient.setEMail(shipMailId);
recipient.setFax(shipFax);
recipient.setPostalCode(pin);
System.out.println("pin code is :"+recipient.getPostalCode());
shipment2.setRecipient(recipient);
System.out.println("service code "+serviceCode);
//HardCoded valus needs to be change later.
com.adsionline.ADSIShippingWS.Service service = new com.adsionline.ADSIShippingWS.Service();
//service.setFriendlyName(serviceCode);
service.setFriendlyName(serviceCode);
//service.setSymbol(serviceCode);
//System.out.println("Service symbol is :"+service.getSymbol());
shipment2.setService(service);
System.out.println("Service name is :"+shipment2.getService());
System.out.println("Service code is :"+serviceCode);
shipment2.setTerms(EnumTerms.trmSHIPPER);
//HardCoded valus needs to be change later.
shipment2.setSignatureReleaseFlag(false);//false As per Taro
shipment2.setSignatureRequiredFlag(false);//true Required As per Taro
shipment2.setSaturdayDeliveryFlag(false);// Taro Need To clerify "what is based on service level?"
java.util.Date date = new java.util.Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
shipment2.setShipDate(calendar);
shipment2.setConsigneeAccount("");//Not Required As per Taro
shipment2.setThirdPartyBillingFlag(false);//Not Required As per Taro
shipment2.setThirdPartyBillingAccount("");//Not Required As per Taro
Address addrs = new Address();//Need to capture if required
shipment2.setThirdPartyBillingAddress(addrs);//Not Required As per Taro
shipment2.setHALFlag(false);//Need clarification from Taro
shipment2.setHALAddress(addrs);//Need clarification from Taro
shipment2.setManifestAction(EnumManifestAction.maRELEASE);//As per taro by default its maRELEASE
shipment2.setConsigneeBillingFlag(false);//As per Taro Not Required
shipment2.setConsigneeBillingFlag(false);//As per Taro Not Required
shipment2.setShipperReference(ptcn);//As per Taro use PTCN(Pick Ticket Control No)
shipment2.setConsigneeReference(custPord);//As per Taro it is sorder.cust_pord
if(shipmentType != null && shipmentType.trim().length() > 0)
{
shipment2.setShipperName(shipmentType);
}
else
{
shipment2.setShipperName("Taro Commercial");//Needs to change after clarity
}
shipment2.setTimeInTransit(EnumTimeInTransit.tntFOREVER);//As per taro its tntFOREVER
shipment2.setSaturdayDeliveryFlag(false);//Need to discuss with Taro
}
else
{
System.out.println("---ADSI Server Not Connected throw error---");
errString = itmDBAccessEJB.getErrorString("","ADSISRVERR","","",conn);
return errString;
}
}
//Changed By Rekha WM3BSUN006 20/05/13 To get the SOAP connection Iff parcel pick 'Y' or Master Pack 'Y'.end
////
......@@ -7771,13 +7975,31 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
ctrMaster++;
}
String nafFlag ="";
if((!"Y".equalsIgnoreCase(pPickAllow)))
{
int allMasterListlen = allMasterList.size();
String masterCartonNo = "";
//Change For ADSI
CommodityInfo[] infoCom = null;
String itmLen = null;
String itmWidth= null;
String itmHeight = null;
PreparedStatement pstmt2 = null;
ResultSet rs2 = null;;
String sqlSize=null;
nafFlag = discommon.getDisparams("999999","NAFTA_FLAG_COUNT",conn);
double slength = 0;
double width =0;
double height=0;
packgeList = new Package2[allMasterListlen];
sqlSize = "SELECT LENGTH , WIDTH , HEIGHT FROM PACKING WHERE PACK_CODE = (SELECT PACK_CODE FROM CARTON_MASTER WHERE CARTON_NO = ? )";
pstmt2 = conn.prepareStatement(sqlSize);
for(int j = 0 ;j < allMasterListlen ; j++)
{
pkg2 = new Package2();
caseWeightTotal = 0.0;
caseVolumeTotal = 0.0;
ArrayList tempList = (ArrayList)allMasterList.get(j);
......@@ -7806,18 +8028,123 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("CURRENT CASE VOLUME TOTAL["+caseVolumeTotal+"]");
masterCartonNo = updateCartonMaster(packRefId, j + 1,Double.parseDouble("1"),ptcn,"M-PACK", xtraParams, conn,caseWeightTotal,caseVolumeTotal,pickType,"");
//Change For ADSI.start
NameValuePair[] additionalFields = new NameValuePair[1];
additionalFields[0] = new NameValuePair("carton_no", masterCartonNo);
//CHANGE BY REKHA ON 23-05-13
masterOrParclNoList.add(masterCartonNo);
pkg2.setID(masterCartonNo);
pkg2.setWeight(caseWeightTotal);
pstmt2.setString(1, masterCartonNo);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
slength =rs2.getDouble("LENGTH");
width = rs2.getDouble("WIDTH");
height =rs2.getDouble("HEIGHT");
}
pstmt2.clearParameters();
String strlen = ""+slength;
String widthStr = ""+width;
String heightStr = ""+height;
strlen = Double.toString(slength);
widthStr=Double.toString(width);
heightStr = Double.toString(height);
/*itmLen = rs.getDouble("ITEM_LEN");
itmWidth = rs.getDouble("ITEM_WID");
itmHeight = rs.getDouble("ITEM_HEIGHT");*/
pkg2.setDimension(slength+"x"+widthStr+"x"+heightStr);
System.out.println("Dimension of master package :"+pkg2.getDimension());
pkg2.setTrackingNumber("");//Not Required Optional
pkg2.setDescription("Pharmaceuticals");//As per Taro
pkg2.setOversizeFlag(false);//As per Taro
pkg2.setDeclaredValueFlag(false);//As per Taro
pkg2.setDeclaredValueAmount(0.0);//As per Taro not required
pkg2.setDeclaredValueCustoms(0.0);//As per Taro not required
pkg2.setBillOfLadingComment("");//As per Taro not required
pkg2.setAdditionalHandlingFlag(false);//As per Taro false
pkg2.setPackaging(EnumPackageType.pkgCUSTOM);//As per Taro default pkgCUSTOM
pkg2.setCODFlag(false);//As per Taro false
pkg2.setCODAmount(0.0);//As per Taro not required
pkg2.setCODPaymentType(0);//As per Taro not required
Address addr = new Address();
pkg2.setCODReturnAddress(addr);//As per Taro not required
pkg2.setAdditionalFields(additionalFields);
//Change For ADSI.end
infoCom = new CommodityInfo[tempList.size()];
for(int k =0 ; k < tempList.size() ; k++)
{
HashMap tempMap = (HashMap)tempList.get(k);
itemCode = (String)tempMap.get("item_code");
lotNo = (String)tempMap.get("lot_no");
noArt = (String)tempMap.get("no_art");
System.out.println("Item Name["+itemCode+"]");
System.out.println("No Of Art["+noArt+"]");
System.out.println("Alloc Qty["+tempMap.get("alloc_qty")+"]");
itmVolumeMap = getItemVoumeMap(itemCode,"",conn);
packSizeCase = (Double)itmVolumeMap.get("PACK_SIZE");
perItemVolume = (Double)itmVolumeMap.get("ITEM_SIZE");
caseVolume = (Double)itmVolumeMap.get("LOT_SIZE");
caseWeight = (Double)itmVolumeMap.get("PACK_WEIGHT");
itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT");
hazardous = (String)itmVolumeMap.get("HAZARDOUS");
harmonizCode = (String)itmVolumeMap.get("HARMONIZATION_NO");
harmonizDescr = (String)itmVolumeMap.get("HARMONIZATION_DESCR");
originCountry = (String)itmVolumeMap.get("ORIGIN_COUNTRY");
/*itmLen = itmVolumeMap.get("ITEM_LEN").toString();
itmWidth = (String)itmVolumeMap.get("ITEM_WID").toString();
itmHeight = (String)itmVolumeMap.get("ITEM_HEIGHT").toString();*/
unitValue = getRateStdoum(saleOrder, itemCode, conn);
ArrayList valList = (ArrayList)mapItemPick.get(itemCode);
int valListLen = valList.size();
if("Y".equalsIgnoreCase(hazardous))
{
pkg2.setHazmatFlag(true);
}
else
{
pkg2.setHazmatFlag(false);
}
comInfo = new CommodityInfo();
comInfo.setDescription(harmonizDescr);//As per taro Harmonization description
comInfo.setQuantity(Double.parseDouble(noArt) * packSizeCase);
//comInfo.setQuantity();
comInfo.setHarmonizedCode(harmonizCode);//As per Taro Haromonization code
comInfo.setUnitValue(unitValue);
comInfo.setUnitWeight(caseWeight);
Country originCountryMfg = soap.getCountry("ISO3", originCountry).getResponseCountry();
comInfo.setOriginCountry(originCountryMfg);
//change by rekha on 31-05-13 start
System.out.println("VALUES IN NAFTA VALUES "+nafFlag);
if(nafFlag.indexOf(shipCountry) != -1)
{
comInfo.setNaftaFlag(true);
System.out.println("available in disparm");
}
else
{
System.out.println("not in disparm");
comInfo.setNaftaFlag(false);//False as Per Taro Need To change canda/Mexico as true.
}
Calendar calendar = Calendar.getInstance();
comInfo.setExportNumberExpireDate(calendar);
comInfo.setUnitOfMeasure(EnumUnitOfMeasure.uomPCS);
infoCom[k] = comInfo;
for(int vCtr = 0; vCtr < valListLen;vCtr++)
{
HashMap vMap = (HashMap)valList.get(vCtr);
......@@ -7840,7 +8167,15 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
vMap.put("no_art", currentnoArt - Double.parseDouble(noArt));
}
comodityInfoList.add(comInfo);
}
System.out.println("Commodity Info List"+infoCom.toString());
//CommodityInfo[] infoCom = (CommodityInfo[])comodityInfoList.toArray();
//infoCom[0] = comInfo;
pkg2.setCommodityInfos(infoCom);
packgeList[j] = pkg2;
}
......@@ -7849,8 +8184,174 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
updatePalletNo(ptcn, palletNo, conn);
}
if(pstmt2 != null)
{
pstmt2.close();
pstmt2 = null;
}
if(rs2 != null)
{
rs2.close();
rs2 = null;
}
}
else
{
//Change by rekha on 21-05-13 start
System.out.println("parcel pick value is :"+pPickAllow);
String sqlQuery = "";
double rateStdOum = 0.0;
PreparedStatement pstmt1 = null;
ResultSet rs = null;
String lotLen=null;
String lotWidth=null;
String lotHeight = null;
TreeMap<String, String> tempMap = new TreeMap<String, String> ();
System.out.println("parcel pick value is in try :"+pPickAllow);
sqlQuery = "SELECT ITEM_CODE,CARTON_NO FROM CARTON_MASTER WHERE PTCN = ? AND CARTON_TYPE ='P' ORDER BY CARTON_NO";
pstmt1 = conn.prepareStatement(sqlQuery);
pstmt1.setString(1, ptcn);
rs = pstmt1.executeQuery();
while(rs.next())
{
String cartonNo = rs.getString("CARTON_NO");
itemCode = rs.getString("ITEM_CODE");
tempMap.put(cartonNo, itemCode);
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
Set keySetCarton = tempMap.keySet();
Iterator itemIterator= keySetCarton.iterator();
int n=tempMap.size();
String masterCartonNo = "";
packgeList = new Package2[n];
int Ctr=0;
String tempItem = "";
String tempKey = "";
String tempValue = "";
int cnt=0;
while(itemIterator.hasNext())
{
tempKey = (String)itemIterator.next();
tempValue =(String)tempMap.get(tempKey);
System.out.println("parcel pick value is in while :"+tempKey+"]["+tempValue);
if(!tempItem.equalsIgnoreCase(tempValue))
{
System.out.println("tempKey value is in tempValue :"+tempKey);
tempItem = tempValue;
itmVolumeMap = getItemVoumeMap(tempValue,"",conn);
packSizeCase = (Double)itmVolumeMap.get("PACK_SIZE");
caseWeight = (Double)itmVolumeMap.get("PACK_WEIGHT");
itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT");
hazardous = (String)itmVolumeMap.get("HAZARDOUS");
harmonizCode = (String)itmVolumeMap.get("HARMONIZATION_NO");
harmonizDescr = (String)itmVolumeMap.get("HARMONIZATION_DESCR");
originCountry = (String)itmVolumeMap.get("ORIGIN_COUNTRY");
lotLen = itmVolumeMap.get("LITEM_LEN").toString();
lotWidth = (String)itmVolumeMap.get("LITEM_WID").toString();
lotHeight = (String)itmVolumeMap.get("LITEM_HEIGHT").toString();
unitValue = getRateStdoum(saleOrder, tempValue, conn);
}
NameValuePair[] additionalFields = new NameValuePair[1];
additionalFields[0] = new NameValuePair("carton_no", tempKey);
masterOrParclNoList.add(tempKey);
pkg2 =new Package2();
pkg2.setID(tempKey);
pkg2.setWeight(caseWeight);
//pkg2.setDimension("10x10x10");//Hard Coded Need to change.
/*lotLen = ""+rs.getDouble("LITEM_LEN");
lotWidth = ""+rs.getDouble("LITEM_WID");
lotHeight = ""+rs.getDouble("LITEM_HEIGHT");*/
pkg2.setDimension(lotLen+"x"+lotWidth+"x"+lotHeight);
//pkg2.setDimension(lotLen+""+lotWidth*lotHeight);
//pkg2.setDimension(String("lotLen") "x" String("lotWidth") "x" String("lotHeight"));
System.out.println("Dimension of package in parcel:"+pkg2.getDimension());
pkg2.setDescription("Pharmaceuticals");//As per Taro
pkg2.setOversizeFlag(false);//As per Taro
pkg2.setDeclaredValueFlag(false);//As per Taro
pkg2.setDeclaredValueAmount(0.0);//As per Taro not required
pkg2.setDeclaredValueCustoms(0.0);//As per Taro not required
pkg2.setBillOfLadingComment("");//As per Taro not required
pkg2.setAdditionalHandlingFlag(false);//As per Taro false
pkg2.setPackaging(EnumPackageType.pkgCUSTOM);//As per Taro default pkgCUSTOM
pkg2.setCODFlag(false);//As per Taro false
pkg2.setCODAmount(0.0);//As per Taro not required
pkg2.setCODPaymentType(0);//As per Taro not required
pkg2.setAdditionalFields(additionalFields);
if("Y".equalsIgnoreCase(hazardous))
{
pkg2.setHazmatFlag(true);
}
else
{
pkg2.setHazmatFlag(false);
}
Address addr = new Address();
pkg2.setCODReturnAddress(addr);//As per Taro not required NAFTA_FLAG_COUNT
nafFlag = discommon.getDisparams("999999","NAFTA_FLAG_COUNT",conn);
CommodityInfo[] infoCom1 = new CommodityInfo[1] ;
comInfo = new CommodityInfo();
comInfo.setDescription(harmonizDescr);
comInfo.setQuantity(Double.parseDouble(noArt) * packSizeCase);
comInfo.setHarmonizedCode(harmonizCode);//As per Taro Haromonization code
comInfo.setUnitValue(unitValue);
comInfo.setUnitWeight(itemWeight);
Country originCountryMfg = soap.getCountry("ISO3", originCountry).getResponseCountry();
comInfo.setOriginCountry(originCountryMfg);
if(nafFlag.indexOf(shipCountry) != -1)
{
comInfo.setNaftaFlag(true);
System.out.println("available in disparm");
}
else
{
System.out.println("not in disparm");
comInfo.setNaftaFlag(false);//False as Per Taro Need To change canda/Mexico as true.
}
Calendar calendar = Calendar.getInstance();
comInfo.setExportNumberExpireDate(calendar);
comInfo.setUnitOfMeasure(EnumUnitOfMeasure.uomLB);
infoCom1[0] = comInfo;
pkg2.setCommodityInfos(infoCom1);
packgeList[Ctr]=pkg2;
Ctr++;
}
System.out.println("parcel pick value is in next while"+Ctr);
}
//Change by rekha on 21-05-13 end
}
System.out.println("allActivesListLen::::"+allActivesList.toString());
......@@ -8917,7 +9418,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("Inside loc_in_stat---->");
if(!isReplHdrRSV)
{
replRefDeepId = updateWaveTaskDet(waveID,1,saleOrder,"RP-ACT","E",ptcn,conn);
replRefDeepId = updateWaveTaskDet(waveId,1,saleOrder,"RP-ACT","E",ptcn,conn);
pstmtRplHdr.setString(1,replRefDeepId);
//pstmtRplHdr.setString(9,"Q");
pstmtRplHdr.setString(9,"T");
......@@ -9106,6 +9607,329 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
//change by rekha on 23-05-13 start
//if(packgeList.length != 0 || packgeList.length > 0)
if("P".equalsIgnoreCase(waveMode) && packgeList != null && packgeList.length > 0)
{
BASE64Decoder decoder = new BASE64Decoder();
Timestamp currDate = new Timestamp(System.currentTimeMillis());
shipment2.setPackages2(packgeList);
ShipmentResultReturn2 objReturn2 = soap.shipWithLabel(shipment2, ShipWithLabelType.PNG, ImageRotation.Rotation_180);
System.out.println("Is successfully Executed ["+objReturn2.isSuccess()+"]");
System.out.println("Message String ["+objReturn2.getMessage()+"]");
if(!objReturn2.isSuccess())
{
errString = getError(saleOrder + "[" + objReturn2.getMessage() +"]", "ADSISRVERR", conn);
return errString;
}
else
{
//Updating ADSI getting the images.start
String serviceSymbol = "";
String carrierSymbol = "";
String carrierFriendlyName = "";
ShipmentResult2 objShipResult = objReturn2.getShipmentResultResponse2();
int lenPacakges = objShipResult.getPackageResults2().length;
String value = "";
String pckgId = "";
String trackNo="";
double msnNo=0.0;
ResultSet rs = null ;
String imagePath =null;
serviceSymbol = objShipResult.getServiceSymbol();
System.out.println("serviceSymbol["+serviceSymbol+"]");
carrierSymbol = serviceSymbol.substring(0,serviceSymbol.lastIndexOf(".") );
System.out.println("Carrier Symbol ["+carrierSymbol+"]");
Carrier[] carr = soap.getCarriers().getCarrierList();
for(int j = 0;j<carr.length;j++)
{
Carrier carr1 = carr[j];
System.out.println("Carrier Symbol["+carr1.getSymbol());
System.out.println("Friendly Name["+carr1.getFriendlyName());
System.out.println("Short Name["+carr1.getShortName());
if(carr1.getSymbol().equalsIgnoreCase(carrierSymbol))
{
carrierFriendlyName = carr1.getFriendlyName();
break;
}
}
System.out.println("Carrier Symbol ["+carrierFriendlyName+"]");
imagePath = discommon.getDisparams("999999","SHIP_WITH_PATH",conn);
for(int pCtr=0;pCtr < lenPacakges;pCtr++)
{
PackageResult2 pkg2frm = (PackageResult2)objShipResult.getPackageResults2()[pCtr];
value = pkg2frm.getBase64Label();
pckgId = pkg2frm.getPackageID();
//change by rekha on 23-05-13.start
pkg2frm.getAdditionalFields();
trackNo = pkg2frm.getTrackingNumber();
for(int Cadd=0;Cadd<pkg2frm.getAdditionalFields().length;Cadd++)
{
System.out.println("additional fields are Name:"+pkg2frm.getAdditionalFields()[Cadd].getName());
System.out.println("additional fields are Value:"+pkg2frm.getAdditionalFields()[Cadd].getValue());
}
//change by rekha on 23-05-13. end
String cnumber = (String) masterOrParclNoList.get(pCtr);
System.out.println("cnumber is :"+cnumber);
System.out.println("Package ID["+pckgId+"]");
System.out.println("Tracking No ["+pkg2frm.getTrackingNumber()+"]");
System.out.println("BASE64lABEL Length["+value.length()+"]");
System.out.println("Package id for carton no is :[" +decoder.decodeBuffer(pckgId) +"]");
msnNo = pkg2frm.getMSN();
System.out.println("MSN NO IN EACH PACKAGE IS :" +msnNo);
byte[] imgBytes = decoder.decodeBuffer(value);
System.out.println("IMAGE Byte Length ["+imgBytes.length+"]");
BufferedImage bufImg = ImageIO.read(new ByteArrayInputStream(imgBytes));
File imgOutFile = new File(imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+cnumber +".png");
String path = imgOutFile.getPath();
System.out.println("Get Path ["+path+"]");
//path = path.substring(0,path.lastIndexOf(File.separator));
//System.out.println("after Path ["+path+"]");
File createFolder = new File(path);
if(!createFolder.exists())
{
createFolder.mkdirs();
}
//UPDATE CARTON MASTER TRACKING NO , IMAGENAME PATH,
/*sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? , SHIP_LABEL= ? , MSN_NO =?"
+ " WHERE CARTON_NO = ?"; */
sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? , SHIP_LABEL= ? , MSN_NO =?,CARRIER_SYMBOL = ? , CARRIER_FRIENDLYNAME = ?"
+ " WHERE CARTON_NO = ?";
pstmtCart = conn.prepareStatement(sql);
pstmtCart.setString(1, trackNo);
pstmtCart.setString(2, path );
pstmtCart.setDouble(3, msnNo);
pstmtCart.setString(4, carrierSymbol);
pstmtCart.setString(5, carrierFriendlyName);
pstmtCart.setString(6, cnumber);
System.out.println("carton number in for loop: "+cnumber);
System.out.println("msn no for pkg result is :" +msnNo);
int test = pstmtCart.executeUpdate();
System.out.println("update statement is :"+test);
if(test==1)
{
System.out.println("updated");
}
else
{
System.out.println("not updated");
}
imgOutFile.createNewFile();
ImageIO.write(bufImg, "png", imgOutFile);
System.out.println("Write File Complete----");
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
OutputStream file = new FileOutputStream(imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+"Ship"+".ser" );
OutputStream buffer = new BufferedOutputStream( file );
ObjectOutput output = new ObjectOutputStream( buffer );
output.writeObject(shipment2);
output.flush();
output.close();
file = new FileOutputStream( imagePath+ File.separator+"Ship_Label"+File.separator+ ptcn + File.separator + ptcn+"_"+"ShipRslt"+".ser" );
buffer = new BufferedOutputStream( file );
output = new ObjectOutputStream( buffer );
output.writeObject(objReturn2);
output.flush();
output.close();
if("Y".equalsIgnoreCase(mPackAllow) || "Y".equalsIgnoreCase(pPickAllow))
{
//String windowName="w_wave_stat_org";
String tranId="";
String sqlInsertDt=null;
int lineNo = 1;
String cartonNo = "";
String pickOrder = "";
String refSer = "";
String refId = "";
String cartonType = "";
String packCode = "";
String masterCarton = "";
String itmCode = "";
String weight = "";
String trackingNo = "";
String shipLabel = "";
String lineNoPick = "";
String new_trackingNo = "";
String new_shipLabel = "";
tranId = getTranId("w_wave_stat_org", conn);
/*serviceSymbol = objShipResult.getServiceSymbol();
System.out.println("serviceSymbol["+serviceSymbol+"]");
carrierSymbol = serviceSymbol.substring(0,serviceSymbol.lastIndexOf(".") );
System.out.println("Carrier Symbol ["+carrierSymbol+"]");
Carrier[] carr = soap.getCarriers().getCarrierList();
for(int j = 0;j<carr.length;j++)
{
Carrier carr1 = carr[j];
System.out.println("Carrier Symbol["+carr1.getSymbol());
System.out.println("Friendly Name["+carr1.getFriendlyName());
System.out.println("Short Name["+carr1.getShortName());
if(carr1.getSymbol().equalsIgnoreCase(carrierSymbol))
{
carrierFriendlyName = carr1.getFriendlyName();
break;
}
}*/
//sqlInsertData = "INSERT INTO WAVE_STATUS_ORG (TRAN_ID, WAVE_ID,TRAN_CODE,PTCN,CHG_USER,CHG_DATE,CHG_TERM,PRINT_STATUS)"+
// " VALUES (?,?,?,?,?,?,?,?)";
sqlInsertData = "INSERT INTO WAVE_STATUS_ORG (TRAN_ID, WAVE_ID,TRAN_CODE,PTCN,CHG_USER,CHG_DATE,CHG_TERM,PRINT_STATUS,CARRIER_SYMBOL,CARRIER_FRIENDLYNAME)"+
" VALUES (?,?,?,?,?,?,?,?,?,?)";
pstmtInsertData = conn.prepareStatement(sqlInsertData);
pstmtInsertData.setString(1,tranId);
pstmtInsertData.setString(2,waveID);
pstmtInsertData.setString(3,tranCode);
pstmtInsertData.setString(4,ptcn);
pstmtInsertData.setString(5,chgUser);
pstmtInsertData.setTimestamp(6,currDate);
pstmtInsertData.setString(7,chgTerm);
pstmtInsertData.setString(8,"Y");
pstmtInsertData.setString(9,carrierSymbol);
pstmtInsertData.setString(10,carrierFriendlyName);
//Chnaged by sumit on 03/04/12
pstmtInsertData.addBatch();
sqlInsertDt = "SELECT CARTON_NO,PICK_ORDER,LINE_NO__PICK,CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE,TRACKING_NO,SHIP_LABEL FROM CARTON_MASTER WHERE PTCN = ? ORDER BY ITEM_CODE";
sqlInsertData1 = "INSERT INTO WAVE_STATUS_ORG_DET (TRAN_ID, LINE_NO,PTCN,CARTON_NO," +
" PICK_ORDER, LINE_NO__PICK ,REF_SER, REF_ID, " +
" CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE, " +
"WEIGHT,TRACKING_NO, SHIP_LABEL )"+
" VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,? , ?,?, ?)";
pstmtInsertData1 = conn.prepareStatement(sqlInsertData1);
pstmtDt = conn.prepareStatement(sqlInsertDt);
pstmtDt.setString(1, ptcn);
rsD = pstmtDt.executeQuery();
ArrayList test = new ArrayList();
String tempItem = "";
while(rsD.next())
{
//tranId =rsD.getString("TRAN_ID");
//lineNo = rsD.getInt("LINE_NO");
cartonNo = rsD.getString("CARTON_NO");
pickOrder = rsD.getString("PICK_ORDER");
lineNoPick = rsD.getString("LINE_NO__PICK");
// refSer = rsD.getString("REF_SER");
// refId = rsD.getString("REF_ID");
cartonType = rsD.getString("CARTON_TYPE");
packCode = rsD.getString("PACK_CODE");
masterCarton = rsD.getString("MASTER_CARTON");
itmCode=rsD.getString("ITEM_CODE");
//weight = rsD.getString("WEIGHT");
new_trackingNo = rsD.getString("TRACKING_NO");
if(itmCode != null && !tempItem.equalsIgnoreCase(itmCode))
{
tempItem = itmCode;
itmVolumeMap = getItemVoumeMap(itmCode,"",conn);
caseWeight = (Double)itmVolumeMap.get("PACK_WEIGHT");
itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT");
}
new_shipLabel = rsD.getString("SHIP_LABEL");
System.out.println("carton no in while loop :" +cartonNo);
System.out.println("tracking no in while loop :"+new_trackingNo);
System.out.println("ship_label in while loop :"+new_shipLabel);
pstmtInsertData1.setString(1,tranId);
pstmtInsertData1.setInt(2,lineNo);
pstmtInsertData1.setString(3,ptcn);
pstmtInsertData1.setString(4,cartonNo);
pstmtInsertData1.setString(5,pickOrder);
pstmtInsertData1.setString(6,lineNoPick);
pstmtInsertData1.setString(7,refSer);
pstmtInsertData1.setString(8,refId);
pstmtInsertData1.setString(9,cartonType);
pstmtInsertData1.setString(10,packCode);
pstmtInsertData1.setString(11,masterCarton);
pstmtInsertData1.setString(12,itmCode);
if(new_trackingNo == null || new_trackingNo.trim().length()==0)
{
pstmtInsertData1.setDouble(13,caseWeight);
pstmtInsertData1.setString(14,"");
pstmtInsertData1.setString(15,"");
}
else
{
pstmtInsertData1.setDouble(13,0.0);
pstmtInsertData1.setString(14,new_trackingNo);
pstmtInsertData1.setString(15,new_shipLabel);
}
pstmtInsertData1.addBatch();
lineNo++;
}
}
pstmtInsertData.executeBatch();
pstmtInsertData1.executeBatch();
pstmtInsertData.clearParameters();
pstmtInsertData1.clearParameters();
if( pstmtInsertData != null)
{
pstmtInsertData.close();
pstmtInsertData = null;
}
if( pstmtInsertData1 != null)
{
pstmtInsertData1.close();
pstmtInsertData1 = null;
}
// change by rekha on 29-05-13 end
}
}
//change by rekha on 23-05-13 end
//Updating ADSI getting the images.end
if( rSet != null )
{
rSet.close();
......@@ -9151,8 +9975,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtPickHdr = null;
}
}
catch(Exception e)
{
e.printStackTrace();
......@@ -10338,15 +11163,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
PreparedStatement pstmt = null;
//Changed By Pragyan 12/03/13 To set hazardous item check
String sql="",hazardous = "";
//Changed By Rekha To add columns required for ADSI
String harmonizCode = "",harmonizDescr = "",originCountry = "";
ResultSet rs = null;
double itmLen = 0,itmWidth = 0,itmHeight = 0,itemWeight = 0,lotLen = 0 ,lotHeight = 0,lotWidth = 0,lotWeight = 0;
HashMap dataVolumeMap = new HashMap();
try {
//Changed By Rekha To add columns required for ADSI
//Changed By Pragyan 12/03/13 To set hazardous item check
//sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_WEIGHT,"
//sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_WEIGHT,I.HAZARDOUS HAZARD, "
sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_WEIGHT,I.HAZARDOUS HAZARD, "
+" I.HARMONIZATION_NO HARMONIZATION_NO,I.HARMONIZATION_DESCR HARMONIZATION_DESCR,I.COUNT_CODE__MFG ORIGIN_COUNTRY,"
+" L.LENGTH LITEM_LEN,L.WIDTH LITEM_WID,L.HEIGHT LITEM_HEIGHT,L.SHIPPER_SIZE SHIPSIZE,L.GROSS_WEIGHT LOT_WEIGHT FROM"
+" ITEM I,ITEM_LOT_PACKSIZE L"
+" WHERE I.ITEM_CODE = L.ITEM_CODE"
......@@ -10381,6 +11211,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
lotHeight = rs.getDouble("LITEM_HEIGHT");
packSize = rs.getDouble("SHIPSIZE");
lotWeight = rs.getDouble("LOT_WEIGHT");
harmonizCode = rs.getString("HARMONIZATION_NO");
harmonizDescr = rs.getString("HARMONIZATION_DESCR");
originCountry = rs.getString("ORIGIN_COUNTRY");
}
//packSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight);
......@@ -10396,6 +11229,17 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
dataVolumeMap.put("HAZARDOUS", hazardous);
dataVolumeMap.put("ITEM_WEIGHT", itemWeight);
dataVolumeMap.put("PACK_WEIGHT", lotWeight);
dataVolumeMap.put("HARMONIZATION_NO", harmonizCode);
dataVolumeMap.put("HARMONIZATION_DESCR", harmonizDescr);
dataVolumeMap.put("ORIGIN_COUNTRY", originCountry);
dataVolumeMap.put("ITEM_LEN", itmLen);
dataVolumeMap.put("ITEM_WID", itmWidth);
dataVolumeMap.put("ITEM_HEIGHT", itmHeight);
dataVolumeMap.put("LITEM_LEN", lotLen);
dataVolumeMap.put("LITEM_WID", lotWidth);
dataVolumeMap.put("LITEM_HEIGHT", lotHeight);
if(pstmt != null)
......@@ -11501,7 +12345,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("Return Suggested Location will throw error == >["+suggLocCode+"]");
return suggestedLocList;
}
private HashMap getTransportInfo(String saleOrder,double perShipWeight ,double noArt,Connection conn) throws ITMException
/*private HashMap getTransportInfo(String saleOrder,double perShipWeight ,double noArt,Connection conn) throws ITMException
{
String sql = "";
String sql1 = "";
......@@ -11530,29 +12374,29 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pinFrm = getPinSite(siteCodeShip,conn);
pinTo = getPinCust(custCodeDlv,conn);
//Changed by Rohan on 30/06/12.start
/*
sql = "SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE FROM DISTROUTEDET A,DISTROUTE B "
+ " WHERE A.STAN_CODE__FR = ? AND A.STAN_CODE__TO = ? AND A.STATE_CODE__FR = ? AND A.STATE_CODE__TO = ?"
+ " AND A.DIST_ROUTE = B.DIST_ROUTE AND B.CUST_CODE = ? ";
*/
/*
sql = "SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE FROM DISTROUTEDET A,DISTROUTE B "
+ " WHERE A.STATE_CODE__FR = ? AND A.STATE_CODE__TO = ?"
+ " AND A.DIST_ROUTE = B.DIST_ROUTE AND B.CUST_CODE = ? ";
*/
//Changed by Rohan on 30/06/12.end
//pstmt = conn.prepareStatement(sql);
//Changed by Rohan on 30/06/12.start
/*
pstmt.setString(1,stanCodeFrm);
pstmt.setString(2,stanCodeCust);
pstmt.setString(3,stateCodeFrm);
pstmt.setString(4,stateCodeCust);
pstmt.setString(5,custCodeDlv);
rs = pstmt.executeQuery();
*/
/*
pstmt.setString(1,stateCodeFrm);
pstmt.setString(2,stateCodeCust);
pstmt.setString(3,custCodeDlv);
......@@ -11567,9 +12411,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
maxWeight = rs.getString("MAX_WEIGHT");
locType = rs.getString("LOC_TYPE");
}
*/
//Changed by Rohan on 30/06/12.start
/*
if("null".equalsIgnoreCase(tranCode) || (tranCode.trim().length()) == 0)
{
pstmt.setString(3," ");
......@@ -11582,8 +12426,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
locType = rs.getString("LOC_TYPE");
}
}
*/
/*else
else
{
if(pstmt != null)
{
......@@ -11610,7 +12454,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
locType = rs.getString("LOC_TYPE");
}
}*/
}
//change by Kunal Mandhre on 04/07/12 as per S Manoharan Sir instruction
......@@ -11687,7 +12531,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
maxWeight = rs.getString("MAX_WEIGHT");
locType = rs.getString("LOC_TYPE");
}
/*
else
{
if( rs != null )
......@@ -11909,7 +12753,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
}
*/
if( rs != null )
{
rs.close();
......@@ -11970,8 +12814,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
}
return transInfoMap;
}
}*/
//Changed By Pragyan 25/02/12 To implement changed parcel picking logic.start
//Changed by shankara on 13-06-13 for bug fixing.start
/*
......@@ -12372,10 +13215,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String pinTo = "",pinFrm = "";
HashMap stationInfoMap = null;
String dbShipType = "";
String serviceCode="";
String serviceCode = "";
String shipmentType = "";
try
{
HashMap sordMap = getSordInfo(saleOrder,conn);
siteCodeShip = (String)sordMap.get("SHIP_CODE");
stanCodeCust = (String)sordMap.get("STAN_CODE");
......@@ -12390,7 +13235,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if(("P".equalsIgnoreCase(pickType) && "P".equalsIgnoreCase(shipType)) || ("M".equalsIgnoreCase(pickType) && "M".equalsIgnoreCase(shipType)) )//|| "".equalsIgnoreCase(shipType) || "L".equalsIgnoreCase(shipType))
{
System.out.println("Sql Check 1 .............pickType["+pickType+"]shipType["+shipType+"]");
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE,T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B, TRANSPORTER T "
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE,T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B, TRANSPORTER T "
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
// + " AND ( A.STATE_CODE__TO = ? OR A.STATE_CODE__TO = ' ' ) AND (A.DIST_ROUTE = B.DIST_ROUTE) AND (B.CUST_CODE = ?) AND ( SHIP_TYPE = ?)" ;
......@@ -12400,7 +13245,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
else if(("P".equalsIgnoreCase(pickType) && "A".equalsIgnoreCase(shipType)) || ("M".equalsIgnoreCase(pickType) && "A".equalsIgnoreCase(shipType)) || "".equalsIgnoreCase(shipType) || "L".equalsIgnoreCase(shipType))
{
System.out.println("Sql Check 2 .............pickType["+pickType+"]shipType["+shipType+"]");
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE,T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B , TRANSPORTER T"
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE,T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B , TRANSPORTER T"
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
+ " AND ( A.STATE_CODE__TO = ? OR A.STATE_CODE__TO = ' ' ) AND A.DIST_ROUTE = B.DIST_ROUTE AND B.CUST_CODE = ?"
......@@ -12412,7 +13257,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{
System.out.println("Sql Check 3 .............pickType["+pickType+"]shipType["+shipType+"]");
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.SERVICE_CODE AS SERVICE_CODE , T.TRAN_CODE AS TRAN_CODE,T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B , TRANSPORTER T"
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.SERVICE_CODE AS SERVICE_CODE , T.TRAN_CODE AS TRAN_CODE,T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B , TRANSPORTER T"
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
+ " AND ( A.STATE_CODE__TO = ? OR A.STATE_CODE__TO = ' ' ) AND A.DIST_ROUTE = B.DIST_ROUTE AND B.CUST_CODE = ? "
......@@ -12481,7 +13326,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
maxWeight = rs.getString("MAX_WEIGHT");
locType = rs.getString("LOC_TYPE");
dbShipType = checkNull(rs.getString("SHIP_TYPE"));
serviceCode= rs.getString("SERVICE_CODE");
serviceCode = rs.getString("SERVICE_CODE");
shipmentType = rs.getString("SHIPMENT_TYPE");
}
else if(("P".equalsIgnoreCase(pickType) && "A".equalsIgnoreCase(shipType)) || ("M".equalsIgnoreCase(pickType) && "A".equalsIgnoreCase(shipType)))
{
......@@ -12491,7 +13337,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rs.close();
rs = null;
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B,TRANSPORTER T "
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B,TRANSPORTER T "
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
+ " AND ( A.STATE_CODE__TO = ? OR A.STATE_CODE__TO = ' ' ) AND A.DIST_ROUTE = B.DIST_ROUTE AND MIN_WEIGHT <= ? "
......@@ -12523,6 +13369,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
locType = rs.getString("LOC_TYPE");
dbShipType = checkNull(rs.getString("SHIP_TYPE"));
serviceCode= rs.getString("SERVICE_CODE");
shipmentType = rs.getString("SHIPMENT_TYPE");
}
else
......@@ -12534,7 +13381,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rs.close();
rs = null;
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B ,TRANSPORTER T"
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B ,TRANSPORTER T"
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
+ " AND ( A.STATE_CODE__TO = ? OR A.STATE_CODE__TO = ' ' ) AND A.DIST_ROUTE = B.DIST_ROUTE AND B.CUST_CODE = ? "
......@@ -12566,6 +13413,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
// CHANGE BY REKHA ON 27-05-13 ADD SERVICE_CODE START
serviceCode= rs.getString("SERVICE_CODE");
// CHANGE BY REKHA ON 27-05-13 ADD SERVICE_CODE END
shipmentType = rs.getString("SHIPMENT_TYPE");
}
else
{
......@@ -12575,7 +13423,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rs.close();
rs = null;
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B,TRANSPORTER T "
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B,TRANSPORTER T "
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
+ " AND ( A.STATE_CODE__TO = ? OR A.STATE_CODE__TO = ' ' ) AND A.DIST_ROUTE = B.DIST_ROUTE AND MIN_WEIGHT <= ? "
......@@ -12605,6 +13453,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
// CHANGE BY REKHA ON 27-05-13 ADD SERVICE_CODE START
serviceCode=rs.getString("SERVICE_CODE");
// CHANGE BY REKHA ON 27-05-13 ADD SERVICE_CODE END
shipmentType = rs.getString("SHIPMENT_TYPE");
}
pstmt.close();
......@@ -12629,7 +13478,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if(("P".equalsIgnoreCase(pickType) && "P".equalsIgnoreCase(shipType)) || ("M".equalsIgnoreCase(pickType) && "M".equalsIgnoreCase(shipType)) || "".equalsIgnoreCase(shipType) || "L".equalsIgnoreCase(shipType))
{
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE , T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B , TRANSPORTER T"
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE , T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B , TRANSPORTER T"
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
// + " AND ( A.STATE_CODE__TO = ? OR A.STATE_CODE__TO = ' ' ) AND A.DIST_ROUTE = B.DIST_ROUTE AND SHIP_TYPE = ?";
......@@ -12637,7 +13486,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
else if ("".equalsIgnoreCase(shipType) || "L".equalsIgnoreCase(shipType))
{
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE, T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B ,TRANSPORTER T"
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE, T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B ,TRANSPORTER T"
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " WHERE ( A.PIN__FR >= ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO <= ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
......@@ -12647,7 +13496,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
else
{
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE FROM DISTROUTEDET A,DISTROUTE B ,TRANSPORTER T"
sql = " SELECT A.TRAN_CODE AS TRAN_CODE,A.TRANS_MODE AS TRANS_MODE,A.MAX_WEIGHT,A.LOC_TYPE,A.SHIP_TYPE,T.TRAN_CODE AS TRAN_CODE , T.SERVICE_CODE AS SERVICE_CODE,T.SHIPMENT_TYPE AS SHIPMENT_TYPE FROM DISTROUTEDET A,DISTROUTE B ,TRANSPORTER T"
+ " WHERE ( A.PIN__FR = ? OR A.PIN__FR = ' ' ) AND (A.PIN__TO = ? OR A.PIN__TO = ' ') AND (A.STAN_CODE__FR =? OR A.STAN_CODE__FR = ' ' ) "
+ " AND ( A.STAN_CODE__TO =? OR A.STAN_CODE__TO = ' ') AND ( A.STATE_CODE__FR = ? OR A.STATE_CODE__FR = ' ') "
+ " AND ( A.STATE_CODE__TO = ? OR A.STATE_CODE__TO = ' ' ) AND A.DIST_ROUTE = B.DIST_ROUTE AND MIN_WEIGHT <= ? "
......@@ -12703,6 +13552,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
// CHANGE BY REKHA ON 27-05-13 ADD SERVICE_CODE START
serviceCode=rs.getString("SERVICE_CODE");
// CHANGE BY REKHA ON 27-05-13 ADD SERVICE_CODE END
shipmentType = rs.getString("SHIPMENT_TYPE");
}
if( rs != null )
{
......@@ -12724,7 +13574,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
transInfoMap.put("SHIP_TYPE", dbShipType);
transInfoMap.put("SERVICE_CODE", serviceCode);
transInfoMap.put("PIN", pinTo);
transInfoMap.put("SHIPMENT_TYPE",shipmentType);
transInfoMap.putAll(sordMap);
if( rs != null )
{
rs.close();
......@@ -12775,16 +13627,39 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
PreparedStatement pstmt = null;
HashMap sordInfoMap = new HashMap();
String custCode = "",stanCode = "",siteCodeShip = "",stateCodeDlv = "",shipConsGrp = "";
String custCode = "",stanCode = "",siteCodeShip = "",stateCodeDlv = "",shipConsGrp = ""
//Changed By Rekha to get additional fields for ADSI
,custName="",custShName = "",shipCity="",shipCountry = "",shipAdd1 = "",shipAdd2 = "",shipAdd3 = "",
shipPh="",shipFax ="",shipMailId = "",custPord = "";
try
{
//Change By Rekha To get the required rcpnt value from customer
//Changed By Pragyan To get customer ship consigee group
/*sql = "SELECT C.CUST_CODE AS CUST_CODE,C.STAN_CODE AS STAN_CODE,S.SITE_CODE__SHIP AS SHIP_CODE,C.STATE_CODE AS STATE_DLV FROM SORDER S,CUSTOMER C "
+ " WHERE S.CUST_CODE__DLV = C.CUST_CODE "
+ " AND S.SALE_ORDER = ? ";*/
sql = "SELECT C.CUST_CODE AS CUST_CODE,C.STAN_CODE AS STAN_CODE,S.SITE_CODE__SHIP AS SHIP_CODE,C.STATE_CODE AS STATE_DLV,C.SHIP_CONS_GRP AS SHIP_CONS_GRP FROM SORDER S,CUSTOMER C "
/*sql = "SELECT C.CUST_CODE AS CUST_CODE,C.STAN_CODE AS STAN_CODE,S.SITE_CODE__SHIP AS SHIP_CODE,C.STATE_CODE AS STATE_DLV,C.SHIP_CONS_GRP AS SHIP_CONS_GRP FROM SORDER S,CUSTOMER C "
+ " WHERE S.CUST_CODE__DLV = C.CUST_CODE "
+ " AND S.SALE_ORDER = ? ";*/
sql = "SELECT C.CUST_CODE AS CUST_CODE,"
+" C.STAN_CODE AS STAN_CODE,"
+" S.SITE_CODE__SHIP AS SHIP_CODE,"
+" S.CUST_PORD AS CUST_PORD,"
+" C.STATE_CODE AS STATE_DLV,"
+" C.SHIP_CONS_GRP AS SHIP_CONS_GRP,"
+" C.CUST_NAME AS CUST_NAME,"
+" C.SH_NAME AS SH_NAME,"
+" C.ADDR1 AS ADDR1,"
+" C.ADDR2 AS ADDR2,"
+" C.ADDR3 AS ADDR3,"
+" C.CITY AS CITY,"
+" C.COUNT_CODE AS COUNT_CODE,"
+" C.TELE1 AS PHONE,"
+" C.FAX AS FAX,"
+" C.EMAIL_ADDR AS EMAIL_ID"
+" FROM SORDER S,CUSTOMER C "
+ " WHERE S.CUST_CODE__DLV = C.CUST_CODE "
+ " AND S.SALE_ORDER = ? ";
......@@ -12799,12 +13674,35 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
siteCodeShip = rs.getString("SHIP_CODE");
stateCodeDlv = rs.getString("STATE_DLV");
shipConsGrp = rs.getString("SHIP_CONS_GRP");
custName = rs.getString("CUST_NAME");
custShName = rs.getString("SH_NAME");
shipCity = rs.getString("CITY");
shipAdd1 = rs.getString("ADDR1");
shipAdd2 = rs.getString("ADDR2");
shipAdd3 = rs.getString("ADDR3");
shipCountry = rs.getString("COUNT_CODE");
shipPh = rs.getString("PHONE");
shipMailId = rs.getString("EMAIL_ID");
shipFax = rs.getString("FAX");
custPord = rs.getString("CUST_PORD");
}
sordInfoMap.put("CUST_CODE", custCode);
sordInfoMap.put("STAN_CODE", stanCode);
sordInfoMap.put("SHIP_CODE", siteCodeShip);
sordInfoMap.put("STATE_DLV", stateCodeDlv);
sordInfoMap.put("CUST_NAME", custName);
sordInfoMap.put("SH_NAME", custShName);
sordInfoMap.put("CITY", shipCity);
sordInfoMap.put("ADDR1", shipAdd1);
sordInfoMap.put("ADDR2", shipAdd2);
sordInfoMap.put("ADDR3", shipAdd3);
sordInfoMap.put("COUNT_CODE", shipCountry);
sordInfoMap.put("PHONE", shipPh);
sordInfoMap.put("EMAIL_ID", shipMailId);
sordInfoMap.put("FAX", shipFax);
sordInfoMap.put("CUST_PORD", custPord);
if(shipConsGrp != null && shipConsGrp.length() > 0 )
{
......@@ -16246,6 +17144,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
catch(Exception e)
{
throw e;
......@@ -16968,6 +17867,41 @@ private String getPalletNo(String siteCode,String lotNo, String lotSl,String ite
}
return palletNo;
}
private double getRateStdoum(String saleOrder,String itemCode,Connection conn) throws ITMException
{
String sql = "";
double rateStdOum = 0.0;
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
sql = " SELECT RATE__STDUOM FROM SORDDET WHERE SALE_ORDER = ? AND ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, saleOrder);
pstmt.setString(2, itemCode);
rs = pstmt.executeQuery();
if( rs.next())
{
rateStdOum = rs.getDouble(1);
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
}
catch(Exception ex)
{
ex.printStackTrace();
throw new ITMException(ex);
}
return rateStdOum;
}
private void updatePalletNo(String PTCN,String palletNo , Connection conn) throws ITMException
{
String sql = "",sql1 = "";
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Sybase_eDataWindow>
<Sybase_eDataWindow>
<Release>9</Release>
<BaseDefinition>
<units>1</units>
<timer_interval>0</timer_interval>
<color>67108864</color>
<processing>0</processing>
<HTMLDW>no</HTMLDW>
<print>
<documentname></documentname>
<printername></printername>
<orientation>0</orientation>
<margin>
<left>24</left>
<right>24</right>
<top>24</top>
<bottom>24</bottom>
</margin>
<paper>
<source>0</source>
<size>0</size>
</paper>
<prompt>no</prompt>
<canusedefaultprinter>yes</canusedefaultprinter>
<buttons>no</buttons>
<preview.buttons>no</preview.buttons>
<cliptext>no</cliptext>
<overrideprintjob>no</overrideprintjob>
</print>
</BaseDefinition>
<Summary>
<height>0</height>
<color>536870912</color>
</Summary>
<Footer>
<height>0</height>
<color>536870912</color>
</Footer>
<Detail>
<height>76</height>
<color>536870912</color>
</Detail>
<TableDefinition>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>ptcn</name>
<dbname>ptcn</dbname>
</table_column>
<table_column>
<type size="12">char</type>
<updatewhereclause>no</updatewhereclause>
<name>wave_id</name>
<dbname>wave_id</dbname>
</table_column>
<table_column>
<type size="200">char</type>
<updatewhereclause>no</updatewhereclause>
<name>printer_name</name>
<dbname>printer_name</dbname>
</table_column>
</TableDefinition>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Wave Id:</text>
<border>6</border>
<color>33554432</color>
<x>217</x>
<y>17</y>
<height>16</height>
<width>55</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>wave_id_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>536870912</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Printer Name:</text>
<border>6</border>
<color>33554432</color>
<x>16</x>
<y>43</y>
<height>16</height>
<width>75</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>printer_name_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>536870912</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>PTCN:</text>
<border>6</border>
<color>33554432</color>
<x>16</x>
<y>16</y>
<height>16</height>
<width>75</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>ptcn_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>536870912</color>
</background>
</TextObject>
<ColumnObject>
<band>Detail</band>
<id>1</id>
<alignment>0</alignment>
<tabsequence>10</tabsequence>
<border>5</border>
<color>33554432</color>
<x>96</x>
<y>17</y>
<height>16</height>
<width>102</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>ptcn</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>10</limit>
<case>any</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>2</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>3</id>
<alignment>0</alignment>
<tabsequence>30</tabsequence>
<border>5</border>
<color>33554432</color>
<x>97</x>
<y>43</y>
<height>16</height>
<width>266</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>printer_name</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>2</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>1073741824</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>2</id>
<alignment>0</alignment>
<tabsequence>20</tabsequence>
<border>5</border>
<color>33554432</color>
<x>278</x>
<y>17</y>
<height>16</height>
<width>84</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>wave_id</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>2</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>1073741824</color>
</background>
</ColumnObject>
<HtmlTable>
<border>1</border>
</HtmlTable>
<HtmlGen>
<clientevents>1</clientevents>
<clientvalidation>1</clientvalidation>
<clientcomputedfields>1</clientcomputedfields>
<clientformatting>0</clientformatting>
<clientscriptable>0</clientscriptable>
<generatejavascript>1</generatejavascript>
<encodeselflinkargs>1</encodeselflinkargs>
<netscapelayers>0</netscapelayers>
</HtmlGen>
<Export.XML>
<headgroups>1</headgroups>
<includewhitespace>0</includewhitespace>
<metadatatype>0</metadatatype>
<savemetadata>0</savemetadata>
</Export.XML>
<Import.XML>
</Import.XML>
<Export.PDF>
<method>0</method>
<distill.custompostscript>0</distill.custompostscript>
<xslfop.print>0</xslfop.print>
</Export.PDF>
</Sybase_eDataWindow>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Sybase_eDataWindow>
<Sybase_eDataWindow>
<Release>9</Release>
<BaseDefinition>
<units>1</units>
<timer_interval>0</timer_interval>
<color>67108864</color>
<processing>0</processing>
<HTMLDW>no</HTMLDW>
<print>
<documentname></documentname>
<printername></printername>
<orientation>0</orientation>
<margin>
<left>24</left>
<right>24</right>
<top>24</top>
<bottom>24</bottom>
</margin>
<paper>
<source>0</source>
<size>0</size>
</paper>
<prompt>no</prompt>
<canusedefaultprinter>yes</canusedefaultprinter>
<buttons>no</buttons>
<preview.buttons>no</preview.buttons>
<cliptext>no</cliptext>
<overrideprintjob>no</overrideprintjob>
</print>
</BaseDefinition>
<Summary>
<height>0</height>
<color>536870912</color>
</Summary>
<Footer>
<height>0</height>
<color>536870912</color>
</Footer>
<Detail>
<height>194</height>
<color>536870912</color>
</Detail>
<TableDefinition>
<table_column>
<type>date</type>
<updatewhereclause>no</updatewhereclause>
<name>from_date</name>
<dbname>from_date</dbname>
</table_column>
<table_column>
<type>date</type>
<updatewhereclause>no</updatewhereclause>
<name>to_date</name>
<dbname>to_date</dbname>
</table_column>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>tran_code_from</name>
<dbname>tran_code_from</dbname>
</table_column>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>tran_code_to</name>
<dbname>tran_code_to</dbname>
</table_column>
<table_column>
<type size="20">char</type>
<updatewhereclause>no</updatewhereclause>
<name>shipment_type</name>
<dbname>shipment_type</dbname>
</table_column>
</TableDefinition>
<GroupBox>
<band>Detail</band>
<text>Basic</text>
<border>5</border>
<color>0</color>
<x>5</x>
<y>0</y>
<height>84</height>
<width>367</width>
<name>gb_1</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</GroupBox>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>From Date:</text>
<border>0</border>
<color>0</color>
<x>9</x>
<y>17</y>
<height>16</height>
<width>102</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>from_date_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>553648127</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>To Date:</text>
<border>0</border>
<color>0</color>
<x>214</x>
<y>17</y>
<height>16</height>
<width>74</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>to_date_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>553648127</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Transporter From:</text>
<border>0</border>
<color>0</color>
<x>10</x>
<y>39</y>
<height>16</height>
<width>101</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_code_from_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>553648127</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Transporter To:</text>
<border>0</border>
<color>0</color>
<x>199</x>
<y>39</y>
<height>16</height>
<width>89</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_code_to_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>553648127</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Shipment Type:</text>
<border>0</border>
<color>0</color>
<x>10</x>
<y>62</y>
<height>16</height>
<width>101</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>shipment_type_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>553648127</color>
</background>
</TextObject>
<ColumnObject>
<band>Detail</band>
<id>1</id>
<alignment>0</alignment>
<tabsequence>10</tabsequence>
<border>5</border>
<color>33554432</color>
<x>115</x>
<y>17</y>
<height>16</height>
<width>74</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>from_date</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>2</id>
<alignment>0</alignment>
<tabsequence>20</tabsequence>
<border>5</border>
<color>33554432</color>
<x>292</x>
<y>17</y>
<height>16</height>
<width>74</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>to_date</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>3</id>
<alignment>0</alignment>
<tabsequence>30</tabsequence>
<border>5</border>
<color>33554432</color>
<x>115</x>
<y>39</y>
<height>16</height>
<width>74</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_code_from</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>4</id>
<alignment>0</alignment>
<tabsequence>40</tabsequence>
<border>5</border>
<color>33554432</color>
<x>292</x>
<y>39</y>
<height>16</height>
<width>74</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_code_to</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>5</id>
<alignment>0</alignment>
<tabsequence>50</tabsequence>
<border>5</border>
<color>33554432</color>
<x>115</x>
<y>62</y>
<height>16</height>
<width>252</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>shipment_type</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<HtmlTable>
<border>1</border>
</HtmlTable>
<HtmlGen>
<clientevents>1</clientevents>
<clientvalidation>1</clientvalidation>
<clientcomputedfields>1</clientcomputedfields>
<clientformatting>0</clientformatting>
<clientscriptable>0</clientscriptable>
<generatejavascript>1</generatejavascript>
<encodeselflinkargs>1</encodeselflinkargs>
<netscapelayers>0</netscapelayers>
</HtmlGen>
<Export.XML>
<headgroups>1</headgroups>
<includewhitespace>0</includewhitespace>
<metadatatype>0</metadatatype>
<savemetadata>0</savemetadata>
</Export.XML>
<Import.XML>
</Import.XML>
<Export.PDF>
<method>0</method>
<distill.custompostscript>0</distill.custompostscript>
<xslfop.print>0</xslfop.print>
</Export.PDF>
</Sybase_eDataWindow>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Sybase_eDataWindow>
<Sybase_eDataWindow>
<Release>9</Release>
<BaseDefinition>
<units>1</units>
<timer_interval>0</timer_interval>
<color>67108864</color>
<processing>1</processing>
<HTMLDW>no</HTMLDW>
<print>
<documentname></documentname>
<printername></printername>
<orientation>0</orientation>
<margin>
<left>24</left>
<right>24</right>
<top>24</top>
<bottom>24</bottom>
</margin>
<paper>
<source>0</source>
<size>0</size>
</paper>
<prompt>no</prompt>
<canusedefaultprinter>yes</canusedefaultprinter>
<buttons>no</buttons>
<preview.buttons>no</preview.buttons>
<cliptext>no</cliptext>
<overrideprintjob>no</overrideprintjob>
</print>
<grid.lines>0</grid.lines>
</BaseDefinition>
<Header>
<height>20</height>
<color>536870912</color>
</Header>
<Summary>
<height>1</height>
<color>536870912</color>
</Summary>
<Footer>
<height>0</height>
<color>536870912</color>
</Footer>
<Detail>
<height>22</height>
<color>536870912</color>
</Detail>
<TableDefinition>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>ptcn</name>
<dbname>ptcn</dbname>
</table_column>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>shipment_id</name>
<dbname>shipment_id</dbname>
</table_column>
<table_column>
<type size="40">char</type>
<updatewhereclause>no</updatewhereclause>
<name>tran_name</name>
<dbname>tran_name</dbname>
</table_column>
</TableDefinition>
<TextObject>
<band>Header</band>
<alignment>0</alignment>
<text>PTCN</text>
<border>6</border>
<color>0</color>
<x>2</x>
<y>2</y>
<height>16</height>
<width>165</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>ptcn_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>553648127</color>
</background>
</TextObject>
<TextObject>
<band>Header</band>
<alignment>0</alignment>
<text>Shipment Id</text>
<border>6</border>
<color>0</color>
<x>169</x>
<y>2</y>
<height>16</height>
<width>144</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>shipment_id_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>553648127</color>
</background>
</TextObject>
<TextObject>
<band>Header</band>
<alignment>0</alignment>
<text>Transporter Name</text>
<border>6</border>
<color>0</color>
<x>315</x>
<y>2</y>
<height>16</height>
<width>841</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_name_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>553648127</color>
</background>
</TextObject>
<ColumnObject>
<band>Detail</band>
<id>1</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>5</border>
<color>33554432</color>
<x>2</x>
<y>2</y>
<height>19</height>
<width>165</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>ptcn</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>1</mode>
<color>536870912</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>2</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>5</border>
<color>33554432</color>
<x>169</x>
<y>2</y>
<height>19</height>
<width>144</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>shipment_id</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>3</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>5</border>
<color>33554432</color>
<x>315</x>
<y>2</y>
<height>19</height>
<width>841</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_name</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<HtmlTable>
<border>1</border>
</HtmlTable>
<HtmlGen>
<clientevents>1</clientevents>
<clientvalidation>1</clientvalidation>
<clientcomputedfields>1</clientcomputedfields>
<clientformatting>0</clientformatting>
<clientscriptable>0</clientscriptable>
<generatejavascript>1</generatejavascript>
<encodeselflinkargs>1</encodeselflinkargs>
<netscapelayers>0</netscapelayers>
</HtmlGen>
<Export.XML>
<headgroups>1</headgroups>
<includewhitespace>0</includewhitespace>
<metadatatype>0</metadatatype>
<savemetadata>0</savemetadata>
</Export.XML>
<Import.XML>
</Import.XML>
<Export.PDF>
<method>0</method>
<distill.custompostscript>0</distill.custompostscript>
<xslfop.print>0</xslfop.print>
</Export.PDF>
</Sybase_eDataWindow>
......@@ -38768,3 +38768,2914 @@ VALUES (
NULL,
NULL);
COMMIT;
--Changed by Rohan on 28-06-13 for ADSI as said by Pragayn
--//Changed By Rekha WM3BSUN006 20/05/13 To get the SOAP connection.start
INSERT INTO disparm (
prd_code ,
var_name ,
var_type ,
var_value ,
descr ,
var_subs ,
chg_date ,
chg_user ,
chg_term
)
VALUES
(
'999999',
'WMS_ADSI_SOAP_URL',
'S',
'http://172.20.0.137/ADSIShippingWS/ADSIShipping.asmx',
'WMS ADSI Integration soap URL',
0,
fn_sysdate(),
'BASE',
'Rekha'
);
Prompt -------Ashish : I thing we decided to create a day wise folder for the lables , YOu can create a folder on c:\ADSI AND IN THAT CREATE DAY WISE FOLDERS
INSERT INTO disparm (
prd_code ,
var_name ,
var_type ,
var_value ,
descr ,
var_subs ,
chg_date ,
chg_user ,
chg_term
)
VALUES
(
'999999',
'SHIP_WITH_PATH',
'S',
'C://ADSI/',
'Save Ship With Label Images(Any Path Of Application Server)',
0,
fn_sysdate(),
'BASE',
'Rekha'
);
INSERT INTO disparm (
prd_code ,
var_name ,
var_type ,
var_value ,
descr ,
var_subs ,
chg_date ,
chg_user ,
chg_term
)
VALUES
(
'999999',
'SHIPPER_DEFAULT_PH',
'S',
'9143459001',
'Default phone no for recipient',
0,
fn_sysdate(),
'BASE',
'Rekha'
);
INSERT INTO disparm (
prd_code ,
var_name ,
var_type ,
var_value ,
descr ,
var_subs ,
chg_date ,
chg_user ,
chg_term
)
VALUES
(
'999999',
'NAFTA_FLAG_COUNT',
'S',
'MEX,CAN',
'Nafta Flag is true for this country code',
0,
fn_sysdate(),
'BASE',
'Rekha'
);
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'ADSISRVERR',
'ADSI Connection Failure',
'Metis connection to ADSI Server Failed,for UPS/Fedex Labels',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
--//Changed By Rekha WM3BSUN006 20/05/13 To get the SOAP connection.end
alter table transporter add service_code varchar2(10); -- already exist
alter table delivery_term add adsi_dlv_term varchar2(25);
alter table carton_master add tracking_no varchar2(200);
alter table carton_master add ship_label varchar2(120);
alter table carton_master add msn_no number(14,3);
Prompt -------Ashish : What is this table used for ?
-- changes by sumit
create table wave_status_org
(
tran_id char(10),
wave_id varchar2(12),
tran_code char(10),
ptcn char(10),
chg_user char(10),
chg_date date,
chg_term varchar2(15),
print_status char(1)
);
alter table wave_status_org add constraint pk_wave_org primary key (tran_id) ;
create table wave_status_org_det
(
tran_id char(10),
line_no number(3,0),
ptcn char(10),
carton_no varchar2(20),
pick_order char(10),
line_no__pick number(3,0),
ref_ser char(6),
ref_id char(10),
carton_type char(1),
pack_code char(5),
master_carton varchar2(20),
item_code char(10),
weight number(14,3),
tracking_no varchar2(200),
ship_label varchar2(120)
) ;
alter table wave_status_org_det add constraint pk_wave_org_det primary key
(tran_id,line_no);
ALTER TABLE wave_status_org_det ADD CONSTRAINT FK_wave_org_det FOREIGN KEY
(tran_id ) REFERENCES wave_status_org ON DELETE CASCADE;
alter table carton_master add change_status char(1) default 'N';
Prompt -------Ashish : The key string needs to be proper , not seq 10 we can discuss and change it before executing
INSERT INTO TRANSETUP (
tran_window ,
save_flag ,
val_flag ,
key_flag ,
key_string ,
udf_1 ,
udf_2 ,
udf_3 ,
udf_4 ,
udf_5 ,
repeate_add ,
chg_date ,
chg_user ,
chg_term ,
edi_option ,
site_acc_col ,
confirm_col ,
confirm_val ,
repeat_add_det ,
repeatadddet ,
load_mode ,
auto_confirm ,
ledg_post_conf ,
chg_date_on_conf ,
tran_id_col ,
mail_option ,
confirm_mode ,
garbage_opt ,
val_flag_edi ,
verify_password ,
cust_acc_col ,
sales_pers_acc_col ,
supp_acc_col ,
item_ser_acc_code ,
emp_acc_col ,
item_ser_acc_col ,
workflow_opt ,
table_name ,
application ,
table_desc ,
tran_date_col ,
tran_id__from ,
tran_id__to ,
table_name_det1 ,
table_name_det2 ,
table_name_det3 ,
multitire_opt ,
ref_ser ,
view_mode ,
tax_forms ,
sign_status ,
user_tran_window ,
custom_preview_obj ,
ignoreerrlist_onload ,
childdata_argopt ,
edit_tmplt ,
wrkflw_init ,
edittax ,
formal_args ,
audit_trail_opt ,
edit_opt ,
cache_opt ,
optimize_mode ,
edit_expr ,
rate_col ,
qty_col ,
edit_expr_inp ,
rcp_cache_status ,
print_control ,
transfer_mode ,
profile_id__res ,
tran_compl_msg ,
period_option ,
wrkflw_priority ,
exec_type ,
disp_meta_data ,
allow_attach ,
start_form ,
isattachment ,
header_form_no ,
msg_onsave ,
wf_status )
VALUES (
'w_gen_label',
'2',
'2',
'A',
'seq10',
NULL,
NULL,
NULL,
NULL,
NULL,
'N',
TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE ',
'0',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'G-LABL',
'F',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'0',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'M',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
Prompt -------Ashish : The menu has to be put under new tree - I have changed this in the below sql according to the new menu
INSERT INTO ITM2MENU (
application ,
level_1 ,
level_2 ,
level_3 ,
level_4 ,
level_5 ,
win_name ,
descr ,
comments ,
menu_path ,
icon_path ,
close_icon ,
open_icon ,
obj_type ,
chg_date ,
chg_term ,
chg_user ,
mob_deploy )
VALUES (
'WMS',
13,
3,
12,
0,
0,
'w_gen_label',
'Generate UPS/Fedex Label',
'Generate UPS/Fedex Label',
'WMS.13.3.12.0.0',
'e12_logo.gif',
NULL,
NULL,
'P',
TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE ',
NULL);
INSERT INTO OBJ_FORMS (
win_name ,
title ,
obj_brow_name ,
obj_edit_name ,
cross_update_expr ,
expr_fld_info ,
target_fld_info ,
expr_comment ,
form_no ,
scr_flag ,
auto_accept_scan ,
scan_flag ,
scan_metadata ,
property_info ,
scan_delimiter ,
column_on_save ,
after_save ,
ext_setup ,
ext_metadata ,
ext_com ,
auto_accept_weighdata ,
form_type ,
disp_metadata ,
parent_key_col ,
qty_col ,
rate_col ,
assisted_mode ,
storage_key_metadata ,
selection_mode ,
default_view )
VALUES (
'w_gen_label',
'Label Detail',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'1',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
INSERT INTO OBJ_ACTIONS (
obj_name ,
line_no ,
image ,
description ,
service_code ,
interactive ,
rights_char ,
title ,
form_no ,
service_handler ,
placement ,
action_type ,
tran_type ,
chg_date ,
chg_term ,
chg_user )
VALUES (
'gen_label',
8,
NULL,
'Action Button for processing the data',
'process',
'a',
'R',
'Process',
'1',
'3',
NULL,
'U',
NULL,
NULL,
NULL,
NULL);
INSERT INTO OBJ_ITEMCHANGE (
obj_name ,
form_no ,
field_name ,
mandatory )
VALUES (
'gen_label',
'1 ',
'ptcn',
'Y');
INSERT INTO OBJ_ITEMCHANGE (
obj_name ,
form_no ,
field_name ,
mandatory )
VALUES (
'gen_label',
'1 ',
'wave_id',
'Y');
INSERT INTO SYSTEM_EVENTS (
obj_name ,
event_code ,
event_context ,
service_code ,
method_rule ,
overwrite_core ,
chg_date ,
chg_user ,
chg_term ,
result_handle ,
comp_type ,
comp_name ,
comm_format )
VALUES (
'gen_label',
'post_item_change',
'1',
'poic_gen_label',
NULL,
'0',
TO_DATE('31-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
'2',
'EJB',
'GenerateLabelsIC',
NULL);
INSERT INTO SYSTEM_EVENTS (
obj_name ,
event_code ,
event_context ,
service_code ,
method_rule ,
overwrite_core ,
chg_date ,
chg_user ,
chg_term ,
result_handle ,
comp_type ,
comp_name ,
comm_format )
VALUES (
'gen_label',
'pre_validate',
'1',
'prv_gen_label',
NULL,
'0',
TO_DATE('31-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
'2',
'EJB',
'GenerateLabelsIC',
NULL);
INSERT INTO SYSTEM_EVENTS (
obj_name ,
event_code ,
event_context ,
service_code ,
method_rule ,
overwrite_core ,
chg_date ,
chg_user ,
chg_term ,
result_handle ,
comp_type ,
comp_name ,
comm_format )
VALUES (
'gen_label',
'process',
'1',
'prc_gen_label',
NULL,
'0',
TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
'2',
'EJB',
'GenerateLabelsPrc',
NULL);
Prompt -------Ashish :The ip address and the dotnetservice name has to be correct , This looks like very old msi also at the end its .asm it should be .asmx
INSERT INTO SYSTEM_EVENT_SERVICES(
service_code ,
service_descr ,
service_uri ,
service_provider ,
method_name ,
return_value ,
return_type ,
return_descr ,
return_xfrm ,
chg_date ,
chg_user ,
chg_term )
VALUES (
'prc_gen_label',
'Action To process the Data',
'http://172.16.100.15/BaseE12DotNetService6-3-0-054/E12BusinessLogic6-3-0-054.asmx',
'BASE',
'process',
'String',
'S',
NULL,
NULL,
TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE');
INSERT INTO SYSTEM_EVENT_SERVICES(
service_code ,
service_descr ,
service_uri ,
service_provider ,
method_name ,
return_value ,
return_type ,
return_descr ,
return_xfrm ,
chg_date ,
chg_user ,
chg_term )
VALUES (
'poic_gen_label',
'Item Chnage',
'http://172.16.100.15/BaseE12DotNetService6-3-0-054/E12BusinessLogic6-3-0-054.asmx',
'BASE',
'itemChanged',
'String',
'S',
NULL,
NULL,
TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE');
INSERT INTO SYSTEM_EVENT_SERVICES(
service_code ,
service_descr ,
service_uri ,
service_provider ,
method_name ,
return_value ,
return_type ,
return_descr ,
return_xfrm ,
chg_date ,
chg_user ,
chg_term )
VALUES (
'prv_gen_label',
'Validation',
'http://172.16.100.15/BaseE12DotNetService6-3-0-054/E12BusinessLogic6-3-0-054.asmx',
'BASE',
'wfValData',
'String',
'S',
NULL,
NULL,
TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE');
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
1,
'COMPONENT_TYPE',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
'EJB');
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
2,
'COMPONENT_NAME',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
'GenerateLabelsIC');
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
3,
'XML_DATA',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
4,
'XML_DATA_1',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
5,
'XML_DATA_ALL',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
6,
'OBJ_CONTEXT',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
7,
'FOCUSED_COLUMN',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
8,
'EDIT_FLAG',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'poic_gen_label',
9,
'XTRA_PARAMS',
'I',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prc_gen_label',
1,
'COMPONENT_TYPE',
'I',
'Component Type',
'C.String',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE ',
'EJB');
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prc_gen_label',
2,
'COMPONENT_NAME',
'I',
'Component Name',
'C.String',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE ',
'GenerateLabelsPrc');
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prc_gen_label',
3,
'XML_DATA_1',
'I',
'XML data of form no 1',
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE ',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prc_gen_label',
4,
'XML_DATA__ALL',
'I',
'XML data of form no 1',
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE ',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prc_gen_label',
5,
'OBJ_CONTEXT',
'I',
'Object Context',
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE ',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prc_gen_label',
6,
'XTRA_PARAMS',
'I',
'Extra Arguments',
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE ',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prv_gen_label',
1,
'COMPONENT_TYPE',
'l',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
'EJB');
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prv_gen_label',
2,
'COMPONENT_NAME',
'l',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
'GenerateLabelsIC');
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prv_gen_label',
3,
'XML_DATA',
'l',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prv_gen_label',
4,
'XML_DATA_1',
'l',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES(
'prv_gen_label',
5,
'XML_DATA_ALL',
'l',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prv_gen_label',
6,
'OBJ_CONTEXT',
'l',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prv_gen_label',
7,
'OBJ_CONTEXT',
'l',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'prv_gen_label',
8,
'XTRA_PARAMS',
'l',
NULL,
'S',
NULL,
TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE ',
'BASE',
NULL);
Prompt -------Ashish : Correction in messages done
-- If entered wave is in hold or canceled.
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'WAVECAORHO',
'Invalid Wave ID',
'Entered wave id is on hold or canceled',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
-- Entered wave id or ptcn is not matching.
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'WAVEAPTNSM',
'Invalid Wave ID or PTCN',
'Entered wave id or ptcn is not matching',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
-- Wave id is not present in master.
Prompt -------Ashish : What do you mean by Entered wave id is not present in the master . There is no master for wave , COrrect this message
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'INVAWAVEID',
'Invalid Wave ID',
'Entered wave id is not present in wave transations.',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
-- IF both wave id and ptcn field is null
Prompt -------Ashish : Replace null with Blank
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'NULLBOTHFD',
'Blank Wave ID and PTCN',
'Both wave id and PTCN can not be null.',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
--ptcn does not present in wave master.
Prompt -------Ashish : Again what is wave master ? its wrong
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'INVAPTCN09',
'Invalid PTCN',
'Entered PTCN is not present in Wave transaction',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
-- IF entered ptcn does not contain master or parcel task
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'INVAPTCN10',
'Invalid PTCN',
'Entered PTCN does not contain master or parcel pack.',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
-- IF entered wave id does not contain master or parcel task
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'INVAWAVE11',
'Invalid Wave ID',
'Entered wave id does not contain master or parcel pack.',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
--If label is already printed
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'ALLREPRINT',
'Invalid PTCN',
'Label of entered ptcn is already generated.',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
-- if despatch is allready confirmed of entered ptcn
Prompt -------Ashish : PTCN changed to Capital
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'DESPCONFIR',
'Invalid PTCN',
'Despatch of entered PTCN is already confirmed.',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
-- validation at the time of loading if user didn't print label.
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'INVPRINTST',
'Invalid print status',
'Please reprint UPS/Fedex label.',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'NOTHING2PR',
'Invalid Quantity',
'Zero quantity.',
'E',
'E',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL,
NULL);
-------------- Function To Print Transporter Name From Despatch ------------------
CREATE OR REPLACE FUNCTION DDF_GET_TRAN_NAME_DESPATCH(AS_REPL_ORDER WAVE_TASK_DET.REF_ID%TYPE)
RETURN varchar2 IS
AS_TRAN_NAME TRANSPORTER.TRAN_NAME%TYPE;
AS_PTCN WAVE_TASK_DET.PTCN%TYPE;
AS_REF_ID WAVE_TASK_DET.REF_ID%TYPE;
AS_TRAN_CODE TRANSPORTER.TRAN_CODE%TYPE;
BEGIN
SELECT PTCN INTO AS_PTCN FROM WAVE_TASK_DET WHERE REF_ID = AS_REPL_ORDER;
SELECT REF_ID INTO AS_REF_ID FROM WAVE_TASK_DET WHERE PTCN = AS_PTCN AND REF_SER = 'S-DSP ';
SELECT TRAN_CODE INTO AS_TRAN_CODE FROM DESPATCH WHERE DESP_ID = AS_REF_ID;
SELECT TRAN_NAME INTO AS_TRAN_NAME FROM TRANSPORTER WHERE TRAN_CODE = AS_TRAN_CODE;
RETURN AS_TRAN_NAME ;
EXCEPTION
WHEN NO_DATA_FOUND THEN RETURN '' ;
END;
/
-------Changed by sankara add sql's given by rohan on 22-06-2013--------------------
alter table wave_status_org add carrier_symbol varchar2(50);
alter table wave_status_org add carrier_friendlyName varchar2(50);
alter table carton_master add carrier_symbol varchar2(50);
alter table carton_master add carrier_friendlyName varchar2(50);
commit;
-------Changed by sankara add sql' for added column sf_identity in carton_master on 26-06-2013--------------------
alter table carton_master add sf_identity varchar2(250);
INSERT INTO itm2menu (
application ,
level_1 ,
level_2 ,
level_3 ,
level_4 ,
level_5 ,
win_name ,
descr ,
comments ,
menu_path ,
icon_path ,
close_icon ,
open_icon ,
obj_type ,
chg_date ,
chg_term ,
chg_user ,
mob_deploy )
VALUES (
'WMS',
7,
3,
0,
0,
0,
'w_ptcn_confirm',
'Close Out EOD(Manifestation)',
'PTCN',
'WMS.7.3.0.0.0',
'e12_logo.gif',
NULL,
NULL,
'P',
fn_sysdate(),
'Base ',
'Base ',
NULL);
INSERT INTO transetup (
tran_window,
save_flag,
val_flag,
key_flag,
key_string,
udf_1,
udf_2,
udf_3,
udf_4,
udf_5,
repeate_add,
chg_date,
chg_user,
chg_term,
edi_option,
site_acc_col,
confirm_col,
confirm_val,
repeat_add_det,
repeatadddet,
load_mode,
auto_confirm,
ledg_post_conf,
chg_date_on_conf,
tran_id_col,
mail_option,
confirm_mode,
garbage_opt,
val_flag_edi,
verify_password,
cust_acc_col,
sales_pers_acc_col,
supp_acc_col,
item_ser_acc_code,
emp_acc_col,
item_ser_acc_col,
workflow_opt,
table_name,
application,
table_desc,
tran_date_col,
tran_id__from,
tran_id__to,
table_name_det1,
table_name_det2,
table_name_det3,
multitire_opt,
ref_ser,
view_mode,
tax_forms,
sign_status,
user_tran_window,
custom_preview_obj,
ignoreerrlist_onload,
childdata_argopt,
edit_tmplt,
wrkflw_init,
edittax,
formal_args,
audit_trail_opt,
edit_opt,
cache_opt,
optimize_mode,
edit_expr,
rate_col,
qty_col,
edit_expr_inp,
rcp_cache_status,
print_control,
transfer_mode,
profile_id__res,
tran_compl_msg,
period_option,
wrkflw_priority,
exec_type,
disp_meta_data,
allow_attach,
start_form,
isattachment)
VALUES (
'w_ptcn_confirm',
'2',
'2',
'M',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'N',
fn_sysdate(),
'Base ',
'Base ',
'0',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'0',
'0',
'N',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'DIS',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'P-RCP',
'F',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
INSERT INTO obj_forms(
win_name ,
title ,
obj_brow_name ,
obj_edit_name ,
cross_update_expr ,
expr_fld_info ,
target_fld_info ,
expr_comment ,
form_no ,
scr_flag ,
auto_accept_scan ,
scan_flag ,
scan_metadata ,
property_info ,
scan_delimiter ,
column_on_save ,
after_save ,
ext_setup ,
ext_metadata ,
ext_com ,
auto_accept_weighdata ,
form_type ,
disp_metadata ,
parent_key_col ,
qty_col ,
rate_col ,
assisted_mode ,
storage_key_metadata )
VALUES (
'w_ptcn_confirm',
'ptcn',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'1',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
INSERT INTO obj_forms(
win_name ,
title ,
obj_brow_name ,
obj_edit_name ,
cross_update_expr ,
expr_fld_info ,
target_fld_info ,
expr_comment ,
form_no ,
scr_flag ,
auto_accept_scan ,
scan_flag ,
scan_metadata ,
property_info ,
scan_delimiter ,
column_on_save ,
after_save ,
ext_setup ,
ext_metadata ,
ext_com ,
auto_accept_weighdata ,
form_type ,
disp_metadata ,
parent_key_col ,
qty_col ,
rate_col ,
assisted_mode ,
storage_key_metadata )
VALUES (
'w_ptcn_confirm',
'ptcn',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'2',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
INSERT INTO obj_actions (
obj_name ,
line_no ,
image ,
description ,
service_code ,
interactive ,
rights_char ,
title ,
form_no ,
service_handler ,
placement ,
action_type ,
tran_type ,
chg_date ,
chg_term ,
chg_user )
VALUES (
'ptcn_confirm',
1,
NULL,
'GetData',
'get_data',
'a',
'R',
'GetData',
'1',
'3',
NULL,
'U',
NULL,
fn_sysdate(),
'BASE ',
'BASE ');
INSERT INTO obj_actions (
obj_name ,
line_no ,
image ,
description ,
service_code ,
interactive ,
rights_char ,
title ,
form_no ,
service_handler ,
placement ,
action_type ,
tran_type ,
chg_date ,
chg_term ,
chg_user )
VALUES (
'ptcn_confirm',
2,
NULL,
'Process',
'process',
'a',
'R',
'Process',
'1',
'3',
NULL,
'U',
NULL,
fn_sysdate(),
'BASE',
'BASE');
INSERT INTO system_events (
obj_name,
event_code,
event_context,
service_code,
method_rule,
overwrite_core,
chg_date,
chg_user,
chg_term,
result_handle,
comp_type,
comp_name,
comm_format)
VALUES (
'ptcn_confirm',
'get_data',
'1',
'ptcn_get_data',
NULL,
'0',
fn_sysdate(),
'Base ',
'Base',
'2',
'EJB',
'ShipmentPrc',
NULL);
INSERT INTO system_events (
obj_name,
event_code,
event_context,
service_code,
method_rule,
overwrite_core,
chg_date,
chg_user,
chg_term,
result_handle,
comp_type,
comp_name,
comm_format)
VALUES (
'ptcn_confirm',
'process',
'1',
'ptcn_process',
NULL,
'0',
fn_sysdate(),
'Base ',
'Base',
'2',
'EJB',
'ShipmentPrc',
NULL);
INSERT INTO system_event_services (
service_code ,
service_descr ,
service_uri ,
service_provider ,
method_name ,
return_value ,
return_type ,
return_descr ,
return_xfrm ,
chg_date ,
chg_user ,
chg_term )
VALUES (
'ptcn_get_data',
'GetData',
'http://localhost/axis/services/ProcessService',
'BASE',
'getData',
'String',
'S',
NULL,
NULL,
fn_sysdate(),
'BASE ',
'BASE');
INSERT INTO system_event_services (
service_code ,
service_descr ,
service_uri ,
service_provider ,
method_name ,
return_value ,
return_type ,
return_descr ,
return_xfrm ,
chg_date ,
chg_user ,
chg_term )
VALUES (
'ptcn_process',
'process',
'http://localhost/axis/services/ProcessService',
'BASE',
'process',
'String',
'S',
NULL,
NULL,
fn_sysdate(),
'BASE',
'BASE');
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_get_data',
1,
'COMPONENT_TYPE',
'I',
NULL,
'S',
NULL,
fn_sysdate(),
'Base',
'Base',
'EJB');
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_get_data',
2,
'COMPONENT_NAME',
'I',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE ',
'BASE',
'ShipmentPrc');
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_get_data',
3,
'XML_DATA',
'l',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE ',
'BASE',
NULL);
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_get_data',
4,
'XML_DATA_1',
'l',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE ',
'BASE',
NULL);
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_get_data',
5,
'WINNAME',
'l',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE ',
'BASE',
NULL);
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_get_data',
6,
'XTRA_PARAMS',
'l',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE ',
'BASE',
NULL);
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_process',
1,
'COMPONENT_TYPE',
'I',
NULL,
'C.String',
NULL,
fn_sysdate(),
'BASE',
'BASE',
'EJB');
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_process',
2,
'COMPONENT_NAME',
'I',
NULL,
'C.String',
NULL,
fn_sysdate(),
'BASE',
'BASE',
'ShipmentPrc');
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_process',
3,
'XML_DATA_1',
'l',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL);
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_process',
4,
'XML_DATA__ALL',
'l',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL);
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_process',
5,
'OBJ_CONTEXT',
'l',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL);
INSERT INTO system_service_args (
service_code ,
line_no ,
arg_name ,
arg_mode ,
descr ,
arg_type ,
arg_xfrm ,
chg_date ,
chg_user ,
chg_term ,
arg_value )
VALUES (
'ptcn_process',
6,
'XTRA_PARAMS',
'l',
NULL,
'S',
NULL,
fn_sysdate(),
'BASE',
'BASE',
NULL);
INSERT INTO messages (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'BLKFROMDT ',
'From Date Blank',
'From Date Should not be Blank',
'E',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO messages (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'BLKTODT ',
'To Date Blank',
'To Date Should not be Blank',
'E',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO messages (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'INVLDATA ',
'No Data Found',
'No Data Found For Given Arguments',
'E',
'0',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO messages (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'INVLDATE ',
'Invalid Date !',
'To Date is always greater than From Date',
'E',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'BASE ',
'BASE ',
NULL,
NULL);
INSERT INTO MESSAGES(
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'BLKSHIPTYP',
'Blank Shipment Type',
'Shipment Type Should not be Blank',
'E',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO MESSAGES(
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'BLKTRANFR ',
'Transporter Code From Blank',
'Transporter Code From Should not be Blank',
'E',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO MESSAGES(
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'BLKTRANTO ',
'Transporter Code To Blank',
'Transporter Code To should not be Blank',
'E',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO MESSAGES(
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'INVSHIPTYP',
'Invalid Shipment Type',
'Entered Shipment type does not exist in the gencodes master',
'E',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO MESSAGES(
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'INVTRANPRT',
'Invalid Transporter Code',
'Entered Transporter Code does not exist in the Transporter Master',
'E',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO MESSAGES(
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input ,
mail_option )
VALUES (
'PRCESSFUL',
'Process Successful !',
'Selected rows updated Successfully',
'W',
'Y',
NULL,
NULL,
NULL,
fn_sysdate(),
'Base ',
'Base ',
NULL,
NULL);
INSERT INTO pophelp(
field_name ,
mod_name ,
sql_str ,
dw_object ,
msg_title ,
width ,
height ,
chg_date ,
chg_user ,
chg_term ,
dist_opt ,
filter_string ,
sql_input ,
default_col ,
pop_align ,
query_mode ,
page_context ,
pophelp_cols ,
pophelp_source ,
multi_opt ,
help_option )
VALUES (
'TRAN_CODE_FROM',
'W_PTCN_CONFIRM',
'SELECT TRAN_CODE,TRAN_NAME FROM TRANSPORTER',
'ptcn_confirm',
'Transporter From',
0,
0,
fn_sysdate(),
'Base ',
'Base ',
'0',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
INSERT INTO pophelp(
field_name ,
mod_name ,
sql_str ,
dw_object ,
msg_title ,
width ,
height ,
chg_date ,
chg_user ,
chg_term ,
dist_opt ,
filter_string ,
sql_input ,
default_col ,
pop_align ,
query_mode ,
page_context ,
pophelp_cols ,
pophelp_source ,
multi_opt ,
help_option )
VALUES (
'TRAN_CODE_TO',
'W_PTCN_CONFIRM',
'SELECT TRAN_CODE,TRAN_NAME FROM TRANSPORTER',
'ptcn_confirm',
'Transporter To',
0,
0,
fn_sysdate(),
'Base ',
'Base ',
'0',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
INSERT INTO pophelp(
field_name ,
mod_name ,
sql_str ,
dw_object ,
msg_title ,
width ,
height ,
chg_date ,
chg_user ,
chg_term ,
dist_opt ,
filter_string ,
sql_input ,
default_col ,
pop_align ,
query_mode ,
page_context ,
pophelp_cols ,
pophelp_source ,
multi_opt ,
help_option )
VALUES (
'SHIPMENT_TYPE',
'W_PTCN_CONFIRM',
'SELECT FLD_VALUE,DESCR FROM GENCODES WHERE FLD_NAME = ''SHIPMENT_TYPE'' AND MOD_NAME = ''W_TRANSPORTER''',
'ptcn_confirm',
'Shipment Type',
0,
0,
fn_sysdate(),
'BASE ',
'BASE ',
'0',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
UPDATE GENCODES SET FLD_VALUE='Taro Commercial' WHERE FLD_NAME='SHIPMENT_TYPE' AND MOD_NAME='W_TRANSPORTER' AND DESCR='TARO COMMERCIAL';
UPDATE GENCODES SET FLD_VALUE='Taro Fulfillment' WHERE FLD_NAME='SHIPMENT_TYPE' AND MOD_NAME='W_TRANSPORTER' AND DESCR='TARO FULFILLMENT';
COMMIT;
$PBExportHeader$d_gen_label.srd
release 9;
datawindow(units=1 timer_interval=0 color=67108864 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 24 print.margin.right = 24 print.margin.top = 24 print.margin.bottom = 24 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes hidegrayline=no )
summary(height=0 color="536870912" )
footer(height=0 color="536870912" )
detail(height=76 color="536870912" )
table(column=(type=char(10) updatewhereclause=no name=ptcn dbname="ptcn" )
column=(type=char(12) updatewhereclause=no name=wave_id dbname="wave_id" )
column=(type=char(200) updatewhereclause=no name=printer_name dbname="printer_name" )
)
text(band=detail alignment="1" text="Wave Id:" border="6" color="33554432" x="217" y="17" height="16" width="55" html.valueishtml="0" name=wave_id_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=detail alignment="1" text="Printer Name:" border="6" color="33554432" x="16" y="43" height="16" width="75" html.valueishtml="0" name=printer_name_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=detail alignment="1" text="PTCN:" border="6" color="33554432" x="16" y="16" height="16" width="75" html.valueishtml="0" name=ptcn_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=detail id=1 alignment="0" tabsequence=10 border="5" color="33554432" x="96" y="17" height="16" width="102" format="[general]" html.valueishtml="0" name=ptcn visible="1" edit.limit=10 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=3 alignment="0" tabsequence=30 border="5" color="33554432" x="97" y="43" height="16" width="266" html.valueishtml="0" name=printer_name visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="1073741824" )
column(band=detail id=2 alignment="0" tabsequence=20 border="5" color="33554432" x="278" y="17" height="16" width="84" html.valueishtml="0" name=wave_id visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="1073741824" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
import.xml()
export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )
\ No newline at end of file
$PBExportHeader$d_ptcn11.srd
release 9;
datawindow(units=1 timer_interval=0 color=67108864 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 24 print.margin.right = 24 print.margin.top = 24 print.margin.bottom = 24 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes hidegrayline=no )
summary(height=0 color="536870912" )
footer(height=0 color="536870912" )
detail(height=194 color="536870912" )
table(column=(type=date updatewhereclause=no name=from_date dbname="from_date" )
column=(type=date updatewhereclause=no name=to_date dbname="to_date" )
column=(type=char(10) updatewhereclause=no name=tran_code_from dbname="tran_code_from" )
column=(type=char(10) updatewhereclause=no name=tran_code_to dbname="tran_code_to" )
column=(type=char(20) updatewhereclause=no name=shipment_type dbname="shipment_type" )
)
groupbox(band=detail text="Basic"border="5" color="0" x="5" y="0" height="84" width="367" name=gb_1 visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
text(band=detail alignment="1" text="From Date:" border="0" color="0" x="9" y="17" height="16" width="102" html.valueishtml="0" name=from_date_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
text(band=detail alignment="1" text="To Date:" border="0" color="0" x="214" y="17" height="16" width="74" html.valueishtml="0" name=to_date_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
text(band=detail alignment="1" text="Transporter From:" border="0" color="0" x="10" y="39" height="16" width="101" html.valueishtml="0" name=tran_code_from_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
text(band=detail alignment="1" text="Transporter To:" border="0" color="0" x="199" y="39" height="16" width="89" html.valueishtml="0" name=tran_code_to_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
text(band=detail alignment="1" text="Shipment Type:" border="0" color="0" x="10" y="62" height="16" width="101" html.valueishtml="0" name=shipment_type_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
column(band=detail id=1 alignment="0" tabsequence=10 border="5" color="33554432" x="115" y="17" height="16" width="74" format="[general]" html.valueishtml="0" name=from_date visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=2 alignment="0" tabsequence=20 border="5" color="33554432" x="292" y="17" height="16" width="74" format="[general]" html.valueishtml="0" name=to_date visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=3 alignment="0" tabsequence=30 border="5" color="33554432" x="115" y="39" height="16" width="74" format="[general]" html.valueishtml="0" name=tran_code_from visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=4 alignment="0" tabsequence=40 border="5" color="33554432" x="292" y="39" height="16" width="74" format="[general]" html.valueishtml="0" name=tran_code_to visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=5 alignment="0" tabsequence=50 border="5" color="33554432" x="115" y="62" height="16" width="252" format="[general]" html.valueishtml="0" name=shipment_type visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
import.xml()
export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )
\ No newline at end of file
$PBExportHeader$d_ptcn12.srd
release 9;
datawindow(units=1 timer_interval=0 color=67108864 processing=1 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 24 print.margin.right = 24 print.margin.top = 24 print.margin.bottom = 24 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes hidegrayline=no grid.lines=0 )
header(height=20 color="536870912" )
summary(height=1 color="536870912" )
footer(height=0 color="536870912" )
detail(height=22 color="536870912" )
table(column=(type=char(10) updatewhereclause=no name=ptcn dbname="ptcn" )
column=(type=char(10) updatewhereclause=no name=shipment_id dbname="shipment_id" )
column=(type=char(40) updatewhereclause=no name=tran_name dbname="tran_name" )
)
text(band=header alignment="0" text="PTCN" border="6" color="0" x="2" y="2" height="16" width="165" html.valueishtml="0" name=ptcn_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
text(band=header alignment="0" text="Shipment Id" border="6" color="0" x="169" y="2" height="16" width="144" html.valueishtml="0" name=shipment_id_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
text(band=header alignment="0" text="Transporter Name" border="6" color="0" x="315" y="2" height="16" width="841" html.valueishtml="0" name=tran_name_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
column(band=detail id=1 alignment="0" tabsequence=32766 border="5" color="33554432" x="2" y="2" height="19" width="165" format="[general]" html.valueishtml="0" name=ptcn visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=detail id=2 alignment="0" tabsequence=32766 border="5" color="33554432" x="169" y="2" height="19" width="144" format="[general]" html.valueishtml="0" name=shipment_id visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=3 alignment="0" tabsequence=32766 border="5" color="33554432" x="315" y="2" height="19" width="841" format="[general]" html.valueishtml="0" name=tran_name visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
import.xml()
export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )
\ 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