when invoice same item how to combine in one line

my sample invoice

custname.......

product id detail qty price

603001 harddisk 500GB. 1 1500
604001 monitor 17" 1 2900
608001 RAM 2GB. 2 400
603001 harddisk 500GB. 2 1500

i want to know how to write code that order, in line 1 and line 4 the products those have the same product id i want
combine and sum qty in one line like this sample below

603001 harddisk 500GB. 3 1500
604001 monitor 17" 1 2900
608001 RAM 2GB. 2 400

i'm sorry in language english not good
please teach me
thank you
warat in thailand

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 10:07AM
    use a query with anorder by clause to supply yor data

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.