Reversed invoice is create with invoice date
http://sourceforge.net/tracker/?func=detail&atid=879332&aid=2839194&group_id=176962 A new method was implemented and the Account date now is a parameter the original method was deprecated kind regards Victor Perez www.e-evolution.com
This commit is contained in:
parent
72ee6e0bdd
commit
791623a49d
|
@ -81,6 +81,30 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
} // getOfBPartner
|
||||
|
||||
/**
|
||||
* Create new Invoice by copying
|
||||
* @param from invoice
|
||||
* @param dateDoc date of the document date
|
||||
* @param acctDate original account 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, Timestamp dateAcct,
|
||||
int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter,
|
||||
String trxName, boolean setOrder)
|
||||
{
|
||||
MInvoice to = copyFrom ( from, dateDoc,
|
||||
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
|
||||
|
@ -109,7 +133,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
to.setIsSOTrx(isSOTrx);
|
||||
//
|
||||
to.setDateInvoiced (dateDoc);
|
||||
to.setDateAcct (from.getDateAcct());
|
||||
to.setDateAcct (dateDoc);
|
||||
to.setDatePrinted(null);
|
||||
to.setIsPrinted (false);
|
||||
//
|
||||
|
@ -1879,7 +1903,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
}
|
||||
|
||||
// Deep Copy
|
||||
MInvoice counter = copyFrom(this, getDateInvoiced(),
|
||||
MInvoice counter = copyFrom(this, getDateInvoiced(), getDateAcct(),
|
||||
C_DocTypeTarget_ID, !isSOTrx(), true, get_TrxName(), true);
|
||||
//
|
||||
counter.setAD_Org_ID(counterAD_Org_ID);
|
||||
|
@ -2055,7 +2079,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
load(get_TrxName()); // reload allocation reversal info
|
||||
|
||||
// Deep Copy
|
||||
MInvoice reversal = copyFrom (this, getDateInvoiced(),
|
||||
MInvoice reversal = copyFrom (this, getDateInvoiced(), getDateAcct(),
|
||||
getC_DocType_ID(), isSOTrx(), false, get_TrxName(), true);
|
||||
if (reversal == null)
|
||||
{
|
||||
|
|
|
@ -107,7 +107,7 @@ public class MRecurring extends X_C_Recurring
|
|||
else if (getRecurringType().equals(MRecurring.RECURRINGTYPE_Invoice))
|
||||
{
|
||||
MInvoice from = new MInvoice (getCtx(), getC_Invoice_ID(), get_TrxName());
|
||||
MInvoice invoice = MInvoice.copyFrom (from, dateDoc,
|
||||
MInvoice invoice = MInvoice.copyFrom (from, dateDoc, dateDoc,
|
||||
from.getC_DocType_ID(), from.isSOTrx(), false, get_TrxName(), false);
|
||||
run.setC_Invoice_ID(invoice.getC_Invoice_ID());
|
||||
msg += invoice.getDocumentNo();
|
||||
|
|
Loading…
Reference in New Issue