• CRM合同转订单20130604


    展柜合同头
    
    insert into ZVBAK(ZCRMID,ZOPERA,ZSYSTY,ZDATE1,ZTIME1,DOC_TYPE,BUKRS,SALES_ORG,DIVISION,SALES_OFF,SALES_GRP,PSPID,PURCH_NO_C,PURCH_DATE,REQ_DATE_H,
    PMNTTRMS,
    BILL_BLOCK,
    ZFLAG,
    CFLAG,
    MANDT,
    TYPE_GROUP,
    DISTR_CHAN
    
    )
    values(${entity.FId},1,2,TO_CHAR(now(),'YYYYMMDD'),TO_CHAR(now(),'HHMMSS'),'ZS01',
    (select FCompanyId from TsDepartment
    where FId=${entity.FSalesDepartmentId}),
    (select FVkOrg from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FIndustry from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FVkbur from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FVkgrp from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FName from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FName from TuSalesOppt where FId=${entity.FSalesOpptId}),
    TO_CHAR(now(),'YYYYMMDD'),
    TO_CHAR(now(),'YYYYMMDD'),
    'D000',
    'Z1',
    0,
    0,
    810,
    1,
    '01'
    );
    
    
    insert into ZVBPA(ZCRMID,
    ZOPERA,
    ZSYSTY,
    ZDATE1,
    ZTIME1,
    MANDT,
    ZVBAK_CRMID,
    PARTN_ROLE,
    PARTN_NUMB,
    
    TYPE_GROUP,
    ZFLAG,
    CFLAG
    )VALUES(uuid(),
    1,
    2,
    TO_CHAR(now(),'YYYYMMDD'),
    TO_CHAR(now(),'HHMMSS'),
    810,
    ${entity.FId},
    'AG',
    ${entity.FSAPCustomerNum},
    
    1,
    0,
    0
    
    );
    
    
    insert into ZVBPA(ZCRMID,
    ZOPERA,
    ZSYSTY,
    ZDATE1,
    ZTIME1,
    MANDT,
    ZVBAK_CRMID,
    PARTN_ROLE,
    PARTN_NUMB,
    
    TYPE_GROUP,
    ZFLAG,
    CFLAG
    )VALUES(uuid(),
    1,
    2,
    TO_CHAR(now(),'YYYYMMDD'),
    TO_CHAR(now(),'HHMMSS'),
    810,
    ${entity.FId},
    'VE',
    (select FLoginName from TsUser where FId=${entity.FSignedUserId}),
    
    1,
    0,
    0
    );
    
    
    
    

      

    insert into ZVBAP(MANDT,ZCRMID,ZOPERA,ZSYSTY,ZDATE1,ZTIME1,
    ZVBAK_CRMID,
    TYPE_GROUP,
    REQ_QTY,
    MATERIAL,
    PLANT,
    TARGET_QTY,
    COND_TYPE,
    COND_VALUE,
    CURRENCY,
    ZFLAG,
    CFLAG
    )
    values
    (810,
    uuid(),
    1,
    2,
    TO_CHAR(now(),'YYYYMMDD'),
    TO_CHAR(now(),'HHMMSS'),
    ${entity.FContractId},
    1,
    1,
    (
    select 
    case FAmountType
    when to_nchar('现场') then 'S000003'
    when to_nchar('柜台') then 'S000002'
    when to_nchar('设计费') then 
    (select 
      case FProperty
      when to_nchar('Design') then 'S0019'
      else 'S00001'
      end
      from TuSalesOppt where FId=(select FSalesOpptId from TcContract where FId=${entity.FContractId})
      
    )
    else 'S00004'
    
    end
    from TcContractDetail 
    where FId='734b6013-667e-4836-a3bb-87e31969b98e'),
    (
    select FCompanyId from TsDepartment  where FId=(select FSalesDepartmentId from TcContract where FId=${entity.FContractId})),
    1,
    'ZPR0',
    ${entity.FAmount},
    'CNY',
    0,
    0
    
    )
    

      

    java新手自学群 626070845
    java/springboot/hadoop/JVM 群 4915800
    Hadoop/mongodb(搭建/开发/运维)Q群481975850
    GOLang Q1群:6848027
    GOLang Q2群:450509103
    GOLang Q3群:436173132
    GOLang Q4群:141984758
    GOLang Q5群:215535604
    C/C++/QT群 1414577
    单片机嵌入式/电子电路入门群群 306312845
    MUD/LIB/交流群 391486684
    Electron/koa/Nodejs/express 214737701
    大前端群vue/js/ts 165150391
    操作系统研发群:15375777
    汇编/辅助/破解新手群:755783453
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    React 组件生命周期
    React Ant Design Mobile 中 ListView 简单使用,搞懂每一行代码
    .net网站自动化部署-致两年前的遗留的问题
    【479】cross-entropy与softmax的求导
    【478】Victor Zhou深度学习链接
    网站高并发大流量访问的处理及解决方案
    年轻人的第一个 Docker 应用,大大提高生产力!
    Spring Boot 静态资源处理,妙!
    Spring 配置最好不要配置 xsd 版本号!
    自己动手实现一个简单的 IOC,牛皮!!
  • 原文地址:https://www.cnblogs.com/cfas/p/3117242.html
Copyright © 2020-2023  润新知