How to get more advanced calculs in AOS... total cost ? profit ?

Hi,

We would like to know if there is a possibility to write the calcul functions we need in AOS, and to get simple result as profit=total sales price - total costs price
This is as so important that to know the sales total for a manager, of course… :lol:

  • In the line items you can get $aos_products_quotes_product_list_price X $aos_products_quotes_product_qty = $aos_products_quotes_product_total_price
    This is done for sales… but no equivalences for cost???

I just found : $aos_products_quotes_product_costprice … but no fields to X and get a "$aos_products_quotes_productCOSTqty … and no fields to = a $aos_products_quotes_product_totalCOST_price.

So what is the reason to create a cost value if there is no way (clearly identified) to use it for calculs…

Also, what and how to write to get total costs and after to use it to get a profit value?

Can someone help us on this with a complete answer? We are not developpers…

Thanks :blink:

I don’t have time to write the code for you but if you look at the file modules/AOS_Products_Quotes/line_items.js you will find three functions calculateLine, calculateAllLines() and calculateTotal(). These handle the calculations so you want to alter the JavaScript in this file to achieve the customisations that your after.

Thanks for your fast answer.

Do you think I can do my tests directly under in modules/AOS_Products_Quotes/line_items.js or do I have to create a file under /custom/module/modules/AOS_Products_Quotes/line_items.js

I’ve read that people who modified the original file destroyed the calcul functions…

You should do it in the custom folder but just make sure you keep a back up of the originals