Skip to content

Commit

Permalink
Improved: logic for scanning product using barcode identifier (hotwax…
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Nov 7, 2024
1 parent f6ff0bf commit fc67601
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"Assigned to": "Assigned to",
"Authenticating": "Authenticating",
"Back to Launchpad": "Back to Launchpad",
"Barcode Identifier": "Barcode Identifier",
"Before": "Before",
"Browser TimeZone": "Browser TimeZone",
"Browser time zone": "Browser time zone",
Expand Down
8 changes: 4 additions & 4 deletions src/views/CountDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,17 @@ function handleBlur() {
async function handleInput(event) {
if (!isInputFocused.value) return;
let sku = event.target.value;
if(!sku) {
let scannedValue = event.target.value;
if(!scannedValue) {
showToast(translate("Scan a valid product barcode identifier"));
return;
}
const cachedProducts = getCachedProducts.value;
const barcodeIdentifer = productStoreSettings.value["barcodeIdentificationPref"];
const itemVal = getProductIdentificationValue(barcodeIdentifer, cachedProducts[product.value.productId])
if(itemVal === sku) {
const itemVal = getProductIdentificationValue(barcodeIdentifer, cachedProducts[product.value.productId]) ? getProductIdentificationValue(barcodeIdentifer, cachedProducts[product.value.productId]) : cachedProducts[product.value.productId]?.internalName
if(itemVal && itemVal === scannedValue) {
inputCount.value++;
} else {
showToast(translate('Scanned item does not match current product'));
Expand Down

0 comments on commit fc67601

Please sign in to comment.