handle no month situation for sales plug
This commit is contained in:
parent
3447f9d48c
commit
6794d8ff9a
24
fpvt.frm
24
fpvt.frm
@ -92,8 +92,8 @@ Private Sub lbMonth_Change()
|
||||
Dim i As Long
|
||||
For i = 0 To 13
|
||||
If lbMonth.Selected(i) Then
|
||||
mline = i
|
||||
If i <> 0 And i <> 13 Then
|
||||
mline = i
|
||||
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 opmvol Then
|
||||
fVolm = (pVolm + bVolm) * pchange
|
||||
If nomonth Then
|
||||
fVolm = fValm / bPrcm
|
||||
fPrcm = bPrcm
|
||||
Else
|
||||
fVolm = pVolm + bVolm
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user