Foxtable(狐表)用户栏目专家坐堂 → [求助]


  共有4145人关注过本帖平板打印复制链接

主题:[求助]

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


加好友 发短信
等级:超级版主 帖子:106688 积分:542629 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/12/8 18:28:00 [只看该作者]

Dim t1 As Table = Tables("Shipment.customsinvoice")
If t1.Rows.Count = 0 Then Return ""
Dim cr1 As Row
Dim cr2 As Row


Dim str As String = ""
For i As Integer = t1.TopPosition To t1.BottomPosition
    str = str & "," & t1.Rows(i)("_Identify")
Next


str = str.Trim(",")
t1.Filter = "supplier <> 'GSS' and [_Identify] in (" & str & ")"
Dim cr As Row
Dim Total As Double
Dim Totalp As Double

If t1.Rows.Count > 1 Then
    
    cr = t1.Rows(0)
    Total = cr("Netweight_Total")
    Totalp = cr("Totalprice")
    For i As Integer = t1.Rows.Count - 1 To 1 Step -1
        If cr("ShippingNO") = t1.Rows(i)("ShippingNO") AndAlso cr("NameinChinese") = t1.Rows(i)("NameinChinese") AndAlso cr("Unit") = t1.Rows(i)("unit") AndAlso cr("HS") = t1.Rows(i)("HS") AndAlso cr("Declaration") = t1.Rows(i)("Declaration") AndAlso cr("PO_UnitPrice") = t1.Rows(i)("PO_UnitPrice")
            cr("Qty") += val(t1.Rows(i)("Qty"))
            cr("TotalPrice") += val(t1.Rows(i)("TotalPrice"))
            cr("GrossWeight_total") += val(t1.Rows(i)("GrossWeight_Total"))
            '   cr("Netweight_Total") += val(t.Rows(i)("Netweight_Total"))
            Total += val(t1.Rows(i)("Netweight_Total"))
            cr("Netweight_PC") = Total /cr("Qty")
            Totalp += val(t1.Rows(i)("Totalprice"))
            cr("PO_UnitPrice") = Totalp /cr("Qty")
            cr("GSSPartNo") &= ","  & t1.Rows(i)("GSSPartNo")
            t1.Rows(i).delete
        Else
            cr = t1.Rows(i)
        End If
    Next
    
End If



t1.Filter = "supplier = 'GSS' and [_Identify] in (" & str & ")"
If t1.Rows.Count <= 1 Then
    t1.Filter = ""
    Return ""
End If
msgbox(1)
cr = t1.Rows(0)
Total  = cr("Netweight_Total")
Totalp  = cr("Totalprice")
For i As Integer = t1.Rows.Count - 1 To 1 Step -1
    If cr("ShippingNO") = t1.Rows(i)("ShippingNO") AndAlso cr("MaterialName") = t1.Rows(i)("MaterialName") AndAlso cr("Unit") = t1.Rows(i)("unit") AndAlso cr("HS") = t1.Rows(i)("HS")
        cr("Qty") += val(t1.Rows(i)("Qty"))
        cr("TotalPrice") += val(t1.Rows(i)("TotalPrice"))
        cr("GrossWeight_total") += val(t1.Rows(i)("GrossWeight_Total"))
        '   cr("Netweight_Total") += val(t.Rows(i)("Netweight_Total"))
        Total += val(t1.Rows(i)("Netweight_Total"))
        cr("Netweight_PC") = Total /cr("Qty")
        Totalp += val(t1.Rows(i)("Totalprice"))
        cr("PO_UnitPrice") = Totalp /cr("Qty")
        cr("GSSPartNo") &= ","  & t1.Rows(i)("GSSPartNo")
        t1.Rows(i).delete
    Else
        cr = t1.Rows(i)
    End If
Next
t1.Filter = ""

 回到顶部
总数 64 1 2 3 4 5 6 7 下一页