Subversion Repositories SmartDukaan

Rev

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

Rev 3062 Rev 3107
Line 114... Line 114...
114
	        accountNo = provider.getDetails().get(DeliveryType.COD).getAccountNo();
114
	        accountNo = provider.getDetails().get(DeliveryType.COD).getAccountNo();
115
	    else
115
	    else
116
	        accountNo = provider.getDetails().get(DeliveryType.PREPAID).getAccountNo();
116
	        accountNo = provider.getDetails().get(DeliveryType.PREPAID).getAccountNo();
117
	    
117
	    
118
	    Date awbDate = new Date();
118
	    Date awbDate = new Date();
-
 
119
	    String location = removeNewLines(warehouse.getLocation());
-
 
120
	    
119
	    int serialNo = 0;
121
	    int serialNo = 0;
120
	    for(int i = 0; i<orders.size(); i++){
122
	    for(int i = 0; i<orders.size(); i++){
121
	    	Order order = orders.get(i);
123
	    	Order order = orders.get(i);
122
			if(order.getLogistics_provider_id()!=providerId)
124
			if(order.getLogistics_provider_id()!=providerId)
123
				continue;
125
				continue;
Line 153... Line 155...
153
		    contentRow.createCell(15).setCellValue(lineItem.getId());
155
		    contentRow.createCell(15).setCellValue(lineItem.getId());
154
		    Cell weightCell = contentRow.createCell(16);
156
		    Cell weightCell = contentRow.createCell(16);
155
		    weightCell.setCellValue(lineItem.getTotal_weight());
157
		    weightCell.setCellValue(lineItem.getTotal_weight());
156
		    weightCell.setCellStyle(weightStyle);
158
		    weightCell.setCellStyle(weightStyle);
157
		    contentRow.createCell(17).setCellValue(lineItem.getBrand() + " " + lineItem.getModel_number() + " " + lineItem.getModel_name() + " " + lineItem.getColor());
159
		    contentRow.createCell(17).setCellValue(lineItem.getBrand() + " " + lineItem.getModel_number() + " " + lineItem.getModel_name() + " " + lineItem.getColor());
158
		    contentRow.createCell(18).setCellValue(warehouse.getLocation());
160
		    contentRow.createCell(18).setCellValue(location);
159
		    contentRow.createCell(19).setCellValue(accountNo);
161
		    contentRow.createCell(19).setCellValue(accountNo);
160
	    }
162
	    }
161
 
163
 
162
		// Write the workbook to the output stream
164
		// Write the workbook to the output stream
163
		try {
165
		try {
Line 175... Line 177...
175
			return "-";
177
			return "-";
176
		else
178
		else
177
			return s; 
179
			return s; 
178
	}
180
	}
179
	
181
	
-
 
182
	private String removeNewLines(String str){
-
 
183
	    return str.replace('\n', ' ');
-
 
184
	}
-
 
185
	
180
	/**
186
	/**
181
	 * @param args
187
	 * @param args
182
	 */
188
	 */
183
	public static void main(String[] args) {
189
	public static void main(String[] args) {
184
		System.out.println("Hey There");
190
		System.out.println("Hey There");
Line 187... Line 193...
187
			FileOutputStream f = new FileOutputStream("/home/ashish/Downloads/courier-details.xls");
193
			FileOutputStream f = new FileOutputStream("/home/ashish/Downloads/courier-details.xls");
188
			ByteArrayOutputStream baosXLS = g.generateCourierDetails(1, 1, true);
194
			ByteArrayOutputStream baosXLS = g.generateCourierDetails(1, 1, true);
189
			baosXLS.writeTo(f);
195
			baosXLS.writeTo(f);
190
			f.close();
196
			f.close();
191
		} catch (FileNotFoundException e) {
197
		} catch (FileNotFoundException e) {
192
			e.printStackTrace();
198
			logger.error("Error while creating the Courier Details report", e);
193
		} catch (IOException e) {
199
		} catch (IOException e) {
194
			e.printStackTrace();
200
			logger.error("IO error while writing the Courier Details report", e);
195
		}
201
		}
196
		System.out.println("Successfully generated the detailed courier report");
202
		System.out.println("Successfully generated the detailed courier report");
197
	}
203
	}
198
 
204
 
199
}
205
}