Article 340 [source]

Spanish Criminal Code
English translation

If the person responsible for any of the acts classified in this Title has voluntarily proceeded to repair the damage caused, the Judges and Courts will impose a penalty one degree lower than those respectively provided.