Subversion Repositories SmartDukaan

Rev

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

Rev 34397 Rev 34404
Line 460... Line 460...
460
    public double calculateFofoIdTodayTarget(int fofoId, double secondryMtd) {
460
    public double calculateFofoIdTodayTarget(int fofoId, double secondryMtd) {
461
 
461
 
462
        LocalDate todayDate = LocalDate.now();
462
        LocalDate todayDate = LocalDate.now();
463
 
463
 
464
        MonthlyTarget monthlyTarget = monthlyTargetRepository.selectByDateAndFofoId(YearMonth.now(), fofoId);
464
        MonthlyTarget monthlyTarget = monthlyTargetRepository.selectByDateAndFofoId(YearMonth.now(), fofoId);
-
 
465
        if (monthlyTarget == null) {
-
 
466
            // Log or handle as needed
-
 
467
            return 0; // or -1 or some fallback
-
 
468
        }
465
 
469
 
466
        double remainingTarget = monthlyTarget.getPurchaseTarget() - secondryMtd;
470
        double remainingTarget = monthlyTarget.getPurchaseTarget() - secondryMtd;
467
 
471
 
468
        double remainingWorkingDays = getWorkingDaysCount(todayDate);
472
        double remainingWorkingDays = getWorkingDaysCount(todayDate);
469
 
473