]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: Allow lowercase letters in monetary currency code field (#6359)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Wed, 10 Apr 2024 15:27:03 +0000 (08:27 -0700)
committerGitHub <noreply@github.com>
Wed, 10 Apr 2024 15:27:03 +0000 (08:27 -0700)
src-ui/src/app/components/common/input/monetary/monetary.component.ts

index 6c17b2c7693f982374d274b5e5df328bc8b81b1e..db190c59d86d767092ffe74ff3a9ba3d17e3766b 100644 (file)
@@ -35,7 +35,8 @@ export class MonetaryComponent extends AbstractInputComponent<string> {
 
   get currencyCode(): string {
     const focused = document.activeElement === this.currencyField?.nativeElement
-    if (focused && this.value) return this.value.match(/^([A-Z]{0,3})/)?.[0]
+    if (focused && this.value)
+      return this.value.toUpperCase().match(/^([A-Z]{0,3})/)?.[0]
     return (
       this.value
         ?.toString()
@@ -45,7 +46,7 @@ export class MonetaryComponent extends AbstractInputComponent<string> {
   }
 
   set currencyCode(value: string) {
-    this.value = value + this.monetaryValue?.toString()
+    this.value = value.toUpperCase() + this.monetaryValue?.toString()
   }
 
   get monetaryValue(): string {