Subversion Repositories SmartDukaan

Rev

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

Rev 19985 Rev 20634
Line 333... Line 333...
333
					
333
					
334
					if ((new Long(order.getSource()).intValue() == OrderSource.EBAY.getValue()) && (order.getLogistics_provider_id()>7) &&(ordersList.size()==1)) {
334
					if ((new Long(order.getSource()).intValue() == OrderSource.EBAY.getValue()) && (order.getLogistics_provider_id()>7) &&(ordersList.size()==1)) {
335
						if (order.getAirwaybill_no()== null || order.getAirwaybill_no().equals("null") || order.getAirwaybill_no().isEmpty() 
335
						if (order.getAirwaybill_no()== null || order.getAirwaybill_no().equals("null") || order.getAirwaybill_no().isEmpty() 
336
								|| order.getWarehouse_id() == 7 || order.getWarehouse_id() == 5 || order.getWarehouse_id() == 9) {
336
								|| order.getWarehouse_id() == 7 || order.getWarehouse_id() == 5 || order.getWarehouse_id() == 9) {
337
							if(withBill){
337
							if(withBill){
338
								PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + " "+ addressInfo.getAddress() + "-" + addressInfo.getPin() , sellerInfo.getTin(), invoiceFormat);
338
								PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + "\n"+ addressInfo.getAddress() + "-" + addressInfo.getPin() , sellerInfo.getTin(), invoiceFormat);
339
								taxTable.setSpacingBefore(5.0f);
339
								taxTable.setSpacingBefore(5.0f);
340
								taxTable.setWidthPercentage(90.0f);
340
								taxTable.setWidthPercentage(90.0f);
341
								document.add(new DottedLineSeparator());
341
								document.add(new DottedLineSeparator());
342
								document.add(taxTable);
342
								document.add(taxTable);
343
							}else{
343
							}else{
Line 350... Line 350...
350
						} else {
350
						} else {
351
							document.newPage();
351
							document.newPage();
352
						}
352
						}
353
					} else if (new Long(order.getSource()).intValue() == OrderSource.SNAPDEAL.getValue() &&(ordersList.size()==1)) {
353
					} else if (new Long(order.getSource()).intValue() == OrderSource.SNAPDEAL.getValue() &&(ordersList.size()==1)) {
354
						if(withBill){
354
						if(withBill){
355
							PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + " " + addressInfo.getAddress() + "-" + addressInfo.getPin() , sellerInfo.getTin(), invoiceFormat);
355
							PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + "\n" + addressInfo.getAddress() + "-" + addressInfo.getPin() , sellerInfo.getTin(), invoiceFormat);
356
							taxTable.setSpacingBefore(5.0f);
356
							taxTable.setSpacingBefore(5.0f);
357
							taxTable.setWidthPercentage(90.0f);
357
							taxTable.setWidthPercentage(90.0f);
358
							document.add(new DottedLineSeparator());
358
							document.add(new DottedLineSeparator());
359
							document.add(taxTable);
359
							document.add(taxTable);
360
						}else{
360
						}else{
Line 364... Line 364...
364
							document.add(new DottedLineSeparator());
364
							document.add(new DottedLineSeparator());
365
							document.add(extraInfoTable);
365
							document.add(extraInfoTable);
366
						}
366
						}
367
					}
367
					}
368
					if(withBill){
368
					if(withBill){
369
						PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + " " + addressInfo.getAddress() + "-" + addressInfo.getPin() , this.sellerInfo.getTin(), invoiceFormat);
369
						PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + "\n" + addressInfo.getAddress() + "-" + addressInfo.getPin() , this.sellerInfo.getTin(), invoiceFormat);
370
						taxTable.setSpacingBefore(5.0f);
370
						taxTable.setSpacingBefore(5.0f);
371
						taxTable.setWidthPercentage(90.0f);
371
						taxTable.setWidthPercentage(90.0f);
372
						document.add(new DottedLineSeparator());
372
						document.add(new DottedLineSeparator());
373
						document.add(taxTable);
373
						document.add(taxTable);
374
						if(order.getSource() == OrderSource.FLIPKART.getValue()) {
374
						if(order.getSource() == OrderSource.FLIPKART.getValue()) {
Line 790... Line 790...
790
		PdfPTable invoiceTable = getTopInvoiceTable(orderList, this.sellerInfo.getTin(), invoiceFormat);
790
		PdfPTable invoiceTable = getTopInvoiceTable(orderList, this.sellerInfo.getTin(), invoiceFormat);
791
		PdfPTable addressTable = new PdfPTable(1);
791
		PdfPTable addressTable = new PdfPTable(1);
792
		addressTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
792
		addressTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
793
		addressTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
793
		addressTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
794
		
794
		
795
		PdfPCell addressCell = getAddressCell(sellerInfo.getOrganisationName() + " " + addressInfo.getAddress() +
795
		PdfPCell addressCell = getAddressCell(sellerInfo.getOrganisationName() + "\n" + addressInfo.getAddress() +
796
				" - " + addressInfo.getPin() + "\nContact No.- +91-9818116289" + "\n\n");
796
				" - " + addressInfo.getPin() + "\nContact No.- +91-9818116289" + "\n\n");
797
 
797
 
798
		PdfPTable chargesTable = new PdfPTable(1);
798
		PdfPTable chargesTable = new PdfPTable(1);
799
		chargesTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
799
		chargesTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
800
		chargesTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
800
		chargesTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
Line 872... Line 872...
872
		logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
872
		logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
873
				
873
				
874
		PdfPCell logoCell;
874
		PdfPCell logoCell;
875
		String logoPath;
875
		String logoPath;
876
		
876
		
877
		if(order.getSource() == OrderSource.STORE.getValue()){
-
 
878
			logoCell = new PdfPCell(new Phrase(""));
877
		logoCell = new PdfPCell(new Phrase(""));
-
 
878
		/*if(order.getSource() == OrderSource.STORE.getValue()){
879
			
879
			
880
		}else{
880
		}else{
881
			logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
881
			logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
882
			
882
			
883
			try {
883
			try {
Line 886... Line 886...
886
				//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
886
				//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
887
				logger.warn("Couldn't load the Saholic logo: ", e);
887
				logger.warn("Couldn't load the Saholic logo: ", e);
888
				logoCell = new PdfPCell(new Phrase("Saholic Logo"));
888
				logoCell = new PdfPCell(new Phrase("Saholic Logo"));
889
			}
889
			}
890
		
890
		
891
		}
891
		}*/
892
		logoCell.setBorder(Rectangle.NO_BORDER);
892
		logoCell.setBorder(Rectangle.NO_BORDER);
893
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
893
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
894
		logoTable.addCell(logoCell);
894
		logoTable.addCell(logoCell);
895
		logoTable.addCell(" ");
895
		logoTable.addCell(" ");
896
		
896