Subversion Repositories SmartDukaan

Rev

Rev 20834 | Rev 20838 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20834 Rev 20836
Line 97... Line 97...
97
		
97
		
98
		try {
98
		try {
99
			WarehouseAddress wha = buyerInfo.getBuyerAddress();
99
			WarehouseAddress wha = buyerInfo.getBuyerAddress();
100
			baosPDF = new ByteArrayOutputStream();
100
			baosPDF = new ByteArrayOutputStream();
101
			Font helvetica8 = FontFactory.getFont(FontFactory.HELVETICA, 8);
101
			Font helvetica8 = FontFactory.getFont(FontFactory.HELVETICA, 8);
-
 
102
			Font helvetica9 = FontFactory.getFont(FontFactory.HELVETICA, 9);
102
			Document document = new Document();
103
			Document document = new Document();
103
			PdfWriter.getInstance(document, baosPDF);
104
			PdfWriter.getInstance(document, baosPDF);
104
			document.addAuthor("shop2020");
105
			document.addAuthor("shop2020");
105
			document.addTitle("Manifest for warehouse " + warehouseId + " provider " + providerId);
106
			document.addTitle("Manifest for warehouse " + warehouseId + " provider " + providerId);
106
			document.open();
107
			document.open();
107
			PdfPTable table = new PdfPTable(3);
108
			PdfPTable table = new PdfPTable(3);
108
			table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
109
			table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
109
			table.getDefaultCell().setPaddingBottom(10.0f);
110
			table.getDefaultCell().setPaddingBottom(10.0f);
110
			
111
			
111
			Paragraph companyPara = new Paragraph(buyerInfo.getOrganisationName() + " Manifest Report", new Font(FontFamily.TIMES_ROMAN,16f));
-
 
112
			PdfPCell companyCell = new PdfPCell();
-
 
113
			companyCell.addElement(companyPara);
-
 
114
			companyCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-
 
115
			companyCell.setBorder(Rectangle.NO_BORDER);
-
 
116
 
-
 
117
			
112
			
118
			String addressString =  wha.getAddress() + "\nPIN " + wha.getPin()+ "\n\n";
113
			String addressString =  wha.getAddress() + "\nPIN " + wha.getPin()+ "\n\n";
119
			Paragraph addressParagraph = new Paragraph(addressString, new Font(FontFamily.TIMES_ROMAN,8f));
-
 
120
			PdfPCell addressCell = new PdfPCell();
-
 
121
			addressCell.addElement(addressParagraph);
-
 
122
			addressCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-
 
123
			addressCell.setBorder(Rectangle.NO_BORDER);
-
 
124
			
114
			
-
 
115
						
125
			PdfPTable ordersTable = null;
116
			PdfPTable ordersTable = null;
126
			ordersTable = new PdfPTable(8);
117
			ordersTable = new PdfPTable(8);
127
			if (providerId > 7 && providerId <12) {
118
			if (providerId > 7 && providerId <12) {
128
				ordersTable = new PdfPTable(10);
119
				ordersTable = new PdfPTable(10);
129
			}
120
			}
Line 233... Line 224...
233
					ordersTable.addCell(new Phrase(store.getCity(), helvetica8));
224
					ordersTable.addCell(new Phrase(store.getCity(), helvetica8));
234
					ordersTable.addCell(new Phrase(store.getPhone(), helvetica8));
225
					ordersTable.addCell(new Phrase(store.getPhone(), helvetica8));
235
				}
226
				}
236
				
227
				
237
			}
228
			}
238
			table.addCell(companyCell);
-
 
239
			table.addCell(addressCell);
-
 
240
			if(isCod) {
229
			if(isCod) {
241
				table.addCell(new Phrase("Manifest ID: COD" + df.format(new Date()) + String.format("%02d", warehouseId) + String.format("%02d", providerId), helvetica8));
230
				table.addCell(new Phrase("Manifest ID: COD" + df.format(new Date()) + String.format("%02d", warehouseId) + String.format("%02d", providerId), helvetica9));
242
			    table.addCell(new Phrase("PAYMODE: COD", helvetica8));
231
			    table.addCell(new Phrase("PAYMODE: COD", helvetica9));
243
			}
232
			}
244
			else {
233
			else {
245
				table.addCell(new Phrase("Manifest ID: PRE" + df.format(new Date()) + String.format("%02d", warehouseId) + String.format("%02d", providerId), helvetica8));
234
				table.addCell(new Phrase("Manifest ID: PRE" + df.format(new Date()) + String.format("%02d", buyerInfo.getAddressId()) + String.format("%02d", providerId), helvetica8));
246
			    table.addCell(new Phrase("PAYMODE: Prepaid", helvetica8));
235
			    table.addCell(new Phrase("PAYMODE: Prepaid", helvetica8));
247
			}
236
			}
248
			if(provider.getPickup() == PickUpType.RUNNER){
237
			if(provider.getPickup() == PickUpType.RUNNER){
249
				table.addCell(new Phrase("Runner Name: " + runner, helvetica8));
238
				table.addCell(new Phrase("Runner Name: " + runner, helvetica8));
250
				table.addCell(new Phrase("Manifest Type: Runner Manifest", helvetica8));
239
				table.addCell(new Phrase("Manifest Type: Runner Manifest", helvetica8));
251
			}else{
240
			}else{
252
				table.addCell(new Phrase("Courier Name: " + provider.getName(), helvetica8));
241
				table.addCell(new Phrase("Courier Name: " + provider.getName(), helvetica8));
-
 
242
				table.addCell(new Phrase("Courier Name: " + provider.getDetails().get(0).getAccountNo(), helvetica8));
253
				table.addCell(new Phrase("Manifest Type: Courier Manifest", helvetica8));
243
				table.addCell(new Phrase("Manifest Type: Courier Manifest", helvetica8));
254
			}
244
			}
255
			
245
			
256
			table.addCell(new Phrase("Dispatch Date: " + DateFormat.getDateInstance(DateFormat.MEDIUM).format(new Date()), helvetica8));
246
			table.addCell(new Phrase("Dispatch Date: " + DateFormat.getDateInstance(DateFormat.MEDIUM).format(new Date()), helvetica8));
257
			table.addCell(new Phrase("No. of Shipments: " + airwayBillNoMap.size(), helvetica8));
247
			table.addCell(new Phrase("No. of Shipments: " + airwayBillNoMap.size(), helvetica8));
258
			
-
 
259
			/*PdfPTable table1 = new PdfPTable(3);
-
 
260
			table1.getDefaultCell().setBorder(Rectangle.NO_BORDER);
248
			document.add(new Paragraph(buyerInfo.getOrganisationName() + " Manifest Report", new Font(FontFamily.TIMES_ROMAN,12f)));
261
			table1.getDefaultCell().setPaddingBottom(10.0f);
249
			document.add(new Paragraph(addressString, new Font(FontFamily.TIMES_ROMAN,8f)));
262
			table1.addCell(ordersTable);
-
 
263
			table.setWidthPercentage(90.0f);*/
-
 
264
			
-
 
265
			document.add(table);  
250
			document.add(table);  
266
			document.add(ordersTable);  
251
			document.add(ordersTable);  
267
			document.close();
252
			document.close();
268
			baosPDF.close();
253
			baosPDF.close();
269
		} catch (DocumentException e) {
254
		} catch (DocumentException e) {