Repository navigation
Conversation
Since PMK 112/PMK.03/2022 the NPWP has 16 digits: the NIK for resident individuals, and the old 15-digit number with a leading 0 for other taxpayers. Also escape the dots in the formatted 15-digit pattern, which matched any character.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2977 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2599 2599
Branches 658 658
=========================================
Hits 2599 2599 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isVAT(str, 'ID')only accepts the old 15-digit NPWP. Since PMK 112/PMK.03/2022 the NPWP has 16 digits:0in frontThe 16-digit format is the one used in the tax system now, so valid numbers are rejected today:
This PR accepts 15 or 16 digits (with the optional
IDprefix, as before).It also escapes the dots in the formatted pattern (
12.345.678.9-012.345). They were unescaped, so any character matched, e.g.isVAT('12a345b678c9-012d345', 'ID')returnedtrue. The formatted 15-digit form is otherwise unchanged. The 16-digit number has no official punctuated form, so I only accept it as plain digits.References:
0: https://jdih.kemenkeu.go.id/download/50006df6-b9c4-4079-b7d9-33590e3fb6ee/2023pmkeuangan136.pdfTests: added valid 16-digit numbers (with and without
ID, and a NIK-style number) and invalid ones (17 digits, letters in place of the dots, a 16-digit number in the formatted pattern). The new valid cases fail without the change.npm testpasses (323 passing, 100% statements).Checklist
IDcountry code is already listed