Hello I have a table where I show the items as the category.
SELECT
item, description, price, codfamilia
FROM
article
If a client has logged led him to another table:
SELECT
codcli, codfamilia, article, discount, price
FROM
rates
WHERE
(codcli = ‘[v_codcli]’) AND (codart = ‘{codart}’)
Then I put the conditions
If the field is NULL codfamilia field and is equal to codart article makes me a discount on the price.
if (dataset {[0] [1]} = “NULL” and {dataset [0] [2]} = “160000000013”) {
$importedto dataset = {[0] [4]} * {dataset [0] [3]} / 100; // If the field is NULL codfam does tpcdes prevention
{price} = {dataset [0] [4]} - $importedto;
So far I more or less does the problem that arises is me:
I want to do that if the article codfamilia table is equal to all items of the article table makes me a discount rates codfamilia table, respecting those who have found the article in the rates table?
customerid article codfamilia discount price
1 NULL 160 000 000 013 25.00 55,000 (this would be the first condition)
1 15.00 16000 NULL NULL (here would have to apply the 15% discount for the whole family “16000” table items excluding the article “160000000013”
Thank you very much, hope I explained.