Your daily pay is your gross annual pay, including the two pagas extra and any fixed supplements, divided by 365. Multiply it by the days the law gives you for each year of service: 33 for an unfair dismissal, 20 for an objective or collective dismissal, 12 when a temporary contract ends. Service under a full year is prorated by month, and a part month counts as a whole one.
If you started before 12 February 2012, the years up to then count at the old 45-day rate. The total is capped at 720 days, unless the pre-2012 part alone is already higher; then that figure is the cap, up to 42 months' pay. For an objective dismissal the cap is 12 months' pay, and your employer must also give 15 days' notice or pay for them.
Tax is where estimates often go wrong. The legal amount is exempt from IRPF up to €180,000, but only if an unfair dismissal is recognised at the SMAC conciliation or by a court. For an objective dismissal on economic or organisational grounds, the exemption stretches to the 33-day amount, so a negotiated top-up is usually tax-free. The 12 days at the end of a temporary contract are taxed in full.