*/
protected String doIt() throws java.lang.Exception
{
// Need to have Template
if (p_EMailPDF && p_R_MailText_ID == 0)
throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@");
log.info ("C_BPartner_ID=" + m_C_BPartner_ID
+ ", C_Invoice_ID=" + m_C_Invoice_ID
+ ", EmailPDF=" + p_EMailPDF + ",R_MailText_ID=" + p_R_MailText_ID
+ ", DateInvoiced=" + m_dateInvoiced_From + "-" + m_dateInvoiced_To
+ ", DocumentNo=" + m_DocumentNo_From + "-" + m_DocumentNo_To);
MMailText mText = null;
if (p_R_MailText_ID != 0)
{
mText = new MMailText(getCtx(), p_R_MailText_ID, get_TrxName());
if (mText.get_ID() != p_R_MailText_ID)
throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@ - " + p_R_MailText_ID);
}
// Too broad selection
if (m_C_BPartner_ID == 0 && m_C_Invoice_ID == 0 && m_dateInvoiced_From == null && m_dateInvoiced_To == null
&& m_DocumentNo_From == null && m_DocumentNo_To == null)
throw new AdempiereUserError ("@RestrictSelection@");
MClient client = MClient.get(getCtx());
// Get Info
StringBuffer sql = new StringBuffer (