Subversion Repositories SmartDukaan

Rev

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

Rev 37374 Rev 37427
Line 487... Line 487...
487
        model.addAttribute("bulletins", bulletins);
487
        model.addAttribute("bulletins", bulletins);
488
        return "bulletin-list";
488
        return "bulletin-list";
489
    }
489
    }
490
 
490
 
491
 
491
 
492
    private static String formatIndianCurrency(long amount) {
492
    static String formatIndianCurrency(long amount) {
493
        if (amount >= 10000000L) {
493
        if (amount >= 10000000L) {
494
            return String.format("%.2f Cr", amount / 10000000.0);
494
            return String.format("%.2f Cr", amount / 10000000.0);
495
        }
495
        }
496
        if (amount >= 100000L) {
496
        if (amount >= 100000L) {
497
            return String.format("%.2f L", amount / 100000.0);
497
            return String.format("%.2f L", amount / 100000.0);
Line 2714... Line 2714...
2714
            default:
2714
            default:
2715
                return day + "th";
2715
                return day + "th";
2716
        }
2716
        }
2717
    }
2717
    }
2718
 
2718
 
2719
    private static String formatSchemePeriodDisplay(LocalDateTime start, LocalDateTime end) {
2719
    static String formatSchemePeriodDisplay(LocalDateTime start, LocalDateTime end) {
2720
        if (start == null || end == null) return "";
2720
        if (start == null || end == null) return "";
2721
        String startPart = ordinalDay(start.getDayOfMonth()) + " " +
2721
        String startPart = ordinalDay(start.getDayOfMonth()) + " " +
2722
                start.getMonth().getDisplayName(java.time.format.TextStyle.FULL, Locale.ENGLISH);
2722
                start.getMonth().getDisplayName(java.time.format.TextStyle.FULL, Locale.ENGLISH);
2723
        String endPart = ordinalDay(end.getDayOfMonth()) + " " +
2723
        String endPart = ordinalDay(end.getDayOfMonth()) + " " +
2724
                end.getMonth().getDisplayName(java.time.format.TextStyle.FULL, Locale.ENGLISH) + " " + end.getYear();
2724
                end.getMonth().getDisplayName(java.time.format.TextStyle.FULL, Locale.ENGLISH) + " " + end.getYear();
Line 2848... Line 2848...
2848
                    // Accessories target is fixed at 1% of the assigned mobile+LED target.
2848
                    // Accessories target is fixed at 1% of the assigned mobile+LED target.
2849
                    accessoriesTarget = Math.round(mobileLedTarget * 0.01);
2849
                    accessoriesTarget = Math.round(mobileLedTarget * 0.01);
2850
                    totalTarget = mobileLedTarget + accessoriesTarget;
2850
                    totalTarget = mobileLedTarget + accessoriesTarget;
2851
                    achievementPercent = totalTarget > 0 ? (int) Math.round(schemeAchievement * 100.0 / totalTarget) : 0;
2851
                    achievementPercent = totalTarget > 0 ? (int) Math.round(schemeAchievement * 100.0 / totalTarget) : 0;
2852
 
2852
 
2853
                    // "Currently aiming for" — dynamic tier based on total achievement (not assigned target).
2853
                    // "Currently aiming for" — floored at the partner's target tier.
-
 
2854
                    // Partner keeps aiming at their assigned tier until achievement crosses it,
2854
                    // Same SRC5 thresholds; the tier advances as achievement crosses each ceiling.
2855
                    // then advances to the next tier as achievement crosses each ceiling.
-
 
2856
                    long aimBasis = Math.max(mobileLedTarget, (long) schemeAchievement);
2855
                    if (schemeAchievement < 4000000) {
2857
                    if (aimBasis < 4000000) {
2856
                        aimingTier = "Shuruaat";       // up to 40 Lacs
2858
                        aimingTier = "Shuruaat";       // up to 40 Lacs
2857
                    } else if (schemeAchievement < 7000000) {
2859
                    } else if (aimBasis < 7000000) {
2858
                        aimingTier = "Udaan";          // 40 – 70 Lacs
2860
                        aimingTier = "Udaan";          // 40 – 70 Lacs
2859
                    } else if (schemeAchievement < 9000000) {
2861
                    } else if (aimBasis < 9000000) {
2860
                        aimingTier = "Raftaar";        // 70 – 90 Lacs
2862
                        aimingTier = "Raftaar";        // 70 – 90 Lacs
2861
                    } else if (schemeAchievement < 12000000) {
2863
                    } else if (aimBasis < 12000000) {
2862
                        aimingTier = "Tarakki";        // 90 Lacs – 1.20 Cr
2864
                        aimingTier = "Tarakki";        // 90 Lacs – 1.20 Cr
2863
                    } else if (schemeAchievement < 24000000) {
2865
                    } else if (aimBasis < 24000000) {
2864
                        aimingTier = "Vijeta";         // 1.20 – 2.40 Cr
2866
                        aimingTier = "Vijeta";         // 1.20 – 2.40 Cr
2865
                    } else {
2867
                    } else {
2866
                        aimingTier = "Maharaja";       // 2.40 Cr and above
2868
                        aimingTier = "Maharaja";       // 2.40 Cr and above
2867
                    }
2869
                    }
2868
                }
2870
                }