Subversion Repositories SmartDukaan

Rev

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

Rev 19980 Rev 19985
Line 238... Line 238...
238
				try {
238
				try {
239
					sellerInfo = getSellerInfo(o.getSeller_id(), tclient);
239
					sellerInfo = getSellerInfo(o.getSeller_id(), tclient);
240
					addressInfo = getWarehouseAddress(o.getWarehouse_address_id(), tclient);
240
					addressInfo = getWarehouseAddress(o.getWarehouse_address_id(), tclient);
241
				} catch (Exception e) {
241
				} catch (Exception e) {
242
					logger.info("Error occurred while getting address/seller info", e);
242
					logger.info("Error occurred while getting address/seller info", e);
-
 
243
					return baosPDF;
243
				}
244
				}
244
				if(o.isSetLogisticsTransactionId()){
245
				if(o.isSetLogisticsTransactionId()){
245
					List<Order> groupOrdersList = tclient.getGroupOrdersByLogisticsTxnId(o.getLogisticsTransactionId());
246
					List<Order> groupOrdersList = tclient.getGroupOrdersByLogisticsTxnId(o.getLogisticsTransactionId());
246
					logisticsTxnIdOrdersMap.put(o.getLogisticsTransactionId(), groupOrdersList);
247
					logisticsTxnIdOrdersMap.put(o.getLogisticsTransactionId(), groupOrdersList);
247
				}
248
				}
Line 332... Line 333...
332
					
333
					
333
					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)) {
334
						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() 
335
								|| 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) {
336
							if(withBill){
337
							if(withBill){
337
								PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, addressInfo.getAddress() + "-" + addressInfo.getPin() , sellerInfo.getTin(), invoiceFormat);
338
								PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + " "+ addressInfo.getAddress() + "-" + addressInfo.getPin() , sellerInfo.getTin(), invoiceFormat);
338
								taxTable.setSpacingBefore(5.0f);
339
								taxTable.setSpacingBefore(5.0f);
339
								taxTable.setWidthPercentage(90.0f);
340
								taxTable.setWidthPercentage(90.0f);
340
								document.add(new DottedLineSeparator());
341
								document.add(new DottedLineSeparator());
341
								document.add(taxTable);
342
								document.add(taxTable);
342
							}else{
343
							}else{
Line 349... Line 350...
349
						} else {
350
						} else {
350
							document.newPage();
351
							document.newPage();
351
						}
352
						}
352
					} 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)) {
353
						if(withBill){
354
						if(withBill){
354
							PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, addressInfo.getAddress() + "-" + addressInfo.getPin() , sellerInfo.getTin(), invoiceFormat);
355
							PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + " " + addressInfo.getAddress() + "-" + addressInfo.getPin() , sellerInfo.getTin(), invoiceFormat);
355
							taxTable.setSpacingBefore(5.0f);
356
							taxTable.setSpacingBefore(5.0f);
356
							taxTable.setWidthPercentage(90.0f);
357
							taxTable.setWidthPercentage(90.0f);
357
							document.add(new DottedLineSeparator());
358
							document.add(new DottedLineSeparator());
358
							document.add(taxTable);
359
							document.add(taxTable);
359
						}else{
360
						}else{
Line 363... Line 364...
363
							document.add(new DottedLineSeparator());
364
							document.add(new DottedLineSeparator());
364
							document.add(extraInfoTable);
365
							document.add(extraInfoTable);
365
						}
366
						}
366
					}
367
					}
