Subversion Repositories SmartDukaan

Rev

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

Rev 4746 Rev 4747
Line 222... Line 222...
222
	            	extraInfoTable.setSpacingBefore(5.0f);
222
	            	extraInfoTable.setSpacingBefore(5.0f);
223
	            	extraInfoTable.setWidthPercentage(90.0f);
223
	            	extraInfoTable.setWidthPercentage(90.0f);
224
	                document.add(new DottedLineSeparator());
224
	                document.add(new DottedLineSeparator());
225
	                document.add(extraInfoTable);
225
	                document.add(extraInfoTable);
226
	            }
226
	            }
227
	            // Adding facility to store the bill on the local directory. This will happen for only for Mahipalpur warehouse.
-
 
228
	            if(withBill && !printAll){
-
 
229
	            	Calendar cal = new GregorianCalendar();
-
 
230
	            	cal.setTimeInMillis(order.getBilling_timestamp());
-
 
231
	            	int year = cal.get(Calendar.YEAR);
-
 
232
	      		  	int month = cal.get(Calendar.MONTH);
-
 
233
	      		  	int day = cal.get(Calendar.DAY_OF_MONTH);
-
 
234
	      		  	String dirPath = "/SaholicInvoices" + File.separator + year + File.separator  + month + File.separator + day;
-
 
235
	      		  	File dirFile = new File(dirPath);
-
 
236
	      		  	if(!dirFile.exists()){
-
 
237
	      		  		dirFile.mkdirs();	
-
 
238
	      		  	}
-
 
239
	      		  	File f = new File( dirPath + File.separator + orderId + ".pdf");
-
 
240
	                FileOutputStream fos = new FileOutputStream(f);
-
 
241
	                baosPDF.writeTo(fos);
-
 
242
	            }
-
 
243
	            document.newPage();
227
	            document.newPage();
244
            }
228
            }
245
            document.close();
229
            document.close();
246
            baosPDF.close();
230
            baosPDF.close();
-
 
231
         // Adding facility to store the bill on the local directory. This will happen for only for Mahipalpur warehouse.
-
 
232
            if(withBill && !printAll){
-
 
233
            	Calendar cal = new GregorianCalendar();
-
 
234
            	cal.setTimeInMillis(orders.get(0).getBilling_timestamp());
-
 
235
            	int year = cal.get(Calendar.YEAR);
-
 
236
      		  	int month = cal.get(Calendar.MONTH);
-
 
237
      		  	int day = cal.get(Calendar.DAY_OF_MONTH);
-
 
238
      		  	String dirPath = "/SaholicInvoices" + File.separator + year + File.separator  + month + File.separator + day;
-
 
239
      		  	File dirFile = new File(dirPath);
-
 
240
      		  	if(!dirFile.exists()){
-
 
241
      		  		dirFile.mkdirs();	
-
 
242
      		  	}
-
 
243
      		  	File f = new File( dirPath + File.separator + orderId + ".pdf");
-
 
244
                FileOutputStream fos = new FileOutputStream(f);
-
 
245
                baosPDF.writeTo(fos);
-
 
246
            }
247
        } catch (Exception e) {
247
        } catch (Exception e) {
248
            logger.error("Error while generating Invoice: ", e);
248
            logger.error("Error while generating Invoice: ", e);
249
        }
249
        }
250
        return baosPDF;
250
        return baosPDF;
251
    }
251
    }