Subversion Repositories SmartDukaan

Rev

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

Rev 35600 Rev 35848
Line 143... Line 143...
143
        }
143
        }
144
 
144
 
145
        List<PartnerDailyInvestment> currentMonthInvestments = partnerDailyInvestmentRepository.selectAll(fofoId, currentMonthStart, currentMonthStart.withDayOfMonth(currentMonthStart.lengthOfMonth()));
145
        List<PartnerDailyInvestment> currentMonthInvestments = partnerDailyInvestmentRepository.selectAll(fofoId, currentMonthStart, currentMonthStart.withDayOfMonth(currentMonthStart.lengthOfMonth()));
146
        boolean isInvestmentOk = partnerInvestmentService.isInvestmentOk(fofoId, ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT);
146
        boolean isInvestmentOk = partnerInvestmentService.isInvestmentOk(fofoId, ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT);
147
 
147
 
148
        long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= 10).collect(Collectors.counting());
148
        long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= ProfitMandiConstants.OK_INVESTMENT_SHORT_PERCENTAGE).collect(Collectors.counting());
149
        PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(fofoId, LocalDate.now());
149
        PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(fofoId, LocalDate.now());
150
        investments.put("today", investment.getTotalInvestment());
150
        investments.put("today", investment.getOwnInvestment());
151
        investments.put("partnerType", partnerType);
151
        investments.put("partnerType", partnerType);
152
        investments.put("investment", investment);
152
        investments.put("investment", investment);
153
        investments.put("minimumInvestment", investment.getMinInvestment());
153
        investments.put("minimumInvestment", investment.getMinInvestment());
154
        investments.put("totalInvestment", investment.getTotalInvestment());
154
        investments.put("totalInvestment", investment.getOwnInvestment());
155
        investments.put("isInvestmentOk", isInvestmentOk);
155
        investments.put("isInvestmentOk", isInvestmentOk);
156
        investments.put("inStock", investment.getInStockAmount());
156
        investments.put("inStock", investment.getInStockAmount());
157
        investments.put("minimum", investment.getMinInvestmentString());
157
        investments.put("minimum", investment.getMinInvestmentString());
158
        investments.put("short", investment.getShortPercentage());
158
        investments.put("short", investment.getShortPercentage());
159
        investments.put("activated_stock", investment.getActivatedStockAmount());
159
        investments.put("activated_stock", investment.getActivatedStockAmount());
Line 174... Line 174...
174
            yesterdayInvestment = new PartnerDailyInvestment();
174
            yesterdayInvestment = new PartnerDailyInvestment();
175
        }
175
        }
176
 
176
 
177
        List<PartnerDailyInvestment> currentMonthInvestments = partnerDailyInvestmentRepository.selectAll(fofoId, currentMonthStart, currentMonthStart.withDayOfMonth(currentMonthStart.lengthOfMonth()));
177
        List<PartnerDailyInvestment> currentMonthInvestments = partnerDailyInvestmentRepository.selectAll(fofoId, currentMonthStart, currentMonthStart.withDayOfMonth(currentMonthStart.lengthOfMonth()));
178
 
178
 
179
        long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= 10).collect(Collectors.counting());
179
        long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= ProfitMandiConstants.OK_INVESTMENT_SHORT_PERCENTAGE).collect(Collectors.counting());
180
        investments.put("today", investment.getTotalInvestment());
180
        investments.put("today", investment.getOwnInvestment());
181
        investments.put("investment", investment);
181
        investments.put("investment", investment);
182
        investments.put("inStock", investment.getInStockAmount());
182
        investments.put("inStock", investment.getInStockAmount());
183
        investments.put("minimum", investment.getMinInvestmentString());
183
        investments.put("minimum", investment.getMinInvestmentString());
184
        investments.put("short", investment.getShortPercentage());
184
        investments.put("short", investment.getShortPercentage());
185
        investments.put("activated_stock", investment.getActivatedStockAmount());
185
        investments.put("activated_stock", investment.getActivatedStockAmount());
Line 590... Line 590...
590
        investmentWalletAmount.put("InStocks", investment.getInStockAmount() - investment.getActivatedStockAmount());
590
        investmentWalletAmount.put("InStocks", investment.getInStockAmount() - investment.getActivatedStockAmount());
591
        investmentWalletAmount.put("Unbilled Order", investment.getUnbilledAmount());
591
        investmentWalletAmount.put("Unbilled Order", investment.getUnbilledAmount());
592
        investmentWalletAmount.put("GrnPending", investment.getGrnPendingAmount() - investment.getActivatedGrnPendingAmount());
592
        investmentWalletAmount.put("GrnPending", investment.getGrnPendingAmount() - investment.getActivatedGrnPendingAmount());
593
        investmentWalletAmount.put("ReturnInTransit", investment.getReturnInTransitAmount());
593
        investmentWalletAmount.put("ReturnInTransit", investment.getReturnInTransitAmount());
594
 
594
 
-
 
595
        if (investment.getUtilizedAmount() > 0) {
-
 
596
            investmentWalletAmount.put("Credit Utilized", -investment.getUtilizedAmount());
-
 
597
        }
-
 
598
 
595
        if (investment.getShortInvestment() > 0) {
599
        if (investment.getShortInvestment() > 0) {
596
            investmentWalletAmount.put("Short Investment", investment.getShortInvestment());
600
            investmentWalletAmount.put("Short Investment", investment.getShortInvestment());
597
        }
601
        }
598
 
602
 
599
        ChartInvestmentModel cm = new ChartInvestmentModel();
603
        ChartInvestmentModel cm = new ChartInvestmentModel();
Line 623... Line 627...
623
                backgroundColor.add("orange");
627
                backgroundColor.add("orange");
624
            }
628
            }
625
            if (label.equals("GrnPending")) {
629
            if (label.equals("GrnPending")) {
626
                backgroundColor.add("yellow");
630
                backgroundColor.add("yellow");
627
            }
631
            }
-
 
632
            if (label.equals("Credit Utilized")) {
-
 
633
                backgroundColor.add("grey");
-
 
634
            }
628
 
635
 
629
        }
636
        }
630
 
637
 
631
        Data data = new Data();
638
        Data data = new Data();
632
        data.setData(values);
639
        data.setData(values);