Advertisement
Guest User

Untitled

a guest
Jan 30th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 5.11 KB | None | 0 0
  1. private function generaNoteProd()
  2.     note = ""
  3.     dr_numdoc   = sy_rvf("prg")
  4.     dr_tipdoc   = sy_rvf("tipo")
  5.     dr_anndoc   = sy_rvf("anno")
  6.     dr_riga     = sy_rvf("riga")
  7.     sql = "SELECT dr_comm_cod, dr_comm_riga,dc_teste.lingua FROM dc_teste, dc_righe WHERE "
  8.     sql = sql & " dt_tipo_doc = dr_tipdoc "
  9.     sql = sql & " AND numero = dr_numdoc "
  10.     sql = sql & " AND dt_anno = dr_anndoc "
  11.     sql = sql & " AND dr_tipdoc = " & sy_cvs(dr_tipdoc)
  12.     sql = sql & " AND dr_numdoc = " & sy_cvn(dr_numdoc)
  13.     sql = sql & " AND dr_anndoc = " & sy_cvn(dr_anndoc)
  14.     sql = sql & " AND dr_riga   = " & sy_cvn(dr_riga)
  15.     set commc = conn.execute(sql)
  16.     if  not commc.eof then
  17.             commcod = commc("dr_comm_cod")
  18.         commrig = commc("dr_comm_riga")
  19.         lingua  = commc("dc_teste.lingua")
  20.     else
  21.         commcod = 0
  22.         commrig = 0
  23.     end if
  24. 'COLORE
  25.     colore = gesColori(valFromConf(dr_numdoc,dr_tipdoc,dr_anndoc,dr_riga,14))
  26.     if colore <> "" then
  27.         note = note & "COLORE " & colore & vbCrLf
  28.     end if
  29.  
  30. 'DESC COLORE
  31.     desc_colore = valFromConf(dr_numdoc,dr_tipdoc,dr_anndoc,dr_riga,15)
  32.     if desc_colore <> "" then
  33.         note = note & "DESC. COLORE " & desc_colore & vbCrLf
  34.     end if
  35.  
  36. 'CONICITA
  37.     conicita = valFromConf(dr_numdoc,dr_tipdoc,dr_anndoc,dr_riga,11)
  38.     if conicita <> "" then
  39.         sql = "SELECT mco_des FROM mg_conicita WHERE mco_cod=" & sy_cvs(conicita)
  40.         set rscd = conn.execute(sql)
  41.         if not rscd.eof then
  42.             note = note & "CONICITÀ " & rscd("mco_des") & vbCrLf
  43.         end if
  44.     end if
  45.     sql = "SELECT cnfc_id,cnfc_deslist,cnfc_tpcar,cfgc_tipo,cfgc_id,cnfvp_sigla,cnfvp_rilievo,cnfvp_cliche,cfgc_des,cnfvp_note,cnfvp_dcolor,descrizione,descrizione_agg,mgc_desccliche,mgc_desclogo,mgc_descicrf FROM mg_grmercar,cnf_caratteristiche,cnf_valprod,cnf_grpcaratt,mg_art,mg_cliche WHERE "
  46.     sql = sql & " cfgc_id           = cnfc_grpcaratt "
  47.     sql = sql & " AND mgrp_idcar    = cnfc_id"
  48.     sql = sql & " AND mgrp_id       = cnfvp_grmercar"
  49.     sql = sql & " AND cfgc_id       = cnfc_grpcaratt"
  50.     sql = sql & " AND cnfvp_cliche = mgc_id"
  51.     sql = sql & " AND cnfvp_sigla = codice"
  52.     sql = sql & " AND cnfvp_numdoc  = " & sy_cvn(dr_numdoc)
  53.     sql = sql & " AND cnfvp_tipdoc  = " & sy_cvs(dr_tipdoc)
  54.     sql = sql & " AND cnfvp_anndoc  = " & sy_cvn(dr_anndoc)
  55.     sql = sql & " AND cnfvp_dcriga  = " & sy_cvn(dr_riga)
  56.     sql = sql & " ORDER BY cfgc_id"
  57.     set rs = conn.execute(sql)
  58.     do until rs.eof
  59.         cliche = ""
  60.         colore_lamina = ""
  61.         desc_car = rs("cnfc_deslist")
  62.  
  63.         sql = "SELECT cfrl_des FROM cnf_tiporilievi WHERE cfrl_id = " & sy_cvs(rs("cnfvp_rilievo"))
  64.         set rsr = conn.execute(sql)
  65.         if not rsr.eof then
  66.             rilievo = rsr("cfrl_des")
  67.         end if
  68.  
  69.         if rs("cnfvp_dcolor") <> "" then
  70.             colore_lamina = rs("cnfvp_dcolor")
  71.         else
  72.             if rs("cnfvp_sigla") <> "" then
  73.                 colore_lamina = rs("descrizione") & " " & rs("descrizione_agg")
  74.             end if
  75.         end if
  76.  
  77.         if Int(rs("cnfvp_cliche")) <> 0 then
  78.             cliche = rs("mgc_desccliche") & " " & rs("mgc_desclogo") & " " & rs("mgc_descicrf")
  79.         end if
  80.  
  81.         if Int(lingua) <> 1 then
  82.             sql = "SELECT cnfcl_des FROM cnf_carattlin WHERE "
  83.             sql = sql & " cnfcl_lingua = " & sy_cvn(lingua)
  84.             sql = sql & " AND cnfcl_id = " & sy_cvn(rs("cnfc_id"))
  85.             set rsl = conn.execute(sql)
  86.             if not rsl.eof then
  87.                     desc_car = rsl("cnfcl_des")
  88.             end if
  89.         else
  90.             if rs("cnfvp_note") <> "" then
  91.                 desc_car = rs("cnfvp_note")
  92.             end if
  93.         end if
  94.  
  95.         if prec_tpcar_tipo <> rs("cfgc_id") then
  96.             desc_gruppo_car = rs("cfgc_des")
  97.             if Int(lingua) <> 1 then
  98.                 sql = "SELECT cfgcl_des FROM cnf_grpcarattlin WHERE "
  99.                 sql = sql & " cfgcl_lingua = " & sy_cvn(lingua)
  100.                 sql = sql & " AND cfgcl_id = " & sy_cvn(rs("cfgc_id"))
  101.                 set rsl = conn.execute(sql)
  102.                 if not rsl.eof then
  103.                     desc_gruppo_car = rsl("cfgcl_des")
  104.                 end if
  105.             end if
  106.             note = note & desc_gruppo_car & ":" & vbCrLf
  107.         end if
  108.  
  109.         note = note & " - " & desc_car & vbCrLf
  110.         if colore_lamina <> "" then
  111.             note = note & "     Lamina: " & colore_lamina & vbCrLf
  112.         end if
  113.         if cliche <> "" then
  114.             note = note & "     Cliche: " & cliche & vbCrLf
  115.         end if
  116.         if rs("cnfvp_rilievo") <> "." then
  117.             note = note & "     Rilievo: " & rilievo & vbCrLf
  118.         end if
  119.         prec_tpcar_tipo = rs("cfgc_id")
  120.         rs.movenext
  121.     loop
  122.     sql = "SELECT cnf_valbistra.*,cfgs_cod,cfgs_des FROM cnf_valbistra,cnf_gescolori WHERE "
  123.     sql = sql & " cnfvb_colore = cfgs_id"
  124.     sql = sql & " AND cnfvb_flgtsfc = 'F' "
  125.     sql = sql & " AND cnfvb_numdoc = " & sy_cvn(dr_numdoc)
  126.     sql = sql & " AND cnfvb_tipdoc = " & sy_cvs(dr_tipdoc)
  127.     sql = sql & " AND cnfvb_anndoc = " & sy_cvn(dr_anndoc)
  128.     sql = sql & " AND cnfvb_dcriga = " & sy_cvn(dr_riga)
  129.     sql = sql & " ORDER BY cnfvb_flgtsfc"
  130.     set rs = conn.execute(sql)
  131.     if not rs.eof then
  132.         do until rs.eof
  133.             if flg_prec <> rs("cnfvb_flgtsfc") then
  134.                 if rs("cnfvb_flgtsfc") = "F" then
  135.                     note = note & "BISTRA FIANCO:" & vbCrLf
  136.                 else
  137.                     note = note & "BISTRA TESTA:" & vbCrLf
  138.                 end if
  139.             end if
  140.             note = note & " - " & rs("cnfvb_desc_colore") & vbCrLf
  141.             note = note & "     Colore: " & rs("cfgs_cod") & " - " & rs("cfgs_des") & vbCrLf
  142.             note = note & "     Note: " & rs("cnfvb_note") & vbCrLf
  143.             flg_prec = rs("cnfvb_flgtsfc")
  144.             rs.movenext
  145.         loop
  146.     end if
  147.     print note
  148. end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement