handle no month situation for sales plug

This commit is contained in:
Trowbridge 2019-03-06 05:02:35 -05:00
parent 3447f9d48c
commit 6794d8ff9a
2 changed files with 13 additions and 11 deletions

View File

@ -92,8 +92,8 @@ Private Sub lbMonth_Change()
Dim i As Long
For i = 0 To 13
If lbMonth.Selected(i) Then
If i <> 0 And i <> 13 Then
mline = i
If i <> 0 And i <> 13 Then
Me.load_var
Me.load_mbox
Else
@ -566,24 +566,26 @@ Sub calc_mval()
Dim pchange As Double
If IsNumeric(tbMFVal.value) Then
'get textbox value
fValm = tbMFVal.value
'calculate percent change
'If (pValm + bValm) = 0 Then Exit Sub
pchange = fValm / (pValm + bValm)
'plug the adjustment required
'do calculations
aValm = fValm - bValm - pValm
'---------if volume adjustment method is selected, scale the volume up----------------------------------
If nomonth Then
fVolm = fValm / bPrcm
fPrcm = bPrcm
Else
If opmvol Then
pchange = fValm / (pValm + bValm)
fVolm = (pVolm + bVolm) * pchange
Else
fVolm = pVolm + bVolm
End If
End If
fPrcm = fValm / fVolm
aVolm = fVolm - (bVolm + pVolm)
aPrcm = fValm / fVolm - (bValm + pValm) / (bVolm + pVolm)
aPrcm = fPrcm - (bPrcm + pPrcm)
Else
aVolm = fVolm - bVolm - pVolm
aPrcm = 0

BIN
fpvt.frx

Binary file not shown.