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