• Ласкаво просимо на Спільнота для обміну досвідом між користувачами програм УкрБланк, УкрСклад, УкрЗарплата.
 

Звіт Прайс-листи

Автор molotokk, Листопад 20, 2017, 22:50:40

Попередня тема - Наступна тема

0 Користувачі і 1 Гість дивляться цю тему.

molotokk

Привіт. Є звіт прайс-листи, чи можна в нього якось добавити можливість вибору груп товарів галочками?  тобто щоб з 10 груп я вибрав наприклад 4?

SELECT
  tz.kolvo, 
  t.*, 
  CASE 
    WHEN (t.cena_curr_id = par.param) THEN t.cena   
    WHEN (c.how_to_calc = 0 AND ct_in.how_to_calc = 1) THEN t.cena/c.kurs/ct_in.kurs   
    WHEN (c.how_to_calc = 1 AND ct_in.how_to_calc = 1) THEN t.cena*c.kurs/ct_in.kurs     
    WHEN (c.how_to_calc = 0 AND ct_in.how_to_calc = 0) THEN t.cena/c.kurs*ct_in.kurs   
    WHEN (c.how_to_calc = 1 AND ct_in.how_to_calc = 0) THEN t.cena*c.kurs*ct_in.kurs     
  END AS cena_national_valuta,   
  CASE   
    WHEN (t.cena_out_curr_id = par.param) THEN t.cena_r   
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 1) THEN t.cena_r/c.kurs/ct_out.kurs   
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 1) THEN t.cena_r*c.kurs/ct_out.kurs   
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 0) THEN t.cena_r/c.kurs*ct_out.kurs   
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 0) THEN t.cena_r*c.kurs*ct_out.kurs   
  END AS cena_r_national_valuta,   
  CASE   
    WHEN (t.cena_out_curr_id = par.param) THEN t.cena_o   
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 1) THEN t.cena_o/c.kurs/ct_out.kurs   
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 1) THEN t.cena_o*c.kurs/ct_out.kurs     
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 0) THEN t.cena_o/c.kurs*ct_out.kurs   
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 0) THEN t.cena_o*c.kurs*ct_out.kurs     
  END AS cena_o_national_valuta,   
  CASE   
    WHEN (t.cena_out_curr_id = par.param) THEN t.cena_1   
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 1) THEN t.cena_1/c.kurs/ct_out.kurs   
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 1) THEN t.cena_1*c.kurs/ct_out.kurs     
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 0) THEN t.cena_1/c.kurs*ct_out.kurs   
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 0) THEN t.cena_1*c.kurs*ct_out.kurs     
  END AS cena_1_national_valuta,   
  CASE   
    WHEN (t.cena_out_curr_id = par.param) THEN t.cena_2   
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 1) THEN t.cena_2/c.kurs/ct_out.kurs   
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 1) THEN t.cena_2*c.kurs/ct_out.kurs   
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 0) THEN t.cena_2/c.kurs*ct_out.kurs   
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 0) THEN t.cena_2*c.kurs*ct_out.kurs   
  END AS cena_2_national_valuta, 
  CASE   
    WHEN (t.cena_out_curr_id = par.param) THEN t.cena_3 
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 1) THEN t.cena_3/c.kurs/ct_out.kurs 
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 1) THEN t.cena_3*c.kurs/ct_out.kurs 
    WHEN (c.how_to_calc = 0 AND ct_out.how_to_calc = 0) THEN t.cena_3/c.kurs*ct_out.kurs 
    WHEN (c.how_to_calc = 1 AND ct_out.how_to_calc = 0) THEN t.cena_3*c.kurs*ct_out.kurs 
  END AS cena_3_national_valuta, 
  CASE     
    WHEN (t.cena_curr_id = 0) THEN t.cena   
    WHEN (ct_in.how_to_calc = 1) THEN t.cena/ct_in.kurs   
    WHEN (ct_in.how_to_calc = 0) THEN t.cena*ct_in.kurs   
  END AS cena_main_valuta,   
  CASE     
    WHEN (t.cena_curr_id = 0) THEN t.cena_r   
    WHEN (ct_out.how_to_calc = 1) THEN t.cena_r/ct_out.kurs   
    WHEN (ct_out.how_to_calc = 0) THEN t.cena_r*ct_out.kurs   
  END AS cena_r_main_valuta,   
  CASE     
    WHEN (t.cena_curr_id = 0) THEN t.cena_o   
    WHEN (ct_out.how_to_calc = 1) THEN t.cena_o/ct_out.kurs   
    WHEN (ct_out.how_to_calc = 0) THEN t.cena_o*ct_out.kurs   
  END AS cena_o_main_valuta,   
  CASE     
    WHEN (t.cena_curr_id = 0) THEN t.cena_1   
    WHEN (ct_out.how_to_calc = 1) THEN t.cena_1/ct_out.kurs   
    WHEN (ct_out.how_to_calc = 0) THEN t.cena_1*ct_out.kurs   
  END AS cena_1_main_valuta,   
  CASE     
    WHEN (t.cena_curr_id = 0) THEN t.cena_2   
    WHEN (ct_out.how_to_calc = 1) THEN t.cena_2/ct_out.kurs   
    WHEN (ct_out.how_to_calc = 0) THEN t.cena_2*ct_out.kurs   
  END AS cena_2_main_valuta,   
  CASE     
    WHEN (t.cena_curr_id = 0) THEN t.cena_3 
    WHEN (ct_out.how_to_calc = 1) THEN t.cena_3/ct_out.kurs 
    WHEN (ct_out.how_to_calc = 0) THEN t.cena_3*ct_out.kurs 
  END AS cena_3_main_valuta, 
  gr.group_name,
  ti.tov_image,
  ti.tov_image_type,
  gi.tov_image AS group_image,
  gi.tov_image_type AS group_image_type
FROM     
  tovar_name t   
    LEFT JOIN currency ct_in ON t.cena_curr_id = ct_in.num   
    LEFT JOIN currency ct_out ON t.cena_out_curr_id = ct_out.num
    LEFT JOIN tovar_images ti ON (ti.doc_type = 102 AND ti.num = (SELECT FIRST 1 ti2.num FROM tovar_images ti2 WHERE ti2.tovar_id = t.num ORDER BY ti2.isort ))
    LEFT JOIN tovar_images gi ON (gi.doc_type = 1020 AND gi.num = (SELECT FIRST 1 gi2.num FROM tovar_images gi2 WHERE gi2.tovar_id = t.tip ORDER BY gi2.isort )),
  print_view_sklad(#товар_группа_№#,#склад_№#) gr,   
  tovar_zal tz,     
  currency c,     
  params par     
WHERE     
  par.name = 'NationalValutaId' AND
  c.num = par.param AND     
  t.tip = gr.num AND     
  t.visible = 1 AND     
  t.is_price_invisible = 0 AND   
  t.num=tz.tovar_id AND     
  tz.sklad_id=#склад_№#   
ORDER BY     
  gr.group_name,   
  t.#товар_сорт#
підбір та продаж обладнання для торгівлі, допомога в налаштуваннях програми ⇒ "komfort-m.com" ⇒ "t.me/komfortmservice" ⇒ ✆ 097-873-59-01