GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 25
→
WX (Windev, Webdev e Windev Mobile) - Cálculo do Pix para QRCODE
WX (Windev, Webdev e Windev Mobile) - Cálculo do Pix para QRCODE
Iniciado por Boller, jun., 02 2021 11:34 PM - 2 respostas
Conecte-se…
Boller
#1
Membro registado
3.651 mensagems
Popularité : +175 (223 votes)
Publicado em junho, 02 2021 - 11:34 PM
Boa noite a todos
Abaixo segue o código enviado pelo Paulo Viana
Procedure
rot_pix
(
chave
)
meuvalor
is string
=
chave
n
Tamanho
is int
=
Length
(
meuvalor
)
n
Poly
is
2
-
byte
unsigned
int
=
0x1021
Wcrc
is
2
-
byte
unsigned
int
=
0xFFFF
FOR i
=
1
_TO_
Length
(
meuvalor
)
Wcrc
=
BinaryXOR
(
Wcrc
,
Asc
(
meuvalor
[
[i]
]
)
bitLeftShift
8
)
FOR j
=
0
TO
7
IF
(
Wcrc
&
0x8000
)
THEN
Wcrc
=
(
Wcrc bitLeftShift
1
) |
|
0x1021
ELSE
Wcrc
=
Wcrc bitLeftShift
1
END
END
END
RESULT
(
chave
+
IntToHexa
(
Wcrc
)
[
[
5
TO
]
]
)
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Denunciar
0
0
Boller
#2
Membro registado
3.651 mensagems
Popularité : +175 (223 votes)
Publicado em junho, 02 2021 - 11:43 PM
muito obrigado Paulo Viana da i9 sempre ajudando com exemplos
show de bola
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Denunciar
0
0
Boller
#3
Membro registado
3.651 mensagems
Popularité : +175 (223 votes)
Publicado em agosto, 20 2022 - 3:03 PM
/
/
NOVO CODIGO
IF EDT_Valor
<
=
0
THEN
Info
(
"Informe Um Valor Válido"
)
ReturnToCapture
(
EDT_Valor
)
ELSE
cyValorDoc
is currency
=
EDT_Valor
sCChavePix
is string
=
"+5591984311845"
sIdentificacao
is string
=
"JOSE WILLEM DO NASCIMENTO"
/
/
Nome do beneficiário
(
até
25
letras
)
sCidade
is string
=
"BELEM"
sCEP
is string
=
"66625410"
sDoc
is string
=
"000000164"
/
/
sDoc
=
/
/
Initializes the generator of random numbers
InitRandom
(
)
sRandomString is string
/
/
Generates the random string
LOOP
(
25
)
/
/
Generates a number at random in the
65
-
122
(A-z)
interval
nCharacter is int
=
Random
(
65
,
122
)
/
/
Don
't take the characters included between 91 and 96
WHILE (91 <= nCharacter <= 96)
nCharacter = Random(65,122)
END
// Fills the string
sRandomString += Charact(nCharacter)
END
sRandomString
= "abc56897xbxs6565ssw89"
EDT_Identificador
= sRandomString
sDoc
= sRandomString
sString
is string
= ""
sMsg
is string
= "05" + NumToString( Length( NoSpace( Left( NoSpace(sDoc),21))),"02d") + Left(NoSpace(sDoc),21)
nTamChave
is int
= 22 + Length(NoSpace(sCChavePix))
sString = "000201" //Inicio do código para gerar o Qr-Code
sString += "26" + NumToString(nTamChave,"02d") + "0014br.gov.bcb.pix01" + NumToString( Length( NoSpace( sCChavePix )),"02d") + NoSpace( sCChavePix )
sString += "52040000"
sString += "5303986"
// essa linha que tem que ser alterada
sString += "54" + NumToString( Length( NoSpace( NumToString(cyValorDoc,"10.2f"))),"02d") + NoSpace(NumToString(cyValorDoc,"10.2f"))
sString += "5802BR"
sString += "59" + NumToString( Length( NoSpace( sIdentificacao )),"02d") + NoSpace( sIdentificacao )
sString += "60" + NumToString( Length( Left (NoSpace( sCidade),15)),"02d") + NoSpace( Left( sCidade,15))
sString += "62" + NumToString( Length( sMsg), "02d" ) + sMsg
sString += "6304"
sString
= Rot_Pix(sString)
EDT_Pix
= sString
ToClipboard(sString)
BAC_Pix.Value
= sString
ImageQRCodeCenter is Image
ImageQRCodeCenter = IMG_FLAG
MyBarCode is BarCode
MyBarCode.Content
= sString
MyBarCode.TypeBarCode
= BC_QRCODE
MyBarCode.Image = ImageQRCodeCenter
MyBarCode.CorrectionError = qrcodeLevelH
MyBarCode.ImageProportion= 3
ImageBarCode is Image = BCToImage(MyBarCode,200,200)
IMG_Pix = ImageBarCode
END
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Denunciar
0
0
→ Voltar para WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto