solfm_ValidarCUIT ( )

Function stats

Average user rating
299
312
9999
Support
FileMaker 10.0 +
Date posted
12 June 2011
Version
1
Recursive function
No

Author Info
 Diego D'Alessio (solfilemaker)

5 functions

Average Rating None

author_avatar



 

Function overview

Prototype

solfm_ValidarCUIT  ( CUIT )


Parameters

CUIT  


Description

Tags:  validate   validar   CUIT   argentina  

Validates if the Argentinian CUIT (tax ID) is Valid or Not.
Permite validad si el CUIT es o no es correcto.
En caso de error; devuelve "Error" y el dígito verificador que corresponde.

Examples

Sample input

20245602260


Sample output

Correcto

 

Function code

Let (
[
p1=Middle(CUIT;1;1)*5;
p2=Middle(CUIT;2;1)*4;
p3=Middle(CUIT;3;1)*3;
p4=Middle(CUIT;4;1)*2;
p5=Middle(CUIT;5;1)*7;
p6=Middle(CUIT;6;1)*6;
p7=Middle(CUIT;7;1)*5;
p8=Middle(CUIT;8;1)*4;
p9=Middle(CUIT;9;1)*3;
p10=Middle(CUIT;10;1)*2;
result=Mod ((p1+p2+p3+p4+p5+p6+p7+p8+p9+p10);11);

verificador=Case
(
result = 0;0;

result = 11;0;
result = 10;1;
result ≤ 9;11-result
)
];


Case (CUIT=Middle(CUIT;1;10)&verificador;"Correcto";"Error "& result)
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/312

    Prototype: solfm_ValidarCUIT( CUIT )
    Function Author: Diego D'Alessio (solfilemaker) (http://www.fmfunctions.com/mid/299)
    Last updated: 12 June 2011
    Version: 1

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (31)
List  (28)
Date  (26)
Format  (23)
XML  (22)
Dev  (19)
Sql  (18)
Debug  (16)
Interface  (13)
Text  (13)
Layout  (13)
Variables  (12)
Filter  (11)
Design  (10)
Layout Objects  (8)
Timestamp  (7)