2022.07.18更新BOM附加成品产品资料相关信息(标准单位,扩展属性4,5),感谢常德老师的左连接的写法指导,感谢十二老师的指导 int test() { return 1; }; int main() { if(is_user_in_group("BOM完整版")) { string v,v1; v="select pcode as 部门,a.res_id as 成品编号,a.res_id as 成品名称,"; v=v+"a.ext_2 as BOM编号,a.ext_3 as BOM版本日期,a.ext_1 as 序号,a.sub_res_id as 组成材料编号,b.res_name as 组成材料名称,"; v=v+"b.res_unit_type as 材料单位,a.num as 需求量,a.ext_4 as 反向用量,a.note_info as 备注 from res_composing a,res b where a.sub_res_id=b.res_id and pcode in ('XC','MB','DY')"; v1="select o.部门,p.ext_5 as 客户,o.成品编号,o.成品名称,p.res_unit_type as 成品单位,p.ext_4 as 每箱数量,o.BOM编号,o.BOM版本日期,o.序号,o.组成材料编号,o.组成材料名称,o.材料单位," v1=v1+"o.需求量,o.反向用量,o.备注 from ( " + v + " ) o left join (select * from res) p on o.成品编号 = p.res_id" db_run(v1); db_map("res_unit_type","成品单位","成品单位"); db_map("eba","客户","客户"); db_map("res_unit_type","材料单位","材料单位"); db_map("res","成品名称","成品名称"); db_sort_ext('成品编号,序号'); db_show('线材部&面板部&电源部_BOM清单合并版') }; else{ msg('没有权限查看全部BOM清单,请联系管理员!Không được phép xem toàn bộ danh sách BOM, vui lòng liên hệ quản trị viên!')}; //msg('更新完成'); return 1; }; |