| Line 12... |
Line 12... |
| 12 |
import in.shop2020.model.v1.inventory.InventoryServiceException;
|
12 |
import in.shop2020.model.v1.inventory.InventoryServiceException;
|
| 13 |
import in.shop2020.model.v1.inventory.Warehouse;
|
13 |
import in.shop2020.model.v1.inventory.Warehouse;
|
| 14 |
import in.shop2020.model.v1.order.Attribute;
|
14 |
import in.shop2020.model.v1.order.Attribute;
|
| 15 |
import in.shop2020.model.v1.order.LineItem;
|
15 |
import in.shop2020.model.v1.order.LineItem;
|
| 16 |
import in.shop2020.model.v1.order.Order;
|
16 |
import in.shop2020.model.v1.order.Order;
|
| - |
|
17 |
import in.shop2020.model.v1.order.OrderSource;
|
| 17 |
import in.shop2020.model.v1.order.OrderStatus;
|
18 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 18 |
import in.shop2020.model.v1.order.OrderType;
|
19 |
import in.shop2020.model.v1.order.OrderType;
|
| 19 |
import in.shop2020.thrift.clients.CatalogClient;
|
20 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 20 |
import in.shop2020.thrift.clients.LogisticsClient;
|
21 |
import in.shop2020.thrift.clients.LogisticsClient;
|
| 21 |
import in.shop2020.thrift.clients.TransactionClient;
|
22 |
import in.shop2020.thrift.clients.TransactionClient;
|
| Line 27... |
Line 28... |
| 27 |
import java.io.FileOutputStream;
|
28 |
import java.io.FileOutputStream;
|
| 28 |
import java.io.IOException;
|
29 |
import java.io.IOException;
|
| 29 |
import java.text.DateFormat;
|
30 |
import java.text.DateFormat;
|
| 30 |
import java.text.DecimalFormat;
|
31 |
import java.text.DecimalFormat;
|
| 31 |
import java.util.ArrayList;
|
32 |
import java.util.ArrayList;
|
| 32 |
import java.util.Calendar;
|
- |
|
| 33 |
import java.util.Date;
|
33 |
import java.util.Date;
|
| 34 |
import java.util.Enumeration;
|
34 |
import java.util.Enumeration;
|
| 35 |
import java.util.GregorianCalendar;
|
- |
|
| 36 |
import java.util.List;
|
35 |
import java.util.List;
|
| 37 |
import java.util.Locale;
|
36 |
import java.util.Locale;
|
| 38 |
import java.util.Properties;
|
37 |
import java.util.Properties;
|
| 39 |
import java.util.ResourceBundle;
|
38 |
import java.util.ResourceBundle;
|
| 40 |
|
39 |
|
| Line 274... |
Line 273... |
| 274 |
|
273 |
|
| 275 |
PdfPTable table = new PdfPTable(1);
|
274 |
PdfPTable table = new PdfPTable(1);
|
| 276 |
table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
275 |
table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
| 277 |
|
276 |
|
| 278 |
PdfPTable logoTable = new PdfPTable(2);
|
277 |
PdfPTable logoTable = new PdfPTable(2);
|
| 279 |
logoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
- |
|
| 280 |
logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
|
- |
|
| 281 |
logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
|
- |
|
| 282 |
logoTable.addCell(getLogoCell());
|
278 |
addLogoTable(logoTable, order);
|
| 283 |
if(order.isLogisticsCod())
|
- |
|
| 284 |
logoTable.addCell(new Phrase("COD ", helvetica28));
|
- |
|
| 285 |
else
|
279 |
|
| 286 |
logoTable.addCell(new Phrase(" ", helvetica28));
|
- |
|
| 287 |
PdfPCell titleCell = getTitleCell();
|
280 |
PdfPCell titleCell = getTitleCell();
|
| 288 |
PdfPTable customerTable = getCustomerAddressTable(order, destCode, false, helvetica12, false);
|
281 |
PdfPTable customerTable = getCustomerAddressTable(order, destCode, false, helvetica12, false);
|
| 289 |
PdfPTable providerInfoTable = getProviderTable(order, provider, barCodeFont);
|
282 |
PdfPTable providerInfoTable = getProviderTable(order, provider, barCodeFont);
|
| 290 |
|
283 |
|
| 291 |
PdfPTable dispatchTable = new PdfPTable(new float[]{0.5f, 0.1f, 0.4f});
|
284 |
PdfPTable dispatchTable = new PdfPTable(new float[]{0.5f, 0.1f, 0.4f});
|
| Line 301... |
Line 294... |
| 301 |
|
294 |
|
| 302 |
PdfPTable chargesTable = new PdfPTable(1);
|
295 |
PdfPTable chargesTable = new PdfPTable(1);
|
| 303 |
chargesTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
296 |
chargesTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
| 304 |
chargesTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
|
297 |
chargesTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
|
| 305 |
if(order.isLogisticsCod()){
|
298 |
if(order.isLogisticsCod()){
|
| 306 |
chargesTable.addCell(new Phrase("AMOUNT TO BE COLLECTED : Rs " + (order.getTotal_amount()-order.getGvAmount()), helveticaBold12));
|
299 |
chargesTable.addCell(new Phrase("AMOUNT TO BE COLLECTED : Rs " + (order.getTotal_amount()-order.getGvAmount()-order.getAdvanceAmount()), helveticaBold12));
|
| 307 |
chargesTable.addCell(new Phrase("RTO ADDRESS:DEL/HPW/111116"));
|
300 |
chargesTable.addCell(new Phrase("RTO ADDRESS:DEL/HPW/111116"));
|
| 308 |
} else {
|
301 |
} else {
|
| 309 |
chargesTable.addCell(new Phrase("Do not pay any extra charges to the Courier."));
|
302 |
chargesTable.addCell(new Phrase("Do not pay any extra charges to the Courier."));
|
| 310 |
}
|
303 |
}
|
| 311 |
|
304 |
|
| Line 321... |
Line 314... |
| 321 |
table.addCell(new Phrase("If undelivered, return to:", helvetica10));
|
314 |
table.addCell(new Phrase("If undelivered, return to:", helvetica10));
|
| 322 |
table.addCell(addressAndNoteTable);
|
315 |
table.addCell(addressAndNoteTable);
|
| 323 |
return table;
|
316 |
return table;
|
| 324 |
}
|
317 |
}
|
| 325 |
|
318 |
|
| - |
|
319 |
private void addLogoTable(PdfPTable logoTable, Order order) {
|
| - |
|
320 |
logoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
| - |
|
321 |
logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
|
| - |
|
322 |
logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
|
| - |
|
323 |
|
| - |
|
324 |
PdfPCell logoCell;
|
| - |
|
325 |
String logoPath;
|
| - |
|
326 |
|
| - |
|
327 |
if(order.getSource() == OrderSource.WEBSITE.getValue()){
|
| - |
|
328 |
logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
|
| - |
|
329 |
|
| - |
|
330 |
try {
|
| - |
|
331 |
logoCell = new PdfPCell(Image.getInstance(logoPath), false);
|
| - |
|
332 |
} catch (Exception e) {
|
| - |
|
333 |
//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
|
| - |
|
334 |
logger.warn("Couldn't load the Saholic logo: ", e);
|
| - |
|
335 |
logoCell = new PdfPCell(new Phrase("Saholic Logo"));
|
| - |
|
336 |
}
|
| - |
|
337 |
logoCell.setBorder(Rectangle.NO_BORDER);
|
| - |
|
338 |
logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
| - |
|
339 |
|
| - |
|
340 |
logoTable.addCell(logoCell);
|
| - |
|
341 |
|
| - |
|
342 |
}
|
| - |
|
343 |
|
| - |
|
344 |
if(order.getSource() == OrderSource.STORE.getValue()){
|
| - |
|
345 |
logoPath = InvoiceGenerationService.class.getResource("/Hotspot-Logo.jpg").getPath();
|
| - |
|
346 |
|
| - |
|
347 |
try {
|
| - |
|
348 |
logoCell = new PdfPCell(Image.getInstance(logoPath), false);
|
| - |
|
349 |
} catch (Exception e) {
|
| - |
|
350 |
//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
|
| - |
|
351 |
logger.warn("Couldn't load the Saholic logo: ", e);
|
| - |
|
352 |
logoCell = new PdfPCell(new Phrase("Hotspot Logo"));
|
| - |
|
353 |
}
|
| - |
|
354 |
logoCell.setBorder(Rectangle.NO_BORDER);
|
| - |
|
355 |
logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
| - |
|
356 |
|
| - |
|
357 |
logoTable.addCell(logoCell);
|
| - |
|
358 |
|
| - |
|
359 |
logoPath = InvoiceGenerationService.class.getResource("/Saholic-Logo.jpg").getPath();
|
| - |
|
360 |
|
| - |
|
361 |
try {
|
| - |
|
362 |
logoCell = new PdfPCell(Image.getInstance(logoPath), false);
|
| - |
|
363 |
} catch (Exception e) {
|
| - |
|
364 |
//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
|
| - |
|
365 |
logger.warn("Couldn't load the Saholic logo: ", e);
|
| - |
|
366 |
logoCell = new PdfPCell(new Phrase("Saholic Logo"));
|
| - |
|
367 |
}
|
| - |
|
368 |
logoCell.setBorder(Rectangle.NO_BORDER);
|
| - |
|
369 |
logoCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
|
| - |
|
370 |
logoTable.addCell(logoCell);
|
| - |
|
371 |
|
| - |
|
372 |
}
|
| - |
|
373 |
}
|
| - |
|
374 |
|
| 326 |
private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
|
375 |
private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
|
| 327 |
String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
|
376 |
String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
|
| 328 |
FontFactoryImp ttfFontFactory = new FontFactoryImp();
|
377 |
FontFactoryImp ttfFontFactory = new FontFactoryImp();
|
| 329 |
ttfFontFactory.register(fontPath, "barcode");
|
378 |
ttfFontFactory.register(fontPath, "barcode");
|
| 330 |
Font barCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, barcodeFontSize);
|
379 |
Font barCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, barcodeFontSize);
|
| 331 |
return barCodeFont;
|
380 |
return barCodeFont;
|
| 332 |
}
|
381 |
}
|
| 333 |
|
382 |
|
| 334 |
private PdfPCell getLogoCell() {
|
- |
|
| 335 |
String logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
|
- |
|
| 336 |
PdfPCell logoCell;
|
- |
|
| 337 |
try {
|
- |
|
| 338 |
logoCell = new PdfPCell(Image.getInstance(logoPath), false);
|
- |
|
| 339 |
} catch (Exception e) {
|
- |
|
| 340 |
//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
|
- |
|
| 341 |
logger.warn("Couldn't load the Saholic logo: ", e);
|
- |
|
| 342 |
logoCell = new PdfPCell(new Phrase("Saholic Logo"));
|
- |
|
| 343 |
}
|
- |
|
| 344 |
logoCell.setBorder(Rectangle.NO_BORDER);
|
- |
|
| 345 |
return logoCell;
|
- |
|
| 346 |
}
|
- |
|
| 347 |
|
- |
|
| 348 |
private PdfPCell getTitleCell() {
|
383 |
private PdfPCell getTitleCell() {
|
| 349 |
PdfPCell titleCell = new PdfPCell(new Phrase("Dispatch Advice", helveticaBold12));
|
384 |
PdfPCell titleCell = new PdfPCell(new Phrase("Dispatch Advice", helveticaBold12));
|
| 350 |
titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
|
385 |
titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
|
| 351 |
titleCell.setBorder(Rectangle.NO_BORDER);
|
386 |
titleCell.setBorder(Rectangle.NO_BORDER);
|
| 352 |
return titleCell;
|
387 |
return titleCell;
|
| 353 |
}
|
388 |
}
|
| 354 |
|
389 |
|
| 355 |
private PdfPTable getProviderTable(Order order, Provider provider, Font barCodeFont) {
|
390 |
private PdfPTable getProviderTable(Order order, Provider provider, Font barCodeFont) {
|
| 356 |
PdfPTable providerInfoTable = new PdfPTable(1);
|
391 |
PdfPTable providerInfoTable = new PdfPTable(1);
|
| 357 |
providerInfoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
392 |
providerInfoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
| - |
|
393 |
if(order.isLogisticsCod()){
|
| - |
|
394 |
PdfPCell deliveryTypeCell = new PdfPCell(new Phrase("COD ", helvetica28));
|
| - |
|
395 |
deliveryTypeCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
|
| - |
|
396 |
deliveryTypeCell.setBorder(Rectangle.NO_BORDER);
|
| - |
|
397 |
providerInfoTable.addCell(deliveryTypeCell);
|
| - |
|
398 |
}
|
| - |
|
399 |
|
| - |
|
400 |
|
| - |
|
401 |
|
| - |
|
402 |
|
| 358 |
PdfPCell providerNameCell = new PdfPCell(new Phrase(provider.getName(), helveticaBold12));
|
403 |
PdfPCell providerNameCell = new PdfPCell(new Phrase(provider.getName(), helveticaBold12));
|
| 359 |
providerNameCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
404 |
providerNameCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
| 360 |
providerNameCell.setBorder(Rectangle.NO_BORDER);
|
405 |
providerNameCell.setBorder(Rectangle.NO_BORDER);
|
| 361 |
|
406 |
|
| 362 |
PdfPCell awbNumberCell = new PdfPCell(new Paragraph("*" + order.getAirwaybill_no() + "*", barCodeFont));
|
407 |
PdfPCell awbNumberCell = new PdfPCell(new Paragraph("*" + order.getAirwaybill_no() + "*", barCodeFont));
|
| Line 400... |
Line 445... |
| 400 |
invoiceTable.addCell(getInsuranceCell(4));
|
445 |
invoiceTable.addCell(getInsuranceCell(4));
|
| 401 |
invoiceTable.addCell(getPriceCell(order.getInsuranceAmount()));
|
446 |
invoiceTable.addCell(getPriceCell(order.getInsuranceAmount()));
|
| 402 |
invoiceTable.addCell(getPriceCell(order.getInsuranceAmount()));
|
447 |
invoiceTable.addCell(getPriceCell(order.getInsuranceAmount()));
|
| 403 |
}
|
448 |
}
|
| 404 |
|
449 |
|
| - |
|
450 |
if(order.getSource() == OrderSource.STORE.getValue()) {
|
| - |
|
451 |
invoiceTable.addCell(getAdvanceAmountCell(4));
|
| - |
|
452 |
invoiceTable.addCell(getPriceCell(order.getAdvanceAmount()));
|
| - |
|
453 |
invoiceTable.addCell(getPriceCell(order.getAdvanceAmount()));
|
| - |
|
454 |
}
|
| - |
|
455 |
|
| 405 |
invoiceTable.addCell(getTotalCell(4));
|
456 |
invoiceTable.addCell(getTotalCell(4));
|
| 406 |
invoiceTable.addCell(getRupeesCell());
|
457 |
invoiceTable.addCell(getRupeesCell());
|
| 407 |
invoiceTable.addCell(getTotalAmountCell(order.getTotal_amount()-order.getGvAmount()));
|
458 |
invoiceTable.addCell(getTotalAmountCell(order.getTotal_amount()-order.getGvAmount()-order.getAdvanceAmount()));
|
| 408 |
|
459 |
|
| 409 |
PdfPCell tinCell = new PdfPCell(new Phrase("TIN NO. " + tinNo, helvetica8));
|
460 |
PdfPCell tinCell = new PdfPCell(new Phrase("TIN NO. " + tinNo, helvetica8));
|
| 410 |
tinCell.setColspan(6);
|
461 |
tinCell.setColspan(6);
|
| 411 |
tinCell.setPadding(2);
|
462 |
tinCell.setPadding(2);
|
| 412 |
invoiceTable.addCell(tinCell);
|
463 |
invoiceTable.addCell(tinCell);
|
| Line 422... |
Line 473... |
| 422 |
invoiceTable.addCell(new Phrase("In-Store", helvetica8));
|
473 |
invoiceTable.addCell(new Phrase("In-Store", helvetica8));
|
| 423 |
else if (order.isCod())
|
474 |
else if (order.isCod())
|
| 424 |
invoiceTable.addCell(new Phrase("COD", helvetica8));
|
475 |
invoiceTable.addCell(new Phrase("COD", helvetica8));
|
| 425 |
else
|
476 |
else
|
| 426 |
invoiceTable.addCell(new Phrase("Prepaid", helvetica8));
|
477 |
invoiceTable.addCell(new Phrase("Prepaid", helvetica8));
|
| 427 |
/*
|
478 |
|
| 428 |
if(order.isLogisticsCod())
|
- |
|
| 429 |
invoiceTable.addCell(new Phrase("COD", helvetica8));
|
- |
|
| 430 |
else
|
- |
|
| 431 |
invoiceTable.addCell(new Phrase("Prepaid", helvetica8));
|
- |
|
| 432 |
*/
|
- |
|
| 433 |
invoiceTable.addCell(getProductNameCell(lineitem, false, order.getFreebieItemId()));
|
479 |
invoiceTable.addCell(getProductNameCell(lineitem, false, order.getFreebieItemId()));
|
| 434 |
|
480 |
|
| 435 |
invoiceTable.addCell(new Phrase(lineitem.getQuantity() + "", helvetica8));
|
481 |
invoiceTable.addCell(new Phrase(lineitem.getQuantity() + "", helvetica8));
|
| 436 |
|
482 |
|
| 437 |
invoiceTable.addCell(getPriceCell(lineitem.getUnit_price()-order.getGvAmount()));
|
483 |
invoiceTable.addCell(getPriceCell(lineitem.getUnit_price()-order.getGvAmount()));
|
| Line 453... |
Line 499... |
| 453 |
PdfPTable taxTable = new PdfPTable(1);
|
499 |
PdfPTable taxTable = new PdfPTable(1);
|
| 454 |
Phrase phrase = null;
|
500 |
Phrase phrase = null;
|
| 455 |
taxTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
501 |
taxTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
| 456 |
taxTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
|
502 |
taxTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
|
| 457 |
|
503 |
|
| - |
|
504 |
// PdfPTable logoTable = new PdfPTable(2);
|
| - |
|
505 |
// addLogoTable(logoTable, order);
|
| - |
|
506 |
|
| 458 |
if (order.getOrderType().equals(OrderType.B2B)) {
|
507 |
if (order.getOrderType().equals(OrderType.B2B)) {
|
| 459 |
phrase = new Phrase("TAX INVOICE", helveticaBold12);
|
508 |
phrase = new Phrase("TAX INVOICE", helveticaBold12);
|
| 460 |
} else {
|
509 |
} else {
|
| 461 |
phrase = new Phrase("RETAIL INVOICE", helveticaBold12);
|
510 |
phrase = new Phrase("RETAIL INVOICE", helveticaBold12);
|
| 462 |
}
|
511 |
}
|
| Line 482... |
Line 531... |
| 482 |
PdfPTable invoiceTable = getBottomInvoiceTable(order, isVAT);
|
531 |
PdfPTable invoiceTable = getBottomInvoiceTable(order, isVAT);
|
| 483 |
|
532 |
|
| 484 |
PdfPCell disclaimerCell = new PdfPCell(new Phrase("Goods once sold will not be taken back.\nAll disputes subject to Delhi Jurisdiction.\nThis is a Computer generated Invoice.", helvetica8));
|
533 |
PdfPCell disclaimerCell = new PdfPCell(new Phrase("Goods once sold will not be taken back.\nAll disputes subject to Delhi Jurisdiction.\nThis is a Computer generated Invoice.", helvetica8));
|
| 485 |
disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
534 |
disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
| 486 |
disclaimerCell.setBorder(Rectangle.NO_BORDER);
|
535 |
disclaimerCell.setBorder(Rectangle.NO_BORDER);
|
| 487 |
|
536 |
|
| - |
|
537 |
//taxTable.addCell(logoTable);
|
| 488 |
taxTable.addCell(retailInvoiceTitleCell);
|
538 |
taxTable.addCell(retailInvoiceTitleCell);
|
| 489 |
taxTable.addCell(sorlAddress);
|
539 |
taxTable.addCell(sorlAddress);
|
| 490 |
taxTable.addCell(addrAndOrderDetailsTable);
|
540 |
taxTable.addCell(addrAndOrderDetailsTable);
|
| 491 |
taxTable.addCell(invoiceTable);
|
541 |
taxTable.addCell(invoiceTable);
|
| 492 |
taxTable.addCell(disclaimerCell);
|
542 |
taxTable.addCell(disclaimerCell);
|
| Line 688... |
Line 738... |
| 688 |
vatCell.setColspan(3);
|
738 |
vatCell.setColspan(3);
|
| 689 |
vatCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
|
739 |
vatCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
|
| 690 |
return vatCell;
|
740 |
return vatCell;
|
| 691 |
}
|
741 |
}
|
| 692 |
|
742 |
|
| - |
|
743 |
private PdfPCell getAdvanceAmountCell(int colspan) {
|
| - |
|
744 |
PdfPCell insuranceCell = null;
|
| - |
|
745 |
insuranceCell = new PdfPCell(new Phrase("Advance Amount Received", helvetica8));
|
| - |
|
746 |
insuranceCell.setColspan(colspan);
|
| - |
|
747 |
insuranceCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
|
| - |
|
748 |
return insuranceCell;
|
| - |
|
749 |
}
|
| - |
|
750 |
|
| 693 |
private PdfPCell getInsuranceCell(int colspan) {
|
751 |
private PdfPCell getInsuranceCell(int colspan) {
|
| 694 |
PdfPCell insuranceCell = null;
|
752 |
PdfPCell insuranceCell = null;
|
| 695 |
insuranceCell = new PdfPCell(new Phrase("1 Year WorldWide Theft Insurance", helvetica8));
|
753 |
insuranceCell = new PdfPCell(new Phrase("1 Year WorldWide Theft Insurance", helvetica8));
|
| 696 |
insuranceCell.setColspan(colspan);
|
754 |
insuranceCell.setColspan(colspan);
|
| 697 |
insuranceCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
|
755 |
insuranceCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
|
| Line 831... |
Line 889... |
| 831 |
return extraInfoTable;
|
889 |
return extraInfoTable;
|
| 832 |
}
|
890 |
}
|
| 833 |
|
891 |
|
| 834 |
public static void main(String[] args) throws IOException {
|
892 |
public static void main(String[] args) throws IOException {
|
| 835 |
InvoiceGenerationService invoiceGenerationService = new InvoiceGenerationService();
|
893 |
InvoiceGenerationService invoiceGenerationService = new InvoiceGenerationService();
|
| 836 |
long orderId = 148574;
|
894 |
long orderId = 356324;
|
| 837 |
ByteArrayOutputStream baos = invoiceGenerationService.generateInvoice(orderId, false, false, 1);
|
895 |
ByteArrayOutputStream baos = invoiceGenerationService.generateInvoice(orderId, true, false, 1);
|
| 838 |
String userHome = System.getProperty("user.home");
|
896 |
String userHome = System.getProperty("user.home");
|
| 839 |
File f = new File(userHome + "/invoice-" + orderId + ".pdf");
|
897 |
File f = new File(userHome + "/invoice-" + orderId + ".pdf");
|
| 840 |
FileOutputStream fos = new FileOutputStream(f);
|
898 |
FileOutputStream fos = new FileOutputStream(f);
|
| 841 |
baos.writeTo(fos);
|
899 |
baos.writeTo(fos);
|
| 842 |
System.out.println("Invoice generated.");
|
900 |
System.out.println("Invoice generated.");
|