Skip to content

Commit

Permalink
fix(norway): add support for VAT registered legal entities (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
smilovanovic authored Apr 21, 2021
1 parent b90362a commit 0674462
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/amd/lib/countries/norway.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ define(["require", "exports"], function (require, exports) {
multipliers: {
common: [3, 2, 7, 6, 5, 4, 3, 2]
},
regex: [/^(NO)(\d{9})$/]
regex: [/^(NO)(\d{9})(MVA)?$/]
}
};
});
2 changes: 1 addition & 1 deletion lib/commonjs/lib/countries/norway.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ exports.norway = {
multipliers: {
common: [3, 2, 7, 6, 5, 4, 3, 2]
},
regex: [/^(NO)(\d{9})$/]
regex: [/^(NO)(\d{9})(MVA)?$/]
}
};
2 changes: 1 addition & 1 deletion lib/es6/lib/countries/norway.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export const norway = {
multipliers: {
common: [3, 2, 7, 6, 5, 4, 3, 2]
},
regex: [/^(NO)(\d{9})$/]
regex: [/^(NO)(\d{9})(MVA)?$/]
}
};
2 changes: 1 addition & 1 deletion lib/system/lib/countries/norway.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ System.register([], function (exports_1, context_1) {
multipliers: {
common: [3, 2, 7, 6, 5, 4, 3, 2]
},
regex: [/^(NO)(\d{9})$/]
regex: [/^(NO)(\d{9})(MVA)?$/]
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/umd/lib/countries/norway.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
multipliers: {
common: [3, 2, 7, 6, 5, 4, 3, 2]
},
regex: [/^(NO)(\d{9})$/]
regex: [/^(NO)(\d{9})(MVA)?$/]
}
};
});
2 changes: 1 addition & 1 deletion src/lib/countries/norway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export const norway: Country = {
multipliers: {
common: [3, 2, 7, 6, 5, 4, 3, 2]
},
regex: [/^(NO)(\d{9})$/]
regex: [/^(NO)(\d{9})(MVA)?$/]
}
};
51 changes: 50 additions & 1 deletion test/countries_vat_lists/norway.vat.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,56 @@ export const valid = [
'NO996293815',
'NO996707415',
'NO996840506',
'NO999600476'
'NO999600476',
'NO864234232MVA',
'NO919405619MVA',
'NO924319623MVA',
'NO936869335MVA',
'NO938532397MVA',
'NO939194428MVA',
'NO939350675MVA',
'NO945748931MVA',
'NO946938505MVA',
'NO951390534MVA',
'NO959021740MVA',
'NO962209017MVA',
'NO965920358MVA',
'NO966891750MVA',
'NO971526157MVA',
'NO975962229MVA',
'NO976320344MVA',
'NO976389387MVA',
'NO976559029MVA',
'NO976682157MVA',
'NO979423705MVA',
'NO979523483MVA',
'NO981026330MVA',
'NO981532848MVA',
'NO892462402MVA',
'NO982512069MVA',
'NO982702887MVA',
'NO982928885MVA',
'NO983851800MVA',
'NO984058098MVA',
'NO985333629MVA',
'NO985770573MVA',
'NO987058765MVA',
'NO988023671MVA',
'NO990630372MVA',
'NO992037601MVA',
'NO992186208MVA',
'NO992227079MVA',
'NO992324252MVA',
'NO992977558MVA',
'NO992986913MVA',
'NO993466344MVA',
'NO998053501MVA',
'NO995073331MVA',
'NO995203626MVA',
'NO996293815MVA',
'NO996707415MVA',
'NO996840506MVA',
'NO999600476MVA'
];

export const validOnlyByFormat = ['NO962209011', 'NO962209012', 'NO962209013', 'NO962209014'];
Expand Down

0 comments on commit 0674462

Please sign in to comment.