f_init_cttbinfo.srf 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. $PBExportHeader$f_init_cttbinfo.srf
  2. global type f_init_cttbinfo from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_init_cttbinfo (datetime arg_ctdt, long arg_bg_int, long arg_ed_int, ref s_yfct s_ctmx[])
  6. end prototypes
  7. global function integer f_init_cttbinfo (datetime arg_ctdt, long arg_bg_int, long arg_ed_int, ref s_yfct s_ctmx[]);//s_ctmx[].etbname :表英文名
  8. //s_ctmx[].ctbname :表中文名
  9. //s_ctmx[].wherestr :截数串
  10. //s_ctmx[].checkstr :检查串
  11. //s_ctmx[].delstr :删除串
  12. //s_ctmx[].fromstr :
  13. //s_ctmx[].linkstr :关联串
  14. //s_ctmx[].delid:删除id
  15. //***删除工资月
  16. Long ls_del_wagemth,ls_pdint
  17. Date ls_del_date
  18. DateTime ls_del_wagemth_date
  19. ls_pdint = long(String(arg_ctdt,'yyyymmdd'))
  20. //**工资删除前月*****************************
  21. ls_del_date = Date(String(arg_ctdt,'yyyy-mm-dd'))
  22. IF Month(ls_del_date) = 1 THEN
  23. ls_del_wagemth = (Year(ls_del_date) - 1) * 100 + 12
  24. ELSE
  25. ls_del_wagemth = Year(ls_del_date) * 100 + Month(ls_del_date) - 1
  26. END IF
  27. ls_del_wagemth_date = DateTime(Date(Left(String(ls_del_wagemth),4)+'-'+Right(String(ls_del_wagemth),2)+'-01'),Time(0))
  28. //*********************************************
  29. s_ctmx[1].etbname = 'u_buytaskmx'
  30. s_ctmx[1].ctbname = '采购订单明细表'
  31. s_ctmx[1].wherestr= " where (u_buytask.status = 3 or u_buytask.status = 5 or u_buytask.status = 6) and u_buytask.ctmint = 0 and u_buytask.requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  32. s_ctmx[1].checkstr= " where (u_buytask.status <> 3 and u_buytask.status <> 5 and u_buytask.status <> 6) and u_buytask.ctmint = 0 and u_buytask.requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  33. s_ctmx[1].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  34. s_ctmx[1].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  35. s_ctmx[1].delid = "taskid"
  36. s_ctmx[1].fromstr = " from u_buytaskmx,u_buytask"
  37. s_ctmx[1].linkstr = " and u_buytask.scid = u_buytaskmx.scid and u_buytask.taskid = u_buytaskmx.taskid"
  38. s_ctmx[2].etbname = 'u_buytask'
  39. s_ctmx[2].ctbname = '采购订单表'
  40. s_ctmx[2].wherestr= " where (status = 3 or status = 5 or status = 6) and ctmint = 0 and requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  41. s_ctmx[2].checkstr= " where (status<>3 and status <> 5 and status <> 6) and ctmint = 0 and requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  42. s_ctmx[2].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  43. s_ctmx[2].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  44. s_ctmx[2].delid = "taskid"
  45. s_ctmx[2].fromstr = " from u_buytask"
  46. s_ctmx[2].linkstr = ""
  47. s_ctmx[3].etbname = 'u_saleRqMtrl_scll'
  48. s_ctmx[3].ctbname = '销售订单明细物料需求表'
  49. s_ctmx[3].wherestr= " where (u_saletask.status = 3 or u_saletask.status = 5) and u_saletask.ctmint = 0 and u_saletask.taskdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  50. s_ctmx[3].checkstr= " where (u_saletask.status <> 3 and u_saletask.status <> 5) and u_saletask.ctmint = 0 and u_saletask.taskdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  51. s_ctmx[3].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  52. s_ctmx[3].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  53. s_ctmx[3].delid = "taskid"
  54. s_ctmx[3].fromstr = " from u_saleRqMtrl_scll,u_saletask"
  55. s_ctmx[3].linkstr = " and u_saletask.scid = u_saleRqMtrl_scll.scid and u_saletask.taskid = u_saleRqMtrl_scll.taskid"
  56. s_ctmx[4].etbname = 'u_saletaskmx'
  57. s_ctmx[4].ctbname = '销售订单明细表'
  58. s_ctmx[4].wherestr= " where (u_saletask.status = 3 or u_saletask.status = 5) and u_saletask.ctmint = 0 and u_saletask.taskdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  59. s_ctmx[4].checkstr= " where (u_saletask.status <> 3 and u_saletask.status <> 5) and u_saletask.ctmint = 0 and u_saletask.taskdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  60. s_ctmx[4].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  61. s_ctmx[4].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  62. s_ctmx[4].delid = "taskid"
  63. s_ctmx[4].fromstr = " from u_saletaskmx,u_saletask"
  64. s_ctmx[4].linkstr = " and u_saletask.scid = u_saletaskmx.scid and u_saletask.taskid = u_saletaskmx.taskid"
  65. s_ctmx[5].etbname = 'u_saletask'
  66. s_ctmx[5].ctbname = '销售订单表'
  67. s_ctmx[5].wherestr = " where (status = 3 or status = 5) and ctmint = 0 and taskdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  68. s_ctmx[5].checkstr = " where (status<>3 and status <> 5) and ctmint = 0 and taskdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  69. s_ctmx[5].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  70. s_ctmx[5].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  71. s_ctmx[5].delid = "taskid"
  72. s_ctmx[5].fromstr = " from u_saletask"
  73. s_ctmx[5].linkstr = ""
  74. s_ctmx[7].etbname = 'u_inwaremx'
  75. s_ctmx[7].ctbname = '进仓单明细表{非采购,加工}'
  76. s_ctmx[7].wherestr = " where billtype <> 1 and billtype <> 4 and u_inware.ctmint = 0 and u_inware.balcflag = 1 and u_inware.flag=1 and u_inware.indate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  77. s_ctmx[7].checkstr = " where billtype <> 1 and billtype <> 4 and (u_inware.balcflag = 0 or u_inware.flag = 0) and u_inware.ctmint = 0 and u_inware.indate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  78. s_ctmx[7].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  79. s_ctmx[7].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  80. s_ctmx[7].delid = "inwareid"
  81. s_ctmx[7].fromstr = " from u_inwaremx,u_inware"
  82. s_ctmx[7].linkstr = " and u_inwaremx.scid = u_inware.scid and u_inwaremx.inwareid = u_inware.inwareid"
  83. s_ctmx[8].etbname = 'u_inware'
  84. s_ctmx[8].ctbname = '进仓单表{非采购,加工}'
  85. s_ctmx[8].wherestr = " where billtype <> 1 and billtype <> 4 and ctmint = 0 and balcflag = 1 and flag=1 and indate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  86. s_ctmx[8].checkstr = " where billtype <> 1 and billtype <> 4 and (balcflag = 0 or flag = 0) and ctmint = 0 and indate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  87. s_ctmx[8].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  88. s_ctmx[8].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  89. s_ctmx[8].delid = "inwareid"
  90. s_ctmx[8].fromstr = " from u_inware"
  91. s_ctmx[8].linkstr = ""
  92. s_ctmx[9].etbname = 'u_outwaremx'
  93. s_ctmx[9].ctbname = '出仓单明细表{非销售,非扣费,非领料}'
  94. s_ctmx[9].wherestr = " where u_outware.billtype <> 10 and u_outware.billtype <> 3 and u_outware.billtype <> 1 and u_outware.ctmint = 0 and u_outware.balcflag = 1 and u_outware.flag = 1 and u_outware.outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  95. s_ctmx[9].checkstr = " where u_outware.billtype <> 10 and u_outware.billtype <> 3 and u_outware.billtype <> 1 and (u_outware.balcflag = 0 or u_outware.flag = 0) and u_outware.ctmint = 0 and u_outware.outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  96. s_ctmx[9].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  97. s_ctmx[9].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  98. s_ctmx[9].delid = "outwareid"
  99. s_ctmx[9].fromstr = " from u_outwaremx,u_outware"
  100. s_ctmx[9].linkstr = " and u_outwaremx.scid = u_outware.scid and u_outwaremx.outwareid = u_outware.outwareid"
  101. s_ctmx[10].etbname = 'u_outware'
  102. s_ctmx[10].ctbname = '出仓单表{非销售,非扣费,非领料}'
  103. s_ctmx[10].wherestr = " where billtype <> 10 and u_outware.billtype <> 3 and billtype <> 1 and ctmint = 0 and balcflag = 1 and flag = 1 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  104. s_ctmx[10].checkstr = " where billtype <> 10 and u_outware.billtype <> 3 and billtype <> 1 and (balcflag = 0 or flag = 0) and ctmint = 0 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  105. s_ctmx[10].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  106. s_ctmx[10].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  107. s_ctmx[10].delid = "outwareid"
  108. s_ctmx[10].fromstr = " from u_outware"
  109. s_ctmx[10].linkstr = ""
  110. s_ctmx[11].etbname = 'u_outwaremx'
  111. s_ctmx[11].ctbname = '出仓单明细表{扣费}'
  112. s_ctmx[11].wherestr = " where u_outware.billtype = 10 and u_outware.ctmint = 0 and u_outware.balcflag = 1 and u_outware.flag = 1 and u_outware.secflag = 1 and u_outware.wagemth > 0 and u_outware.wagemth< " + String(ls_del_wagemth)
  113. s_ctmx[11].checkstr = " where u_outware.billtype = 10 and (u_outware.balcflag = 0 or u_outware.flag = 0 or u_outware.secflag = 0) and u_outware.ctmint = 0 and u_outware.wagemth > 0 and u_outware.wagemth< " + String(ls_del_wagemth)
  114. s_ctmx[11].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  115. s_ctmx[11].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  116. s_ctmx[11].delid = "outwareid"
  117. s_ctmx[11].fromstr = " from u_outwaremx,u_outware"
  118. s_ctmx[11].linkstr = " and u_outwaremx.scid = u_outware.scid and u_outwaremx.outwareid = u_outware.outwareid"
  119. s_ctmx[12].etbname = 'u_outware'
  120. s_ctmx[12].ctbname = '出仓单表{扣费}'
  121. s_ctmx[12].wherestr = " where billtype = 10 and ctmint = 0 and balcflag = 1 and flag = 1 and secflag = 1 and wagemth > 0 and wagemth< " + String(ls_del_wagemth)
  122. s_ctmx[12].checkstr = " where billtype = 10 and (balcflag = 0 or flag = 0 or secflag = 0) and ctmint = 0 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  123. s_ctmx[12].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  124. s_ctmx[12].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  125. s_ctmx[12].delid = "outwareid"
  126. s_ctmx[12].fromstr = " from u_outware"
  127. s_ctmx[12].linkstr = ""
  128. s_ctmx[13].etbname = 'u_outwaremx'
  129. s_ctmx[13].ctbname = '出仓单明细表{销售}'
  130. if sys_option_use_msttake = 1 then
  131. s_ctmx[13].wherestr = " where u_outware.billtype =1 and u_outware.ctmint = 0 and u_outware.balcflag = 1 and u_outware.flag = 1 and u_outware.secflag = 1 and u_outware.outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  132. s_ctmx[13].checkstr = " where u_outware.billtype =1 and (u_outware.balcflag = 0 or u_outware.flag = 0 or u_outware.secflag = 0 ) and u_outware.ctmint = 0 and u_outware.outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  133. else
  134. s_ctmx[13].wherestr = " where u_outware.billtype =1 and u_outware.ctmint = 0 and u_outware.balcflag = 1 and u_outware.flag = 1 and u_outware.outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  135. s_ctmx[13].checkstr = " where u_outware.billtype =1 and (u_outware.balcflag = 0 or u_outware.flag = 0) and u_outware.ctmint = 0 and u_outware.outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  136. end if
  137. s_ctmx[13].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  138. s_ctmx[13].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  139. s_ctmx[13].delid = "outwareid"
  140. s_ctmx[13].fromstr = " from u_outwaremx,u_outware"
  141. s_ctmx[13].linkstr = " and u_outwaremx.scid = u_outware.scid and u_outwaremx.outwareid = u_outware.outwareid"
  142. s_ctmx[14].etbname = 'u_outware'
  143. s_ctmx[14].ctbname = '出仓单表{销售}'
  144. if sys_option_use_msttake = 1 then
  145. s_ctmx[14].wherestr = " where billtype =1 and ctmint = 0 and balcflag = 1 and flag = 1 and secflag = 1 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  146. s_ctmx[14].checkstr = " where billtype =1 and (balcflag = 0 or flag = 0 or secflag = 0 ) and ctmint = 0 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  147. else
  148. s_ctmx[14].wherestr = " where billtype =1 and ctmint = 0 and balcflag = 1 and flag = 1 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  149. s_ctmx[14].checkstr = " where billtype =1 and (balcflag = 0 or flag = 0 ) and ctmint = 0 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  150. end if
  151. s_ctmx[14].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  152. s_ctmx[14].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  153. s_ctmx[14].delid = "outwareid"
  154. s_ctmx[14].fromstr = " from u_outware"
  155. s_ctmx[14].linkstr = ""
  156. //**应收应付****************************
  157. s_ctmx[15].etbname = 'u_bmstpaymx'
  158. s_ctmx[15].ctbname = '应付帐明细表'
  159. s_ctmx[15].wherestr = " where ctmint = 0 and paydate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  160. s_ctmx[15].checkstr = " where ctmint = 0 and paydate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  161. s_ctmx[15].delstr = " where ctmint <= " + String(arg_ed_int)+" and delflag = 1 and ctmint > 0 "
  162. s_ctmx[15].ctstr = " where ctmint <= " + String(arg_ed_int)+" and ctmint > 0 "
  163. s_ctmx[15].delid = "payid"
  164. s_ctmx[15].fromstr = " from u_bmstpaymx"
  165. s_ctmx[15].linkstr = ""
  166. s_ctmx[16].etbname = 'u_bmstpay'
  167. s_ctmx[16].ctbname = '应付帐表'
  168. s_ctmx[16].wherestr = " where ctmint = 0 and paydate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  169. s_ctmx[16].checkstr = " where ctmint = 0 and paydate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  170. s_ctmx[16].delstr = " where ctmint <= " + String(arg_ed_int)+" and deflag = 1 and ctmint > 0 "
  171. s_ctmx[16].ctstr = " where ctmint <= " + String(arg_ed_int)+" and ctmint > 0 "
  172. s_ctmx[16].delid = "payid"
  173. s_ctmx[16].fromstr = " from u_bmstpay"
  174. s_ctmx[16].linkstr = ""
  175. s_ctmx[17].etbname = 'u_bmsttakemx'
  176. s_ctmx[17].ctbname = '应收帐表明细'
  177. s_ctmx[17].wherestr = " where ctmint = 0 and takedate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  178. s_ctmx[17].checkstr = " where ctmint = 0 and takedate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  179. s_ctmx[17].delstr = " where ctmint <= " + String(arg_ed_int)+" and delflag = 1 and ctmint > 0 "
  180. s_ctmx[17].ctstr = " where ctmint <= " + String(arg_ed_int)+" and ctmint > 0 "
  181. s_ctmx[17].delid = "takeid"
  182. s_ctmx[17].fromstr = " from u_bmsttakemx"
  183. s_ctmx[17].linkstr = ""
  184. s_ctmx[18].etbname = 'u_bmsttake'
  185. s_ctmx[18].ctbname = '应收帐表'
  186. s_ctmx[18].wherestr = " where ctmint = 0 and takedate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  187. s_ctmx[18].checkstr = " where ctmint = 0 and takedate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  188. s_ctmx[18].delstr = " where ctmint <= " + String(arg_ed_int)+" and delflag = 1"
  189. s_ctmx[18].ctstr = " where ctmint <= " + String(arg_ed_int)+" and ctmint > 0 "
  190. s_ctmx[18].delid = "takeid"
  191. s_ctmx[18].fromstr = " from u_bmsttake"
  192. s_ctmx[18].linkstr = ""
  193. //**************************************
  194. //**结存要后5天*************************
  195. DateTime ll_datetime
  196. Date ll_date
  197. ll_date = RelativeDate (Date(String(arg_ctdt,'yyyy-mm-dd')),5)
  198. ll_datetime = DateTime(ll_date,Time('24:61'))
  199. s_ctmx[19].etbname = 'u_warebalc'
  200. s_ctmx[19].ctbname = '仓库结存表'
  201. s_ctmx[19].wherestr = " where balcdate<='" + String(ll_datetime,'yyyy-mm-dd hh:mm') + "'"
  202. s_ctmx[19].checkstr = " where balcdate<='" + String(ll_datetime,'yyyy-mm-dd hh:mm') + "'"
  203. s_ctmx[19].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  204. s_ctmx[19].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  205. s_ctmx[19].delid = "mtrlid"
  206. s_ctmx[19].fromstr = " from u_warebalc"
  207. s_ctmx[19].linkstr = ""
  208. //**************************************
  209. s_ctmx[20].etbname = 'u_order_wfjgmx'
  210. s_ctmx[20].ctbname = '外加工计划明细表'
  211. s_ctmx[20].wherestr = " where (u_order_wfjg.status = 3 or u_order_wfjg.status = 5 or u_order_wfjg.status = 6) and u_order_wfjg.ctmint = 0 and u_order_wfjg.requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  212. s_ctmx[20].checkstr = " where (u_order_wfjg.status <> 3 and u_order_wfjg.status <> 5 and u_order_wfjg.status <> 6) and u_order_wfjg.ctmint = 0 and u_order_wfjg.requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  213. s_ctmx[20].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  214. s_ctmx[20].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  215. s_ctmx[20].delid = "wfjgid"
  216. s_ctmx[20].fromstr = " from u_order_wfjgmx,u_order_wfjg"
  217. s_ctmx[20].linkstr = " and u_order_wfjgmx.scid = u_order_wfjg.scid and u_order_wfjgmx.wfjgid = u_order_wfjg.wfjgid"
  218. s_ctmx[21].etbname = 'u_order_wfjgmx_out'
  219. s_ctmx[21].ctbname = '外加工计划发出明细表'
  220. s_ctmx[21].wherestr = " where (u_order_wfjg.status = 3 or u_order_wfjg.status = 5 or u_order_wfjg.status = 6) and u_order_wfjg.ctmint = 0 and u_order_wfjg.requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  221. s_ctmx[21].checkstr = " where (u_order_wfjg.status <> 3 and u_order_wfjg.status <> 5 and u_order_wfjg.status <> 6) and u_order_wfjg.ctmint = 0 and u_order_wfjg.requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  222. s_ctmx[21].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  223. s_ctmx[21].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  224. s_ctmx[21].delid = "wfjgid"
  225. s_ctmx[21].fromstr = " from u_order_wfjgmx_out,u_order_wfjg"
  226. s_ctmx[21].linkstr = " and u_order_wfjgmx_out.scid = u_order_wfjg.scid and u_order_wfjgmx_out.wfjgid = u_order_wfjg.wfjgid"
  227. s_ctmx[22].etbname = 'u_order_wfjg'
  228. s_ctmx[22].ctbname = '外加工计划表'
  229. s_ctmx[22].wherestr = " where (status = 3 or status = 5 or status = 6) and ctmint = 0 and requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  230. s_ctmx[22].checkstr = " where (status<>3 and status <> 5 and status <> 6) and ctmint = 0 and requiredate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  231. s_ctmx[22].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  232. s_ctmx[22].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  233. s_ctmx[22].delid = "wfjgid"
  234. s_ctmx[22].fromstr = " from u_order_wfjg"
  235. s_ctmx[22].linkstr = ""
  236. s_ctmx[23].etbname = 'u_outwaremovemx'
  237. s_ctmx[23].ctbname = '调仓单明细表'
  238. s_ctmx[23].wherestr = " where u_outware_move.flag = 1 and u_outware_move.ctmint = 0 and u_outware_move.outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  239. s_ctmx[23].checkstr = " where u_outware_move.flag = 0 and u_outware_move.ctmint = 0 and u_outware_move.outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  240. s_ctmx[23].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  241. s_ctmx[23].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  242. s_ctmx[23].delid = "outwareid"
  243. s_ctmx[23].fromstr = " from u_outwaremovemx,u_outware_move"
  244. s_ctmx[23].linkstr = " and u_outwaremovemx.outwareid = u_outware_move.outwareid"
  245. s_ctmx[24].etbname = 'u_outware_move'
  246. s_ctmx[24].ctbname = '调仓单表'
  247. s_ctmx[24].wherestr = " where flag = 1 and ctmint = 0 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  248. s_ctmx[24].checkstr = " where flag = 0 and ctmint = 0 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  249. s_ctmx[24].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  250. s_ctmx[24].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  251. s_ctmx[24].delid = "outwareid"
  252. s_ctmx[24].fromstr = " from u_outware_move"
  253. s_ctmx[24].linkstr = ""
  254. //s_ctmx[23].etbname='u_OrderMtrl_workgroup'
  255. //s_ctmx[23].ctbname='生产计划工组明细表'
  256. //s_ctmx[23].wherestr=" where (u_order_ml.status = 3 or u_order_ml.status = 5 or u_order_ml.status = 6) and u_order_ml.jjfinishflag = 1 and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  257. //s_ctmx[23].checkstr=" where (u_order_ml.status <> 3 and u_order_ml.status <> 5 and u_order_ml.status <> 6) and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  258. //s_ctmx[23].delstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  259. //s_ctmx[23].ctstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  260. //s_ctmx[23].delid="orderid"
  261. //s_ctmx[23].fromstr=" from u_order_ml,u_OrderMtrl_workgroup"
  262. //s_ctmx[23].linkstr=" and u_order_ml.scid = u_OrderMtrl_workgroup.scid and u_order_ml.orderid = u_OrderMtrl_workgroup.orderid"
  263. //
  264. //s_ctmx[24].etbname='u_orderrqmtrl'
  265. //s_ctmx[24].ctbname='生产计划用料需求明细表'
  266. //s_ctmx[24].wherestr=" where (u_order_ml.status = 3 or u_order_ml.status = 5 or u_order_ml.status = 6) and u_order_ml.jjfinishflag = 1 and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  267. //s_ctmx[24].checkstr=" where (u_order_ml.status <> 3 and u_order_ml.status <> 5 and u_order_ml.status <> 6) and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  268. //s_ctmx[24].delstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  269. //s_ctmx[24].ctstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  270. //s_ctmx[24].delid="orderid"
  271. //s_ctmx[24].fromstr=" from u_order_ml,u_orderrqmtrl"
  272. //s_ctmx[24].linkstr=" and u_order_ml.scid = u_orderrqmtrl.scid and u_order_ml.orderid = u_orderrqmtrl.orderid"
  273. //
  274. //s_ctmx[25].etbname='u_orderrqmtrl_middle'
  275. //s_ctmx[25].ctbname='生产计划中间明细表'
  276. //s_ctmx[25].wherestr=" where (u_order_ml.status = 3 or u_order_ml.status = 5 or u_order_ml.status = 6) and u_order_ml.jjfinishflag = 1 and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  277. //s_ctmx[25].checkstr=" where (u_order_ml.status <> 3 and u_order_ml.status <> 5 and u_order_ml.status <> 6) and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  278. //s_ctmx[25].delstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  279. //s_ctmx[25].ctstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  280. //s_ctmx[25].delid="orderid"
  281. //s_ctmx[25].fromstr=" from u_order_ml,u_orderrqmtrl_middle"
  282. //s_ctmx[25].linkstr=" and u_order_ml.scid = u_orderrqmtrl_middle.scid and u_order_ml.orderid = u_orderrqmtrl_middle.orderid"
  283. //
  284. //s_ctmx[26].etbname='u_orderrqwp'
  285. //s_ctmx[26].ctbname='生产计划工序明细表'
  286. //s_ctmx[26].wherestr=" where (u_order_ml.status = 3 or u_order_ml.status = 5 or u_order_ml.status = 6) and u_order_ml.jjfinishflag = 1 and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  287. //s_ctmx[26].checkstr=" where (u_order_ml.status <> 3 and u_order_ml.status <> 5 and u_order_ml.status <> 6) and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  288. //s_ctmx[26].delstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  289. //s_ctmx[26].ctstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  290. //s_ctmx[26].delid="orderid"
  291. //s_ctmx[26].fromstr=" from u_order_ml,u_orderrqwp"
  292. //s_ctmx[26].linkstr=" and u_order_ml.scid = u_orderrqwp.scid and u_order_ml.orderid = u_orderrqwp.orderid"
  293. //
  294. //s_ctmx[27].etbname='U_OrderRqwp_safa'
  295. //s_ctmx[27].ctbname='生产计划工序[safa]明细表'
  296. //s_ctmx[27].wherestr=" where (u_order_ml.status = 3 or u_order_ml.status = 5 or u_order_ml.status = 6) and u_order_ml.jjfinishflag = 1 and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  297. //s_ctmx[27].checkstr=" where (u_order_ml.status <> 3 and u_order_ml.status <> 5 and u_order_ml.status <> 6) and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  298. //s_ctmx[27].delstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  299. //s_ctmx[27].ctstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  300. //s_ctmx[27].delid="orderid"
  301. //s_ctmx[27].fromstr=" from u_order_ml,U_OrderRqwp_safa"
  302. //s_ctmx[27].linkstr=" and u_order_ml.scid = U_OrderRqwp_safa.scid and u_order_ml.orderid = U_OrderRqwp_safa.orderid"
  303. //
  304. //s_ctmx[28].etbname='u_order_ml_mx'
  305. //s_ctmx[28].ctbname='生产计划明细表'
  306. //s_ctmx[28].wherestr=" where (u_order_ml.status = 3 or u_order_ml.status = 5 or u_order_ml.status = 6) and u_order_ml.jjfinishflag = 1 and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  307. //s_ctmx[28].checkstr=" where (u_order_ml.status <> 3 and u_order_ml.status <> 5 and u_order_ml.status <> 6) and u_order_ml.ctmint = 0 and u_order_ml.orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  308. //s_ctmx[28].delstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  309. //s_ctmx[28].ctstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  310. //s_ctmx[28].delid="orderid"
  311. //s_ctmx[28].fromstr=" from u_order_ml,u_order_ml_mx"
  312. //s_ctmx[28].linkstr=" and u_order_ml.scid = u_order_ml_mx.scid and u_order_ml.orderid = u_order_ml_mx.orderid"
  313. //
  314. //s_ctmx[29].etbname='u_order_ml'
  315. //s_ctmx[29].ctbname='生产计划表'
  316. //s_ctmx[29].wherestr=" where (status = 3 or status = 5 or status = 6) and jjfinishflag = 1 and ctmint = 0 and orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  317. //s_ctmx[29].checkstr=" where (status <> 3 and status <> 5 and status <> 6) and ctmint = 0 and orderdate<='" + string(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  318. //s_ctmx[29].delstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  319. //s_ctmx[29].ctstr=" where ctmint >= " + string(arg_bg_int) + " and ctmint <= " + string(arg_ed_int)+" "
  320. //s_ctmx[29].delid="orderid"
  321. //s_ctmx[29].fromstr=" from u_order_ml"
  322. //s_ctmx[29].linkstr=""
  323. //
  324. //**工资**************************************
  325. s_ctmx[30].etbname = 'u_gz_wagemx'
  326. s_ctmx[30].ctbname = '工资明细表'
  327. s_ctmx[30].wherestr = " where u_gz_wage.auditingflag = 1 and u_gz_wage.ctmint = 0 and u_gz_wage.wagemth < '" + String(ls_del_wagemth) + "'"
  328. s_ctmx[30].checkstr = " where u_gz_wage.auditingflag = 0 and u_gz_wage.ctmint = 0 and u_gz_wage.wagemth < '" + String(ls_del_wagemth) + "'"
  329. s_ctmx[30].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  330. s_ctmx[30].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  331. s_ctmx[30].delid = "wagemth"
  332. s_ctmx[30].fromstr = " from u_gz_wage,u_gz_wagemx"
  333. s_ctmx[30].linkstr = " and u_gz_wage.empid = u_gz_wagemx.empid and u_gz_wage.wagemth = u_gz_wagemx.wagemth"
  334. s_ctmx[31].etbname = 'u_gz_wage'
  335. s_ctmx[31].ctbname = '工资表'
  336. s_ctmx[31].wherestr = " where auditingflag = 1 and ctmint = 0 and wagemth < '" + String(ls_del_wagemth) + "'"
  337. s_ctmx[31].checkstr = " where auditingflag = 0 and ctmint = 0 and wagemth < '" + String(ls_del_wagemth) + "'"
  338. s_ctmx[31].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  339. s_ctmx[31].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  340. s_ctmx[31].delid = "wagemth"
  341. s_ctmx[31].fromstr = " from u_gz_wage"
  342. s_ctmx[31].linkstr = ""
  343. s_ctmx[32].etbname = 'u_sc_taskworkmx'
  344. s_ctmx[32].ctbname = '计件明细表'
  345. s_ctmx[32].wherestr = " where u_sc_taskwork.auditingflag = 1 and u_sc_taskwork.ctmint = 0 and u_sc_taskwork.wagemth > 0 and u_sc_taskwork.wagemth < " + String(ls_del_wagemth)
  346. s_ctmx[32].checkstr = " where u_sc_taskwork.auditingflag = 0 and u_sc_taskwork.ctmint = 0 and u_sc_taskwork.billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  347. s_ctmx[32].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  348. s_ctmx[32].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  349. s_ctmx[32].delid = "billid"
  350. s_ctmx[32].fromstr = " from u_sc_taskwork,u_sc_taskworkmx"
  351. s_ctmx[32].linkstr = " and u_sc_taskwork.billid = u_sc_taskworkmx.billid"
  352. s_ctmx[33].etbname = 'u_sc_taskwork'
  353. s_ctmx[33].ctbname = '计件表'
  354. s_ctmx[33].wherestr = " where auditingflag = 1 and ctmint = 0 and wagemth > 0 and wagemth < " + String(ls_del_wagemth)
  355. s_ctmx[33].checkstr = " where auditingflag = 0 and ctmint = 0 and billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  356. s_ctmx[33].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  357. s_ctmx[33].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  358. s_ctmx[33].delid = "billid"
  359. s_ctmx[33].fromstr = " from u_sc_taskwork"
  360. s_ctmx[33].linkstr = ""
  361. s_ctmx[34].etbname = 'u_sc_abnormitymx'
  362. s_ctmx[34].ctbname = '个人工序计件单明细表'
  363. s_ctmx[34].wherestr = " where u_sc_abnormity.auditingflag = 1 and u_sc_abnormity.ctmint = 0 and u_sc_abnormity.wagemth > 0 and u_sc_abnormity.wagemth < " + String(ls_del_wagemth)
  364. s_ctmx[34].checkstr = " where u_sc_abnormity.auditingflag = 0 and u_sc_abnormity.ctmint = 0 and u_sc_abnormity.billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  365. s_ctmx[34].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  366. s_ctmx[34].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  367. s_ctmx[34].delid = "billid"
  368. s_ctmx[34].fromstr = " from u_sc_abnormity,u_sc_abnormitymx"
  369. s_ctmx[34].linkstr = " and u_sc_abnormity.billid = u_sc_abnormitymx.billid"
  370. s_ctmx[35].etbname = 'u_sc_abnormity'
  371. s_ctmx[35].ctbname = '个人工序计件单表'
  372. s_ctmx[35].wherestr = " where auditingflag = 1 and ctmint = 0 and wagemth > 0 and wagemth < " + String(ls_del_wagemth)
  373. s_ctmx[35].checkstr = " where auditingflag = 0 and ctmint = 0 and billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  374. s_ctmx[35].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  375. s_ctmx[35].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  376. s_ctmx[35].delid = "billid"
  377. s_ctmx[35].fromstr = " from u_sc_abnormity"
  378. s_ctmx[35].linkstr = ""
  379. s_ctmx[36].etbname = 'u_gz_loanwage'
  380. s_ctmx[36].ctbname = '借支单表'
  381. s_ctmx[36].wherestr = " where flag = 1 and ctmint = 0 and wagemth > 0 and wagemth < " + String(ls_del_wagemth)
  382. s_ctmx[36].checkstr = " where flag = 0 and ctmint = 0 and billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  383. s_ctmx[36].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  384. s_ctmx[36].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  385. s_ctmx[36].delid = "billid"
  386. s_ctmx[36].fromstr = " from u_gz_loanwage"
  387. s_ctmx[36].linkstr = ""
  388. s_ctmx[37].etbname = 'u_gz_award_punish'
  389. s_ctmx[37].ctbname = '奖罚单表'
  390. s_ctmx[37].wherestr = " where flag = 1 and ctmint = 0 and wagemth > 0 and wagemth < " + String(ls_del_wagemth)
  391. s_ctmx[37].checkstr = " where flag = 0 and ctmint = 0 and billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  392. s_ctmx[37].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  393. s_ctmx[37].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  394. s_ctmx[37].delid = "billid"
  395. s_ctmx[37].fromstr = " from u_gz_award_punish"
  396. s_ctmx[37].linkstr = ""
  397. s_ctmx[38].etbname = 'u_gz_cwork'
  398. s_ctmx[38].ctbname = '考勤单表'
  399. s_ctmx[38].wherestr = " where flag = 1 and ctmint = 0 and wagemth > 0 and wagemth < " + String(ls_del_wagemth)
  400. s_ctmx[38].checkstr = " where flag = 0 and ctmint = 0 and billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  401. s_ctmx[38].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  402. s_ctmx[38].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  403. s_ctmx[38].delid = "billid"
  404. s_ctmx[38].fromstr = " from u_gz_cwork"
  405. s_ctmx[38].linkstr = ""
  406. //s_ctmx[39].etbname = 'u_sc_abnormity_bill'
  407. //s_ctmx[39].ctbname = '返工返修赔偿单表'
  408. //s_ctmx[39].wherestr = " where billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  409. //s_ctmx[39].checkstr = " where billdate<='" + String(ls_del_wagemth_date,'yyyy-mm-dd hh:mm') + "'"
  410. //s_ctmx[39].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  411. //s_ctmx[39].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  412. //s_ctmx[39].delid = "billid"
  413. //s_ctmx[39].fromstr = " from u_sc_abnormity_bill"
  414. //s_ctmx[39].linkstr = ""
  415. //**出纳帐****************************
  416. string tmp_wherestr
  417. tmp_wherestr = ''
  418. tmp_wherestr = " where ctmint = 0 and takedate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  419. tmp_wherestr = tmp_wherestr + " and printid not in (select printid from v_max_rapid)"
  420. s_ctmx[40].etbname = 'u_rap_money'
  421. s_ctmx[40].ctbname = '出纳帐表'
  422. s_ctmx[40].wherestr = tmp_wherestr
  423. s_ctmx[40].checkstr = " where ctmint = 0 and takedate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  424. s_ctmx[40].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  425. s_ctmx[40].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  426. s_ctmx[40].delid = "rapmoneyid"
  427. s_ctmx[40].fromstr = " from u_rap_money"
  428. s_ctmx[40].linkstr = ""
  429. s_ctmx[41].etbname = 'u_iteminput'
  430. s_ctmx[41].ctbname = '收入支出帐'
  431. s_ctmx[41].wherestr = " where ctmint = 0 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  432. s_ctmx[41].checkstr = " where ctmint = 0 and outdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  433. s_ctmx[41].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  434. s_ctmx[41].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  435. s_ctmx[41].delid = "dateint"
  436. s_ctmx[41].fromstr = " from u_iteminput"
  437. s_ctmx[41].linkstr = ""
  438. //**************************************
  439. //s_ctmx[42].etbname = 'u_opposemx_dept'
  440. //s_ctmx[42].ctbname = '投诉单部门明细表'
  441. //s_ctmx[42].wherestr = " where u_oppose.ctmint = 0 and u_oppose.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  442. //s_ctmx[42].checkstr = " where u_oppose.ctmint = 0 and u_oppose.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  443. //s_ctmx[42].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  444. //s_ctmx[42].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  445. //s_ctmx[42].delid = "billid"
  446. //s_ctmx[42].fromstr = " from u_oppose,u_opposemx_dept"
  447. //s_ctmx[42].linkstr = " and u_oppose.billid = u_opposemx_dept.billid"
  448. //
  449. //s_ctmx[43].etbname = 'u_opposemx_mtrl'
  450. //s_ctmx[43].ctbname = '投诉单物料明细表'
  451. //s_ctmx[43].wherestr = " where u_oppose.ctmint = 0 and u_oppose.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  452. //s_ctmx[43].checkstr = " where u_oppose.ctmint = 0 and u_oppose.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  453. //s_ctmx[43].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  454. //s_ctmx[43].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  455. //s_ctmx[43].delid = "billid"
  456. //s_ctmx[43].fromstr = " from u_oppose,u_opposemx_mtrl"
  457. //s_ctmx[43].linkstr = " and u_oppose.billid = u_opposemx_mtrl.billid"
  458. //
  459. //s_ctmx[44].etbname = 'u_oppose'
  460. //s_ctmx[44].ctbname = '投诉单表'
  461. //s_ctmx[44].wherestr = " where ctmint = 0 and billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  462. //s_ctmx[44].checkstr = " where ctmint = 0 and billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  463. //s_ctmx[44].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  464. //s_ctmx[44].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  465. //s_ctmx[44].delid = "billid"
  466. //s_ctmx[44].fromstr = " from u_oppose"
  467. //s_ctmx[44].linkstr = ""
  468. s_ctmx[45].etbname = 'u_cusamt'
  469. s_ctmx[45].ctbname = '客户收款单'
  470. s_ctmx[45].wherestr = " where ctmint = 0 and cusdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  471. s_ctmx[45].checkstr = " where ctmint = 0 and cusdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  472. s_ctmx[45].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  473. s_ctmx[45].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  474. s_ctmx[45].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  475. s_ctmx[45].delid = "billid"
  476. s_ctmx[45].fromstr = " from u_cusamt"
  477. s_ctmx[45].linkstr = ""
  478. //*******************************
  479. s_ctmx[46].etbname = 'u_dismantle_installmx'
  480. s_ctmx[46].ctbname = '拆装单明细表'
  481. s_ctmx[46].wherestr = " where u_dismantle_install.Auditingflag = 1 and u_dismantle_install.ctmint = 0 and u_dismantle_install.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  482. s_ctmx[46].checkstr = " where u_dismantle_install.Auditingflag = 0 and u_dismantle_install.ctmint = 0 and u_dismantle_install.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  483. s_ctmx[46].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  484. s_ctmx[46].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  485. s_ctmx[46].delid = "billid"
  486. s_ctmx[46].fromstr = " from u_dismantle_install,u_dismantle_installmx"
  487. s_ctmx[46].linkstr = " and u_dismantle_install.billid = u_dismantle_installmx.billid"
  488. s_ctmx[47].etbname = 'u_dismantle_install'
  489. s_ctmx[47].ctbname = '拆装单表'
  490. s_ctmx[47].wherestr = " where Auditingflag = 1 and ctmint = 0 and billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  491. s_ctmx[47].checkstr = " where Auditingflag = 0 and ctmint = 0 and billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  492. s_ctmx[47].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  493. s_ctmx[47].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  494. s_ctmx[47].delid = "billid"
  495. s_ctmx[47].fromstr = " from u_dismantle_install"
  496. s_ctmx[47].linkstr = ""
  497. //s_ctmx[48].etbname = 'u_orderworkgroup_nummx'
  498. //s_ctmx[48].ctbname = '工组调拨单明细表'
  499. //s_ctmx[48].wherestr = " where u_orderworkgroup_num.flag = 1 and u_orderworkgroup_num.ctmint = 0 and u_orderworkgroup_num.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  500. //s_ctmx[48].checkstr = " where u_orderworkgroup_num.flag = 0 and u_orderworkgroup_num.ctmint = 0 and u_orderworkgroup_num.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  501. //s_ctmx[48].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  502. //s_ctmx[48].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  503. //s_ctmx[48].delid = "billid"
  504. //s_ctmx[48].fromstr = " from u_orderworkgroup_num,u_orderworkgroup_nummx"
  505. //s_ctmx[48].linkstr = " and u_orderworkgroup_num.billid = u_orderworkgroup_nummx.billid"
  506. //
  507. //s_ctmx[49].etbname = 'u_orderworkgroup_num'
  508. //s_ctmx[49].ctbname = '工组调拨单表'
  509. //s_ctmx[49].wherestr = " where flag = 1 and ctmint = 0 and billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  510. //s_ctmx[49].checkstr = " where flag = 0 and ctmint = 0 and billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  511. //s_ctmx[49].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  512. //s_ctmx[49].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  513. //s_ctmx[49].delid = "billid"
  514. //s_ctmx[49].fromstr = " from u_orderworkgroup_num"
  515. //s_ctmx[49].linkstr = ""
  516. //
  517. //s_ctmx[50].etbname = 'u_orderworkgroup_timemx'
  518. //s_ctmx[50].ctbname = '工组调整时间明细表'
  519. //s_ctmx[50].wherestr = " where u_orderworkgroup_time.flag = 1 and u_orderworkgroup_time.ctmint = 0 and u_orderworkgroup_time.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  520. //s_ctmx[50].checkstr = " where u_orderworkgroup_time.flag = 0 and u_orderworkgroup_time.ctmint = 0 and u_orderworkgroup_time.billdate<='" + String(arg_ctdt,'yyyy-mm-dd hh:mm') + "'"
  521. //s_ctmx[50].delstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  522. //s_ctmx[50].ctstr = " where ctmint >= " + String(arg_bg_int) + " and ctmint <= " + String(arg_ed_int)+" "
  523. //s_ctmx[50].delid = "billid"
  524. //s_ctmx[50].fromstr = " from u_orderworkgroup_time,u_orderworkgroup_timemx"
  525. //s_ctmx[50].linkstr = " and u_orderworkgroup_time.billid = u_orderworkgroup_timemx.billid"
  526. //
  527. f_init_cttbinfo_2(arg_ctdt,arg_bg_int,arg_ed_int,s_ctmx[])
  528. RETURN 1
  529. end function