367
					if(withBill){
368
					if(withBill){
368
						PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, addressInfo.getAddress() + "-" + addressInfo.getPin() , this.sellerInfo.getTin(), invoiceFormat);
369
						PdfPTable taxTable = getTaxCumRetailInvoiceTable(ordersList, provider, sellerInfo.getOrganisationName() + " " + addressInfo.getAddress() + "-" + addressInfo.getPin() , this.sellerInfo.getTin(), invoiceFormat);
369
						taxTable.setSpacingBefore(5.0f);
370
						taxTable.setSpacingBefore(5.0f);
370
						taxTable.setWidthPercentage(90.0f);
371
						taxTable.setWidthPercentage(90.0f);
371
						document.add(new DottedLineSeparator());
372
						document.add(new DottedLineSeparator());
372
						document.add(taxTable);
373
						document.add(taxTable);
373
						if(order.getSource() == OrderSource.FLIPKART.getValue()) {
374
						if(order.getSource() == OrderSource.FLIPKART.getValue()) {
Line 678... Line 679...
678
	}
679
	}
679
	//Handle this case when tClient is null
680
	//Handle this case when tClient is null
680
	
681
	
681
	private static SellerInfo getSellerInfo(long sellerId, in.shop2020.model.v1.order.TransactionService.Client tClient) throws Exception{
682
	private static SellerInfo getSellerInfo(long sellerId, in.shop2020.model.v1.order.TransactionService.Client tClient) throws Exception{
682
		if (!sellerInfoMap.containsKey(sellerId)){
683
		if (!sellerInfoMap.containsKey(sellerId)){
683
			sellerInfoMap.put(sellerId, tClient.getSellerInfo(sellerId));
684
			SellerInfo si = tClient.getSellerInfo(sellerId);
-
 
685
			if(si == null){
-
 
686
				throw new Exception("Could not found seller");
-
 
687
			}
-
 
688
			sellerInfoMap.put(sellerId, si);
684
		}
689
		}
685
		return sellerInfoMap.get(sellerId);
690
		return sellerInfoMap.get(sellerId);
686
	}
691
	}
687
	
692
	
688
	
693
	
Line 785... Line 790...
785
		PdfPTable invoiceTable = getTopInvoiceTable(orderList, this.sellerInfo.getTin(), invoiceFormat);
790
		PdfPTable invoiceTable = getTopInvoiceTable(orderList, this.sellerInfo.getTin(), invoiceFormat);
786
		PdfPTable addressTable = new PdfPTable(1);
791
		PdfPTable addressTable = new PdfPTable(1);
787
		addressTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
792
		addressTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
788
		addressTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
793
		addressTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
789
		
794
		
790
		PdfPCell addressCell = getAddressCell(addressInfo.getAddress() +
795
		PdfPCell addressCell = getAddressCell(sellerInfo.getOrganisationName() + " " + addressInfo.getAddress() +
791
				" - " + addressInfo.getPin() + "\nContact No.- +91-9818116289" + "\n\n");
796
				" - " + addressInfo.getPin() + "\nContact No.- +91-9818116289" + "\n\n");
792
 
797
 
793
		PdfPTable chargesTable = new PdfPTable(1);
798
		PdfPTable chargesTable = new PdfPTable(1);
794
		chargesTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
799
		chargesTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
795
		chargesTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
800
		chargesTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
Line 1250... Line 1255...
1250
		PdfPTable regAddAndDisCellTable = new PdfPTable(2);
1255
		PdfPTable regAddAndDisCellTable = new PdfPTable(2);
1251
		
1256
		
1252
		PdfPCell disclaimerCell = new PdfPCell(new Phrase("Goods once sold will not be taken back.\nAll disputes subject to Delhi Jurisdiction.\nThis is a Computer generated Invoice.", helvetica8));
1257
		PdfPCell disclaimerCell = new PdfPCell(new Phrase("Goods once sold will not be taken back.\nAll disputes subject to Delhi Jurisdiction.\nThis is a Computer generated Invoice.", helvetica8));
1253
		disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
1258
		disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
1254
		disclaimerCell.setBorder(Rectangle.NO_BORDER);
1259
		disclaimerCell.setBorder(Rectangle.NO_BORDER);
1255
		PdfPCell regAddressCell = new PdfPCell(new Phrase(sellerInfo.getOrganisationName() + 
1260
		PdfPCell regAddressCell = new PdfPCell(new Phrase(sellerInfo.getOrganisationName() + "\n" +
1256
										"\n Regd. Add. " +  sellerInfo.getRegisteredAddress() + 
1261
										"Regd. Add. " +  sellerInfo.getRegisteredAddress() + "\n" + 
1257
										(StringUtils.isEmpty(sellerInfo.getCinNumber())? "" :"\n CIN: " + sellerInfo.getCinNumber()) +  
1262
										(StringUtils.isEmpty(sellerInfo.getCinNumber())? "" :"CIN: " + sellerInfo.getCinNumber() + "\n") +  
1258
										"Tel. No. +91-9818116289 E-mail. help@saholic.com Website. www.saholic.com", helvetica6));
1263
										"Tel. No. +91-9818116289 E-mail. help@saholic.com Website. www.saholic.com", helvetica6));
1259
		regAddressCell.setHorizontalAlignment(Element.ALIGN_LEFT);
1264
		regAddressCell.setHorizontalAlignment(Element.ALIGN_LEFT);
1260
		regAddressCell.setBorder(Rectangle.NO_BORDER);
1265
		regAddressCell.setBorder(Rectangle.NO_BORDER);
1261
		/*SPICE ONLINE RETAIL PRIVATE LIMITED
1266
		/*SPICE ONLINE RETAIL PRIVATE LIMITED
1262
		Regd. Add. 60-D, STREET NO. C-5, SAINIK FARMS,NEW DELHI-110062
1267
		Regd. Add. 60-D, STREET NO. C-5, SAINIK FARMS,NEW DELHI-110062