initial rework of value calc
This commit is contained in:
parent
bbf3d84e60
commit
3447f9d48c
36
fpvt.frm
36
fpvt.frm
@ -231,11 +231,11 @@ End Sub
|
||||
'--------------------------------monthly buttons--------------------------------------
|
||||
|
||||
Private Sub opmPrice_Click()
|
||||
'calc_mval
|
||||
calc_mval
|
||||
End Sub
|
||||
|
||||
Private Sub opmVol_Click()
|
||||
'calc_mval
|
||||
calc_mval
|
||||
End Sub
|
||||
|
||||
Private Sub tbmfPrice_Change()
|
||||
@ -248,6 +248,12 @@ End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub tbMFVal_Change()
|
||||
If mline = 0 Then Exit Sub
|
||||
If clear_lb Or load_tb Then Exit Sub
|
||||
If opEditSalesM Then calc_mval
|
||||
End Sub
|
||||
|
||||
Private Sub tbmfVol_Change()
|
||||
If mline = 0 Then Exit Sub
|
||||
If clear_lb Or load_tb Then Exit Sub
|
||||
@ -560,31 +566,33 @@ Sub calc_mval()
|
||||
Dim pchange As Double
|
||||
|
||||
If IsNumeric(tbMFVal.value) Then
|
||||
fValm = tbMFVal.value
|
||||
'calculate percent change
|
||||
If (CDbl(tbmPAVal.value) + CDbl(tbMBaseVal.value)) = 0 Then Exit Sub
|
||||
pchange = CDbl(tbMFVal.value) / (CDbl(tbmPAVal.value) + CDbl(tbMBaseVal.value))
|
||||
'If (pValm + bValm) = 0 Then Exit Sub
|
||||
pchange = fValm / (pValm + bValm)
|
||||
|
||||
'plug the adjustment required
|
||||
tbMAVal = Format(CDbl(tbMFVal.value) - CDbl(tbMBaseVal.value) - CDbl(tbmPAVal.value), "#,###")
|
||||
aValm = fValm - bValm - pValm
|
||||
|
||||
|
||||
'---------if volume adjustment method is selected, scale the volume up----------------------------------
|
||||
If opmvol Then
|
||||
tbMFVol = Format((CDbl(tbMPAVol.value) + CDbl(tbMBaseVol.value)) * pchange, "#,###")
|
||||
fVolm = (pVolm + bVolm) * pchange
|
||||
Else
|
||||
tbMFVol = Format((CDbl(tbMPAVol.value) + CDbl(tbMBaseVol.value)), "#,###")
|
||||
fVolm = pVolm + bVolm
|
||||
End If
|
||||
tbMFPrice = Format(CDbl(tbMFVal.value) / CDbl(tbMFVol.value), "#.000")
|
||||
tbMAVol = Format(tbMFVol - (CDbl(tbMBaseVol) + CDbl(tbMPAVol)), "#,###")
|
||||
tbMAPrice = Format(CDbl(tbMFVal.value) / CDbl(tbMFVol.value) - ((CDbl(tbMBaseVal.value) + CDbl(tbmPAVal.value)) / (CDbl(tbMBaseVol.value) + CDbl(tbMPAVol.value))), "#.000")
|
||||
fPrcm = fValm / fVolm
|
||||
aVolm = fVolm - (bVolm + pVolm)
|
||||
aPrcm = fValm / fVolm - (bValm + pValm) / (bVolm + pVolm)
|
||||
Else
|
||||
'tbMFVal = Format(CDbl(tbMPAVal.value) + CDbl(tbMBaseVal.value), "#,###")
|
||||
tbMAVol = Format((CDbl(tbMFVol.value) - CDbl(tbMBaseVol.value) - CDbl(tbMPAVol.value)), "#,###")
|
||||
tbMAPrice = 0
|
||||
'tbMAPrice = Format(CDbl(tbMFVal.value) / CDbl(tbMFVol.value) - ((tbMBaseVal + tbMPAVal) / (tbMBaseVol + tbMPAVol)), "#.000")
|
||||
aVolm = fVolm - bVolm - pVolm
|
||||
aPrcm = 0
|
||||
End If
|
||||
tbMFVal = Format(tbMFVal, "#,###")
|
||||
|
||||
Me.load_mbox
|
||||
Me.load_array
|
||||
|
||||
End Sub
|
||||
|
||||
Sub calc_mprice()
|
||||
|
Loading…
Reference in New Issue
Block a user