| Line 154... |
Line 154... |
| 154 |
poTable.addCell(poTitleCell);
|
154 |
poTable.addCell(poTitleCell);
|
| 155 |
poTable.addCell(getAddressCell(purchaseOrder));
|
155 |
poTable.addCell(getAddressCell(purchaseOrder));
|
| 156 |
poTable.addCell(poSummaryTable);
|
156 |
poTable.addCell(poSummaryTable);
|
| 157 |
poTable.addCell(getSalutationTable(supplier));
|
157 |
poTable.addCell(getSalutationTable(supplier));
|
| 158 |
poTable.addCell(getPoDetailsTable(purchaseOrder, supplier));
|
158 |
poTable.addCell(getPoDetailsTable(purchaseOrder, supplier));
|
| 159 |
poTable.addCell(getBillToTable(purchaseOrder.getWarehouseId(), purchaseOrder.getTaxType()));
|
159 |
poTable.addCell(getBillToTable(purchaseOrder));
|
| 160 |
//poTable.addCell(getCFormCell(purchaseOrder.getTaxType()));
|
160 |
//poTable.addCell(getCFormCell(purchaseOrder.getTaxType()));
|
| 161 |
|
161 |
|
| 162 |
return poTable;
|
162 |
return poTable;
|
| 163 |
}
|
163 |
}
|
| 164 |
|
164 |
|
| Line 379... |
Line 379... |
| 379 |
detailsTable.addCell(new Phrase(String.format("%.0f", totalUnits), helvetica8));
|
379 |
detailsTable.addCell(new Phrase(String.format("%.0f", totalUnits), helvetica8));
|
| 380 |
detailsTable.addCell(getTotalAmountCell(6,total));
|
380 |
detailsTable.addCell(getTotalAmountCell(6,total));
|
| 381 |
return detailsTable;
|
381 |
return detailsTable;
|
| 382 |
}
|
382 |
}
|
| 383 |
|
383 |
|
| 384 |
private static PdfPTable getBillToTable(long warehouseId, TaxType taxType) {
|
384 |
private static PdfPTable getBillToTable(PurchaseOrder po) {
|
| 385 |
//TODO Write this code in a proper configurable way
|
385 |
//TODO Write this code in a proper configurable way
|
| 386 |
String address = "";
|
386 |
String address = "";
|
| 387 |
String tinNo = "";
|
387 |
String tinNo = "";
|
| 388 |
String contactPerson = "";
|
388 |
String contactPerson = "";
|
| - |
|
389 |
BuyerInfo binfo = new BuyerInfo();
|
| - |
|
390 |
try {
|
| - |
|
391 |
in.shop2020.model.v1.order.TransactionService.Client tClient = new TransactionClient().getClient();
|
| - |
|
392 |
binfo = tClient.getBuyerByWarehouse(po.getWarehouseId());
|
| - |
|
393 |
WarehouseAddress addr = tClient.getWarehouseAddress(po.getWarehouseAddressId());
|
| - |
|
394 |
tinNo = binfo.getTin();
|
| - |
|
395 |
address = binfo.getOrganisationName() + "\n" + addr.getAddress() + "\n" + "-" + addr.getPin();
|
| 389 |
if(warehouseId ==7) {
|
396 |
} catch (Exception e) {
|
| 390 |
address = ourAddressDelhi;
|
397 |
logger.error("This should not happen", e);
|
| - |
|
398 |
}
|
| 391 |
tinNo = tinNoDelhi;
|
399 |
if(po.getWarehouseId()==7) {
|
| 392 |
contactPerson = "Mr. Varun Patiyal, Contact No. +91 8860488282, +91 9711178101";
|
400 |
contactPerson = "Mr. Varun Patiyal, Contact No. +91 8860488282, +91 9711178101";
|
| 393 |
} else if(warehouseId == 12) {
|
401 |
} else if(po.getWarehouseId() == 12) {
|
| 394 |
address = ourAddressGoregaon;
|
- |
|
| 395 |
tinNo = tinNoMum;
|
- |
|
| 396 |
contactPerson = "Mr. Avinash Sambhaji Lavange, Contact No. +91 9004049589";
|
402 |
contactPerson = "Mr. Avinash Sambhaji Lavange, Contact No. +91 9004049589";
|
| 397 |
} else if(warehouseId == 13) {
|
403 |
} else if(po.getWarehouseId() == 13) {
|
| 398 |
address = ourAddressBhiwandi;
|
- |
|
| 399 |
tinNo = tinNoMum;
|
- |
|
| 400 |
contactPerson = "Mr. Vishal Tayade, Contact No. +91 9819231651";
|
404 |
contactPerson = "Mr. Vishal Tayade, Contact No. +91 9819231651";
|
| 401 |
} else if(warehouseId ==16) {
|
405 |
} else if(po.getWarehouseId() ==16) {
|
| 402 |
address = amazonAddress;
|
- |
|
| 403 |
tinNo = tinNoMum;
|
- |
|
| 404 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
406 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
| 405 |
} else if(warehouseId ==1765) {
|
407 |
} else if(po.getWarehouseId() ==1765) {
|
| 406 |
address = ourAddressBangalore;
|
- |
|
| 407 |
tinNo = tinNoBan;
|
- |
|
| 408 |
contactPerson = "Mr. Ravi Kumar, Contact No. +91 9686392567";
|
408 |
contactPerson = "Mr. Ravi Kumar, Contact No. +91 9686392567";
|
| 409 |
}
|
409 |
}
|
| 410 |
else if(warehouseId ==1768) {
|
410 |
else if(po.getWarehouseId() ==1768) {
|
| 411 |
address = ourAddressBangaloreSR;
|
- |
|
| 412 |
tinNo = tinNoBan;
|
- |
|
| 413 |
contactPerson = "Mr. Ravi Kumar, Contact No. +91 9686392567";
|
411 |
contactPerson = "Mr. Ravi Kumar, Contact No. +91 9686392567";
|
| 414 |
}
|
412 |
}
|
| 415 |
else if(warehouseId ==1771) {
|
413 |
else if(po.getWarehouseId() ==1771) {
|
| 416 |
address = amazonAddreseBangalore;
|
- |
|
| 417 |
tinNo = tinNoBan;
|
- |
|
| 418 |
contactPerson = "Mr. Ravi Kumar, Contact No. +91 9686392567";
|
414 |
contactPerson = "Mr. Ravi Kumar, Contact No. +91 9686392567";
|
| 419 |
}
|
415 |
}
|
| 420 |
else if(warehouseId ==2854) {
|
416 |
else if(po.getWarehouseId() ==2854) {
|
| 421 |
address = flipkartAddressGgn;
|
- |
|
| 422 |
tinNo = tinNoFkGgn;
|
- |
|
| 423 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
417 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
| 424 |
}
|
418 |
}
|
| 425 |
else if(warehouseId ==2857) {
|
419 |
else if(po.getWarehouseId() ==2857) {
|
| 426 |
address = ourAddressGurgaon;
|
- |
|
| 427 |
tinNo = tinNoOurGgn;
|
- |
|
| 428 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
420 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
| 429 |
}
|
421 |
}
|
| 430 |
else if(warehouseId == 3295) {
|
422 |
else if(po.getWarehouseId() == 3295) {
|
| 431 |
address = amazonAddressMewat;
|
- |
|
| 432 |
tinNo = tinNoOurGgn;
|
- |
|
| 433 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
423 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
| 434 |
}
|
424 |
}
|
| 435 |
else if(warehouseId == 3298) {
|
425 |
else if(po.getWarehouseId() == 3298) {
|
| 436 |
address = ourAddressHyderabad;
|
- |
|
| 437 |
tinNo = tinNoOurHyd;
|
- |
|
| 438 |
contactPerson = "Mr. Achyuta Ramaiah A, Contact No. +91 9246581582";
|
426 |
contactPerson = "Mr. Achyuta Ramaiah A, Contact No. +91 9246581582";
|
| 439 |
}
|
427 |
}
|
| 440 |
else if(warehouseId == 3931) {
|
428 |
else if(po.getWarehouseId() == 3931) {
|
| 441 |
address = ourAddressGurgaonS;
|
- |
|
| 442 |
tinNo = tinNoOurGgn;
|
- |
|
| 443 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
429 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
| 444 |
}
|
430 |
}
|
| 445 |
else if(warehouseId == 4699) {
|
431 |
else if(po.getWarehouseId() == 4699) {
|
| 446 |
address = flipkartAddressDelhi;
|
- |
|
| 447 |
tinNo = tinNoFkDelhi;
|
- |
|
| 448 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
432 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
| 449 |
}
|
433 |
}
|
| 450 |
else if(warehouseId == 5314){
|
434 |
else if(po.getWarehouseId() == 5314){
|
| 451 |
address = snapdealAddressDelhi;
|
- |
|
| 452 |
tinNo = tinNoFkDelhi;
|
- |
|
| 453 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
435 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
| 454 |
}
|
436 |
}
|
| 455 |
else if(warehouseId == 5623){
|
437 |
else if(po.getWarehouseId() == 5623){
|
| 456 |
address = amazonAddressDelhi;
|
- |
|
| 457 |
tinNo = tinNoDelhi;
|
- |
|
| 458 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
438 |
contactPerson = "Mr. Sandeep Sachdeva, Contact No. +91 9716691287";
|
| 459 |
}
|
439 |
}
|
| 460 |
|
440 |
|
| 461 |
PdfPTable billToTable = new PdfPTable(new float[] { 0.2f, 0.8f });
|
441 |
PdfPTable billToTable = new PdfPTable(new float[] { 0.2f, 0.8f });
|
| 462 |
billToTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
|
442 |
billToTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
|
| Line 467... |
Line 447... |
| 467 |
|
447 |
|
| 468 |
billToTable.addCell(new Phrase("Contact Person:", helvetica8));
|
448 |
billToTable.addCell(new Phrase("Contact Person:", helvetica8));
|
| 469 |
billToTable.addCell(new Phrase(contactPerson, helvetica8));
|
449 |
billToTable.addCell(new Phrase(contactPerson, helvetica8));
|
| 470 |
|
450 |
|
| 471 |
billToTable.addCell(new Phrase("Taxes:", helvetica8));
|
451 |
billToTable.addCell(new Phrase("Taxes:", helvetica8));
|
| 472 |
if(taxType == TaxType.CFORM) {
|
452 |
if(po.getTaxType() == TaxType.CFORM) {
|
| 473 |
billToTable.addCell(new Phrase("Prices inclusive of all taxes (To be billed on CST Against C-Form)",
|
453 |
billToTable.addCell(new Phrase("Prices inclusive of all taxes (To be billed on CST Against C-Form)",
|
| 474 |
helvetica8));
|
454 |
helvetica8));
|
| 475 |
} else {
|
455 |
} else {
|
| 476 |
billToTable.addCell(new Phrase("Prices inclusive of all taxes",
|
456 |
billToTable.addCell(new Phrase("Prices inclusive of all taxes",
|
| 477 |
helvetica8));
|
457 |
helvetica8));
|