# Take the price and units and calculate automatically the total price

**URL:** <https://forum.kirupa.com/t/take-the-price-and-units-and-calculate-automatically-the-total-price/285269>\
**Category:** Uncategorized\
**Created:** [March 29, 2009, 7:54pm UTC](https://forum.kirupa.com/t/take-the-price-and-units-and-calculate-automatically-the-total-price/285269 "2009-03-29T19:54:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimiorla](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@dimiorla](https://forum.kirupa.com/u/dimiorla)\
**Post date:** [March 29, 2009, 7:54pm UTC](https://forum.kirupa.com/t/take-the-price-and-units-and-calculate-automatically-the-total-price/285269/1 "2009-03-29T19:54:17Z")

</div>

[SIZE=3][FONT=Times New Roman]Hey everyone,[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman]I would like to know if it is possible in flex to do the following actions.[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman]I have made an HTTPService to a MySQL database, table: orders\_open and it has columns[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]Id | product | price | units | total\_price | customer | waiter | printed | paid\_cash | paid\_card | date[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]The datagrid is filtered by the customer column. Default value of | printed | paid\_cash | paid\_card is 0[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]1)How can I make flex take the price and units and calculate automatically the total\_price? In the datagrid and update the database lines when I save.[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]2) Sum up all filtered total\_price ‘s and give the bill\_total in a text field[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]3) When paid, print the ticket | product | price | units | total\_price | and the bill\_total [/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman]in a printer [/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]Can you help me on my way with a link or a code example?[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]My code has been created by Flex (create application from database)[/FONT][/SIZE]
