PHP Classes

File: public/asset/vendor/jquery-validation/src/additional/nipPL.js

Recommend this page to a friend!
  Classes of fathurrahman   mnTemplate   public/asset/vendor/jquery-validation/src/additional/nipPL.js   Download  
File: public/asset/vendor/jquery-validation/src/additional/nipPL.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: mnTemplate
Route HTTP requests to callback functions
Author: By
Last change:
Date: 1 year ago
Size: 582 bytes
 

Contents

Class file image Download
/* * Numer identyfikacji podatkowej ( NIP ) is the way tax identification used in Poland for companies */ $.validator.addMethod( "nipPL", function( value ) { "use strict"; value = value.replace( /[^0-9]/g, "" ); if ( value.length !== 10 ) { return false; } var arrSteps = [ 6, 5, 7, 2, 3, 4, 5, 6, 7 ]; var intSum = 0; for ( var i = 0; i < 9; i++ ) { intSum += arrSteps[ i ] * value[ i ]; } var int2 = intSum % 11; var intControlNr = ( int2 === 10 ) ? 0 : int2; return ( intControlNr === parseInt( value[ 9 ], 10 ) ); }, "Please specify a valid NIP number." );