Apart from the Convenio for Casinos, where tips as a rule are quite substantial, a percentage of the tips is earmarked to pay part of the wages of the employees. In all other Convenios or the Labour Law, the matter of tips is not regularised.
But the Spanish Civil Code does contain several articles that are relevant.
According to the Civil Code, art. 618 and 619, it’s a donation from the customers as a token of their appreciation for the total of services received (waiters, kitchen staff, cleaners etc.). As tips do not come out of the pocket of the employer, they cannot be considered to be part of wages, so no social security contributions have to be paid.
The Tax Law however, states that the employer should apply the same IRPF retentions as re the regular wages, and pay those to Hacienda in the name of the employees.
According to the Civil Code, art. 637, if a donation has been made to a group of people, the donation is understood to be for each and every member of the group, in equal parts. So no member of staff can be excluded.
There is jurisprudence to this effect as well, from 2017, re a restaurant where the waiting staff divided the tips between them, without including kitchen staff or cleaning personnel. Ruling based on the articles of the Civil Code mentioned above.