In Israel, there was a difficult situation where a self-employed person was did some short term work. The person wanted to be paid “off the books” in Israel. The company demanded a chesbonit mas (tax invoice) from the guy who didn’t want to be “legal” and register as an osek patur/osek murashe with the tax authority and he was suggesting all sorts of “roundabout ways” to get paid bypassing the law. Does the company halachically, have the right to withhold payment from the services already rendered by him to the company until he “gets legal” to avoid trouble with the authorities?
If they didn’t make up otherwise and it wasn’t clear that they would pay off the books-they can withhold since it is a condition in the employment agreement that they don’t have to get into trouble.