Subversion Repositories SmartDukaan

Rev

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

Rev 8097 Rev 8098
Line 355... Line 355...
355
		logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
355
		logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
356
		logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
356
		logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
357
				
357
				
358
		PdfPCell logoCell;
358
		PdfPCell logoCell;
359
		String logoPath;
359
		String logoPath;
-
 
360
		Image logo=null;
360
		logger.info("Order Source Value........."+order.getSource());
361
		logger.info("Order Source Value........."+order.getSource());
361
		if(order.getSource() == OrderSource.STORE.getValue()){
362
		if(order.getSource() == OrderSource.STORE.getValue()){
362
			logoCell = new PdfPCell(new Phrase(""));
363
			logoCell = new PdfPCell(new Phrase(""));
363
			
364
			
364
		}else{
365
		}else{
365
			logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
366
			logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
366
			logger.info("Logo Path........."+logoPath);
367
			logger.info("Logo Path........."+logoPath);
367
			
368
			
368
			try {
369
			try {
369
				logoCell = new PdfPCell(Image.getInstance(logoPath), false);
370
				logoCell = new PdfPCell(Image.getInstance(logoPath), false);
-
 
371
				logo = Image.getInstance(logoPath);
370
			} catch (Exception e) {
372
			} catch (Exception e) {
371
				//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
373
				//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
372
				logger.warn("Couldn't load the Saholic logo: ", e);
374
				logger.warn("Couldn't load the Saholic logo: ", e);
373
				logoCell = new PdfPCell(new Phrase("Saholic Logo"));
375
				logoCell = new PdfPCell(new Phrase("Saholic Logo"));
374
			}
376
			}
375
		
377
		
376
		}
378
		}
377
		logoCell.setBorder(Rectangle.NO_BORDER);
379
		logoCell.setBorder(Rectangle.NO_BORDER);
378
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
380
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-
 
381
		if(logo!=null)
-
 
382
			logoTable.addCell(logo);
379
		
383
		else{
380
		logoTable.addCell(logoCell);
384
			logoTable.addCell(logoCell);
-
 
385
		}
381
		return logoTable;
386
		return logoTable;
382
	}
387
	}
383
 
388
 
384
	private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
389
	private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
385
		String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
390
		String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();