Subject | help with a procedure |
---|---|
Author | Fabio Gomes |
Post date | 2006-02-06T18:26:15Z |
Hi all, i m new to firebird, so i don't know exactly how i can make a
procedure or something like it to solve my problem.
I ll try to be as clear as my english allow me to, but sorry, my english is
kinda bad.
I have a vending control, and the vendors have a fixed commission value is
used to calculate the commission value, my table structure is like this:
vending:
vendor_id
total
vendors:
vendor_id
vendor_comission
vendor_name
items:
product_id
vending_id
products:
product_id
product_comission_value
product_comission_percent
Actually my report calculate the commission value based on the vending
total, but i need to make it calculate like this:
if i have a product_comission_value, it will forget the vendor_comission and
add this value to the total commission..
So basically it have to select the vendings from that vendor, and for each
product test if the product have a commission value, if it has so it
calculates it, if it doesn't the vendors commission is used.
is it clear?
How do you guys think its the best way to do it? with a procedure? with
normal selects and coding by hand? i m kinda lost with this stuff.
Thanks in advance,
Fábio.
[Non-text portions of this message have been removed]
procedure or something like it to solve my problem.
I ll try to be as clear as my english allow me to, but sorry, my english is
kinda bad.
I have a vending control, and the vendors have a fixed commission value is
used to calculate the commission value, my table structure is like this:
vending:
vendor_id
total
vendors:
vendor_id
vendor_comission
vendor_name
items:
product_id
vending_id
products:
product_id
product_comission_value
product_comission_percent
Actually my report calculate the commission value based on the vending
total, but i need to make it calculate like this:
if i have a product_comission_value, it will forget the vendor_comission and
add this value to the total commission..
So basically it have to select the vendings from that vendor, and for each
product test if the product have a commission value, if it has so it
calculates it, if it doesn't the vendors commission is used.
is it clear?
How do you guys think its the best way to do it? with a procedure? with
normal selects and coding by hand? i m kinda lost with this stuff.
Thanks in advance,
Fábio.
[Non-text portions of this message have been removed]