| Line 18... |
Line 18... |
| 18 |
|
18 |
|
| 19 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
19 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 20 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
20 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 21 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
21 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 22 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
22 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| - |
|
23 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseReturnItemRepository;
|
| 23 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
24 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 24 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
25 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 25 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
26 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 26 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
27 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 27 |
import com.spice.profitmandi.service.wallet.WalletService;
|
28 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| Line 53... |
Line 54... |
| 53 |
@Autowired
|
54 |
@Autowired
|
| 54 |
private InventoryService inventoryService;
|
55 |
private InventoryService inventoryService;
|
| 55 |
|
56 |
|
| 56 |
@Autowired
|
57 |
@Autowired
|
| 57 |
private OrderRepository orderRepository;
|
58 |
private OrderRepository orderRepository;
|
| - |
|
59 |
|
| - |
|
60 |
@Autowired
|
| - |
|
61 |
private PurchaseReturnItemRepository purchaseReturnItemRepository;
|
| 58 |
|
62 |
|
| 59 |
/*
|
63 |
/*
|
| 60 |
* @Autowired private ScanRepository scanRepository;
|
64 |
* @Autowired private ScanRepository scanRepository;
|
| 61 |
*/
|
65 |
*/
|
| 62 |
|
66 |
|
| Line 85... |
Line 89... |
| 85 |
float unbilledStockAmount = 0;
|
89 |
float unbilledStockAmount = 0;
|
| 86 |
float grnPendingStockAmount = 0;
|
90 |
float grnPendingStockAmount = 0;
|
| 87 |
float shortPercentage = 100;
|
91 |
float shortPercentage = 100;
|
| 88 |
float totalInvestedAmount = 0;
|
92 |
float totalInvestedAmount = 0;
|
| 89 |
float minimumInvestment = 0;
|
93 |
float minimumInvestment = 0;
|
| - |
|
94 |
float returnedStockInTransit=0;
|
| 90 |
if (roleManager.isAdmin(loginDetails.getRoleIds())) {
|
95 |
if (roleManager.isAdmin(loginDetails.getRoleIds())) {
|
| 91 |
model.addAttribute("showAlert", false);
|
96 |
model.addAttribute("showAlert", false);
|
| 92 |
} else if (roleManager.isPartner(loginDetails.getRoleIds())) {
|
97 |
} else if (roleManager.isPartner(loginDetails.getRoleIds())) {
|
| 93 |
walletAmount = walletService.getUserWallet(loginDetails.getFofoId()).getAmount();
|
98 |
walletAmount = walletService.getUserWallet(loginDetails.getFofoId()).getAmount();
|
| 94 |
inStockAmount = inventoryService.getTotalAmountInStock(loginDetails.getFofoId());
|
99 |
inStockAmount = inventoryService.getTotalAmountInStock(loginDetails.getFofoId());
|
| Line 105... |
Line 110... |
| 105 |
totalInvestedAmount = walletAmount + inStockAmount + unbilledStockAmount + grnPendingStockAmount;
|
110 |
totalInvestedAmount = walletAmount + inStockAmount + unbilledStockAmount + grnPendingStockAmount;
|
| 106 |
shortPercentage = ((fofoStore.getMinimumInvestment() - totalInvestedAmount)
|
111 |
shortPercentage = ((fofoStore.getMinimumInvestment() - totalInvestedAmount)
|
| 107 |
/ fofoStore.getMinimumInvestment()) * 100;
|
112 |
/ fofoStore.getMinimumInvestment()) * 100;
|
| 108 |
model.addAttribute("showAlert", shortPercentage > 10);
|
113 |
model.addAttribute("showAlert", shortPercentage > 10);
|
| 109 |
minimumInvestment = fofoStore.getMinimumInvestment();
|
114 |
minimumInvestment = fofoStore.getMinimumInvestment();
|
| - |
|
115 |
|
| - |
|
116 |
//debitNoteRepository.se
|
| 110 |
}
|
117 |
}
|
| 111 |
model.addAttribute("walletAmount", walletAmount);
|
118 |
model.addAttribute("walletAmount", walletAmount);
|
| 112 |
model.addAttribute("inStockAmount", inStockAmount);
|
119 |
model.addAttribute("inStockAmount", inStockAmount);
|
| 113 |
model.addAttribute("unbilledStockAmount", unbilledStockAmount);
|
120 |
model.addAttribute("unbilledStockAmount", unbilledStockAmount);
|
| 114 |
model.addAttribute("grnPendingStockAmount", grnPendingStockAmount);
|
121 |
model.addAttribute("grnPendingStockAmount", grnPendingStockAmount);
|
| 115 |
model.addAttribute("shortPercentage", shortPercentage);
|
122 |
model.addAttribute("shortPercentage", shortPercentage);
|
| 116 |
model.addAttribute("totalInvestedAmount", totalInvestedAmount);
|
123 |
model.addAttribute("totalInvestedAmount", totalInvestedAmount);
|
| 117 |
model.addAttribute("minimumInvestmentAmount", minimumInvestment);
|
124 |
model.addAttribute("minimumInvestmentAmount", minimumInvestment);
|
| - |
|
125 |
model.addAttribute("returnedStockInTransit", returnedStockInTransit);
|
| 118 |
|
126 |
|
| 119 |
model.addAttribute("fofoStore", fofoStore);
|
127 |
model.addAttribute("fofoStore", fofoStore);
|
| 120 |
model.addAttribute("walletAmount");
|
128 |
model.addAttribute("walletAmount");
|
| 121 |
model.addAttribute("appContextPath", request.getContextPath());
|
129 |
model.addAttribute("appContextPath", request.getContextPath());
|
| 122 |
model.addAttribute("isAdmin", roleManager.isAdmin(loginDetails.getRoleIds()));
|
130 |
model.addAttribute("isAdmin", roleManager.isAdmin(loginDetails.getRoleIds()));
|