Дело в шляпе (concern is in the hat or how we say in English the trick is done). This is what you can say or hear when you or another speaker is sure about the issue of a business or when something has been completed safely.
One of the theories about the origin of this idiom связывает его с взяточничеством (is associated with bribery). Indeed, if какое-либо дело попадало в суд (a case came to the court), then каждый старался подкупить судью (each side would try to bribe the judge) to make sure to win the case. But no one dared to give or take a bribe openly, so they had to come up with different ways to do it quickly and discreetly.
Explore our study programs to learn Russian in Russia in the shortest period of time. Flexible group classes and individual lessons with flexible schedule and duration.
And one of the methods was the hat: судья клал свою шляпу (the judge would place his hat) in a way it was clearly visible to the applicant, если проситель сумел незаметно для других положить в неё деньги (and if the petitioner was able to discretely put money in it), he could count on a decision in his favour.