Subversion Repositories SmartDukaan

Rev

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

Rev 3560 Rev 3575
Line 69... Line 69...
69
				try {
69
				try {
70
					SourceItemPricing sip = client.getItemPricingBySource(item.getId(), source.getId());
70
					SourceItemPricing sip = client.getItemPricingBySource(item.getId(), source.getId());
71
					sellingPrice = sip.getSellingPrice();
71
					sellingPrice = sip.getSellingPrice();
72
					mrp = sip.getMrp();
72
					mrp = sip.getMrp();
73
				} catch (TException e) {
73
				} catch (TException e) {
74
					e.printStackTrace();
74
					
75
				} catch (InventoryServiceException e) {
75
				} catch (InventoryServiceException e) {
76
					e.printStackTrace();
76
					
77
				}
77
				}
78
			}
78
			}
79
			
79
			
80
			if (mrp <= sellingPrice) {
80
			if (mrp <= sellingPrice) {
81
				showmrp = false;
81
				showmrp = false;
Line 93... Line 93...
93
			itemDetail.put("CATALOG_ID", ((int)item.getCatalogItemId())+"");
93
			itemDetail.put("CATALOG_ID", ((int)item.getCatalogItemId())+"");
94
			itemDetail.put("SHOWMRP", showmrp +"");
94
			itemDetail.put("SHOWMRP", showmrp +"");
95
			itemDetail.put("IS_SELECTED", item.isDefaultForEntity() ? "SELECTED" : "");
95
			itemDetail.put("IS_SELECTED", item.isDefaultForEntity() ? "SELECTED" : "");
96
			itemDetails.add(itemDetail);
96
			itemDetails.add(itemDetail);
97
		}
97
		}
-
 
98
		
-
 
99
		
-
 
100
		
98
		File exportDir = new File(exportPath + catalogId);
101
		exportPath = exportPath + catalogId;
99
		if(source != null){
102
		if(source != null){
100
			exportDir = new File(exportPath + catalogId + File.separator + source.getId());	
103
			exportPath = exportPath + catalogId + File.separator + source.getId();
101
		}
104
		}
102
		
105
		
-
 
106
		File exportDir = new File(exportPath);
-
 
107
		
103
		if(!exportDir.exists()) {
108
		if(!exportDir.exists()) {
104
			exportDir.mkdir();
109
			exportDir.mkdir();
105
		}
110
		}
106
 
111
 
107
		// This URL is used to ensure that images such as icon and thumbnail for
112
		// This URL is used to ensure that images such as icon and thumbnail for
Line 146... Line 151...
146
			p.setProperty("file.resource.loader.class","org.apache.velocity.runtime.resource.loader.FileResourceLoader");
151
			p.setProperty("file.resource.loader.class","org.apache.velocity.runtime.resource.loader.FileResourceLoader");
147
			p.setProperty( "file.resource.loader.path", Utils.EXPORT_VELOCITY_PATH);
152
			p.setProperty( "file.resource.loader.path", Utils.EXPORT_VELOCITY_PATH);
148
			Velocity.init(p);
153
			Velocity.init(p);
149
			for(String filename: filenames){
154
			for(String filename: filenames){
150
				Template template = Velocity.getTemplate(catalogId + File.separator + filename + ".vm");
155
				Template template = Velocity.getTemplate(catalogId + File.separator + filename + ".vm");
151
				BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(exportPath + catalogId + File.separator +filename+".html")));
156
				BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(exportPath + File.separator +filename+".html")));
152
				template.merge(context, writer);
157
				template.merge(context, writer);
153
				writer.flush();
158
				writer.flush();
154
				writer.close();	
159
				writer.close();	
155
			}
160
			}
156
		}catch (ResourceNotFoundException e) {
161
		}catch (ResourceNotFoundException e) {