app_cust.sra 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. $PBExportHeader$app_cust.sra
  2. $PBExportComments$Generated Application Object
  3. forward
  4. global type app_cust from application
  5. end type
  6. global transaction sqlca
  7. global dynamicdescriptionarea sqlda
  8. global dynamicstagingarea sqlsa
  9. global error error
  10. global message message
  11. end forward
  12. global variables
  13. String publ_operator = "super" //操作员名
  14. String publ_userid //操作员id
  15. String sys_right //权限串
  16. String sys_psw //用户密码
  17. String sys_cardno //卡号
  18. String sys_superpsw = '4646464646' //超级密码
  19. String sys_user_storagestr //仓库串
  20. Long sys_user_storageid[] //仓库数组
  21. Long sys_all_storageid[] //全部仓库数组
  22. String sys_shortcut //快捷方式串
  23. String sys_areastr //区域串
  24. Long sys_areaid[] //区域数组
  25. String sys_user_scstr //分部权限串
  26. Long sys_user_scid[] //分部数组
  27. Long sys_scid = 0 //分部ID -1 全部[历史]
  28. Long sys_empid = 0 //当前操作员ID
  29. Boolean if_hisdb = FALSE //是否历史数据库
  30. long sys_user_spttype[] // 供应商类别数组
  31. string sys_user_spttypestr //供应商类别串
  32. ////////注意
  33. int sys_mode = 0 //0全部 1旧版模式,安吉
  34. string Ajstr = ",1,30,60,70,53,41,221,222," //过滤权限
  35. long cc = 14215660
  36. String sys_computer_key
  37. Boolean sys_power_issuper = FALSE
  38. //超级用户标志
  39. String sys_super_name = '超级用户'
  40. String sys_super_id = 'super'
  41. //超级用户id
  42. String sys_inifilename = 'ljerp_pulg.ini'
  43. String sys_inifilename_other = 'Ecleverv25_other_wiz.ini'
  44. //指定系统ini文件
  45. String sys_power_key = '123457851239866'
  46. String sys_system_id = '800001ljsalerv2.5'
  47. //版本
  48. String sys_prg_id = '800001'
  49. String sys_cur_version = '2.5.020805'
  50. String sys_curDB_version=''
  51. String sys_Allow_version = '2.5.060601'
  52. int sys_version_type = 0 // 1,商业版;0,工业版;2,工业版+
  53. int sys_if_register = 1 //软件注册标记
  54. int sys_if_network = 1 // 网络版标记
  55. //419249027573405627908568719049
  56. //系统信息
  57. String sys_message_username = '有限公司'
  58. String sys_message_title = "龙嘉企精灵管理信息系统V3.0"
  59. String sys_message_report_title = "有限公司"
  60. String sys_message_customer_tel = ""
  61. String sys_message_customer_sit = ""
  62. String sys_message_customer_sitcode = ""
  63. String sys_message_customer_bank = ""
  64. String sys_message_customer_bankname = ""
  65. String sys_message_customer_fax = ""
  66. String sys_message_maker = "顺德区龙嘉软件有限公司"
  67. String sys_message_copyright_inc = "2001-04-10"
  68. String sys_message_copyright_ine = ""
  69. String sys_message_version = "v1"
  70. String sys_cur_path = ''
  71. String sys_message_copytime = "2001-04-10"
  72. String sys_message_timeoutdate = "2001.08.01"
  73. Date sys_begin_date = 2001-04-13
  74. Int sys_show_bsn = 0 //0-显示业务内容 1-只显示售价管理
  75. String sys_flashbmpname = 'flashwinpic.bmp' //开始窗口的图片名称
  76. DateTime sys_showsaledata_mindt
  77. //datetime sys_salershowdate_BG
  78. //datetime sys_salershowdate_ED
  79. Long sys_option_buyprice_type = 1 //库存批号类型 1:批号手动,2:批号单价
  80. String sys_option_winrar_path = 'c:\program files\winrar\' //winrar路径
  81. Int sys_option_timeout = 300 //系统注消时间
  82. Boolean local_retrieve_all = FALSE //分页显示-----true:不分页,false:分页
  83. Int sys_option_mustprint = 0 //单据逐张打印
  84. Int sys_option_autoyes = 0 //自动是订单或计划
  85. Int sys_option_auditprint = 0 //收货单先审核后打印
  86. Int sys_option_auditprint_saletask = 0 //销售订单先审核后打印
  87. Int sys_option_auditprint_sale = 0 //销售单审核认后打印
  88. Int sys_option_auditprint_buy = 0 //采购订单审核认后打印
  89. Int sys_option_ifovertask = 1 //用超订货收货
  90. Int sys_option_aloweditstatus = 0 //规格颜色先定义
  91. Int sys_option_cusarea = 0 //区域限制
  92. Int sys_option_input_days = 60 //单据录入天数限制
  93. Int sys_option_if_color = 0 //按颜色拆装
  94. String sys_option_change_pcode = '' //面料文本
  95. String sys_option_change_woodcode = '' //材质文本
  96. String sys_option_change_status = '' //颜色文本
  97. String sys_option_change_usermtrlmode = '' //自定义3
  98. String sys_option_change_mtrlsectype = '' //物料自定义文本1
  99. String sys_option_change_zxmtrlmode = '' //物料自定义文本2
  100. Int sys_option_price_if_status = 0 //销售价按颜色约束
  101. Int sys_option_price_if_list = 0 //销售价取价格表
  102. Int sys_option_unit_dec = 5 //单位转换小数点
  103. Int sys_option_confirmaudit_sale = 0 //销售单先确认后审核
  104. Decimal sys_option_cust_rate = 1 //客户最低返率
  105. Int sys_option_use_msttake = 1 //系统使用应收帐模块
  106. Int sys_option_use_mstpay = 1 //系统使用应付帐模块
  107. Int sys_option_autowaste = 0 //自动废弃销售单
  108. Int sys_option_saletask_addware = 0 //订单审核自动加0库存
  109. Int sys_option_saletask_addware_taskqty = 0 //订单审核自动加订单库存开关
  110. dec sys_option_saletask_addware_taskqty_qty = 0 //订单审核自动加订单库存数量
  111. int sys_option_confirmprint_sale=0 //销售单先确认后打印
  112. int sys_option_addqty=1 //辅数约束1:约束,0:不约束
  113. string sys_option_change_otheramt_buy = '' //采购收货单优惠金额文本
  114. boolean if_switchdb=false //是否使用切换数据库功能
  115. String sys_switchpsw = '' //切换密码
  116. String sys_option_switchpath = '' //切换程序路径
  117. int sys_option_switch_Chktime=2 //检查时隔
  118. string sys_option_switch_Sername='' //切换数据库服务名称
  119. string sys_option_switch_Dbname='' //切换数据库名称
  120. string sys_option_switch_LoginID='' //切换数据库登录用户
  121. string sys_option_switch_LoginPsw='' //切换数据库登录用户
  122. string sys_option_returnpsw='' //返回原数据连接密码
  123. int sys_option_buy_rateedit=0 //采购进仓单转换率是否可修改
  124. Transaction sys_remote_sqlca[] //远程事务对象数组
  125. Int sys_remote_sqlca_p = 0 //远程事务对象数组指针
  126. Transaction dataincept_sqlca //数据传递事务对象
  127. Transaction source_sqlca //原切换数据库事务对象
  128. int sys_option_mst_multimoney=0 //销售应收帐使用多币种结算
  129. decimal sys_option_dlsecends = 15 //刷卡等待时间(秒)
  130. int sys_dismantle_install_check=0 //拆装单检查拆装数量
  131. int sys_saleamt_round=2 //销售订单、销售单整正处理//0:元位,1:角位,:2:分位
  132. int sys_spt_hideinfo = 0 //隐藏供应商信息
  133. int sys_option_allow_edit_outrep = 0 //销售单可修改业务员
  134. int sys_option_buyprice_ifbj = 0 //收货按报价取价
  135. int sys_option_buylimit_ifbj = 0 //收货按报价限价
  136. int sys_option_cost_dec = 5 //库存成本价小数位
  137. int sys_option_buyprice_buytask_limit = 0 //采购订单限制价格
  138. int sys_option_inware_cp_assignqty = 0 //允许超排产数生产进仓
  139. int sys_option_taskwork_mod_price //计件单选工序不可改单价
  140. int sys_option_saletask_plan = 1 //销售订单默认安排 1无,2采购,3生产,4按产品属性
  141. int sys_option_inwarecp_saleprice = 0 //生产进仓选订单带订单单价,(计划价)
  142. int sys_option_planprice_configure = 0 //产品计划价按配置
  143. int sys_option_planprice_directinput = 1 //产品计划价允许直接录入
  144. int sys_option_inwarecp_planprice = 0 //生产进仓单允许录入单价
  145. int sys_option_abnormity_price = 0 //计件单加选项不能修改单价
  146. int sys_option_2unit = 0 //外协双单位核算
  147. int sys_option_2unit_ch = 1 //外协双单位使用物料定义辅助单位. 1 - 是. 0-选择单位定义资料
  148. string sys_option_cmpl_status_qty = '' //属性计算关键字
  149. String sys_option_change_otheramt = '' //销售发货单优惠金额文本
  150. int sys_option_packqty_sale = 0 //销售发货单允许手动录入包装数量
  151. //dw2xls变量
  152. String gs_path
  153. //日期控件 
  154. Date id_date_selected
  155. datastore sys_ds_funcinfo
  156. datastore sys_ds_maininfo
  157. datastore sys_ds_shortcutinfo
  158. datastore sys_ds_userinfo
  159. window w_curwin
  160. String publ_logoico_name_normal = "ljprj_logo.ico" //托盘图标所用图标名
  161. //file
  162. Transaction sys_fileDB_sqlca //文件附件数据库连接
  163. String sys_user_class_edit_str //附件编辑权限串
  164. String sys_user_class_view_str //附件查看权限串
  165. String ins_fjtemppath = 'fjtemp' //附件下载路径
  166. //xls bill
  167. String sys_user_xls_print_str //xls单据打印 权限串 '0' 则全部允许
  168. String sys_user_xls_send_str //xls单据 发送 权限串 '0' 则全部允许
  169. Int sys_option_xls_ifuse_passwd = 1 //0,随机密码;1,用sys_option_xls_user_passwd设置的密码
  170. String sys_option_xls_user_passwd = '' //xls输出的加密密码
  171. Int sys_option_xls_lock = 0 //xls输出是否锁定,0-锁,1-不锁
  172. string sys_help_chm = '龙嘉企精灵帮助.chm'
  173. String sys_right_rpt = '0' //自定义单据打印格式权限串
  174. string sys_option_pos_jsbarcode =''
  175. string sys_user_pluginsstr //外挂串
  176. long sys_user_plugins[] //外挂数组
  177. string sys_user_reportstr // 模板式自定义报表串
  178. long sys_user_report[] // 模板式自定义报表数组
  179. datastore ds_bf_mtrltype
  180. datastore ds_bf_retr_mtrltype
  181. String sys_ServerNameFJ
  182. String sys_DataBaseFJ //附件数据库名称
  183. String sys_LoginIDFJ
  184. String sys_LoginPwdFJ
  185. oleobject AppCom, FXAppCom
  186. string app_token
  187. string app_token_fx // 分销系统的token
  188. int app_cusid
  189. string app_cuscode
  190. string app_cusname
  191. string app_username // 分销系统 与圣萝莎重用
  192. string app_custype
  193. string app_tele // 分销系统 与圣萝莎重用
  194. string app_address // 分销系统 与圣萝莎重用
  195. string app_freight // 分销系统 与圣萝莎重用
  196. string app_freight_tele // 分销系统 与圣萝莎重用
  197. string app_comname // 分销系统企业名
  198. string app_comtele // 分销系统企业电话
  199. long app_usertype // 分销系统用户类型 1-采购人员 2-销售人员 3-管理人员
  200. string app_fx_title_erp // 协同系统对应ERP企业名称
  201. long app_iferpuser // ERP用户
  202. // 停用
  203. string app_myrelcode // 分销系统ERP企业编号
  204. long app_relationtype // 分销系统 本企业类型(0-客户 1-供应商)
  205. // 停用
  206. boolean app_login = false
  207. // 协同系统当前已打开的窗口(以funcid为数组下标)
  208. s_fx_win s_win_open[]
  209. // 协同系统菜单
  210. //datastore ds_menu
  211. datastore sys_func_all // 协同系统全部权限的权限树,不要进行filter sort dertroy操作
  212. datastore sys_func_pwr // sys_func_pwr 存放当前用户的权限树
  213. // 协同系统龙嘉邮件邮箱(当前用户)
  214. datastore sys_ds_ljmailbox
  215. // 协同主界面默认自动刷新频率(秒)
  216. long app_retrieve_interval = 30
  217. // 协同系统配置文件
  218. string sys_fx_ini = 'fx_server.ini'
  219. string sys_fx_positon = 'fx_position.ini'
  220. // dw-F2功能显示窗体对象名用--相当于L1的clname
  221. string sys_dw_f2_win_name
  222. boolean runtimeLog = false // 是否记录日志标记,测试用
  223. string sys_kms_root = "http://kms.longjoe.com:82"
  224. end variables
  225. global type app_cust from application
  226. string appname = "app_cust"
  227. end type
  228. global app_cust app_cust
  229. type prototypes
  230. subroutine keybd_event(uint bvk,uint bscan,long dwflags,long dwextrainfo ) library 'user32.dll'
  231. Public Function Long LoadImage (Long hInst, String lpsz, Long un1, Long n1, Long n2, Long un2) Library "user32" Alias For "LoadImageA;Ansi"
  232. Public Function Integer Shell_NotifyIcon (Long dwMessage, Any lpData) Library "shell32" Alias For "Shell_NotifyIconA"
  233. Public Function Long DestroyIcon (Long hIcon) Library "user32" Alias For "DestroyIcon"
  234. function long ShellExecute32( long hWindow, string lpOperation, string lpFile, &
  235. string lpParameters, string lpDirectory, long nShowCmd ) Library "shell32" Alias For "ShellExecuteA;Ansi"
  236. Function Long HtmlHelpA (long hwnd ,string lpHelpFile , long wCommand, string dwData) Library "hhctrl.ocx" alias for "HtmlHelpA;Ansi"
  237. Function Long SetCapture(Long hwnd) library "user32"
  238. Function Long ReleaseCapture() library "user32"
  239. Function long GetTempPath (Long nBufferLength, ref string lpBuffer) Library "kernel32" Alias for "GetTempPathA;Ansi"
  240. end prototypes
  241. forward prototypes
  242. public function integer wf_create_fx_ini_file ()
  243. end prototypes
  244. public function integer wf_create_fx_ini_file ();int rslt = 1
  245. // 创建协同系统INI文件
  246. if (not FileExists(sys_fx_ini)) then
  247. FileOpen(sys_fx_ini, LineMode!, Write!, Shared!, Replace!)
  248. end if
  249. if (not FileExists(sys_fx_positon)) then
  250. FileOpen(sys_fx_positon, LineMode!, Write!, Shared!, Replace!)
  251. end if
  252. return rslt
  253. end function
  254. on app_cust.create
  255. appname="app_cust"
  256. message=create message
  257. sqlca=create transaction
  258. sqlda=create dynamicdescriptionarea
  259. sqlsa=create dynamicstagingarea
  260. error=create error
  261. end on
  262. on app_cust.destroy
  263. destroy(sqlca)
  264. destroy(sqlda)
  265. destroy(sqlsa)
  266. destroy(error)
  267. destroy(message)
  268. end on
  269. event open;//messagebox('', GetCurrentDirectory())
  270. //return
  271. Int rslt = 1
  272. String arg_msg
  273. Boolean lb_update
  274. // 编译之前进行修改,true为分销系统门店客户端,false为圣萝莎客户端
  275. boolean fxSvr = true
  276. if fxSvr then
  277. if (f_init_fxappcom() = 1) then
  278. //Open(w_fx_welcome)
  279. wf_create_fx_ini_file()
  280. Open(w_login_fx)
  281. end if
  282. return
  283. end if
  284. uo_reghelper ll_reghelper
  285. ll_reghelper = Create uo_reghelper
  286. AppCom = Create oleobject
  287. IF ll_reghelper.ConnectToNewObject("SanrossDll.AppCom", "SanrossDll.dll", AppCom, arg_msg) <> 1 THEN
  288. rslt = 0
  289. GOTO ext
  290. END IF
  291. String url
  292. url = ProfileString('sanross.ini', 'sanross', 'url', '')
  293. //url = 'http://127.0.0.1:8087/webapi.ashx'
  294. IF AppCom.SetUrl(url) <> True THEN
  295. rslt = 0
  296. arg_msg = '初始化控件失败'
  297. GOTO ext
  298. END IF
  299. lb_update = AppCom.AutoUpdate(Ref arg_msg)
  300. IF arg_msg <> '' THEN
  301. MessageBox('提示', '自动更新失败,' + arg_msg)
  302. ELSE
  303. IF lb_update THEN
  304. MessageBox('提示', '程序更新成功,程序即将关闭,请手动重新启动')
  305. rslt = 0
  306. GOTO ext
  307. END IF
  308. END IF
  309. ext:
  310. Destroy ll_reghelper
  311. IF rslt = 1 THEN
  312. app_token = ''
  313. Open(w_login)
  314. //rslt = Message.DoubleParm
  315. IF app_login THEN
  316. //MessageBox('', 'app_login')
  317. Open(w_main)
  318. ELSE
  319. //MessageBox('', 'not app_login')
  320. END IF
  321. ELSE
  322. IF arg_msg <> '' THEN
  323. MessageBox('Error', arg_msg)
  324. END IF
  325. END IF
  326. //MessageBox('', 'app_exit')
  327. end event