'----****
'----**** MyBusiness POS V20
'----**** Version del script: 1.0
'----**** 19/02/2020
'----****
Public Sub Main()
n = Ambiente.Tag
nCosto = Val2( Parent.txtFields(24) )
Select Case n
Case 2,4,6,8,10,12,14,16,18,20
If nCosto = 0 Then
Exit Sub
End If
nPrecio = Val2( txtFields(n) )
nMargen = ( ( nPrecio / nCosto ) - 1 ) * 100
txtFields(n + 1) = Formato( nMargen, Ambiente.FDinero )
Case 3,5,7,9,11,13,15,17,19,21
If nCosto = 0 Then
Exit Sub
End If
nMargen = Val2( txtFields(n) )
nPrecio = ( ( nMargen / 100 ) + 1 ) * nCosto
txtFields(n - 1) = Formato( nPrecio, Ambiente.FDinero )
'Case 24
' Command1.Setfocus
End Select
End Sub
Relacionado