daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. prj_no_i = upper(this.parent.pj_no.displayvalue)
  2. ddr_no_s = upper(this.parent.ser_no.displayvalue)
  3. issue_d = strtran(this.parent.issue_da.value,"/","")
  4. pj_desc = prj_no_lst.prj_desc
  5. store '' to dept_sel_ar,old_dwg_no,old_rev_no,sel_dept_ar
  6. sel_idx = 0
  7. select grid3_f
  8. zap
  9. sql1 = "select distinct dept_cd,hand_sw,tel_nos from fas.dbo.drawing_issue where prj_no = '" + prj_no_i
  10. *sql2 = "' and iss_date_eg = '" + issue_d + "' order by dept_cd"
  11. sql2 = "' and ddr_no = '" + ddr_no_s + "' order by dept_cd"
  12. sql = sql1 + sql2
  13. res = sqlexec(han2,sql,'curs1')
  14. if res > 0 and !empty(curs1.dept_cd)
  15.     do while !eof()
  16.         scatter memvar
  17.         dept_idx = val(right(m.dept_cd,3))
  18.         select cpy_set_f
  19.         locate for dept_cd = m.dept_cd
  20.         if found()
  21.             dept_sel_ar(dept_idx,1) = alltrim(cpy_set_f.dept_na)
  22.             dept_sel_ar(dept_idx,2) = 0
  23.             sel_idx = sel_idx + 1
  24.             sel_dept_ar(sel_idx) = alltrim(cpy_set_f.dept_na)
  25.             replace sel_sw  with .t.
  26.             replace hand_sw with m.hand_sw
  27.             replace tel_txt with alltrim(m.tel_nos)
  28.         endif
  29.         select curs1
  30.         skip
  31.     enddo
  32.     seq_no = 0
  33.     for i = 1 to 100
  34.         if len(alltrim(dept_sel_ar(i,1))) > 0
  35.             seq_no = seq_no + 1
  36.             dept_sel_ar(i,2) = alltrim(str(seq_no,2))
  37.         endif
  38.     next
  39. endif
  40. sql1 = "select *,"
  41. sql2 = "isnull((select distinct dwg_desc from fas.dbo.drawing_master where prj_no = a.prj_no and equip_no = a.equip_no and ctci_no = a.ctci_no),'') dwg_desc"
  42. sql3 = " from fas.dbo.drawing_issue a where prj_no = '" + prj_no_i
  43. sql4 = "' and ddr_no = '" + ddr_no_s + "' order by equip_no,ctci_no,iss_rev,dept_cd"
  44. sql = sql1 + sql2 + sql3 + sql4
  45. res = sqlexec(han2,sql,'curs1')
  46. if res > 0 and !empty(curs1.prj_no)
  47.     old_dwg_no = curs1.ctci_no
  48.     old_rev_no = curs1.iss_rev
  49.     old_dwg_des = alltrim(curs1.dwg_desc)
  50.     store '' to qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28
  51.     do while !eof()
  52.         scatter memvar
  53.         if old_dwg_no <> m.ctci_no
  54.             if len(qty1) > 0 or len(qty2) > 0 or len(qty3) > 0 or len(qty4) > 0 or len(qty5) > 0 or len(qty6) > 0 or len(qty7) > 0 or len(qty8) > 0 or len(qty9) > 0 or len(qty10) > 0 or len(qty11) > 0 or len(qty12) > 0 or len(qty13) > 0 or len(qty14) > 0 or len(qty15) > 0 or len(qty16) > 0 or len(qty17) > 0 or len(qty18) > 0 or len(qty19) > 0 or len(qty20) > 0 or len(qty21) > 0 or len(qty22) > 0 or len(qty23) > 0 or len(qty24) > 0 or len(qty25) > 0 or len(qty26) > 0 or len(qty27) > 0 or len(qty28) > 0
  55.                 insert into grid3_f values(old_dwg_no,old_rev_no,qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28,old_dwg_des)
  56.             endif
  57.             old_rev_no = m.iss_rev
  58.             old_dwg_no = m.ctci_no
  59.             old_dwg_des = alltrim(m.dwg_desc)
  60.             store '' to qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28
  61.         endif
  62.         if old_rev_no <> m.iss_rev
  63.             if len(qty1) > 0 or len(qty2) > 0 or len(qty3) > 0 or len(qty4) > 0 or len(qty5) > 0 or len(qty6) > 0 or len(qty7) > 0 or len(qty8) > 0 or len(qty9) > 0 or len(qty10) > 0 or len(qty11) > 0 or len(qty12) > 0 or len(qty13) > 0 or len(qty14) > 0 or len(qty15) > 0 or len(qty16) > 0 or len(qty17) > 0 or len(qty18) > 0 or len(qty19) > 0 or len(qty20) > 0 or len(qty21) > 0 or len(qty22) > 0 or len(qty23) > 0 or len(qty24) > 0 or len(qty25) > 0 or len(qty26) > 0 or len(qty27) > 0 or len(qty28) > 0
  64.                 insert into grid3_f values(.f.,old_dwg_no,old_rev_no,qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28,old_dwg_des)
  65.             endif
  66.             old_rev_no = m.iss_rev
  67.             old_dwg_no = m.ctci_no
  68.             old_dwg_des = alltrim(m.dwg_desc)
  69.             store '' to qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28
  70.         endif
  71.         dept_idx = val(right(m.dept_cd,3))
  72.         qty_s = 'qty' + dept_sel_ar(dept_idx,2)
  73.         &qty_s = alltrim(str(m.dept_qty,2)) + 'P'
  74.         select curs1
  75.         skip
  76.     enddo
  77.     if len(alltrim(old_dwg_no)) > 0
  78.         if len(qty1) > 0 or len(qty2) > 0 or len(qty3) > 0 or len(qty4) > 0 or len(qty5) > 0 or len(qty6) > 0 or len(qty7) > 0 or len(qty8) > 0 or len(qty9) > 0 or len(qty10) > 0 or len(qty11) > 0 or len(qty12) > 0 or len(qty13) > 0 or len(qty14) > 0 or len(qty15) > 0 or len(qty16) > 0 or len(qty17) > 0 or len(qty18) > 0 or len(qty19) > 0 or len(qty20) > 0 or len(qty21) > 0 or len(qty22) > 0 or len(qty23) > 0 or len(qty24) > 0 or len(qty25) > 0 or len(qty26) > 0 or len(qty27) > 0 or len(qty28) > 0
  79.             insert into grid3_f values(old_dwg_no,old_rev_no,qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28,old_dwg_des)
  80.         endif
  81.     endif
  82. else
  83.     old_dwg_no = ''
  84. endif
  85. txt_cnt = 0
  86. idx1 = 2
  87. for i = 1 to 100
  88.     if len(alltrim(dept_sel_ar(i,1))) > 0
  89.         txt_cnt = txt_cnt + 1
  90.         idx1 = idx1 + 1
  91.         if idx1 > 30
  92.             idx1 = 30
  93.         endif
  94.         col_s = 'thisform.grid3.column' + alltrim(str(idx1,2)) + '.header1.caption'
  95.         &col_s = dept_sel_ar(i,1)
  96.         col_s = 'thisform.grid3.column' + alltrim(str(idx1,2)) + '.width'
  97.         &col_s = 60
  98.     endif
  99. next
  100.  
  101. select grid3_f
  102. if reccount() > 0
  103.     width_tot = 1000
  104.     thisform.grid3.width = width_tot
  105.     thisform.cmdPrint.enabled = .t.
  106.     this.parent.grid3.enabled = .t.
  107. else
  108.     thisform.cmdPrint.enabled = .f.
  109.     this.parent.grid3.enabled = .f.
  110.     this.parent.pj_no.enabled = .t.
  111. endif
  112. go top
  113. this.parent.cmdExit.enabled = .t.
  114. thisform.refresh
  115. keyboard "{Tab
  116. *sql2 = "' and iss_date_eg = '" + issue_d + "' order by dept_cd"
  117. sql2 = "' and ddr_no = '" + ddr_no_s + "' order by dept_cd"
  118. sql = sql1 + sql2
  119. res = sqlexec(han2,sql,'curs1')
  120. if res > 0 and !empty(curs1.dept_cd)
  121.     do while !eof()
  122.         scatter memvar
  123.         dept_idx = val(right(m.dept_cd,3))
  124.         select cpy_set_f
  125.         locate for dept_cd = m.dept_cd
  126.         if found()
  127.             dept_sel_ar(dept_idx,1) = alltrim(cpy_set_f.dept_na)
  128.             dept_sel_ar(dept_idx,2) = 0
  129.             sel_idx = sel_idx + 1
  130.             sel_dept_ar(sel_idx) = alltrim(cpy_set_f.dept_na)
  131.             replace sel_sw  with .t.
  132.             replace hand_sw with m.hand_sw
  133.             replace tel_txt with alltrim(m.tel_nos)
  134.         endif
  135.         select curs1
  136.         skip
  137.     enddo
  138.     seq_no = 0
  139.     for i = 1 to 100
  140.         if len(alltrim(dept_sel_ar(i,1))) > 0
  141.             seq_no = seq_no + 1
  142.             dept_sel_ar(i,2) = alltrim(str(seq_no,2))
  143.         endif
  144.     next
  145. endif
  146. sql1 = "select *,"
  147. sql2 = "isnull((select distinct dwg_desc from fas.dbo.drawing_master where prj_no = a.prj_no and equip_no = a.equip_no and ctci_no = a.ctci_no),'') dwg_desc"
  148. sql3 = " from fas.dbo.drawing_issue a where prj_no = '" + prj_no_i
  149. sql4 = "' and ddr_no = '" + ddr_no_s + "' order by equip_no,ctci_no,iss_rev,dept_cd"
  150. sql = sql1 + sql2 + sql3 + sql4
  151. res = sqlexec(han2,sql,'curs1')
  152. if res > 0 and !empty(curs1.prj_no)
  153.     old_dwg_no = curs1.ctci_no
  154.     old_rev_no = curs1.iss_rev
  155.     old_dwg_des = alltrim(curs1.dwg_desc)
  156.     store '' to qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28
  157.     do while !eof()
  158.         scatter memvar
  159.         if old_dwg_no <> m.ctci_no
  160.             if len(qty1) > 0 or len(qty2) > 0 or len(qty3) > 0 or len(qty4) > 0 or len(qty5) > 0 or len(qty6) > 0 or len(qty7) > 0 or len(qty8) > 0 or len(qty9) > 0 or len(qty10) > 0 or len(qty11) > 0 or len(qty12) > 0 or len(qty13) > 0 or len(qty14) > 0 or len(qty15) > 0 or len(qty16) > 0 or len(qty17) > 0 or len(qty18) > 0 or len(qty19) > 0 or len(qty20) > 0 or len(qty21) > 0 or len(qty22) > 0 or len(qty23) > 0 or len(qty24) > 0 or len(qty25) > 0 or len(qty26) > 0 or len(qty27) > 0 or len(qty28) > 0
  161.                 insert into grid3_f values(old_dwg_no,old_rev_no,qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28,old_dwg_des)
  162.             endif
  163.             old_rev_no = m.iss_rev
  164.             old_dwg_no = m.ctci_no
  165.             old_dwg_des = alltrim(m.dwg_desc)
  166.             store '' to qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28
  167.         endif
  168.         if old_rev_no <> m.iss_rev
  169.             if len(qty1) > 0 or len(qty2) > 0 or len(qty3) > 0 or len(qty4) > 0 or len(qty5) > 0 or len(qty6) > 0 or len(qty7) > 0 or len(qty8) > 0 or len(qty9) > 0 or len(qty10) > 0 or len(qty11) > 0 or len(qty12) > 0 or len(qty13) > 0 or len(qty14) > 0 or len(qty15) > 0 or len(qty16) > 0 or len(qty17) > 0 or len(qty18) > 0 or len(qty19) > 0 or len(qty20) > 0 or len(qty21) > 0 or len(qty22) > 0 or len(qty23) > 0 or len(qty24) > 0 or len(qty25) > 0 or len(qty26) > 0 or len(qty27) > 0 or len(qty28) > 0
  170.                 insert into grid3_f values(.f.,old_dwg_no,old_rev_no,qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28,old_dwg_des)
  171.             endif
  172.             old_rev_no = m.iss_rev
  173.             old_dwg_no = m.ctci_no
  174.             old_dwg_des = alltrim(m.dwg_desc)
  175.             store '' to qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28
  176.         endif
  177.         dept_idx = val(right(m.dept_cd,3))
  178.         qty_s = 'qty' + dept_sel_ar(dept_idx,2)
  179.         &qty_s = alltrim(str(m.dept_qty,2)) + 'P'
  180.         select curs1
  181.         skip
  182.     enddo
  183.     if len(alltrim(old_dwg_no)) > 0
  184.         if len(qty1) > 0 or len(qty2) > 0 or len(qty3) > 0 or len(qty4) > 0 or len(qty5) > 0 or len(qty6) > 0 or len(qty7) > 0 or len(qty8) > 0 or len(qty9) > 0 or len(qty10) > 0 or len(qty11) > 0 or len(qty12) > 0 or len(qty13) > 0 or len(qty14) > 0 or len(qty15) > 0 or len(qty16) > 0 or len(qty17) > 0 or len(qty18) > 0 or len(qty19) > 0 or len(qty20) > 0 or len(qty21) > 0 or len(qty22) > 0 or len(qty23) > 0 or len(qty24) > 0 or len(qty25) > 0 or len(qty26) > 0 or len(qty27) > 0 or len(qty28) > 0
  185.             insert into grid3_f values(old_dwg_no,old_rev_no,qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9,qty10,qty11,qty12,qty13,qty14,qty15,qty16,qty17,qty18,qty19,qty20,qty21,qty22,qty23,qty24,qty25,qty26,qty27,qty28,old_dwg_des)
  186.         endif
  187.     endif
  188. else
  189.     old_dwg_no = ''
  190. endif
  191. txt_cnt = 0
  192. idx1 = 2
  193. for i = 1 to 100
  194.     if len(alltrim(dept_sel_ar(i,1))) > 0
  195.         txt_cnt = txt_cnt + 1
  196.         idx1 = idx1 + 1
  197.         if idx1 > 30
  198.             idx1 = 30
  199.         endif
  200.         col_s = 'thisform.grid3.column' + alltrim(str(idx1,2)) + '.header1.caption'
  201.         &col_s = dept_sel_ar(i,1)
  202.         col_s = 'thisform.grid3.column' + alltrim(str(idx1,2)) + '.width'
  203.         &col_s = 60
  204.     endif
  205. next
  206.  
  207. select grid3_f
  208. if reccount() > 0
  209.     width_tot = 1000
  210.     thisform.grid3.width = width_tot
  211.     thisform.cmdPrint.enabled = .t.
  212.     this.parent.grid3.enabled = .t.
  213. else
  214.     thisform.cmdPrint.enabled = .f.
  215.     this.parent.grid3.enabled = .f.
  216.     this.parent.pj_no.enabled = .t.
  217. endif
  218. go top
  219. this.parent.cmdExit.enabled = .t.
  220. thisform.refresh
  221. keyboard "{Tab}"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top