Display sum of values in salary slip using jinja

Hello,

I was customizing salary slip print format, and I need to save sum of salary components values in a variable and print it on the salary slip. I was managed to get values using jinja but dont know how to store sum of those values in a variable.

Below is the jinja code:

jinja

And this is what I got on salary slip:

slip

I want to display sum of those components.

Thanks

Hi @erpnxt_user,

Please apply it,

{{ doc.earnings | sum(attribute='default_amount') }}

Reload and check it.

Thank You!

1 Like

Thanks