Brian Dunning's FileMaker Custom Functions

_solfmValidarCUIT ( CUIT )

Valida el número de CUIT de Argentina

  Average rating: 4.5 (26 votes) Log in to vote

Diego DAlessio   Diego DAlessio
Soluciones FileMaker
http://www.solucionesfilemaker.com

Share on Facebook Share on Twitter

  Sample input:
_solfmValidarCUIT(20245602260)
  Sample output:
Correcto

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Esta función permite incoporar un número de CUIT y determinar si el mismo es correcto o no. En caso de Error, devuelve el Error y el número que debería tener como dígito verificador. Es así que si escribo 2024560226 Daría Error 0

 

Comments

comment   comment, VR
Jun 11, 2011
"Case
(
result =11;... "

That's NOT going to happen.
 
comment   comment, VR
Jun 11, 2011
I think this could be simplified to =

Let ( [
p = Sum (
5 * Middle ( CUIT ; 1 ; 1 ) ;
4 * Middle ( CUIT ; 2 ; 1 ) ;
3 * Middle ( CUIT ; 3 ; 1 ) ;
2 * Middle ( CUIT ; 4 ; 1 ) ;
7 * Middle ( CUIT ; 5 ; 1 ) ;
6 * Middle ( CUIT ; 6 ; 1 ) ;
5 * Middle ( CUIT ; 7 ; 1 ) ;
4 * Middle ( CUIT ; 8 ; 1 ) ;
3 * Middle ( CUIT ; 9 ; 1 ) ;
2 * Middle ( CUIT ; 10 ; 1 )
)
] ;
Case ( Middle ( CUIT ; 11 ; 1 ) = Mod ( -p ; 11 ) ; "Correcto" ; "Error" )
)
 
Diego DAlessio   Diego DAlessio, Vicente Lopez
Jun 13, 2011
Thanks, you're right the simplified version looks nicer. The previous one I posted was the "work in progress". Thanks a lot!
DD
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: