01. DADOS GERAIS
Linha de Produto: | Microsiga Protheus |
---|
Segmento: | Recursos Humanos |
---|
Módulo: | SIGAGPE |
---|
Função: | GPEA180 |
---|
Ticket: | 8765719 |
---|
Issue: | DRHGCH-19067 |
---|
02. SITUAÇÃO/REQUISITO
Sistema apresenta error log ao executar rotina automática de transferência.
03. SOLUÇÃO
Ajuste na rotina para que a transferência seja concluída quando os campos Item Contábil, Classe Valor estão preenchido e parâmetro MV_ITMCLVL igual a 1 ou 3.
Ao utilizar o exemplo de função Transf(), anexada ao chamado, será necessário realizar um ajuste no fonte, para que a transferência seja efetivada. Adicione todos os campos obrigatórios conforme uma transferência realizada via browser, na rotina GPEA180 - Transferência.
Abaixo temos um exemplo de preenchimento dos campos Centro de Custo, Item Contábil e Matricula, para realizar uma transferência de centro de custo:
Bloco de código |
---|
language | cpp |
---|
theme | DJango |
---|
firstline | 24 |
---|
title | Exemplo preenchimento de campos obrigatórios em rotina automática: |
---|
linenumbers | true |
---|
collapse | true |
---|
|
dDataTransf := StoD("20160303")
aAdd( aCampos, { "RA_CLVL", "002" } )
aAdd( aCampos, { "RA_CC" , " CC000008" } )
aAdd( aAutoItens, { "D MG 01 ", "000118", aCampos } ) |
Exemplo completo rotina automática de transferência, função Transf():
Bloco de código |
---|
language | cpp |
---|
theme | DJango |
---|
firstline | 1 |
---|
title | Função Transf() |
---|
linenumbers | true |
---|
collapse | true |
---|
|
#INCLUDE "Protheus.CH"
#iNCLUDE 'TBICONN.CH'
#Include 'FWMVCDef.ch'
#DEFINE CRLF Chr(13)+Chr(10)
//////////////ROTINA AUTOMATICA/////////////
//////////////////GPEA180///////////////////
User Function TRANSF()
Local aAutoItens := {}
Local aCampos := {}
Local aLogAuto := {}
Local dDataTransf := CtoD("//")
Private lMsErroAuto := .F.
PREPARE ENVIRONMENT EMPRESA "T1" FILIAL "D MG 01 " MODULO "GPE"
ConOut(Repl("-",80))
ConOut("Inicio: "+Time())
ConOut(PadC("Rotina Automatica Transferencia de funcionarios - SRA",80))
dDataTransf := StoD("20160303")
aAdd( aCampos, { "RA_CLVL", "002" } )
aAdd( aCampos, { "RA_CC" , " CC000008" } )
aAdd( aAutoItens, { "D MG 01 ", "000118", aCampos } )
//chamada ExecAuto
MSExecAuto( {|x,y,z,w| GPEA180(x,y,z,w)}, 6, aAutoItens, dDataTransf, .T.)
If !lMsErroAuto
ConOut("Transferencia efetuada!")
Else
If !IsBlind()
aLogAuto:= MostraErro('Null')
varinfo("aLogAuto",aLogAuto)
Else
MostraErro() //caso acionada via interface.
EndIf
ConOut("Erro na Transferencia!")
EndIf
ConOut("Fim : "+Time())
ConOut(Repl("-",80))
RESET ENVIRONMENT
Return NIL |
05. ASSUNTOS RELACIONADOS
Exemplo Rotina Automática(ExecAuto) - GPEA180
HTML |
---|
<style>
div.theme-default .ia-splitter #main {
margin-left: 0px;
}
.ia-fixed-sidebar, .ia-splitter-left {
display: none;
}
#main {
padding-left: 10px;
padding-right: 10px;
overflow-x: hidden;
}
.aui-header-primary .aui-nav, .aui-page-panel {
margin-left: 0px !important;
}
.aui-header-primary .aui-nav {
margin-left: 0px !important;
}
</style>
|