Subversion Repositories SmartDukaan

Rev

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

Rev 23923 Rev 23936
Line 84... Line 84...
84
		float inStockAmount = 0;
84
		float inStockAmount = 0;
85
		float unbilledStockAmount = 0;
85
		float unbilledStockAmount = 0;
86
		float grnPendingStockAmount = 0;
86
		float grnPendingStockAmount = 0;
87
		float shortPercentage = 100;
87
		float shortPercentage = 100;
88
		float totalInvestedAmount = 0;
88
		float totalInvestedAmount = 0;
-
 
89
		float minimumInvestment = 0;
89
		if (roleManager.isAdmin(loginDetails.getRoleIds())) {
90
		if (roleManager.isAdmin(loginDetails.getRoleIds())) {
90
			model.addAttribute("showAlert", false);
91
			model.addAttribute("showAlert", false);
91
		} else if (roleManager.isPartner(loginDetails.getRoleIds())) {
92
		} else if (roleManager.isPartner(loginDetails.getRoleIds())) {
92
			walletAmount = walletService.getUserWallet(loginDetails.getFofoId()).getAmount();
93
			walletAmount = walletService.getUserWallet(loginDetails.getFofoId()).getAmount();
93
			inStockAmount = inventoryService.getTotalAmountInStock(loginDetails.getFofoId());
94
			inStockAmount = inventoryService.getTotalAmountInStock(loginDetails.getFofoId());
Line 103... Line 104...
103
			}
104
			}
104
			totalInvestedAmount = walletAmount + inStockAmount + unbilledStockAmount + grnPendingStockAmount;
105
			totalInvestedAmount = walletAmount + inStockAmount + unbilledStockAmount + grnPendingStockAmount;
105
			shortPercentage = ((fofoStore.getMinimumInvestment() - totalInvestedAmount)
106
			shortPercentage = ((fofoStore.getMinimumInvestment() - totalInvestedAmount)
106
					/ fofoStore.getMinimumInvestment()) * 100;
107
					/ fofoStore.getMinimumInvestment()) * 100;
107
			model.addAttribute("showAlert", shortPercentage < 90);
108
			model.addAttribute("showAlert", shortPercentage < 90);
-
 
109
			minimumInvestment = fofoStore.getMinimumInvestment();
108
		}
110
		}
109
		model.addAttribute("walletAmount", walletAmount);
111
		model.addAttribute("walletAmount", walletAmount);
110
		model.addAttribute("inStockAmount", inStockAmount);
112
		model.addAttribute("inStockAmount", inStockAmount);
111
		model.addAttribute("unbilledStockAmount", unbilledStockAmount);
113
		model.addAttribute("unbilledStockAmount", unbilledStockAmount);
112
		model.addAttribute("grnPendingStockAmount", grnPendingStockAmount);
114
		model.addAttribute("grnPendingStockAmount", grnPendingStockAmount);
113
		model.addAttribute("shortPercentage", shortPercentage);
115
		model.addAttribute("shortPercentage", shortPercentage);
114
		model.addAttribute("totalInvestedAmount", totalInvestedAmount);
116
		model.addAttribute("totalInvestedAmount", totalInvestedAmount);
115
		model.addAttribute("minimumInvestmentAmount", fofoStore.getMinimumInvestment());
117
		model.addAttribute("minimumInvestmentAmount", minimumInvestment);
116
 
118
 
117
		model.addAttribute("fofoStore", fofoStore);
119
		model.addAttribute("fofoStore", fofoStore);
118
		model.addAttribute("walletAmount");
120
		model.addAttribute("walletAmount");
119
		model.addAttribute("appContextPath", request.getContextPath());
121
		model.addAttribute("appContextPath", request.getContextPath());
120
		model.addAttribute("isAdmin", roleManager.isAdmin(loginDetails.getRoleIds()));
122
		model.addAttribute("isAdmin", roleManager.isAdmin(loginDetails.getRoleIds()));