|
Dim a, B, c, d, e, f, g, h, i, J, k, l, m, n, p, q, r As Single
Dim pr As Currency
Me.单价 = DLookup(Me.工序名称, "产品表", "[产品编号]=" & 产品代号.Value)
pr = Nz(DLookup(Me.工序名称, "产品表", "[产品编号]=" & 产品代号.Value), 0)
a = DLookup("倍数", "样品计件参数", "[序号] = 1")
B = DLookup("倍数", "样品计件参数", "[序号] = 2")
c = DLookup("倍数", "样品计件参数", "[序号] = 3")
d = DLookup("倍数", "样品计件参数", "[序号] = 4")
e = DLookup("倍数", "样品计件参数", "[序号] = 5")
f = DLookup("倍数", "样品计件参数", "[序号] = 6")
g = DLookup("倍数", "样品计件参数", "[序号] = 7")
h = DLookup("倍数", "样品计件参数", "[序号] = 8")
i = DLookup("倍数", "样品计件参数", "[序号] = 9")
J = DLookup("倍数", "样品计件参数", "[序号] = 10")
k = DLookup("倍数", "样品计件参数", "[序号] = 11")
m = DLookup("倍数", "样品计件参数", "[序号] = 12")
p = DLookup("倍数", "样品计件参数", "[序号] = 16")
q = DLookup("倍数", "样品计件参数", "[序号] = 17")
r = DLookup("倍数", "样品计件参数", "[序号] = 18") '100PC以上(彩样)
'Me.产品名称 = DLookup("产品名称", "产品表", "[产品编号]=" & 产品代号.Value)
If [单据类型] = "CH" Or [单据类型] = "LY" Then
If Me.样品单 = True Then
If Me.[部门] = "8" Then
If Me.订单量 >= 1 And Me.订单量 <= 2 Then
Me.单价2 = pr * a
ElseIf Me.订单量 >= 3 And Me.订单量 <= 4 Then
Me.单价2 = pr * B
ElseIf Me.订单量 >= 5 And Me.订单量 <= 6 Then
Me.单价2 = pr * c
ElseIf Me.订单量 >= 7 And Me.订单量 <= 10 Then
Me.单价2 = pr * d
ElseIf Me.订单量 >= 11 And Me.订单量 <= 30 Then
Me.单价2 = pr * e
ElseIf Me.订单量 >= 31 And Me.订单量 <= 99 Then '31---99
Me.单价2 = pr * f
ElseIf Me.订单量 >= 100 Then '100以上
Me.单价2 = pr * m
End If
ElseIf Me.[部门] = "2" Then '彩绘大线
If Me.订单量 >= 1 And Me.订单量 <= 10 Then
Me.单价2 = pr * p
ElseIf Me.订单量 >= 11 And Me.订单量 <= 30 Then
Me.单价2 = pr * q
ElseIf Me.订单量 >= 31 And Me.订单量 <= 99 Then
Me.单价2 = pr * q
ElseIf Me.订单量 > 100 Then
Me.单价2 = pr
End If
ElseIf Me.[部门] = "6" Then '包装
Me.单价2 = pr * 1.5
ElseIf Me.[部门] = "1" Then '白坯大线
If Me.订单量 >= 1 And Me.订单量 <= 2 Then
Me.单价2 = pr * g
ElseIf Me.订单量 >= 3 And Me.订单量 <= 5 Then
Me.单价2 = pr * h
ElseIf Me.订单量 >= 6 And Me.订单量 <= 10 Then
Me.单价2 = pr * i
ElseIf Me.订单量 >= 11 And Me.订单量 <= 20 Then
Me.单价2 = pr * J
ElseIf Me.订单量 > 21 Then
Me.单价2 = pr
End If
ElseIf Me.[部门] = "24" Then
If Me.订单量 >= 1 And Me.订单量 <= 2 Then
Me.单价2 = pr * g
ElseIf Me.订单量 >= 3 And Me.订单量 <= 5 Then
Me.单价2 = pr * h
ElseIf Me.订单量 >= 6 And Me.订单量 <= 10 Then
Me.单价2 = pr * i
ElseIf Me.订单量 >= 11 And Me.订单量 <= 20 Then |
|