--------------------------------------------------------------------------------

-- | Is at least one of the orders' items overdue?
hasOverdueItem :: Q Order -> Q Bool
hasOverdueItem o = or [ l_commitdateQ l < l_receiptdateQ l
                      | l <- lineitems
                      , l_orderkeyQ l == o_orderkeyQ o
                      ]
hasOverdueItem :: Q Order -> Q Bool
hasOverdueItem o = or [ l_commitdateQ l < l_receiptdateQ l
                      | l <- lineitems
                      , l_orderkeyQ l == o_orderkeyQ o
                      ]
hasOverdueItem o = or [ l_commitdateQ l < l_receiptdateQ l
                      | l <- lineitems
                      , l_orderkeyQ l == o_orderkeyQ o
                      ]