FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WINDEV 25
→
Aula 1100 - Windev - Dicas 027/... - Historico Erp 4/Final
Aula 1100 - Windev - Dicas 027/... - Historico Erp 4/Final
Iniciado por amarildo, 23,mar. 2017 09:48 - 2 respuestas
Conéctese…
amarildo
#1
Miembro registrado
535 mensajes
Popularité : +14 (14 votes)
Publicado el 23,marzo 2017 - 09:48
Na Aula de hoje, vamos finalizar Historico Erp
No Cadastro de Empresas,em parametros Nfe/Nfce,
tem duas informações muito importantes que vamos gravar
no historico Erp, para segurança.
//Abertura da window
//Gravar Historico Erp
//Save History
gs
_EDT_Tipo_ambiente_nfe
is string
=
""
gs
_EDT_Tipo_ambiente_nfce
is string
=
""
gs
_motivo_alteracao_nfe
is string
=
""
gs
_motivo_alteracao_nfce
is string
=
""
//Vou Criar 4 Variaveis que vou precisar usar
//I will create 4 variables that I will need to use
//Gravar Historico Erp
//Colocar informacoes
MyWindow
..
ReturnedValue
=
False
IF
empresa_parametro_nfe
..
NewRecord
=
True
THEN
//Se for inclusão de um parametro
//If a parameter is included
dados_iniciais
(
)
ELSE
//Gravar Historico Erp
//Save History
gs
_EDT_Tipo_ambiente_nfe
=
E
DT_Tipo_ambiente_nfe
gs
_EDT_Tipo_ambiente_nfce
=
E
DT_Tipo_ambiente_nfce
//Salvar informações antes da alteração
//Save information before change
END
//saida do edt tipo ambinente nfe
IF
gs
_EDT_Tipo_ambiente_nfe
<
>
E
DT_Tipo_ambiente_nfe
THEN
//Se foi modificado esse campo
//If you have modified this field
LOOP
//vou fazer um loop
//I'm going to do a loop
Input
(
"Digite o Motivo Para Alterar Tipo Ambiente Nfe:"
,
gs
_motivo_alteracao_nfe
)
//Tem de digitar o Motivo - obrigatório
//You must enter Reason - required
IF
gs
_motivo_alteracao_nfe
=
""
THEN
//se motivo estiver em branco, vou informar que é obrigatorio
//If reason is blank, I will inform you that it is mandatory
Info
(
"Favor Digitar o Motivo,é obrigatório"
)
ELSE
//Senão
BREAK
//sai do loop
//Get out of the loop
END
END
END
Informar
0
0
amarildo
#2
Miembro registrado
535 mensajes
Popularité : +14 (14 votes)
Publicado el 23,marzo 2017 - 09:48
//Saida tipo ambinente nfce
LOOP
Input
(
"Digite o Motivo Para Alterar Tipo Ambiente Nfce:"
,
gs
_EDT_Tipo_ambiente_nfce
)
IF
gs
_EDT_Tipo_ambiente_nfce
=
""
THEN
Info
(
"Favor Digitar o Motivo,é obrigatório"
)
ELSE
BREAK
END
END
//Rotina Gravar Historico
//Routine Record History
//Nas Futuras Aulas Essa Rotina será transformada uma classe para ser reaproveitada por outros
//In the Future Classes This Routine will be transformed into a class to be reused by others
HReadSeekFirst
(
usuario_matos
,
nome
,
gs
_usuario_nome
)
//Lendo Usuario
//Reading User
b
_grava_historico_Erp
is boolean
=
False
//Criando uma variavel boolean para ver se é para gravar historico
//Creating a boolean variable to see if it is to record history
s
_acao_feita
is string
=
""
//Criando Variavel açao feita
//Creating Variable action done
IF
gs
_EDT_Tipo_ambiente_nfe
<
>
E
DT_Tipo_ambiente_nfe
THEN
//Se foi alterado entao o grava historico sera igual a verdadeiro
//If it has been changed then the historical record will be equal to true
b
_grava_historico_Erp
=
True
s
_acao_feita
+
=
"Alterado Tipo Ambiente Nfe Para["
+
E
DT_Tipo_ambiente_nfe
+
"]"
+
CR
s
_acao_feita
+
=
" Motivo["
+
gs
_motivo_alteracao_nfe
+
"]"
+
CR
//Está sendo colocado acao feita e o sinal de +,pois estou acrescentando informação
//The action is done and the + sign, because I am adding information
//Estou Colocando Cr, pois vou fazer pular de linha
//I'm putting Cr, because I'm going to make the line jump
END
//Vou fazer o mesmo para nfce
//I'll do the same for you
IF
gs
_EDT_Tipo_ambiente_nfce
<
>
E
DT_Tipo_ambiente_nfce
THEN
b
_grava_historico_Erp
=
True
s
_acao_feita
+
=
"Alterado Tipo Ambiente Nfc-e Para["
+
E
DT_Tipo_ambiente_nfce
+
"]"
+
CR
s
_acao_feita
+
=
" Motivo["
+
gs
_motivo_alteracao_nfce
+
"]"
+
CR
END
IF
b
_grava_historico_Erp
=
True
THEN
//Se grava historico é igual a verdadeiro
//If historical record is equal to true
HReset
(
Historico_Erp
)
//Atribuir os valores padrão ao historico
//Assign default values to history
//https://doc.windev.com/en-US/?3044118&name=HReset
_titulo
is string
=
"Parametros Nfe/Nfce"
//Criando uma variavel titulo para parametro
//Creating a Variable Title for Parameter
HReadSeekFirst
(
Historico_Erp
,
titulo
,
_titulo
)
//Lendo Historio erp
//Reading erp story
IF
HFound
(
Historico_Erp
)
THEN
//Se encontrou historico erp
//If you found historical erp
ELSE
//Se não existir vamos criar um novo historico erp
//If it does not exist let's create a new erp history
Historico_Erp.titulo
=
_titulo
HAdd
(
Historico_Erp
)
//Gravando um registro novo historico erp
//Recording a new historical record erp
END
HReset
(
historico_erp_itens
)
//Atribuir os valores padrão aos itens do historio itens
//Assign Default Values to Items in History Items
historico_erp_itens.Historico_ErpID
=
Historico_Erp.Historico_ErpID
//Colocando erpid do historico erp no historio item erp
//Put erpid of historical erp in history item erp
historico_erp_itens.data
=
DateSys
(
)
//estou colocando a data atual
//I'm putting the current date
historico_erp_itens.hora_alteracao
=
Now
(
)
//estou colocando a hora atual
//I am putting the current time
historico_erp_itens.acao_feita
=
s
_acao_feita
historico_erp_itens.valor
=
0
historico_erp_itens.id_empresa
=
gn
EmpresaCodigo
historico_erp_itens.id_usuario
=
usuario_matos.usuario_matosID
historico_erp_itens.nome_usuario
=
gs
_usuario_nome
//acrescentando os outros dados
//Adding the other data
HAdd
(
historico_erp_itens
)
//Gravando um registro novo historico erp item
//Recording a new historical record erp item
END
Informar
0
0
amarildo
#3
Miembro registrado
535 mensajes
Popularité : +14 (14 votes)
Publicado el 23,marzo 2017 - 09:49
http://windevdesenvolvimento.blogspot.com.br/2017/03/aula-1100-windev-dicas-027-historico.html
https://www.youtube.com/watch?v=ZlIPQO_o-CA
Informar
1
0
→ Volver a WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto