Subversion Repositories SmartDukaan

Rev

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

Rev 13589 Rev 13602
Line 208... Line 208...
208
            float avg_total_sale = 0;
208
            float avg_total_sale = 0;
209
            StringBuilder total_days_sale = new StringBuilder();
209
            StringBuilder total_days_sale = new StringBuilder();
210
            
210
            
211
            List<FASalesSnapshot> fiveDaySale = new ArrayList<FASalesSnapshot>(entry.getValue().values());
211
            List<FASalesSnapshot> fiveDaySale = new ArrayList<FASalesSnapshot>(entry.getValue().values());
212
            Collections.sort(fiveDaySale, new FkSaleComparator());
212
            Collections.sort(fiveDaySale, new FkSaleComparator());
-
 
213
            long stockQuantity = 0;
-
 
214
            if(currentFaInventoryMap.containsKey(entry.getKey())){
-
 
215
            	stockQuantity = currentFaInventoryMap.get(entry.getKey());
-
 
216
            }else{
-
 
217
            	stockQuantity = 0;
-
 
218
            }
213
            
219
            
214
            for(FASalesSnapshot sale : fiveDaySale) {
220
            for(FASalesSnapshot sale : fiveDaySale) {
215
            	
221
            	
216
            	if (sale.getTotalOrderCount() != -1) {
222
            	if (sale.getTotalOrderCount() != -1) {
217
                    total_days_sale.append(sale.getTotalOrderCount());
223
                    total_days_sale.append(sale.getTotalOrderCount());
Line 227... Line 233...
227
                count++;
233
                count++;
228
            }
234
            }
229
            if(entry.getValue().size()<5){
235
            if(entry.getValue().size()<5){
230
	            while(count<=5){
236
	            while(count<=5){
231
	            	total_days_sale.append("-");
237
	            	total_days_sale.append("-");
-
 
238
	            	if(stockQuantity>0){
-
 
239
	            		total_days_sale.append("0");
-
 
240
	            		total_sale_days++;
-
 
241
	            	} else {
232
	            	total_days_sale.append("X");
242
	            		total_days_sale.append("X");
-
 
243
	            	}
233
	            	count++;
244
	            	count++;
234
	            }
245
	            }
235
            }
246
            }
236
            
247
            
237
            
248
            
Line 240... Line 251...
240
                total_sale_avg = avg_total_sale / total_sale_days;
251
                total_sale_avg = avg_total_sale / total_sale_days;
241
            }
252
            }
242
            fkExcelRow.setItem_id(entry.getKey());
253
            fkExcelRow.setItem_id(entry.getKey());
243
            
254
            
244
            float days_of_stock = 0;
255
            float days_of_stock = 0;
245
            long stockQuantity = 0;
-
 
246
            if(currentFaInventoryMap.containsKey(entry.getKey())){
-
 
247
            	stockQuantity = currentFaInventoryMap.get(entry.getKey());
-
 
248
            }else{
-
 
249
            	stockQuantity = 0;
-
 
250
            }
256
            
251
            double sellingPrice = 0.0;//
257
            double sellingPrice = 0.0;//
252
            if(currentFAInventorySellingPriceMap.containsKey(entry.getKey())){
258
            if(currentFAInventorySellingPriceMap.containsKey(entry.getKey())){
253
            	sellingPrice = currentFAInventorySellingPriceMap.get(entry.getKey());
259
            	sellingPrice = currentFAInventorySellingPriceMap.get(entry.getKey());
254
            }else{
260
            }else{
255
            	sellingPrice = total_sale/avg_total_sale;
261
            	sellingPrice = total_sale/avg_total_sale;