dailyBalance.setWorkedOnNormalWorkPeriod(dailyBalance.getWorkedOnNormalWorkPeriod().plus(mealDiscount)); System.out.println("nwp: depois " + (dailyBalance.getWorkedOnNormalWorkPeriod()).toPeriod().toString());
dailyBalance.setWorkedOnNormalWorkPeriod(dailyBalance.getWorkedOnNormalWorkPeriod().minus( mealDiscount)); System.out.println("nwp: depois " + (dailyBalance.getWorkedOnNormalWorkPeriod()).toPeriod().toString());
    public void checkMealDurationAccordingToRules(DailyBalance dailyBalance) {        // According to Nota Informativa 55/03        // if mealDuration is shorter than 15 minutes the whole day is subtracted from the normal work period            if (dailyBalance.getLunchBreak().isShorterThan(getMeal().getMinimumMealBreakInterval())) {            // NormalWorkPeriodBalance will be - totalNormalWorkPeriodDuration            System.out.println("almoco e' menor q o tempo dado para almoco");            dailyBalance.setWorkedOnNormalWorkPeriod(Duration.ZERO);            if (definedFixedPeriod()) {                // FixedPeriod absence will be the whole fixed period duration                System.out.println("fixed period com tudo!");                dailyBalance.setFixedPeriodAbsence(((WorkPeriod)this.getFixedWorkPeriod()).getWorkPeriodDuration());                System.out.println(dailyBalance.getFixedPeriodAbsence().toPeriod().toString());            }        } else {            System.out.println("nwp: " + (dailyBalance.getWorkedOnNormalWorkPeriod()).toPeriod().toString());            System.out.println("saldo nwp antes: " + getNormalWorkPeriod().getWorkPeriodDuration().minus((dailyBalance.getWorkedOnNormalWorkPeriod())).toPeriod().toString());            System.out.println("almoco" + dailyBalance.getLunchBreak().toPeriod().toString());            System.out.println("demorou mais de 15m a almocar");            Duration mealDiscount = ((Meal)getMeal()).calculateMealDiscount(dailyBalance.getLunchBreak());            System.out.println("descontar " + mealDiscount.toPeriod().toString());            // periodo normal menos desconto            dailyBalance.setWorkedOnNormalWorkPeriod(dailyBalance.getWorkedOnNormalWorkPeriod().plus(mealDiscount));            System.out.println("nwp: depois " + (dailyBalance.getWorkedOnNormalWorkPeriod()).toPeriod().toString());        }    }