Subversion Repositories SmartDukaan

Rev

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

Rev 4659 Rev 4746
Line 20... Line 20...
20
import java.io.FileOutputStream;
20
import java.io.FileOutputStream;
21
import java.io.IOException;
21
import java.io.IOException;
22
import java.text.DateFormat;
22
import java.text.DateFormat;
23
import java.text.DecimalFormat;
23
import java.text.DecimalFormat;
24
import java.util.ArrayList;
24
import java.util.ArrayList;
-
 
25
import java.util.Calendar;
25
import java.util.Date;
26
import java.util.Date;
26
import java.util.Enumeration;
27
import java.util.Enumeration;
-
 
28
import java.util.GregorianCalendar;
27
import java.util.List;
29
import java.util.List;
28
import java.util.Locale;
30
import java.util.Locale;
29
import java.util.Properties;
31
import java.util.Properties;
30
import java.util.ResourceBundle;
32
import java.util.ResourceBundle;
31
 
33
 
Line 220... Line 222...
220
	            	extraInfoTable.setSpacingBefore(5.0f);
222
	            	extraInfoTable.setSpacingBefore(5.0f);
221
	            	extraInfoTable.setWidthPercentage(90.0f);
223
	            	extraInfoTable.setWidthPercentage(90.0f);
222
	                document.add(new DottedLineSeparator());
224
	                document.add(new DottedLineSeparator());
223
	                document.add(extraInfoTable);
225
	                document.add(extraInfoTable);
224
	            }
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
	            }
225
	            document.newPage();
243
	            document.newPage();
226
            }
244
            }
227
            document.close();
245
            document.close();
228
            baosPDF.close();
246
            baosPDF.close();
229
        } catch (Exception e) {
247
        } catch (Exception e) {