uo_saletask_spi.sru 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. $PBExportHeader$uo_saletask_spi.sru
  2. forward
  3. global type uo_saletask_spi from nonvisualobject
  4. end type
  5. end forward
  6. global type uo_saletask_spi from nonvisualobject
  7. end type
  8. global uo_saletask_spi uo_saletask_spi
  9. forward prototypes
  10. public function integer uf_save_saletask (long arg_scid, s_saletask_import_arr arg_bill, ref long arg_taskid, ref string arg_taskcode, ref string arg_msg, boolean ifcommit)
  11. private function string pf_errmsg ()
  12. public function integer uf_audit_saletask (long arg_scid, long arg_taskid, ref string arg_msg, boolean ifcommit)
  13. public function integer uf_saletask_ch (ref s_taobao_saletask_ch arg_task, ref string arg_msg)
  14. public function integer uof_getprice_saletask (s_saletask_import arg_s_import, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg)
  15. public function integer wf_pricelist_ch (long arg_mtrlid, ref long arg_pricelistid, ref string arg_pricelistname, ref string arg_msg)
  16. public function integer wf_itemdef_ch (ref long arg_itemid, ref string arg_itemcode, ref string arg_itemname, ref string arg_itemtype, ref string arg_msg)
  17. public function integer wf_new_cust_p (s_saletask_import arg_import[], ref string arg_msg)
  18. public function integer uf_fill_taobao_saletask_info (ref s_saletask_import arg_mx, ref string arg_msg)
  19. end prototypes
  20. public function integer uf_save_saletask (long arg_scid, s_saletask_import_arr arg_bill, ref long arg_taskid, ref string arg_taskcode, ref string arg_msg, boolean ifcommit);//====================================================================
  21. // 事件: uo_saletask_spi.uf_save_saletask()
  22. //--------------------------------------------------------------------
  23. // 描述:建立销售订单 返回 订单ID与订单编号
  24. //--------------------------------------------------------------------
  25. // 参数:
  26. // value long arg_scid 建立订单的分部
  27. // value s_saletask_import_arr arg_bill 建立订单的信息
  28. // reference long arg_taskid 返回订单ID
  29. // reference string arg_taskcode 返回订单编号
  30. // reference string arg_msg 返回错误信息
  31. // value boolean ifcommit 是否提交
  32. //--------------------------------------------------------------------
  33. // 返回: integer
  34. //--------------------------------------------------------------------
  35. // 作者: lwl 日期: 2013年04月09日
  36. //--------------------------------------------------------------------
  37. // LONGJOE
  38. //--------------------------------------------------------------------
  39. // 修改历史:
  40. //
  41. //====================================================================
  42. Int rslt = 1
  43. rslt = 0
  44. PopulateError(999, '需要子类实现')
  45. arg_msg = pf_errmsg()
  46. GOTO ext
  47. ext:
  48. IF ifcommit THEN
  49. IF rslt = 1 THEN
  50. COMMIT;
  51. ELSE
  52. ROLLBACK;
  53. END IF
  54. END IF
  55. RETURN rslt
  56. end function
  57. private function string pf_errmsg ();String rslt
  58. rslt = Error.Text + ' at ' + Error.ObjectEvent + ' in ' + Error.Object + ' line ' + String(Error.Line)
  59. RETURN rslt
  60. end function
  61. public function integer uf_audit_saletask (long arg_scid, long arg_taskid, ref string arg_msg, boolean ifcommit);//====================================================================
  62. // 事件: uo_saletask_spi.uf_audit_saletask()
  63. //--------------------------------------------------------------------
  64. // 描述:审核销售订单
  65. //--------------------------------------------------------------------
  66. // 参数:
  67. // value long arg_scid 订单分部
  68. // value long arg_taskid 订单ID
  69. // value string arg_operator 操作人
  70. // reference string arg_msg 错误信息
  71. // value boolean ifcommit 是否提交
  72. //--------------------------------------------------------------------
  73. // 返回: integer
  74. //--------------------------------------------------------------------
  75. // 作者: lwl 日期: 2013年04月09日
  76. //--------------------------------------------------------------------
  77. // LONGJOE
  78. //--------------------------------------------------------------------
  79. // 修改历史:
  80. //
  81. //====================================================================
  82. Int rslt = 1
  83. rslt = 0
  84. PopulateError(999, '需要子类实现')
  85. arg_msg = pf_errmsg()
  86. GOTO ext
  87. ext:
  88. IF ifcommit THEN
  89. IF rslt = 1 THEN
  90. COMMIT;
  91. ELSE
  92. ROLLBACK;
  93. END IF
  94. END IF
  95. RETURN rslt
  96. end function
  97. public function integer uf_saletask_ch (ref s_taobao_saletask_ch arg_task, ref string arg_msg);Int rslt = 1
  98. rslt = 0
  99. PopulateError(999, '需要子类实现')
  100. arg_msg = pf_errmsg()
  101. GOTO ext
  102. ext:
  103. RETURN rslt
  104. end function
  105. public function integer uof_getprice_saletask (s_saletask_import arg_s_import, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg);Int rslt = 1
  106. rslt = 0
  107. PopulateError(999, '需要子类实现')
  108. arg_msg = pf_errmsg()
  109. GOTO ext
  110. ext:
  111. RETURN rslt
  112. end function
  113. public function integer wf_pricelist_ch (long arg_mtrlid, ref long arg_pricelistid, ref string arg_pricelistname, ref string arg_msg);Int rslt = 1
  114. rslt = 0
  115. PopulateError(999, '需要子类实现')
  116. arg_msg = pf_errmsg()
  117. GOTO ext
  118. ext:
  119. RETURN rslt
  120. //Long ll_mtrlid
  121. //ll_mtrlid = dw_1.Object.mtrlid[row]
  122. //
  123. //
  124. //
  125. //OpenWithParm(w_eb_sale_price_list_arr_ch, ll_mtrlid)
  126. //
  127. //s_pricelist_arr_ch s_tran
  128. //s_tran = Message.PowerObjectParm
  129. //IF UpperBound(s_tran.pricelistid) <= 0 THEN RETURN
  130. //IF s_tran.pricelistid[1] > 0 THEN
  131. // dw_1.Object.pricelistid[row] = s_tran.pricelistid[1]
  132. // dw_1.Object.pricelistname[row] = s_tran.pricelistname[1]
  133. //END IF
  134. end function
  135. public function integer wf_itemdef_ch (ref long arg_itemid, ref string arg_itemcode, ref string arg_itemname, ref string arg_itemtype, ref string arg_msg);Int rslt = 1
  136. rslt = 0
  137. PopulateError(999, '需要子类实现')
  138. arg_msg = pf_errmsg()
  139. GOTO ext
  140. ext:
  141. RETURN rslt
  142. //Open(w_itemdef_ch_taobao) //调用
  143. //
  144. //s_itemdef_arr s_inscust
  145. //s_inscust = Message.PowerObjectParm //接受返回结构
  146. //
  147. //IF UpperBound(s_inscust.itemid) <= 0 THEN RETURN
  148. //IF s_inscust.itemid[1] <= 0 THEN RETURN
  149. //
  150. //ins_itemid = s_inscust.itemid[1]
  151. //sle_itemcode.Text = s_inscust.itemcode[1]
  152. //sle_itemname.Text = s_inscust.itemname[1]
  153. //sle_itemtype.Text = s_inscust.itemtype[1]
  154. end function
  155. public function integer wf_new_cust_p (s_saletask_import arg_import[], ref string arg_msg);Int rslt = 1
  156. rslt = 0
  157. PopulateError(999, '需要子类实现')
  158. arg_msg = pf_errmsg()
  159. GOTO ext
  160. ext:
  161. RETURN rslt
  162. //Long i
  163. //
  164. //s_define_import_parm s_tran
  165. //
  166. //FOR i = 1 To UpperBound(arg_import)
  167. // s_tran.cust_arr[i].Name = arg_import[i].cusname
  168. // s_tran.cust_arr[i].cuscode = arg_import[i].cuscode
  169. // s_tran.cust_arr[i].custype = arg_import[i].assign_emp
  170. // s_tran.cust_arr[i].upname = arg_import[i].upname
  171. // s_tran.cust_arr[i].rep = arg_import[i].rel_rep
  172. // s_tran.cust_arr[i].tele = arg_import[i].cus_tele
  173. // s_tran.cust_arr[i].tele1 = ''
  174. // s_tran.cust_arr[i].faxno = arg_import[i].cus_fax
  175. // s_tran.cust_arr[i].Address = arg_import[i].cus_address
  176. // s_tran.cust_arr[i].freight = arg_import[i].freight
  177. // s_tran.cust_arr[i].freight_tele = arg_import[i].freight_tele
  178. // // s_tran.cust_arr[i].moneyid = arg_import[i].moneyid
  179. // s_tran.cust_arr[i].banktypeid = arg_import[i].banktypeid
  180. //
  181. //NEXT
  182. //
  183. //OpenWithParm(w_define_response, s_tran)
  184. //
  185. //RETURN 1
  186. //
  187. end function
  188. public function integer uf_fill_taobao_saletask_info (ref s_saletask_import arg_mx, ref string arg_msg);Int rslt = 1
  189. rslt = 0
  190. PopulateError(999, '需要子类实现')
  191. arg_msg = pf_errmsg()
  192. GOTO ext
  193. ext:
  194. RETURN rslt
  195. end function
  196. on uo_saletask_spi.create
  197. call super::create
  198. TriggerEvent( this, "constructor" )
  199. end on
  200. on uo_saletask_spi.destroy
  201. TriggerEvent( this, "destructor" )
  202. call super::destroy
  203. end on