Check-in Check-out, Days or Nights Calculation Using Custom Script

Solution: Need some help on a bug in a custom script for child table