diff --git a/admin/src/app/home/orders/stock-orders/complete/complete.component.ts b/admin/src/app/home/orders/stock-orders/complete/complete.component.ts index 8b9b5cf1..91107bc7 100644 --- a/admin/src/app/home/orders/stock-orders/complete/complete.component.ts +++ b/admin/src/app/home/orders/stock-orders/complete/complete.component.ts @@ -25,6 +25,7 @@ export class CompleteComponent implements OnInit { public sortAscending = true; public sortColumn = 'productModelSku'; public searchSKUText = ''; + public searchEntry = ''; constructor(private orgModelApi: OrgModelApi, private _route: ActivatedRoute, @@ -106,11 +107,11 @@ export class CompleteComponent implements OnInit { searchProductBySku(sku?: string) { this.loading = true; - var pattern = new RegExp('.*'+sku+'.*', "i"); /* case-insensitive RegExp search */ - var filterData = pattern.toString(); + // var pattern = new RegExp('.*'+sku+'.*', "i"); /* case-insensitive RegExp search */ + // var filterData = pattern.toString(); this.orgModelApi.getProductModels(this.userProfile.orgModelId, { where: { - api_id: { "regexp": filterData } + sku: sku } }).subscribe((data: any) => { if (data.length) { @@ -152,6 +153,9 @@ export class CompleteComponent implements OnInit { keyUpEvent(event, searchSKUText) { if(event.keyCode == '13') { + searchSKUText = searchSKUText.replace(this.searchEntry,''); + this.searchEntry = searchSKUText; + this.searchSKUText = searchSKUText; this.searchProductBySku(searchSKUText) } } diff --git a/admin/src/app/home/orders/stock-orders/fulfill/fulfill.component.ts b/admin/src/app/home/orders/stock-orders/fulfill/fulfill.component.ts index a9bdad65..d84a9cd5 100644 --- a/admin/src/app/home/orders/stock-orders/fulfill/fulfill.component.ts +++ b/admin/src/app/home/orders/stock-orders/fulfill/fulfill.component.ts @@ -397,7 +397,7 @@ export class FulfillComponent implements OnInit { * calls the search sku function */ barcodeSearchSKU($event: any) { - if (this.enableBarcode && this.searchSKUText !== '') { + if (this.enableBarcode && this.searchSKUText !== '' && $event.keyCode == '13') { console.log("this.searchSKUText : ",this.searchSKUText); this.searchAndIncrementProduct(this.searchSKUText); $event.target.select(); diff --git a/admin/src/app/home/orders/stock-orders/generated/generated.component.ts b/admin/src/app/home/orders/stock-orders/generated/generated.component.ts index 6acd95f4..a1e8ff96 100644 --- a/admin/src/app/home/orders/stock-orders/generated/generated.component.ts +++ b/admin/src/app/home/orders/stock-orders/generated/generated.component.ts @@ -58,6 +58,7 @@ export class GeneratedComponent implements OnInit, OnDestroy { public ccInvalidEmailCounter: number = 0; public bccValidEmailCounter: number = 0; public bccInvalidEmailCounter: number = 0; + public searchEntry = ''; constructor(private orgModelApi: OrgModelApi, private _route: ActivatedRoute, @@ -216,6 +217,7 @@ export class GeneratedComponent implements OnInit, OnDestroy { } searchProductBySku(sku?: string) { + console.log("searchProductBySku"); this.loading = true; var pattern = new RegExp('.*'+sku+'.*', "i"); /* case-insensitive RegExp search */ var filterData = pattern.toString(); @@ -520,6 +522,9 @@ export class GeneratedComponent implements OnInit, OnDestroy { keyUpEvent(event, searchSKUText) { if(event.keyCode == '13') { + searchSKUText = searchSKUText.replace(this.searchEntry,''); + this.searchEntry = searchSKUText; + this.searchSKUText = searchSKUText; this.searchProductBySku(searchSKUText) } } diff --git a/admin/src/app/home/orders/stock-orders/receive/receive.component.ts b/admin/src/app/home/orders/stock-orders/receive/receive.component.ts index ae1d2d1f..e8a0288e 100644 --- a/admin/src/app/home/orders/stock-orders/receive/receive.component.ts +++ b/admin/src/app/home/orders/stock-orders/receive/receive.component.ts @@ -434,7 +434,7 @@ export class ReceiveComponent implements OnInit, OnDestroy { * @param searchText */ barcodeSearchSKU($event) { - if (this.enableBarcode && this.searchSKUText !== '') { + if (this.enableBarcode && this.searchSKUText !== '' && $event.keyCode == '13') { this.searchAndIncrementProduct(this.searchSKUText); $event.target.select(); } diff --git a/admin/src/app/home/products/bin-locations/bin-locations.component.html b/admin/src/app/home/products/bin-locations/bin-locations.component.html index 125cb199..d8f6086b 100644 --- a/admin/src/app/home/products/bin-locations/bin-locations.component.html +++ b/admin/src/app/home/products/bin-locations/bin-locations.component.html @@ -18,7 +18,7 @@ [(ngModel)]="searchSKUText" placeholder="Scan SKU barcode here or enter text" [appAutoFocus]="searchSKUFocused" - (keyup)="barcodeSearchSKU()" (keyup)="keyUpEvent($event)"> + (keyup)="barcodeSearchSKU($event)" (keyup)="keyUpEvent($event)">