Breakdown of the base and the withholding on Spanish form 123
Withholding basearticle 93.1 RIRPF
€10,000.00
Withholding applied
€1,900.00
Net to the payee
€8,100.00
There is withholding to pay over: you file the form with an amount.
The base: the article 93 rule, acquisition value and accessory costs
The general rule takes the gross consideration. On a redemption, a repayment or the transfer of a debt security, article 93.2 takes instead the positive difference between what you receive and what you paid, and that difference is not reduced by the costs of the transaction.
The bank's or the broker's fee comes out of your own pocket after the withholding: article 93.2 says that «accessory costs of the transaction shall not reduce» the base.
The next question is about the WHOLE period and not about the payment you are calculating: article 108.1 decides whether you file the form, file it nil, or file nothing at all.