Newbies wzzly Posted July 16, 2012 Newbies Posted July 16, 2012 Hi all, I have a problem I can't seem to solve on my own. I have products in my database that each have 1 of 3 different taxtypes (TAX_A (high tax), TAX_B(low tax), TAX_C(no tax)) and 1 of 3 different producttypes (RENTAL, BUY, PACKAGING) Now on my invoice I want the following TAXES to be displayed. RENTAL (=products that are TAX_A and RENTAL) BUY HIGH (=products that are TAX_A and BUY but not Items::IT_Type= "Drinks 19%" or Items::IT_Type= "Drinks 6%")) BUY LOW (=products that are TAX_B and BUY but not Items::IT_Type= "Drinks 19%" or Items::IT_Type= "Drinks 6%") DRINKS HIGH (=products that are TAX_A and Items::IT_Type= "Drinks 19%") DRINKS LOW (=products that are TAX_B and Items::IT_Type= "Drinks 6%")) PACKAGING (=products that are TAX_C and PACKAGING) So I have to make a some sums but only from the prices of the products that have those 2 conditions... I hope you guys know what I mean...
No_access Posted July 16, 2012 Posted July 16, 2012 You may want to try CASE, this should do what you are looking for. case( producttype = "Rental" and taxtype = tax_a; formula1; (producttype = "Buyl" and taxtype = tax_a) and not (Items::IT_Type = "Drinks 19%" or Items::IT_Type = "Drinks 6%" ; formula2; etc.... )
Newbies wzzly Posted July 17, 2012 Author Newbies Posted July 17, 2012 Thanks for your reply. Still can't figure out how to display the tax. I got this: On the invoice I got a field: <<Bestellingnummer naar BesteldJoin::FACT_BTW_HUUR> In the database I got a field in the "orders" table called "FACT_BTW_HUUR" with: Case( Items::IT_KoopHuur = "HUUR" and Items::IT_BTWType ="A"; FACT_Bruto_BTWA) It's dutch..."HUUR" is dutch for "RENTAL" FACT_Bruto_BTWA has this function: Sum(Besteld BestNr naar Orders::IT_metBTW_A) + FACT_Bezorgkosten + FACT_BreukTotaalInclBTW Anyone able to help? thanks
Recommended Posts
This topic is 4570 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now