Page 1 of 1

How can I sum the artivle values on invoice?

Posted: 2016-01-09 22:38
by Nicolas
Dear members,
I am working with an invoice model which has several items on a look-up table, but when I get them together into a single document I don't know how to show a TOTAL Invoice taking the partial values of each item....
I have twisted the original invoice template to show the fields in a different way, but no idea how to see a total invoice....
Any hint or trick on how to do it!! via hooks¿???
Thank you
Nicolas

Re: How can I sum the artivle values on invoice?

Posted: 2016-02-09 20:55
by Ola Yakout
to calculate total invoice

here are the general steps, but it needs some PHP and JavaScript knowledge

1- you should add field to table and call it total.
2- create js file call "tablename-dv.js" inside the hooks folder (where tablename is the name of your table) and use ajax request to call php script which calculates total of invoice call this script as ajax-yourtablename-total.php to be more readable.
3- use the previous file to select element and calculate the total then set return value of total as value of total invoice using js.
4- use AppGini to make total filed as readonly field.

Re: How can I sum the artivle values on invoice?

Posted: 2017-03-29 11:46
by Nicolas
Thanks for the reply and late thanks from my side... I'll got it done and working!!!
Best regards