Foxtable(狐表)用户栏目专家坐堂 → 【求助】按月生成数据已经初步实现,怎么实现按月生成定金,首付款,尾款数据呢?


  共有1780人关注过本帖树形打印复制链接

主题:【求助】按月生成数据已经初步实现,怎么实现按月生成定金,首付款,尾款数据呢?

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/12/1 8:59:00 [显示全部帖子]

If e.DataCol.Name = "年份" orelse e.datacol.name = "门店名称" Then
    Dim cns() As String = {"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"}
    If e.DataRow.IsNull(e.DataCol.name) Then
        For Each cn As String In cns
            e.DataRow(cn) = Nothing
        Next
    Else
        Dim filter = "(订单门店 = '"  & e.DataRow("门店名称") & "')"
        For i As Integer = 0 To cns.Length - 1
            Dim d As Date = new Date(cint(e.newValue), i+1, 1)
            e.DataRow(cns(i) & "_订单总额") = DataTables("订单主表").compute("sum(订单总额)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
            e.DataRow(cns(i) & "_定金") = DataTables("订单主表").compute("sum(定金)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
            e.DataRow(cns(i) & "_首付款") = DataTables("订单主表").compute("sum(首付款)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
            e.DataRow(cns(i) & "_尾款") = DataTables("订单主表").compute("sum(尾款)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
        Next
    End If
End If

 回到顶部