Agregar Proveedor

This commit is contained in:
Juan Pablo Vial
2024-12-03 16:45:20 -03:00
parent 5b44260245
commit 42e1dcdff7
19 changed files with 473 additions and 283 deletions

View File

@ -2,6 +2,9 @@
<script>
class Rut {
static digitoVerificador(rut) {
if (!(typeof rut === 'string' || rut instanceof String)) {
rut = rut.toString()
}
if (rut.length === 0) {
return ''
}
@ -12,6 +15,9 @@
return S ? S - 1 : 'K'
}
static format(rut) {
if (!(typeof rut === 'string' || rut instanceof String)) {
rut = rut.toString()
}
if (rut.length === 0) {
return ''
}
@ -19,6 +25,9 @@
return rut.replace(/^(\d{1,2})(\d{3})(\d{3})$/, '$1.$2.$3')
}
static validar(rut, digito) {
if (!(typeof digito === 'string' || digito instanceof String)) {
digito = digito.toString()
}
return Rut.digitoVerificador(rut) === digito
}
}