A company and its director have been fined a combined £18,000 after a man was injured during excavation work in West Sussex.