Usina BRAdvPL Guide
Sign in
← All topics
ENTRY POINTUnder review

F040MIRF

F040MIRF()

Handles the minimum IRRF amount. Financeiro P12 references, historical FINA040 context and a boundary test plan.

F040MIRFFINA040FINXFINIRRF
01 · OVERVIEW

Overview

The official index lists F040MIRF under MATXATU/FINXFIN for handling the minimum IRRF amount, while its specific page remains under construction. (TOTVS, n.d., ref. 2) The historical inventory already recorded on this site places a call in F040CalcIr in the FINA040 flow dated 2019-08-26. (TOTVS, 2019, ref. 1) These are different documentary scopes: that historical location does not prove the FINXFIN contract in a current release. F040MIRF() identifies the entry point without asserting a complete argument list. PARAMIXB structure and return handling require confirmation in the target environment. Current research used indexed evidence; access to the full public documentation was restricted. Editorial review does not constitute Protheus validation.

02 · SYNTAX

Syntax

F040MIRF()

Parameters

PARAMIXB
ContextualContext to confirm

The historical entry does not provide a complete PARAMIXB structure here. Check the actual call before reading positions, using aliases or treating the received minimum as a formal argument.

Return value

The 2019 inventory describes a value compatible with the minimum withholding amount. This does not confirm the accepted type, unit, precision or Nil handling in current FINXFIN. Do not use the helper example return as an implementation of this entry point.

03 · PRACTICAL EXAMPLE

Prepare cases below, at and above a boundary

#Include "Protheus.ch"

User Function ExMIRFLim()
    Local nTestLimit := 10
    Local aValues := {9.99, 10, 10.01}
    Local nIndex := 0
    Local cRelation := ""

    // Fictional values: this helper defines neither a legal limit nor a tax rule.
    // Its different name prevents it from replacing F040MIRF in the RPO.
    For nIndex := 1 To Len(aValues)
        Do Case
        Case aValues[nIndex] < nTestLimit
            cRelation := "below"
        Case aValues[nIndex] == nTestLimit
            cRelation := "equal"
        Otherwise
            cRelation := "above"
        EndCase
        ConOut("Test case: " + cRelation)
    Next nIndex
Return
Expected result

The helper should log below, equal and above, in that order. It only organizes boundary cases; it neither calculates IRRF nor determines whether a threshold is inclusive. Use these groups when comparing standard processing with a customized rule in a test environment. The example has not been compiled or run in Protheus.

BEST PRACTICES
  • First confirm the call and return value in the target version; distinguish historical inventory evidence from current environment observations.
  • Prepare scenarios immediately below, exactly at and immediately above the boundary. Equality behavior must be checked rather than assumed.
  • Compare results with uncustomized standard processing and repeat scenarios after the change. Include the rounding and precision actually used by the environment.
  • Agree on the applicable fiscal rule with the responsible team before implementing values. Example numbers are fictional and do not represent legal thresholds.
  • Preserve work areas when selecting aliases; do not change global settings to compensate for an unknown return contract.
COMMON PITFALLS
  • Confusing the minimum withholding amount with the tax base, rate or tax amount.
  • Copying a logical return from a validation entry point when this caller expects another value.
  • Assuming that the 2019 F040CalcIr context matches FINXFIN in every release.
  • Compiling ExMIRFLim as though it implemented F040MIRF; the example is an isolated helper.

Related content

REFERENCES
  1. TOTVS. FINA040.PRX — Contas a Receber. Reference technical documentation dated 26 Aug. 2019; historical location recorded in the project inventory.
  2. TOTVS. Pontos de Entrada - Financeiro - P12. TDN. Indexed evidence accessed on 2026-10-20.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha