@@ -712,7 +712,7 @@ export class WorkdayEntityDialogComponent implements OnInit {
712712 const p2Start = this . getCtrl ( 'planned.shift2.start' ) . value as string | null ;
713713 const p2Stop = this . getCtrl ( 'planned.shift2.stop' ) . value as string | null ;
714714
715- const isSet = ( time : string | null ) => ! ! time && time !== '00:00' ;
715+ const isSet = ( time : string | null ) => ! ! time ; // && time !== '00:00';
716716
717717 // Plan hours enabled only if shift 1 start & stop are empty or 00:00
718718 if ( ( ! p1Start && ! p1Stop ) || ( p1Start === '00:00' && p1Stop === '00:00' ) ) {
@@ -730,7 +730,11 @@ export class WorkdayEntityDialogComponent implements OnInit {
730730
731731 if ( isSet ( p1Stop ) ) {
732732 this . setDisabled ( 'planned.shift1.break' , false ) ;
733- this . setDisabled ( 'planned.shift2.start' , false ) ;
733+ if ( p1Stop !== '00:00' ) {
734+ this . setDisabled ( 'planned.shift2.start' , false ) ;
735+ } else {
736+ this . setDisabled ( 'planned.shift2.start' , true ) ;
737+ }
734738 } else {
735739 this . setDisabled ( 'planned.shift1.break' , true ) ;
736740 this . setDisabled ( 'planned.shift2.start' , true ) ;
@@ -745,12 +749,16 @@ export class WorkdayEntityDialogComponent implements OnInit {
745749
746750 if ( isSet ( p2Stop ) ) {
747751 this . setDisabled ( 'planned.shift2.break' , false ) ;
748- if ( this . data . assignedSiteModel . thirdShiftActive )
749- { this . setDisabled ( 'planned.shift3.start' , false ) ; }
752+ if ( this . data . assignedSiteModel . thirdShiftActive && p2Stop !== '00:00' ) {
753+ this . setDisabled ( 'planned.shift3.start' , false ) ;
754+ } else {
755+ this . setDisabled ( 'planned.shift3.start' , true ) ;
756+ }
750757 } else {
751758 this . setDisabled ( 'planned.shift2.break' , true ) ;
752- if ( this . data . assignedSiteModel . thirdShiftActive )
753- { this . setDisabled ( 'planned.shift3.start' , true ) ; }
759+ if ( this . data . assignedSiteModel . thirdShiftActive ) {
760+ this . setDisabled ( 'planned.shift3.start' , true ) ;
761+ }
754762 }
755763
756764 // Shift 3
@@ -763,12 +771,16 @@ export class WorkdayEntityDialogComponent implements OnInit {
763771
764772 if ( isSet ( p3Stop ) ) {
765773 this . setDisabled ( 'planned.shift3.break' , false ) ;
766- if ( this . data . assignedSiteModel . fourthShiftActive )
767- { this . setDisabled ( 'planned.shift4.start' , false ) ; }
774+ if ( this . data . assignedSiteModel . fourthShiftActive && p3Stop !== '00:00' ) {
775+ this . setDisabled ( 'planned.shift4.start' , false ) ;
776+ } else {
777+ this . setDisabled ( 'planned.shift4.start' , true ) ;
778+ }
768779 } else {
769780 this . setDisabled ( 'planned.shift3.break' , true ) ;
770- if ( this . data . assignedSiteModel . fourthShiftActive )
771- { this . setDisabled ( 'planned.shift4.start' , true ) ; }
781+ if ( this . data . assignedSiteModel . fourthShiftActive ) {
782+ this . setDisabled ( 'planned.shift4.start' , true ) ;
783+ }
772784 }
773785 }
774786
@@ -782,12 +794,16 @@ export class WorkdayEntityDialogComponent implements OnInit {
782794
783795 if ( isSet ( p4Stop ) ) {
784796 this . setDisabled ( 'planned.shift4.break' , false ) ;
785- if ( this . data . assignedSiteModel . fifthShiftActive )
786- { this . setDisabled ( 'planned.shift5.start' , false ) ; }
797+ if ( this . data . assignedSiteModel . fifthShiftActive && p4Stop !== '00:00' ) {
798+ this . setDisabled ( 'planned.shift5.start' , false ) ;
799+ } else {
800+ this . setDisabled ( 'planned.shift5.start' , true ) ;
801+ }
787802 } else {
788803 this . setDisabled ( 'planned.shift4.break' , true ) ;
789- if ( this . data . assignedSiteModel . fifthShiftActive )
790- { this . setDisabled ( 'planned.shift5.start' , true ) ; }
804+ if ( this . data . assignedSiteModel . fifthShiftActive ) {
805+ this . setDisabled ( 'planned.shift5.start' , true ) ;
806+ }
791807 }
792808 }
793809
@@ -844,7 +860,11 @@ export class WorkdayEntityDialogComponent implements OnInit {
844860
845861 if ( a2Stop ) {
846862 this . setDisabled ( 'actual.shift2.pause' , false ) ;
847- this . setDisabled ( 'actual.shift3.start' , false ) ;
863+ if ( this . data . assignedSiteModel . thirdShiftActive && a2Stop !== '00:00' ) {
864+ this . setDisabled ( 'actual.shift3.start' , false ) ;
865+ } else {
866+ this . setDisabled ( 'actual.shift3.start' , true ) ;
867+ }
848868 }
849869
850870 if ( this . data . assignedSiteModel . thirdShiftActive ) {
@@ -857,7 +877,11 @@ export class WorkdayEntityDialogComponent implements OnInit {
857877 }
858878 if ( a3Stop ) {
859879 this . setDisabled ( 'actual.shift3.pause' , false ) ;
860- this . setDisabled ( 'actual.shift4.start' , false ) ;
880+ if ( this . data . assignedSiteModel . fourthShiftActive && a3Stop !== '00:00' ) {
881+ this . setDisabled ( 'actual.shift4.start' , false ) ;
882+ } else {
883+ this . setDisabled ( 'actual.shift4.start' , true ) ;
884+ }
861885 }
862886 }
863887
@@ -871,7 +895,11 @@ export class WorkdayEntityDialogComponent implements OnInit {
871895 }
872896 if ( a4Stop ) {
873897 this . setDisabled ( 'actual.shift4.pause' , false ) ;
874- this . setDisabled ( 'actual.shift5.start' , false ) ;
898+ if ( this . data . assignedSiteModel . fifthShiftActive && a4Stop !== '00:00' ) {
899+ this . setDisabled ( 'actual.shift5.start' , false ) ;
900+ } else {
901+ this . setDisabled ( 'actual.shift5.start' , true ) ;
902+ }
875903 }
876904 }
877905
@@ -1015,6 +1043,7 @@ export class WorkdayEntityDialogComponent implements OnInit {
10151043 if ( changedKey !== 'DayOff' ) {
10161044 this . data . planningPrDayModels . nettoHoursOverrideActive = true ;
10171045 this . data . planningPrDayModels . nettoHoursOverride = this . data . planningPrDayModels . planHours ;
1046+ this . workdayForm . get ( 'nettoHoursOverride' ) ?. setValue ( this . data . planningPrDayModels . planHours ) ;
10181047 } else {
10191048 this . data . planningPrDayModels . nettoHoursOverrideActive = false ;
10201049 }
@@ -1038,6 +1067,7 @@ export class WorkdayEntityDialogComponent implements OnInit {
10381067 const s5 = this . workdayForm . get ( 'planned.shift5' ) as FormGroup ;
10391068 switch ( number ) {
10401069 case 1 :
1070+ this . workdayForm . get ( 'planHours' ) ?. setValue ( 0 , { emitEvent : false } ) ;
10411071 s1 . patchValue ( { start : null , break : null , stop : null } ) ;
10421072 s2 . patchValue ( { start : null , break : null , stop : null } ) ;
10431073 s3 . patchValue ( { start : null , break : null , stop : null } ) ;
@@ -1265,6 +1295,12 @@ export class WorkdayEntityDialogComponent implements OnInit {
12651295 // Rens paidOutFlex
12661296 this . data . planningPrDayModels . paidOutFlex =
12671297 this . data . planningPrDayModels . paidOutFlex === null ? 0 : this . data . planningPrDayModels . paidOutFlex ;
1298+
1299+ if ( this . data . planningPrDayModels . paidOutFlex . toString ( ) . includes ( ',' ) ) {
1300+ this . data . planningPrDayModels . paidOutFlex = parseFloat (
1301+ this . data . planningPrDayModels . paidOutFlex . toString ( ) . replace ( ',' , '.' )
1302+ ) ;
1303+ }
12681304 }
12691305
12701306 private getPlannedShiftMinutes (
0 commit comments