PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Aula 1031 - Dicas - 012 - Pegar Saldo Anterior Caixa
Aula 1031 - Dicas - 012 - Pegar Saldo Anterior Caixa
Started by amarildo, Jan., 11 2017 8:42 AM - 1 reply
Connect yourself…
amarildo
#1
Registered member
535 messages
Popularité : +14 (14 votes)
Posted on January, 11 2017 - 8:42 AM
// 1) Nessa aula de hoje, vou mostrar como pegar o saldo incial do caixa.
// 2) Vamos ter um campo saldo inicial do caixa conta
// 3) vamos fazer uma query lendo os totais de entrada e saida
// 4) Vamos atualizar o saldo
//Qry_Saldo_caixa_Inicial
SELECT
Sum
(
caixa.valor_entradas
)
AS total_valor_entradas
,
Sum
(
caixa.valor_saidas
)
AS total_valor_saidas
FROM
caixa
WHERE
caixa.id_empresa
= {
Parametro_empresa
}
AND
caixa.Caixa_contaID
= {
Parametro_contaID
}
AND
caixa.data_documento
<
{
Parametro_data_inicial
}
//
//Chama Rotina Saldo Caixa
saldo_caixa
(
)
//Rotina Saldo Caixa
Procedure
saldo_caixa
(
)
HReadSeekFirst
(
caixa_conta
,
caixa_contaID
,
gn
_recebe_id_conta
)
cy_saldo_inicial is
currency
=
caixa_conta.saldo_inicial
// Iniciar 100,00
qry_saldo_caixa_inicial.Parametro_contaID
=
gn
_recebe_id_conta
// 1
qry_saldo_caixa_inicial.Parametro_data_inicial
=
EDT_
Data_Inicial
// 10 01 2017
qry_saldo_caixa_inicial.Parametro_empresa
=
gn
EmpresaCodigo
// 1
HExecuteQuery
(
qry_saldo_caixa_inicial
,
hQueryDefault
)
// executando query
cy_saldo_entradas is
currency
=
qry_saldo_caixa_inicial.total_valor_entradas
//vai somar todas entradas menores que a data inicial = 09 01 2017
cy_saldo_saidas is
currency
=
qry_saldo_caixa_inicial.total_valor_saidas
//vai somar todas saidas menores que a data inicial = 09 01 2017
cy_saldo_inicial
=
cy_saldo_inicial
+
cy_saldo_entradas
-
cy_saldo_saidas
EDT_
Saldo_Anterior
=
cy_saldo_inicial
http://windevdesenvolvimento.blogspot.com.br/2017/01/aula-1031-dicas-012-pegar-saldo.html
Report
0
0
BOLLER
#2
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on February, 09 2017 - 11:07 AM
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
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