[ 1721360 ] Dunning print shows duplicate lines

http://sourceforge.net/tracker/index.php?func=detail&aid=1721360&group_id=176962&atid=879332

* code clean up
This commit is contained in:
teo_sarca 2007-05-18 15:15:34 +00:00
parent d10ad99e6f
commit 3dab921fef
1 changed files with 6 additions and 20 deletions

View File

@ -22,8 +22,6 @@ import org.compiere.model.*;
import org.compiere.print.*;
import org.compiere.util.*;
/**
* Dunning Letter Print
*
@ -79,14 +77,14 @@ public class DunningPrint extends SvrProcess
// Need to have Template
if (p_EMailPDF && p_R_MailText_ID == 0)
throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@");
String subject = "";
// String subject = "";
MMailText mText = null;
if (p_EMailPDF)
{
mText = new MMailText (getCtx(), p_R_MailText_ID, get_TrxName());
if (p_EMailPDF && mText.get_ID() == 0)
throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@ - " + p_R_MailText_ID);
subject = mText.getMailHeader();
// subject = mText.getMailHeader();
}
//
MDunningRun run = new MDunningRun (getCtx(), p_C_DunningRun_ID, get_TrxName());
@ -131,20 +129,8 @@ public class DunningPrint extends SvrProcess
continue;
}
}
// BP Language
Language language = Language.getLoginLanguage(); // Base Language
String tableName = "C_Dunning_Header_v";
if (client.isMultiLingualDocument())
{
tableName += "t";
String AD_Language = bp.getAD_Language();
if (AD_Language != null)
language = Language.getLanguage(AD_Language);
}
format.setLanguage(language);
format.setTranslationLanguage(language);
// query
MQuery query = new MQuery(tableName);
MQuery query = new MQuery("C_Dunning_Header_v");
query.addRestriction("C_DunningRunEntry_ID", MQuery.EQUAL,
new Integer(entry.getC_DunningRunEntry_ID()));