How can I sum the artivle values on invoice?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
Nicolas
Veteran Member
Posts: 43
Joined: 2015-12-08 08:08
Location: Barcelona
Contact:

How can I sum the artivle values on invoice?

Post by Nicolas » 2016-01-09 22:38

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
Attachments
invoice-template.GIF
invoice-template.GIF (40.71 KiB) Viewed 6593 times

Ola Yakout
AppGini Intern
Posts: 19
Joined: 2016-02-07 13:24

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

Post by Ola Yakout » 2016-02-09 20:55

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.

Nicolas
Veteran Member
Posts: 43
Joined: 2015-12-08 08:08
Location: Barcelona
Contact:

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

Post by Nicolas » 2017-03-29 11:46

Thanks for the reply and late thanks from my side... I'll got it done and working!!!
Best regards

Post Reply