今天在论坛看到有用户需要用企业微信发送工资条,官方回复后续会考虑添加这个功能,我今天临时写了这个脚本分享出来供有需要的人参考 int init_test() { return 1; }; int create_voucher() { return 1; }; int func_show() { if(is_user_in_group("工资单制单"))//添加一个操作员分组,把有权限发送工资信息的操作员添加进来 { gui_create_speedbutton("Panel_Func","QiYeWxTz",950,7,180,22,"发送工资信息到员工企业微信","call_csp.voucher.IA.QiYeWxTz"); }; return 1; }; int adjust_row() { return 1; }; int func_before_print() { //can_print=1; return 1; }; int func_before_save() { //can_save=1; return 1; }; int func_after_check() { return 1; }; int func_after_print() { return 1; }; int func_after_show_wage_data() { return 1; }; int QiYeWxTz() { int i,grid_rows; string v_id,v_qywx,v_name,m_yf,v_gh,v_xm,v_bm,v_gw,v_jbgz,v_wpbt,v_zfbt,v_cfbt; string v_hfbt,v_jbbt,v_sfgz,v_jzje,v_qtkk,v_yfgz,v_bz,v_gzxx,v_bz,m_dqrq,m_dqsk,m_xq; m_yf = str_cut(gui_get_val("DateTimePicker_Data_Month"),6) m_dqrq = fmt_date(get_cur_date(),'yyyy 年 mm 月 dd 日'); m_xq = get_week_id(get_serv_date()); m_dqsk = get_cur_time(); grid_rows = grid_row_num('MG_Item'); for(i=1;i<grid_rows;i++) { v_id = grid_get_v("MG_Item","emp_id",i); v_name = grid_get_v("MG_Item","emp_name",i); v_bm = grid_get_v("MG_Item","dept_name",i); v_gw = grid_get_v("MG_Item","dept_post_name",i); v_jbgz = wage_get_emp_subject_data(v_id,m_yf,'A01'); v_wpbt = wage_get_emp_subject_data(v_id,m_yf,'A02'); v_zfbt = wage_get_emp_subject_data(v_id,m_yf,'A03'); v_cfbt = wage_get_emp_subject_data(v_id,m_yf,'A04'); v_hfbt = wage_get_emp_subject_data(v_id,m_yf,'A05'); v_jbbt = wage_get_emp_subject_data(v_id,m_yf,'A06'); v_yfgz = wage_get_emp_subject_data(v_id,m_yf,'A07'); v_jzje = wage_get_emp_subject_data(v_id,m_yf,'A08'); v_qtkk = wage_get_emp_subject_data(v_id,m_yf,'A09'); v_sfgz = wage_get_emp_subject_data(v_id,m_yf,'A10'); v_bz = grid_get_v("MG_Item","note_info",i); v_qywx = get_emp_info(v_id,'msn_no'); // 要在员工资料的微信栏位录入该员工的企业微信号 v_gzxx = m_yf+'月份工资条:【工号:'+v_id+'】,【姓名:'+v_name+'】,【部门:'+v_bm+'】,【岗位:'+v_gw+'】,【基本工资:' v_gzxx = v_gzxx+v_jbgz+'】,【外派补贴:'+v_wpbt+'】,【租房补贴:'+v_zfbt+'】,【餐费补贴:'+v_cfbt+'】,【话费补贴:'+v_hfbt v_gzxx = v_gzxx+'】,【加班补贴:'+v_jbbt+'】,【应发工资:'+v_yfgz+'】,【借支金额:'+v_jzje+'】,【其他扣款:'+v_qtkk v_gzxx = v_gzxx+'】,【实发工资:'+v_sfgz+'】,【备注:'+v_bz+'】,【感谢您的辛勤付出,若对收到的工资明细有疑义,请按公司规定联系相关人员处理,谢谢!】' v_gzxx = v_gzxx+'【发送日期时刻:'+m_dqrq+' '+m_dqsk+' 星期 '+m_xq+'】' if(v_id ==''){ msg('没有工资明细数据'); return 0; }if(v_id !='' && v_qywx != ''){ send_qywx_msg(v_qywx,v_gzxx); }if(v_id !='' && v_qywx == ''){ dbg('【员工:'+v_id+' '+v_name+'】的人事资料的微信栏位没有录入企业微信号,请联系人事资料维护员补录入后再发送工资信息到员工企业微信!');}; }; return 1; }; int main() { return 1; }; |