Commit 5eaf270a authored by mpatidar's avatar mpatidar

After modify item change on lot_sl and mfg_date


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91709 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 06187974
......@@ -2227,9 +2227,19 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
//}
//else
//{
mexpDate = expDate; //genericUtility.getValidDateString( ( mexpDateStr == null ? : mexpDateStr ), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//Commented By Mahesh Patidar on 04/05/2012 for set expire date from dom if not found in stock
//mexpDate = expDate; //genericUtility.getValidDateString( ( mexpDateStr == null ? : mexpDateStr ), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//}
//Added By Mahesh Patidar on 04/05/2012 for set expire date from dom if not found in stock
if(expDate != null)
{
mexpDate = expDate;
}
else
{
mexpDate = Timestamp.valueOf(genericUtility.getValidDateString( ( mexpDateStr == null ? getCurrdateInAppFormat() : mexpDateStr ), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}//ended By Mahesh Patidar
String ldtLrdateStr = genericUtility.getColumnValue( "lr_date", dom1 );
ldtLrdate = ldtLrdateStr == null ? null : Timestamp.valueOf(genericUtility.getValidDateString( ( ldtLrdateStr == null ? getCurrdateInAppFormat() : ldtLrdateStr ), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
......@@ -2364,6 +2374,86 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
{
valueXmlString.append("<discount>").append("<![CDATA[" + mdisc + "]]>").append("</discount>");
}
// else part added by Mahesh Patidar on 28/03/12 for discount value change according to lot_sl
else
{
itemCode = genericUtility.getColumnValue("item_code", dom);
invoiceId = genericUtility.getColumnValue("invoice_id", dom1);
retReplFlag = genericUtility.getColumnValue("ret_rep_flag", dom);
lineNoTrace = genericUtility.getColumnValue("line_no__invtrace", dom);
iLineNoTrace = Integer.parseInt( getNumString( lineNoTrace ) );
if (invoiceId != null && invoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( invoiceId.trim() ) )
{
System.out.println( " retReplFlag :2: " + retReplFlag );
if (retReplFlag.equals("R"))
{
sql = "select sord_no, sord_line_no "
+ " from invoice_trace "
+ " where invoice_id = ? "
+ " and line_no = ? ";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, invoiceId );
pstmt.setInt( 2, iLineNoTrace );
rs = pstmt.executeQuery();
if( rs.next() )
{
sorder = rs.getString(1);
sordLineNo = rs.getString(2);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
sql = "select count(1) from invoice_trace "
+ " where invoice_id = ? "
+ " and item_code = ? "
+ " and sord_no = ? "
+ " and sord_line_no = ? "
+ " and item_code <> item_code__ord " ;
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, invoiceId );
pstmt.setString( 2, itemCode );
pstmt.setString( 3, sorder );
pstmt.setString( 4, sordLineNo );
rs = pstmt.executeQuery();
cnt = 0;
if( rs.next() )
{
cnt = rs.getInt(1);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
System.out.println( " cnt :1: " + cnt );
if(cnt == 0)
{
System.out.println( "if in " );
sql = "select discount "
+ " from invoice_trace "
+ " where invoice_id = ? "
+ " and line_no = ? ";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, invoiceId);
pstmt.setInt( 2, iLineNoTrace);
rs = pstmt.executeQuery();
if( rs.next() )
{
discount = rs.getDouble(1);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
}
}
valueXmlString.append("<discount>").append("<![CDATA[" + discount + "]]>").append("</discount>");
setNodeValue( dom, "discount", discount );
} // ended else by Mahesh
mtranDateStr = genericUtility.getColumnValue( "tran_date", dom1 );
mtranDate = Timestamp.valueOf(genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");//dw_header.getitemdatetime(1,"tran_date")
sqlStr = "select count(*) mcount1 " //into :mcount1
......@@ -2615,17 +2705,20 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
{
mexpDate = null; //setnull(mexp_date)
valueXmlString.append("<exp_date>").append("<![CDATA["+""+"]]>").append("</exp_date>");
setNodeValue( dom, "exp_date", "" ); //Added By Mahesh Patidar on 04/05/2012 for set expiry date in node
}
else
{
mexpDate = distCommon.CalcExpiry( mmfgDate, mshlife );
valueXmlString.append("<exp_date>").append("<![CDATA[" + genericUtility.getValidDateString( mexpDate.toString(),genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) + "]]>").append("</exp_date>");
setNodeValue( dom, "exp_date", genericUtility.getValidDateString( mexpDate.toString(),genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ));//Added By Mahesh Patidar on 04/05/2012 for set expiry date in node
}
}
else
{
mexpDate = null; //setnull(mexp_date)
valueXmlString.append("<exp_date>").append("<![CDATA["+""+"]]>").append("</exp_date>");
setNodeValue( dom, "exp_date", "" );//Added By Mahesh Patidar on 04/05/2012 for set expiry date in node
}
//dw_detedit[ii_currformno].setitem(1,"exp_date",mexp_date)
......@@ -2633,17 +2726,26 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
if((mexpDate != null ) || (!(mexpDate.equals(""))))
{
mtranDateStr = genericUtility.getColumnValue( "tran_date", dom1 ); // dw_header.getitemdatetime(1,"tran_date")
mtranDate = Timestamp.valueOf(genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");// Added By Mahesh Patidar on 04/05/12 for convert the trandate string to tran date
mtranDateStr = genericUtility.getColumnValue( "exp_date", dom ); //Added By Mahesh on 04/05/12 for getting the expiry date
mexpDate = Timestamp.valueOf(genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
mtranDateStr = genericUtility.getColumnValue( "lr_date", dom1 ); // dw_header.getitemdatetime(1,"lr_date")
mtranDate = Timestamp.valueOf(genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//mtranDate = Timestamp.valueOf(genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");//Commented By Mahesh Patidar on 04/05/12
// 17/06/10 manoharan commented and put in else condition as null is to be taken care off
//ldtLrdate = Timestamp.valueOf(genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
if( ldtLrdate == null || "19000101".equals( genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), "yyyymmdd" ) ) ) //Isnull(ldt_lrdate) or string(ldt_lrdate,"yyyymmdd") = "19000101" then
//Commented By Mahesh Patidar on 04/05/12 for checking the lr date is null or not i null then set tran date as a lr date
//if( ldtLrdate == null || "19000101".equals( genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), "yyyymmdd" ) ) ) //Isnull(ldt_lrdate) or string(ldt_lrdate,"yyyymmdd") = "19000101" then
//{
// ldtLrdate = mtranDate;
//}
//Ended By Mahesh Patidar
//Added By Mahesh Patidar on 04/05/12 for checking lr date is null or not
if( mtranDateStr == null || !(mtranDateStr.trim().length() > 0) || "19000101".equals( genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), "yyyymmdd" ) ) ) //Isnull(ldt_lrdate) or string(ldt_lrdate,"yyyymmdd") = "19000101" then
{
ldtLrdate = mtranDate;
}
//Ended By Mahesh Patidar
else
{
ldtLrdate = Timestamp.valueOf(genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
......@@ -3049,6 +3151,17 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
valueXmlString.append("<rate protect =\"0\">").append("<![CDATA["+ ( sRate == null || sRate.trim().length() == 0 ? "0" : sRate ) +"]]>").append("</rate>");
}
}//end of status
//Added By Mahesh Patidar on 07/05/12 add item change on exp_date
else if (currentColumn.trim().equals( "exp_date" ) )
{
reStr = itemChanged(dom, dom1, dom2, objContext, "lot_sl", editFlag, xtraParams);
pos = reStr.indexOf("<Detail2>");
reStr = reStr.substring(pos + 9);
pos = reStr.indexOf("</Detail2>");
reStr = reStr.substring(0,pos);
valueXmlString.append(reStr);
}
//ended By Mahesh Patidar
else if (currentColumn.trim().equals( "stk_opt" ) )
{
mstkOpt = genericUtility.getColumnValue( "stk_opt", dom ); //dw_detedit[ii_currformno].getitemstring(1,"stk_opt")
......
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