chaos_29 Posted August 21, 2018 Share Posted August 21, 2018 Hello, I am building a module for work. For this module I nee to match all invoice items from the table tblinvoiceitems to the corresponding product from the tabl tblproducts. I have tried many different things but can't get a link between them. I need this information, because my module adds a discount to the invoice depending on the group of the product. Is there another way to get these informations? Thanks for your help. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 21, 2018 Share Posted August 21, 2018 3 hours ago, chaos_29 said: I am building a module for work. For this module I nee to match all invoice items from the table tblinvoiceitems to the corresponding product from the tabl tblproducts. I have tried many different things but can't get a link between them. I need this information, because my module adds a discount to the invoice depending on the group of the product. Is there another way to get these informations? I think you've got two missing steps in the process... in tblinvoiceitems, you've got a relid field... that matches the id field in either the tblhosting (product/services) or tbldomains (domains) tables - let's ignore domains for now as you don't seem to be interested in them. using the id value in the tblhosting table, you get get the relevant packageid value... that value matches the id of the tblproducts database table and will allow you to identify the specific product. using the id value in the tblproducts table, you can get the gid value for that product - that is the product group ID. if you had to, you could use the gid value as the id value in tblproductgroups to get the product groupname... though it seems the ID will be sufficient for your needs. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.