public class AccountingApprove extends SuperSOA6
{
public AccountingApprove(BMAConnection scon, BMAAbstractLogDispatcher logMgr,
Vector vRow, CCObject ccMaker, char who, ClaimDateObject claimObj) throws Exception
{
super(scon, logMgr, vRow, ccMaker, claimObj);
this.who = who;
subject = " CLAIM APPROVED";
comment = "CLA APP";
// try
// {
//Get sender list from MainObject. If sender list not found, use default sender - defined in property file
//Sender is the first person in signature loop
/*String senderGlobalId = (String)vRow.elementAt(MainObject.LAST_UPD_BY);
String senderList = "";
if(senderGlobalId != null){
senderList = MainObject.senderList.getEmailId(senderGlobalId);
}
if(senderList.length() > 0){
super.sender = senderList;
}*/
String adjNo = (String)vData.elementAt(ADJ_NO);
String senderEmail = MainObject.senderList.getClaimSender(adjNo);
if(senderEmail.length() > 0){ //overwrite default sender
super.sender = senderEmail;
}
populateSendVec();
generateReport();
// }
// catch(Exception err)
// {
// logMgr.log(new BMALogEvent("test",BMALogLevelConstants.BASIC, err));
// }
}
private void generateReport() throws Exception
{
/* CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C SUBROUTINE FOR PRINTING ACCOUNTING APPROVED C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC*/
BMADateWrapper subDat = (BMADateWrapper)vData.elementAt(SUB_DATE);
String palm = (String)vData.elementAt(PALM);
String prgm = (String)vData.elementAt(PRGM);
String resend = (String)vData.elementAt(RESEND);
String cust = (String)vData.elementAt(CNAME);
String ssvno = (String)vData.elementAt(SSVNO);
Vector vCust = getGivenCustomer();
String prod = (String)vData.elementAt(PRD);
String year = (String)vData.elementAt(YR);
String country = (String)vData.elementAt(COUNTRY);
String qtr = (String)vData.elementAt(QTR);
String custNo = (String)vData.elementAt(BILL_NO);
String custRef = (String)vData.elementAt(REF);
String desc = (String)vData.elementAt(DESC);
String email = (String)vCust.elementAt(CCObject.E_EMAIL);
BMADateWrapper startDate = (BMADateWrapper)vData.elementAt(START_DATE);
BMADateWrapper endDate = (BMADateWrapper)vData.elementAt(END_DATE);
String adjNo = (String)vData.elementAt(ADJ_NO);
String approve = (df.format((Double)vData.elementAt(APPROVE))).toString();
String claim = (df.format((Double)vData.elementAt(CLAIM))).toString();
String credit = (df.format((Double)vData.elementAt(CREDIT))).toString();
String creditNo =(String)vData.elementAt(CREDIT_NO);
BMADateWrapper creditDate = (BMADateWrapper)vData.elementAt(CREDIT_DATE);
Vector vAuditor = ccMaker.findType(CCObject.AUDITOR);
// ADDED NOV 2001
if ((vAuditor == null)||(vAuditor.isEmpty()))
{
vAuditor = ccMaker.getAuditor(vData, true);
vInternal.addElement(vAuditor);
}
String aEmpl = (String)vAuditor.elementAt(CCObject.I_EMPL);
String aName = (String)vAuditor.elementAt(CCObject.I_NAME);
String aEmail = (String)vAuditor.elementAt(CCObject.I_EMAIL_A);
String aEmailId = (String)vAuditor.elementAt(CCObject.I_EMAIL);
String aFax = (String)vAuditor.elementAt(CCObject.I_FAX);
String aPhone = (String)vAuditor.elementAt(CCObject.I_PHONE);
rpt(" ");
StringBuffer line = new StringBuffer();
line.append(spacesX(28));
line.append("* CLAIM PAID IN FULL NOTICE *");
doHeader(line.toString());
line = new StringBuffer();
line.append(" Customer Reference No.: ");
line.append(spacesA(30, custRef));
rpt(line.toString());
line = new StringBuffer();
line.append(" Activity Description: ");
//line.append(spacesA(57, desc));
line.append(spacesA(60, desc)); //changed on Mar 16,2004
rpt(line.toString());
Vector vCom = com.getAllComments("C");
linePrinted = false;
for(int i=0; i<vCom.size(); i++)
{
String data = (String)((Vector)vCom.elementAt(i)).elementAt(Comments.DATA);
line = new StringBuffer();
if(linePrinted)
{
line.append(spacesX(25));
line.append(spacesA(60, data));
}
else
{
line.append(" Activity Comments: ");
line.append(spacesA(60, data));
linePrinted = true;
}
rpt(line.toString());
}
/*rpt(" ");
line = new StringBuffer();
line.append(" Customer Claimed Amount: $");
line.append(spacesF(10, claim));
rpt(line.toString());
line = new StringBuffer();
line.append(" bmcc Paid Amount: $");
line.append(spacesF(10, credit));
line.append(" bmcc Credit Memo #: ");
line.append(spacesA(16, creditNo));
rpt(line.toString());
line = new StringBuffer();
line.append(spacesX(38));
line.append(" Credit Memo Date: ");
line.append(spacesA(11, creditDate.toString()));
rpt(line.toString()); */
Vector vCrNums = parseMemoNumber(creditNo);
line = new StringBuffer();
line.append(" Total Approved Amount: $");
line.append(spacesF(10, approve));
line.append(" Payment Date: ");
line.append(spacesA(11, creditDate.toString()));
rpt(line.toString());
line = new StringBuffer();
line.append(" Customer Claimed Amount: $");
line.append(spacesF(10, claim));
line.append(" Payment No.: ");
if ((vCrNums != null)&&(vCrNums.size() > 0))
{
line.append(vCrNums.elementAt(0));
}
rpt(line.toString());
line = new StringBuffer();
line.append(" bmcc Paid Amount: $");
line.append(spacesF(10, credit));
line.append(spacesX(28));
if ((vCrNums != null)&&(vCrNums.size() > 1))
{
line.append(vCrNums.elementAt(1));
}
rpt(line.toString());
line = new StringBuffer();
line.append(spacesX(37));
line.append(spacesX(28));
if ((vCrNums != null)&&(vCrNums.size() > 2))
{
line.append(vCrNums.elementAt(2));
}
rpt(line.toString());
line = new StringBuffer();
line.append(" Dear ");
line.append(spacesA(15, findFirst((String)vCust.elementAt(CCObject.E_NAME))));
rpt(line.toString());
rpt(" ");
rpt(" The audit of your claim, referenced above, has resulted in payment in full. ");
rpt(" Please contact me if you have questions regarding the content of this notice. ");
rpt(" ");
doFooter("Sales Prog. Auditor", vAuditor);
rpt(" ");
printCC();
}
//{{DECLARE_CONTROLS
//}}
}