handle adjustments with -0- basis
This commit is contained in:
parent
111121a801
commit
08a64f4592
11
fpvt.frm
11
fpvt.frm
@ -624,12 +624,18 @@ Sub calc_val()
|
||||
|
||||
'---------if volume adjustment method is selected, scale the volume up----------------------------------
|
||||
If opPlugVol Then
|
||||
If (pVal + bVal) = 0 Then
|
||||
If (Round(pVal, 2) + Round(bVal, 2)) = 0 Then
|
||||
pchange = 0
|
||||
If co_num(pVal, bVal) = 0 Then
|
||||
MsgBox ("a new part was added, and then adjusted to -0-")
|
||||
Else
|
||||
fVol = fVal / (co_num(bVal, pVal) / co_num(bVol, pVol))
|
||||
End If
|
||||
Else
|
||||
pchange = fVal / (pVal + bVal)
|
||||
End If
|
||||
fVol = (pVol + bVol) * pchange
|
||||
End If
|
||||
|
||||
Else
|
||||
fVol = pVol + bVol
|
||||
End If
|
||||
@ -660,6 +666,7 @@ Sub calc_val()
|
||||
If opPlugVol Then
|
||||
adjust("type") = "scale_v"
|
||||
adjust("amount") = aVal
|
||||
adjust("qty") = aVol
|
||||
Else
|
||||
adjust("type") = "scale_p"
|
||||
adjust("amount") = aVal
|
||||
|
@ -161,7 +161,7 @@ On Error GoTo errh
|
||||
Dim i As Integer
|
||||
Call Me.get_sheet
|
||||
Dim vp As String
|
||||
vp = Sheets("month").Range("R2")
|
||||
vp = Sheets("month").Range("Q2")
|
||||
|
||||
For i = 1 To 12
|
||||
If sales(i, 5) = "" Then sales(i, 5) = 0
|
||||
|
Loading…
Reference in New Issue
Block a user