From 8f6bd851d37a7a456dd1f02a5377e91f9b5b20d5 Mon Sep 17 00:00:00 2001 From: Marica Date: Thu, 29 Oct 2020 18:55:52 +0530 Subject: [PATCH] chore: Show Toast alert feedback on Scanning Barcode (#23760) --- erpnext/public/js/controllers/transaction.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 02b1dc0beb..1358a4bd08 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -352,9 +352,15 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ let show_description = function(idx, exist = null) { if (exist) { - scan_barcode_field.set_new_description(__('Row #{0}: Qty increased by 1', [idx])); + frappe.show_alert({ + message: __('Row #{0}: Qty increased by 1', [idx]), + indicator: 'green' + }); } else { - scan_barcode_field.set_new_description(__('Row #{0}: Item added', [idx])); + frappe.show_alert({ + message: __('Row #{0}: Item added', [idx]), + indicator: 'green' + }); } } @@ -365,7 +371,10 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ }).then(r => { const data = r && r.message; if (!data || Object.keys(data).length === 0) { - scan_barcode_field.set_new_description(__('Cannot find Item with this barcode')); + frappe.show_alert({ + message: __('Cannot find Item with this Barcode'), + indicator: 'red' + }); return; }