01.
...
GENERAL DATA
Product: | TOTVS Backoffice |
Product Line: | Microsiga Protheus Line |
Industry: | Services |
Module: | TOTVS Backoffice (Protheus Line) - Fixed Asset (SIGAFIS) |
Function: | ATFA050 - AF050FPR |
Country: | Brazil |
Ticket: | Internal |
Requirement/Story/Issue: | DSERCTR1-39974 |
02.
...
STATUS/REQUISITION
Entry point AF050FPR allows selecting certain assets to be disregarded in the Monthly Calculation of depreciation.
...
Aviso |
---|
|
The impacts caused by using the entry point are the total responsibility of the customer that implements them. You may run this EP via PROCEDURE or ADVPL. If you perform the depreciation calculation without procedure, use the EP in ADVPL; whereas, if you perform the depreciation calculation with PROCEDURE, use the EP via PROCEDURE |
03. SOLUTION
Explanation and contextualization regarding the use of the EP.
...
Totvs custom tabs box |
---|
tabs | Passo Step 01, Passo Step 02, Passo Step 03, Passo Step 04 |
---|
ids | passo1step1,passo2step2 |
---|
|
Totvs custom tabs box items |
---|
default | yes |
---|
referencia | passo1step1 |
---|
| Entry point when the Depreciation Calculation is performed by procedures. Note that, to use procedure AF050FPR, you must encode/develop it in the native language of the SGBD you are using. If you use ORACLE, encode it in ORACLE, if MSSQLSERVER, encode it in SQLSERVER and if in POSTGRES, encode it in POSTGRES. The example below is in Oracle.
Procedure to use the procedure AF050FPR or any other Entry Point in procedure. - Install the main procedure package and check whether the Entry Point was created, being mindful of parameter MV_DROPPE.
- It must be set to "F" to not delete the Entry Points.
Note this procedure is always installed in the database:
Note: note that the EP is always executed in the call of the main procedure ATF001 as follows: Bloco de código |
---|
language | sql |
---|
title | Chamada do PE EP Call via SQL |
---|
linenumbers | true |
---|
| AF050FPR_11_T1 (vcFilial , vcN3_CBASE , vcN3_ITEM , vcN3_TIPO , vcN3_SEQ , IN_DATADEP , vcCalcula ); |
|
Totvs custom tabs box items |
---|
default | no |
---|
referencia | passo2step2 |
---|
| Example in PROCEDURE:
Aviso |
---|
| It is important to pay attention to the procedure in which you must encode, in the database language. |
If encoded in ADVPL: Bloco de código |
---|
language | cpp |
---|
title | Exemplo em Example in ADVPL |
---|
linenumbers | true |
---|
| User Function AF050FPR()
Local lRet := .F.
Local cChave := Paramixb[1]
Local aChave := {}
// Monta array para itens que não serão depreciados
// CBASE CITEM
AADD(aChave, "100003 03 " )
AADD(aChave, "100005 05 " )
AADD(aChave, "111111 11 " )
If Ascan(aChave, cChave) # 0
lRet := .T.
Alert("Ponto de entrada AF050FPR() executado")
EndIf
Return lRet |
|
|
Informações |
---|
title | EP Contextualization |
---|
|
Bloco de código |
---|
language | cpp |
---|
title | Evento de Chamada do PE EP Call Event via ADVPL |
---|
linenumbers | true |
---|
| If ExistBlock("AF050FPR")
If ExecBlock("AF050FPR",.F.,.F.,{cChave})
DbSelectarea(cAliasSn3)
(cAliasSn3)->( DbSkip() )
Loop
EndIf
EndIf |
Bloco de código |
---|
language | sql |
---|
title | Evento de Chamada do PE EP Call Event via PROCEDURE |
---|
linenumbers | true |
---|
| AF050FPR_11_XX (vcFilial , vcN3_CBASE , vcN3_ITEM , vcN3_TIPO , vcN3_SEQ , IN_DATADEP , vcCalcula ); |
Informações |
---|
title | Parameters and Return |
---|
|
Parâmetros em Parameters in ADVPL: ParâmetrosParameters | TipoType | DescriçãoDescription | cChave - PARAMIXB[1] | Caractere | Chave retornada para utilização | Character | Key returned for use |
Parameters in Parâmetros em PROCEDURE: ParâmetrosParameters | TipoType | DescriçãoDescription | IN_FILIAL | Caractere Character | Filial utilizada Branch used | IN_CBASE | CaractereCharacter | Código baseBase Code | IN_ITEM | CaractereCharacter | Base Code Item | do Código Base | IN_TIPO | Caractere | Tipo do bemCharacter | Asset Type | IN_SEQ | Caractere | Sequencia da inclusão do bemCharacter | Asset addition sequence | IN_DATA | Caractere | Data da depreciaçãoCharacter | Depreciation Date | OUT_RESULT | Caractere | Resultado retornado da Character | Result returned from procedure. | Se If "0" | pula o registro, Se skip the record, If "1" | nãodo not |
Return of Entry Point ADVPL and Retorno do ponto de entrada ADVPL e PROCEDURE: ModoMode | RetornoReturn | TipoType | PROCEDURE | OUT_RESULT | Caractere Character | ADVPL | lRet | LógicoLogical |
|
|
05. RELATED SUBJECTS