* Personal Details
*/
PdfPTable table = new PdfPTable(2); // 2 columns.
ArrayList<PdfPCell> cellList = new ArrayList<PdfPCell>();
cellList.add(new PdfPCell(new Phrase("Staff ID:")));
cellList.add(new PdfPCell(new Phrase(this.profileRef.getStaffid())));
cellList.add(new PdfPCell(new Phrase("Title:")));
cellList.add(new PdfPCell(new Phrase(this.profileRef.getTitle())));
cellList.add(new PdfPCell(new Phrase("Surname:")));
cellList.add(new PdfPCell(new Phrase(this.profileRef.getFamilyname())));
cellList.add(new PdfPCell(new Phrase("First Name:")));
cellList.add(new PdfPCell(new Phrase(this.profileRef.getFirstname())));
for (int i = 0; i < cellList.size(); i++) {
if (i % 2 == 0) {
cellList.get(i).setBorder(Rectangle.NO_BORDER);
}
table.addCell(cellList.get(i));
}
document.add(table);
/**
* Travel Details
*/
table = new PdfPTable(2);
cellList = new ArrayList<PdfPCell>();
newLine(document);
document.add(new Paragraph("Travel", mediumFont));
newLine(document);
cellList.add(new PdfPCell(new Phrase("Application Name:")));
cellList.add(new PdfPCell(new Phrase(this.appRef.getDescription())));
cellList.add(new PdfPCell(new Phrase("Date of Initial Departure:")));
cellList.add(new PdfPCell(new Phrase(df.format(this.travelRef.getDatedeparture()))));
cellList.add(new PdfPCell(new Phrase("Date of Final Return:")));
cellList.add(new PdfPCell(new Phrase(df.format(this.travelRef.getDatereturn()))));
cellList.add(new PdfPCell(new Phrase("Purpose of Travel:")));
cellList.add(new PdfPCell(new Phrase(this.travelRef.getDescription())));
for (int i = 0; i < cellList.size(); i++) {
if (i % 2 == 0) {
cellList.get(i).setBorder(Rectangle.NO_BORDER);
}
table.addCell(cellList.get(i));
}
document.add(table);
/**
* Itinerary Details
*/
table = new PdfPTable(4);
table.setWidthPercentage(90f);
table.setHeaderRows(1);
cellList = new ArrayList<PdfPCell>();
newLine(document);
document.add(new Paragraph("Itinerary", mediumFont));
newLine(document);
cellList.add(new PdfPCell(new Phrase("Date", bold)));
cellList.add(new PdfPCell(new Phrase("Destination", bold)));
cellList.add(new PdfPCell(new Phrase("Leave Type", bold)));
cellList.add(new PdfPCell(new Phrase("Travel Day/ Work Day", bold)));
for (Itinerary i : hops) {
//cellList.add(new PdfPCell(new Phrase(df.format(i.getDate()))));
cellList.add(new PdfPCell(new Phrase("BLANK")));
cellList.add(new PdfPCell(new Phrase(i.getDestinationCity())));
cellList.add(new PdfPCell(new Phrase(i.getLeavetype())));
cellList.add(new PdfPCell(new Phrase(i.getTravelday())));
}
for (int i = 0; i < cellList.size(); i++) {
table.addCell(cellList.get(i));
}
document.add(table);
/**
* Quote CostCenter
*/
table = new PdfPTable(2);
cellList = new ArrayList<PdfPCell>();
newLine(document);
document.add(new Paragraph("Quotes", mediumFont));
newLine(document);
cellList.add(new PdfPCell(new Phrase("Cost Center:")));
cellList.add(new PdfPCell(new Phrase(this.quoteRef.getCostcenter())));
for (int i = 0; i < cellList.size(); i++) {
if (i % 2 == 0) {
cellList.get(i).setBorder(Rectangle.NO_BORDER);
}
table.addCell(cellList.get(i));
}
document.add(table);
/**
* Flight Quotes
*/
table = new PdfPTable(4);
table.setWidthPercentage(90f);
table.setHeaderRows(1);
cellList = new ArrayList<PdfPCell>();
newLine(document);
document.add(new Paragraph("Flight Quotes", mediumFont));
newLine(document);
cellList.add(new PdfPCell(new Phrase("From", bold)));
cellList.add(new PdfPCell(new Phrase("To", bold)));
cellList.add(new PdfPCell(new Phrase("Airline", bold)));
cellList.add(new PdfPCell(new Phrase("Cost Quoted", bold)));
Flightquotes f = selectedFlgQte;
cellList.add(new PdfPCell(new Phrase(f.getFlightfromCity())));
cellList.add(new PdfPCell(new Phrase(f.getFlighttoCity())));
cellList.add(new PdfPCell(new Phrase(f.getQuotesource())));
cellList.add(new PdfPCell(new Phrase(f.getCurrency() + " " + f.getQuotecost().toString())));
for (int i = 0; i < cellList.size(); i++) {
table.addCell(cellList.get(i));
}
document.add(table);
/**
* Car Quotes
*/
table = new PdfPTable(4);
table.setWidthPercentage(90f);
table.setHeaderRows(1);
cellList = new ArrayList<PdfPCell>();
newLine(document);
document.add(new Paragraph("Flight Quotes", mediumFont));
newLine(document);
cellList.add(new PdfPCell(new Phrase("Collect Date", bold)));
cellList.add(new PdfPCell(new Phrase("Return Date", bold)));
cellList.add(new PdfPCell(new Phrase("Rental Company", bold)));
cellList.add(new PdfPCell(new Phrase("Cost Quoted", bold)));
Carquotes c = selectedCarQte;
cellList.add(new PdfPCell(new Phrase(df.format(c.getDatecollect()))));
cellList.add(new PdfPCell(new Phrase(df.format(c.getDatereturn()))));
cellList.add(new PdfPCell(new Phrase(c.getProvider())));
cellList.add(new PdfPCell(new Phrase(c.getCurrency() + " " + c.getQuotecost().toString())));
for (int i = 0; i < cellList.size(); i++) {
table.addCell(cellList.get(i));
}
document.add(table);
/**
* Accommodation Quotes
*/
table = new PdfPTable(5);
table.setWidthPercentage(90f);
table.setHeaderRows(1);
cellList = new ArrayList<PdfPCell>();
newLine(document);
document.add(new Paragraph("Accomodation Quotes", mediumFont));
newLine(document);
cellList.add(new PdfPCell(new Phrase("Location", bold)));
cellList.add(new PdfPCell(new Phrase("Checkin Date", bold)));
cellList.add(new PdfPCell(new Phrase("Checkout Date", bold)));
cellList.add(new PdfPCell(new Phrase("Hotel", bold)));
cellList.add(new PdfPCell(new Phrase("Cost Quoted", bold)));
Accomodationquotes a = selectedAccQte;
cellList.add(new PdfPCell(new Phrase(a.getCity())));
cellList.add(new PdfPCell(new Phrase(df.format(a.getDatecheckin()))));
cellList.add(new PdfPCell(new Phrase(df.format(a.getDatecheckout()))));
cellList.add(new PdfPCell(new Phrase(a.getAccomodationprovider())));
cellList.add(new PdfPCell(new Phrase(a.getCurrency() + " " + a.getQuotecost().toString())));
for (int i = 0; i < cellList.size(); i++) {
table.addCell(cellList.get(i));
}
document.add(table);
/**
* Approval Section
*/
newLine(document);
table = new PdfPTable(2);
cellList = new ArrayList<PdfPCell>();
newLine(document);
document.add(new Paragraph("Approval", mediumFont));
newLine(document);
cellList.add(new PdfPCell(new Phrase("Approved:")));
cellList.add(new PdfPCell(new Phrase(this.getApproved() == 1 ? "YES" : "NO")));
cellList.add(new PdfPCell(new Phrase("Authorizer Name:")));
cellList.add(new PdfPCell(new Phrase(this.getApprovalName())));
cellList.add(new PdfPCell(new Phrase("Authorizer Comments:")));
cellList.add(new PdfPCell(new Phrase(this.getApprovalComment())));
for (int i = 0; i < cellList.size(); i++) {
if (i % 2 == 0) {
cellList.get(i).setBorder(Rectangle.NO_BORDER);
}