Peer review -> Reversed invoice is create with invoice date

http://sourceforge.net/tracker/?func=detail&atid=879332&aid=2839194&group_id=176962
Better move code to the non-deprecated method
This commit is contained in:
Carlos Ruiz 2009-08-24 22:54:03 +00:00
parent 791623a49d
commit 11d9867a33
1 changed files with 24 additions and 27 deletions

View File

@ -32,7 +32,6 @@ import org.adempiere.exceptions.DBException;
import org.compiere.print.ReportEngine; import org.compiere.print.ReportEngine;
import org.compiere.process.DocAction; import org.compiere.process.DocAction;
import org.compiere.process.DocumentEngine; import org.compiere.process.DocumentEngine;
import org.compiere.report.MReportTree;
import org.compiere.util.CCache; import org.compiere.util.CCache;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -96,31 +95,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter,
String trxName, boolean setOrder) String trxName, boolean setOrder)
{ {
MInvoice to = copyFrom ( from, dateDoc, MInvoice to = new MInvoice (from.getCtx(), 0, trxName);
C_DocTypeTarget_ID, isSOTrx, counter,
trxName, setOrder);
to.setDateAcct (dateAcct);
return to;
}
/**
* @Deprecated
* Create new Invoice by copying
* @param from invoice
* @param dateDoc date of the document date
* @param C_DocTypeTarget_ID target doc type
* @param isSOTrx sales order
* @param counter create counter links
* @param trxName trx
* @param setOrder set Order links
* @return Invoice
*/
public static MInvoice copyFrom (MInvoice from, Timestamp dateDoc,
int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter,
String trxName, boolean setOrder)
{
MInvoice to = new MInvoice (from.getCtx(), 0, null);
to.set_TrxName(trxName);
PO.copyValues (from, to, from.getAD_Client_ID(), from.getAD_Org_ID()); PO.copyValues (from, to, from.getAD_Client_ID(), from.getAD_Org_ID());
to.set_ValueNoCheck ("C_Invoice_ID", I_ZERO); to.set_ValueNoCheck ("C_Invoice_ID", I_ZERO);
to.set_ValueNoCheck ("DocumentNo", null); to.set_ValueNoCheck ("DocumentNo", null);
@ -133,7 +108,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
to.setIsSOTrx(isSOTrx); to.setIsSOTrx(isSOTrx);
// //
to.setDateInvoiced (dateDoc); to.setDateInvoiced (dateDoc);
to.setDateAcct (dateDoc); to.setDateAcct (dateAcct);
to.setDatePrinted(null); to.setDatePrinted(null);
to.setIsPrinted (false); to.setIsPrinted (false);
// //
@ -187,6 +162,28 @@ public class MInvoice extends X_C_Invoice implements DocAction
throw new IllegalStateException("Could not create Invoice Lines"); throw new IllegalStateException("Could not create Invoice Lines");
return to; return to;
}
/**
* @Deprecated
* Create new Invoice by copying
* @param from invoice
* @param dateDoc date of the document date
* @param C_DocTypeTarget_ID target doc type
* @param isSOTrx sales order
* @param counter create counter links
* @param trxName trx
* @param setOrder set Order links
* @return Invoice
*/
public static MInvoice copyFrom (MInvoice from, Timestamp dateDoc,
int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter,
String trxName, boolean setOrder)
{
MInvoice to = copyFrom ( from, dateDoc, dateDoc,
C_DocTypeTarget_ID, isSOTrx, counter,
trxName, setOrder);
return to;
} // copyFrom } // copyFrom
/** /**