Subversion Repositories SmartDukaan

Rev

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

Rev 8092 Rev 8094
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);
-
 
368
			
367
			try {
369
			try {
368
				logoCell = new PdfPCell(Image.getInstance(logoPath), false);
370
				logoCell = new PdfPCell(Image.getInstance(logoPath), false);
-
 
371
				logo=Image.getInstance(logoPath);
369
			} catch (Exception e) {
372
			} catch (Exception e) {
370
				//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
373
				//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
371
				logger.warn("Couldn't load the Saholic logo: ", e);
374
				logger.warn("Couldn't load the Saholic logo: ", e);
372
				logoCell = new PdfPCell(new Phrase("Saholic Logo"));
375
				logoCell = new PdfPCell(new Phrase("Saholic Logo"));
373
			}
376
			}
Line 375... Line 378...
375
		}
378
		}
376
		logoCell.setBorder(Rectangle.NO_BORDER);
379
		logoCell.setBorder(Rectangle.NO_BORDER);
377
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
380
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
378
		
381
		
379
		logoTable.addCell(logoCell);
382
		logoTable.addCell(logoCell);
-
 
383
		if(logo!=null)
-
 
384
			logoTable.addCell(logo);
380
	}
385
	}
381
 
386
 
382
	private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
387
	private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
383
		String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
388
		String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
384
		FontFactoryImp ttfFontFactory = new FontFactoryImp();
389
		FontFactoryImp ttfFontFactory = new FontFactoryImp();