zoukankan      html  css  js  c++  java
  • 单身金额统计,更新显示到单头

     范例(cxmt052)当单身新增、修改、删除时,汇总单身的应付金额,更新并显示到单头上;

    1、自定义函数,主要是用在单身新增、修改时调用:

    1)

    PRIVATE FUNCTION cxmt052_totalPrice()
        #定义变数
        DEFINE id INT
        DEFINE totalPrice LIKE xmcnuc_t.xmcnuc007
        #初始化应付总金额
        LET totalPrice = 0
        #遍历单身计算应付总金额
        FOR id = 1 TO g_xmcouc_d.getLength()
            LET totalPrice = totalPrice + g_xmcouc_d[id].xmcouc010
        END FOR
        LET  g_xmcnuc_m.xmcnuc007 = totalPrice
        DISPLAY BY NAME g_xmcnuc_m.xmcnuc007
        #更新单头应付总金额
        UPDATE xmcnuc_t SET xmcnuc007 = totalPrice
            WHERE xmcnucent = g_enterprise AND xmcnucdocno = g_xmcnuc_m.xmcnucdocno
    END FUNCTION

    2)单身新增后:

                   #add-point:單身新增後 name="input.body.a_insert"
                    CALL cxmt052_totalPrice()
                   #end add-point

    3)单身修改更新后:

                   #add-point:單身修改後 name="input.body.a_update"
                    CALL cxmt052_totalPrice()
                   #end add-point

    2、单身删除时,在程序执行完毕后,行才会在单身列表中删掉,所以在这里遍历单身汇总金额的时候,要把删除的那条数据排除不汇总

       #add-point:delete_b段define(客製用) name="delete_b.define_customerization"
        DEFINE id INT
        DEFINE totalPrice LIKE xmcnuc_t.xmcnuc007
       #end add-point 


          #add-point:delete_b段刪除前 name="delete_b.b_delete"
    
          #end add-point    
          DELETE FROM xmcouc_t
           WHERE xmcoucent = g_enterprise AND
             xmcoucdocno = ps_keys_bak[1] AND xmcoucseq = ps_keys_bak[2]
          #add-point:delete_b段刪除中 name="delete_b.m_delete"
    
            LET totalPrice = 0
            FOR id = 1 TO g_xmcouc_d.getLength()
                IF g_xmcouc_d[id].xmcoucseq = ps_keys_bak[2] THEN
                    CONTINUE FOR
                END IF
                LET totalPrice = totalPrice + g_xmcouc_d[id].xmcouc010
            END FOR
            LET  g_xmcnuc_m.xmcnuc007 = totalPrice
            DISPLAY BY NAME g_xmcnuc_m.xmcnuc007
            UPDATE xmcnuc_t SET xmcnuc007 = totalPrice
                WHERE xmcnucent = g_enterprise AND xmcnucdocno = g_xmcnuc_m.xmcnucdocno
                
          #end add-point
  • 相关阅读:
    Linux-第一天
    Hadoop学习10--常用命令记录帖
    C# asp.net repeater实现排序功能,自动排序,点击头部排序,点击列排序
    图片与字符之间的转换
    兼容浏览器 div固定浏览器窗口底部 浮动div
    解决QQ未启用状态,QQ留言图标未启用
    C#Cookie操作类,删除Cookie,给Cookie赋值
    vs2008bin下Debug bll Release文件 obj下的Debug bll Release文件区别
    asp.net限制了上传文件大小为..M,解决方法
    多文件上传ajax jquery
  • 原文地址:https://www.cnblogs.com/xiaoli9627/p/6874009.html
Copyright © 2011-2022 走看看