Freight invoice audit and payment

Detention vs. demurrage: which charge applies?