diff --git a/AstuteClient2/src/app/ag-grid-components/empty-error-editor/empty-error-editor.component.ts b/AstuteClient2/src/app/ag-grid-components/empty-error-editor/empty-error-editor.component.ts index 0d934b1..a156c6b 100644 --- a/AstuteClient2/src/app/ag-grid-components/empty-error-editor/empty-error-editor.component.ts +++ b/AstuteClient2/src/app/ag-grid-components/empty-error-editor/empty-error-editor.component.ts @@ -4,7 +4,7 @@ import {ToastManagerService} from '../../services/toast-manager/toast-service.se @Component({ selector: 'app-empty-error-editor', template: ` - + ` }) export class EmptyErrorEditorComponent implements AfterViewInit { @@ -27,6 +27,23 @@ export class EmptyErrorEditorComponent implements AfterViewInit { return this.textInput.nativeElement.value; } + onKeyPress(event) { + if (event.key === '\'') { + event.preventDefault(); + this.notif('Cannot use \' (apostrophes)'); + setTimeout(() => { + this.textInput.nativeElement.focus(); + }); + } + if (event.key === '\'') { + event.preventDefault(); + this.notif('Cannot use \' (apostrophes)'); + setTimeout(() => { + this.textInput.nativeElement.focus(); + }); + } + } + onKeyDown(event) { if (event.keyCode === 9 || event.keyCode === 13) { if (!this.textInput.nativeElement.value) { diff --git a/AstuteClient2/src/app/ag-grid-components/in-det-qty-editor/in-det-qty-editor.component.ts b/AstuteClient2/src/app/ag-grid-components/in-det-qty-editor/in-det-qty-editor.component.ts index 4432bbc..323bc71 100644 --- a/AstuteClient2/src/app/ag-grid-components/in-det-qty-editor/in-det-qty-editor.component.ts +++ b/AstuteClient2/src/app/ag-grid-components/in-det-qty-editor/in-det-qty-editor.component.ts @@ -4,7 +4,7 @@ import {ToastManagerService} from '../../services/toast-manager/toast-service.se @Component({ selector: 'app-in-det-qty-editor', template: ` - + ` }) export class InDetQtyEditorComponent implements AfterViewInit { @@ -37,9 +37,11 @@ export class InDetQtyEditorComponent implements AfterViewInit { setTimeout(() => { this.numberInput.nativeElement.focus(); }); - } else if (this.numberInput.nativeElement.value < 0 || this.numberInput.nativeElement.value > this.remainingQty) { + } else if (!(this.numberInput.nativeElement.value >= 0 + && parseInt((this.numberInput.nativeElement.value * 100000).toFixed(0), 10) - + parseInt((this.remainingQty * 100000).toFixed(0), 10) <= 1)) { event.stopPropagation(); - this.notif('Value should between 0 and ' + this.remainingQty); + this.notif('Value should between 0 and ' + this.remainingQty.toPrecision(2)); setTimeout(() => { this.numberInput.nativeElement.focus(); }); diff --git a/AstuteClient2/src/app/customer/customer.component.html b/AstuteClient2/src/app/customer/customer.component.html index a1e7cc1..3a8f707 100644 --- a/AstuteClient2/src/app/customer/customer.component.html +++ b/AstuteClient2/src/app/customer/customer.component.html @@ -45,7 +45,7 @@ ID*