Skip to content

  • 项目
  • 群组
  • 代码片段
  • 帮助
  • 当前项目
    • 正在载入...
  • 登录 / 注册
O
OpenFlow12
  • 项目
    • 项目
    • 详情
    • 活动
    • 周期分析
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 图表
    • 比较
    • 统计图
  • 议题 363
    • 议题 363
    • 列表
    • 看板
    • 标记
    • 里程碑
  • Wiki
    • Wiki
  • 成员
    • 成员
  • 折叠边栏
  • 活动
  • 图像
  • 聊天
  • 创建新问题
  • 提交
  • 问题看板
  • OpenIssure
  • OpenFlow12
  • Issues
  • #664

已关闭
未关闭
在 11月 09, 2019 由 李顶立@leedsema 
  • 违规举报
  • 新建问题
举报违规 新建问题

按物控档领料倒扣时,判断是否最后一笔入库的条件的疑问,建议按如下修改。

DECLARE c_accept2sql1 CURSOR FORWARD_ONLY FOR Select a.sheet_lot, c.sheet_type, c.cust_no , c.sheet_date, a.sheet_sta, c.sheet_no, a.dIf_flag, a.part_no, a.mpart_no, a.unit_no, a.unit_rate, a.sheet_qty , a.sheet_qty1, a.pur_lot, obas_sheet_type.stk_sta As stk_sta1, obas_sheet_type.stkwh2_sta, obas_sheet_type.sheet_kind, obas_sheet_type.sheet_attr, c.org_no, c.create_date, c.user_no, Case When ( Case When opur_pur2.pur_qty_check = '0' Then opur_pur2.in_tempqty+ opur_pur2.in_qty + opur_pur2.scrab_tempqty+ opur_pur2.scrab_qty- opur_pur2.intl_tempqty- opur_pur2.intl_qty- opur_pur2.sheet_qty *(1-obas_part1.err_rate) Else opur_pur2.scm_in_tempqty+ opur_pur2.scm_in_qty+ opur_pur2.scm_scrab_tempqty+ opur_pur2.scm_scrab_qty- opur_pur2.scm_intl_tempqty- opur_pur2.scm_intl_qty- opur_pur2.scm_sheet_qty End) >=0 and not exists(select top 1 1 from oscm_accept_in2 ,oscm_accept_in1,obas_sheet_type where oscm_accept_in2.sheet_no=oscm_accept_in1.sheet_no and oscm_accept_in1.sheet_type=obas_sheet_type.sheet_type and obas_sheet_type.sheet_kind in ('SCM04','SCM06','SCM07','SCM09','SCM11','SCM12') and oscm_accept_in2.pur_lot=a.pur_lot and oscm_accept_in1.sheet_date>c.sheet_date )--增加判断是否是最后一笔入库单 李顶立 Then '5' Else '0' End From oscm_accept_in2 As a, @t_mo as d, obas_sheet_type, oscm_accept_in1 As c, obas_sheet_type As b, opur_pur1,opur_pur2 join obas_part1 on opur_pur2.part_no=obas_part1.part_no Where a.sheet_lot=d.mo_lot and a.sheet_no=c.sheet_no and
obas_sheet_type.sheet_type=c.sheet_type and obas_sheet_type.sheet_kind in ('SCM04','SCM06','SCM07','SCM09','SCM11','SCM12') and opur_pur2.sheet_lot=a.pur_lot and opur_pur1.sheet_no=opur_pur2.sheet_no and opur_pur1.sheet_type=b.sheet_type and b.sheet_kind in ('SFC01','SUB03') and isnull(b.sfcwhout_sw,'0')='0'

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无截止日期
0
标记
无
指派标记
  • 查看项目标记
引用: OpenIssure/OpenFlow12#664