PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
New formula for calculating the taxi ride
New formula for calculating the taxi ride
Started by adrianoboller, Nov., 18 2014 1:39 PM - No answer
Connect yourself…
adrianoboller
#1
Registered member
3,660 messages
Popularité : +175 (223 votes)
Posted on November, 18 2014 - 1:39 PM
Procedure
WS_FormulaBandeirada
(
LOCAL
Porcentagem
)
TotalCorrida is
string
=
""
r
BandeiraInicial is
real
=
6.80
VlrBandeira01 is
real
=
2.30
VlrBandeira02 is
real
=
2.80
r
VlrHoraParada is
real
=
24.00
//0.40 min parado
VlrMinutoParado is
real
=
0.40
//valor do minuto
r
VlrMinutoParado30 is
real
=
0.30
//valor do minuto
VelocidadeMedia is
real
=
30
// 30km/h
// VM = D/T
//GloDistanciaDestino = WS_CEP_ConfereOrigDestRotaKmGps(O,D)
//GloTempoDestino = WS_CEP_ConfereOrigDestRotaKmGps(O,D)
IF
GloDistanciaDestino
>
0
Tempo is
real
=
0
IF
GloTempoDestino
>
0
THEN
Tempo
=
GloTempoDestino
ELSE
Tempo
= (
(
GloDistanciaDestino
/
1000
) /
VelocidadeMedia
) *
60
// Calculo da velocidade media
END
GloValorBandeira01
=
r
BandeiraInicial
+ (
(
(
VlrBandeira01
*
GloDistanciaDestino
)
/
1000
) + (
(
VlrMinutoParado
*
Tempo
)
/
60
)
)
gloValorBandeira02
=
r
BandeiraInicial
+ (
(
(
VlrBandeira02
*
GloDistanciaDestino
)
/
1000
) + (
(
VlrMinutoParado
*
Tempo
)
/
60
)
)
IF
Porcentagem
>
0
THEN
IF
gloTaxaRetorno
=
0
GloValorBandeira01
=
GloValorBandeira01
+ (
GloValorBandeira01
* (
Porcentagem
/
100
)
)
ELSE
GloValorBandeira01
= (
GloValorBandeira01
+ (
GloValorBandeira01
* (
Porcentagem
/
100
)
)
)
GloValorBandeira01
= (
GloValorBandeira01
+ (
GloValorBandeira01
* (
gloTaxaRetorno
/
100
)
)
)
// + 30% de taxa de retorno
END
IF
gloTaxaRetorno
=
0
gloValorBandeira02
=
gloValorBandeira02
+ (
gloValorBandeira02
* (
Porcentagem
/
100
)
)
ELSE
gloValorBandeira02
=
gloValorBandeira02
+ (
gloValorBandeira02
* (
Porcentagem
/
100
)
)
gloValorBandeira02
=
gloValorBandeira02
+ (
gloValorBandeira02
* (
gloTaxaRetorno
/
100
)
)
// + 30% de taxa de retorno
END
END
GloValorBandeira01
=
RoundDown
(
GloValorBandeira01
)
gloValorBandeira02
=
RoundUp
(
gloValorBandeira02
)
IF
GloValorBandeira01
=
gloValorBandeira02
THEN
gloValorBandeira02
+
=
1
END
TotalCorrida
=
"Bandeira 1: "
+
GloValorBandeira01
+
", Bandeira 2: "
+
gloValorBandeira02
+
", Distancia: "
+
GloDistanciaDestino
+
", Tempo: "
+
Tempo
//Info(TotalCorrida)
END
RESULT
(
TotalCorrida
)
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text