Páginas filhas
  • AF251GrImp PE Acquisition by Transfer ATFA251 - Handling of Taxes to be Apportioned

01. GENERAL DATA

Product:

TOTVS Backoffice

Product Line:

Microsiga Protheus Line

Industry:

Services

Module:

TOTVS Backoffice (Protheus Line) - Fixed Asset (SIGAFIS)

Function:

ATFA251 - Acquisition by Transfer / PE - AF251GrImp 

Country:

Brazil

Ticket:

Internal

Requirement/Story/Issue:

DSERCTR1-41668

02. STATUS/REQUISITION

This document aims to explain the entry point AF251GrImp.

03. SOLUTION

The purpose of entry point AF251GrImp is to enable the handling of tax types in tab GRID (Tax Details) of routine Acquisition by Transfer (ATFA251) that are not the ICMS tax.


Important

The changes performed to the entry point are the total responsibility of the customer that implements them.

Code and Examples

Example of Entry Point
#include 'totvs.ch'
#include "rwmake.ch"     

User Function AF251GrImp()

    Local cArrRot := Paramixb[1] //Use for various validations needed with the tax types already found in asset
    Local aTeste := {}
    //We must emphasize that the array sent to the routine must be 
    //an array with X positions, each of which must contain 6 sub-positions with the value types 		     defined as exemplified below
    
    ///Example: describing array positions for checking and knowledge
    // ArrayExemplificado[Size X of array based on how many taxes to apportion]:
    // ArrayExemplificado[1][1]:  =  "ICMS" - Character
    // ArrayExemplificado[1][2]:  =  "2" - Character
    // ArrayExemplificado[1][3]:  =  0 - Numeric
    // ArrayExemplificado[1][4]:  = .F. - Logical
    // ArrayExemplificado[1][5]:  =  0 - Numeric
    // ArrayExemplificado[1][6]:  =  0 - Numeric

    aTeste := Array(3,6)
    // aTeste := Array(6)

    aTeste[1][1] := "IPI"
    aTeste[1][2] := "2"
    aTeste[1][3] := 0
    aTeste[1][4] := .F.
    aTeste[1][5] := 100
    aTeste[1][6] := 100

    aTeste[2][1] := "CIAP"
    aTeste[2][2] := "2"
    aTeste[2][3] := 0
    aTeste[2][4] := .F.
    aTeste[2][5] := 100
    aTeste[2][6] := 100

Return aTeste   

Points of Attention

  1. We must emphasize that the array sent to the routine must have X positions, each of which must contain 6 sub-positions, with the value type settings exemplified below;
  2. This EP cannot change the ICMS tax type;
  3. Be mindful of the tax types and of each position in the described array, because the types are derived from the system or handled in accordance with the rule implemented.
  4. The Entry Point can handle tax structures, such as the values of an existing tax other than ICMS and new lines.




PE Call in the System
If lAF251GrImp
	
	aAF251GrImp := ExecBlock( 'AF251GrImp', .F., .F., aClone(aAF251Imp) )
	If ValType( aAF251GrImp ) == "A"
		For nA := 1 To Len( aAF251GrImp )
			// Check whether all data types are correct and whether    
            // the same line returned in array aAF251Imp does not exist    
            If 	Len( aAF251GrImp[nA] ) == 6 .and.;
				ValType(aAF251GrImp[nA,1]) == 'C' .and.;
				ValType(aAF251GrImp[nA,2]) == 'C' .and.;
				ValType(aAF251GrImp[nA,3]) == 'N' .and.;
				ValType(aAF251GrImp[nA,4]) == 'L' .and.;
				ValType(aAF251GrImp[nA,5]) == 'N' .and.;
				ValType(aAF251GrImp[nA,6]) == 'N' .and.;
				!('ICMS' $ Upper(aAF251GrImp[nA,1]) )
				nPosImp :=  aScan( aAF251Imp, {|Imp| 	Imp[1] == aAF251GrImp[nA,1] .and. Imp[2] == aAF251GrImp[nA,2] .and.;
				Imp[3] == aAF251GrImp[nA,3] .and. Imp[4] == aAF251GrImp[nA,4] } )
				If nPosImp == 0
					Aadd( aAF251Imp, aClone( aAF251GrImp[nA] ) )
				Else
					aAF251Imp[nPosImp][5] := aAF251GrImp[nA][5]
					aAF251Imp[nPosImp][6] := aAF251GrImp[nA][6]
				EndIF
			EndIf
		Next nA
	EndIf
EndIf

Important

The examples used in this documentation are merely illustrative.

04. OTHER INFORMATION


Parameters

Parameters

Type

Description

PARAIXB[1]

Array

A cloned array in the structure memory that assembles the tax details grid of the asset selected and its handling in accordance with array returned from PE.

Return

Name

Type

Description

aAF251GrImp

Logical

Array containing taxes to be handled and added to tab Tax Details. You may substitute any values to be apportioned or add a new line.


05. RELATED SUBJECTS

  • Not applicable.