mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Fix: Allow negative monetary values with a current code (#6358)
* Updates the currency validation to allow an optional negative * Update frontend regex --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
@@ -51,7 +51,7 @@ export class MonetaryComponent extends AbstractInputComponent<string> {
|
||||
get monetaryValue(): string {
|
||||
if (!this.value) return null
|
||||
const focused = document.activeElement === this.inputField?.nativeElement
|
||||
const val = parseFloat(this.value.toString().replace(/[^0-9.,]+/g, ''))
|
||||
const val = parseFloat(this.value.toString().replace(/[^0-9.,-]+/g, ''))
|
||||
return focused ? val.toString() : val.toFixed(2)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user