-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Faker::Finance.vat_number #1348
Add Faker::Finance.vat_number #1348
Conversation
@tagliala hey brother. Could you please take a look at this PR and let me know how it looks? |
SI: "SI########" | ||
SK: "SK##########" | ||
SM: "SM#####" | ||
UA: "UA##########" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing new line at the end of file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the heads up 👍
# the sum plus whatever the last digit is must be a multiple of 10. So, the | ||
# last digit must be 10 - the last digit of the sum. | ||
luhn_digit = (10 - (luhn_sum % 10)) % 10 | ||
|
||
template.gsub('L', luhn_digit.to_s) | ||
end | ||
|
||
def vat_number(country = 'BR') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for the default country to be BR
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there isn't
* Add Faker::Finance.vat_number, its tests and docs * Update changelog * Add tests and reorder locales * Minor changes * Update test_faker_finance.rb * Minor change
Checklist
This PR fixes #1326