java调⽤⽤友eai_U811.1接⼝EAI系列之⼆--⽣成销售出库单调
⽤U8的EAI通。。。
//====================================================================//函数:
gf_voucher_xml.gf_storeout_xml( )//--------------------------------------------------------------------//描述:⽣成材料出库XML⽂件//--------------------------------------------------------------------//参数://value datawindow adw_head 主表数据所在数据窗⼝//value datawindow adw_detail 细表数据所在数据窗⼝//value datawindow adw_batch 条码表数据所在数据窗⼝//value string as_proc 操作类型:
Add(新增),Edit(修改),Delete(删除),Query(查询)//value string as_exportneedexch 导出时是否要根据对照表替换 Y/N//value string as_codeexchanged 编码是否已转换 Y/N//value string as_renewproofno 是否重新编码Y/N//--------------------------------------------------------------------//返回: integer//--------------------------------------------------------------------//⽇期: 2013年10⽉10⽇ Thursday
09:45:31//--------------------------------------------------------------------//修改历史://
//====================================================================
stringls_sender,ls_xmlstringls_data,ls_detail_pkidlongll_i,ll_finddecimalldc_price,ldc_numstringls_financial_sort
datawindow ldw_tempstringls_key
ls_sender= '002'//需要在数据库中配置//固定表头
ls_xml = "<?xml version='1.0' encoding='UTF-8'?>" + "~r~n"
//数据的表头格式
ls_xml = ls_xml + "" + "~r~n"
//增加⽂件中数据项信息 header
ls_xml = ls_xml + "" + "~r~n"ls_xml= ls_xml + "" + "~r~n"ls_data= "0"ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //收发标志 ⼊库单-收 1,出库单-发 0
ls_data = "32"ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //单据类型 09:其他出库单 11:材料出库单 32:销售出库单
ls_data = "普通销售"ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //业务类型
ls_data = "库存"ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //单据来源 采购、销售、库存、存货
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //对应业务单号
ls_data = adw_batch.Object.stock_code[1]//"0001" 仓库号需要从条码表获取
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //仓库编码
ls_data = string(date(adw_head.Object.out_date[1]),'yyyy-mm-dd')//"2013-10-17"
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //单据⽇期
ls_data = adw_head.Object.delivery_code[1]//"002"
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //单据号
ls_data = "" //根据出库类别基本档案表
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //收发类别编码//获取事务所对应的成本中⼼ 传⼊U8做为部门 前⼀个为合同⼤类,后⼀个为事务所
ls_data = gf_get_costcentre('收⼊',adw_detail.Object.business_type[1],adw_detail.Object.office_code[1])ifgf_str_isnull(ls_data) then
MessageBox("系统提⽰","未获取到事务所对应的成本中⼼!")return 0endifls_xml= ls_xml + "" + ls_data + "" + "~r~n" //部门编码
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //职员编码 业务员
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //采购类型编码 采购⼊库⽤
ls_data = adw_detail.Object.pact_sort[1]//合同类型
SELECT sms_pact_type.pact_area_type
INTO :ls_data
FROM sms_pact_type
Where sms_pact_type.pk_id= :ls_data;//根据合同类型获取
ifgf_str_isnull(ls_data) then
MessageBox("系统提⽰","未获取到合同类型对应的编码!")
Return0endifls_xml= ls_xml + "" + ls_data + "" + "~r~n" //销售类型编码 销售出库⽤
ls_data = adw_head.Object.buddy_code[1]//"00001"
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //客户编码 销售出库单、其他出库单⽤
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //客户分类
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚做什么⽤的
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //供应商编码 采购⼊库单、其他⼊库单⽤ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //订单号
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //产量
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //到货单号 采购⼊库单⽤
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //发票号 采购⼊库单、销售出库单⽤
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //发货单号 销售出库单⽤
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //到货⽇期
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //检验单号
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //检验⽇期
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //检验员 编码
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //模版号
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⽣产批号 产成品⼊库单、材料出库单⽤ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //经⼿⼈ 编码
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //备注
ls_data =user.user_name
ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //制单⼈
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //审核⼈
ls_data = adw_detail.Object.pact_code[1]//⾃定义字段1,传输合同编号
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段1
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段2
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段3
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段5
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段6
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段7
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段8
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段9
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段10
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段11
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段12
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段13
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段14
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段15
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃定义字段16
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //审核⽇期
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //税率
ls_data = adw_detail.describe("Evaluate('Lookupdisplay(money_sort)',1)") ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //币种名称
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //汇率
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //扣税类别
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "
" + ls_data + "
" + "~r~n" //不清楚XML中含义
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //不清楚XML中含义
ls_xml = ls_xml + "" + "~r~n"
//body
ls_xml = ls_xml + "
" + "~r~n"For ll_i= 1To adw_batch.RowCount()
ls_detail_pkid=adw_batch.Object.stock_out_detail_pkid[ll_i]
ll_find= adw_detail.Find("pk_id = '" + ls_detail_pkid + "'",1,adw_detail.RowCount())
ls_xml= ls_xml + "" + "~r~n"ls_data= ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //条形码
ls_data = adw_batch.Object.special_prot_code[ll_i]//"0002"
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //存货编码
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项1
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项2
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项3
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项4
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项5
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项6
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项7
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项8
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项9
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾃由项10
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //应收(发)数量
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //应收(发)件数
ldc_num =adw_batch.Object.prot_num[ll_i]
ls_data= string(ldc_num)
ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //数量(主记量数量) 应收(发)数量和数量不能同时为空。ls_data = adw_batch.describe("Evaluate('Lookupdisplay(prot_unit)'," + string(ll_i) + ")")
ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //主记量单位名称?
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //辅记量单位
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //辅记量单位名称
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //换算率?
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //件数
ldc_price = adw_detail.object.sale_price[ll_find]
ls_data= string(ldc_price)//销售单价
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //单价
ls_data = string(round(ldc_num * ldc_price,2))
ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⾦额
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //计划单价?java xml是什么
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //计划⾦额?
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //批号
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //⽣产⽇期
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //失效⽇期)
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //调拨单⼦表ID号
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //发票⼦表ID号
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //采购订单⼦表ID号
ls_data =adw_batch.Object.stack_code[ll_i]
ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //货位
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //项⽬⼤类编码
ls_data = "00"//项⽬⼤类编码固定为00
ls_xml = ls_xml + "" + ls_data + "" + "~r~n" //项⽬⼤类名称
ls_financial_sort =adw_detail.Object.financial_sort[ll_find]if
gf_get_sanyoerp_encode("SMS",'SAP',ls_financial_sort,ls_data,'09') = 0then MessageBox("系统提⽰
","获取财务类别:" + ls_financial_sort + "对应业务范围失败!") Return0endifls_xml= ls_xml + "" + ls_data + "" + "~r~n" //项⽬编码
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //项⽬名称
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项22
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项23
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项24
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项25
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项26
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项27
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项28
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项29
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项30
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项31
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项32
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项33
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项34
ls_data = ""ls_xml= ls_xml + "" + ls_data + "" + "~r~n" //表体⾃定义项35
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论