Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
68167d3e
Commit
68167d3e
authored
May 25, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug bipping a product not in shelf
parent
c1f2b126
Pipeline
#2218
passed with stage
in 1 minute 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
shelf_inventory.js
shelfs/static/js/shelf_inventory.js
+12
-4
No files found.
shelfs/static/js/shelf_inventory.js
View file @
68167d3e
...
@@ -32,7 +32,8 @@ var shelf = null,
...
@@ -32,7 +32,8 @@ var shelf = null,
// datetime for which shelf's ongoing_inv_start_datetime is considered null
// datetime for which shelf's ongoing_inv_start_datetime is considered null
default_inventory_start_datetime
=
"0001-01-01 00:00:00"
,
default_inventory_start_datetime
=
"0001-01-01 00:00:00"
,
selected_products_for_shelf_change
=
[],
selected_products_for_shelf_change
=
[],
all_shelfs
=
null
;
// Use get_all_shelfs to access it's value
all_shelfs
=
null
,
debounce_timeout
=
null
;
// Use get_all_shelfs to access it's value
/* UTILS */
/* UTILS */
...
@@ -56,6 +57,11 @@ function back() {
...
@@ -56,6 +57,11 @@ function back() {
document
.
location
.
href
=
parent_location
;
document
.
location
.
href
=
parent_location
;
}
}
function
debounce
(
func
,
delay
=
100
)
{
clearTimeout
(
debounce_timeout
);
debounce_timeout
=
setTimeout
(
func
,
delay
);
}
function
get_added_qties_sum
(
item
)
{
function
get_added_qties_sum
(
item
)
{
let
total
=
null
;
let
total
=
null
;
...
@@ -109,6 +115,8 @@ function barcode_analyzer(chars) {
...
@@ -109,6 +115,8 @@ function barcode_analyzer(chars) {
}
else
{
}
else
{
select_product_from_bc
(
barcode
);
select_product_from_bc
(
barcode
);
}
}
search_chars
=
[];
}
}
/**
/**
...
@@ -198,6 +206,7 @@ function select_product_from_bc(barcode) {
...
@@ -198,6 +206,7 @@ function select_product_from_bc(barcode) {
}
}
}
else
{
}
else
{
console
.
log
(
'Code barre introuvable'
);
console
.
log
(
'Code barre introuvable'
);
alert
(
"Le produit bippé n'est pas enregistré dans ce rayon."
)
}
}
}
else
if
(
barcode
==
editing_item
.
barcode
&&
qty
)
{
}
else
if
(
barcode
==
editing_item
.
barcode
&&
qty
)
{
// We scan the same product as the current one
// We scan the same product as the current one
...
@@ -1247,7 +1256,7 @@ function init() {
...
@@ -1247,7 +1256,7 @@ function init() {
if
(
e
.
which
>=
48
&&
e
.
which
<=
57
)
{
// figures [0-9]
if
(
e
.
which
>=
48
&&
e
.
which
<=
57
)
{
// figures [0-9]
search_chars
.
push
(
String
.
fromCharCode
(
e
.
which
));
search_chars
.
push
(
String
.
fromCharCode
(
e
.
which
));
}
else
if
(
e
.
which
==
13
||
search_chars
.
length
>=
13
)
{
}
else
if
(
e
.
which
==
13
||
search_chars
.
length
>=
13
)
{
barcode_analyzer
();
debounce
(
barcode_analyzer
);
// Avoid concurrent barcode analysing
}
}
});
});
...
@@ -1256,8 +1265,7 @@ function init() {
...
@@ -1256,8 +1265,7 @@ function init() {
//access `event.code` - barcode data
//access `event.code` - barcode data
var
barcode
=
event
.
code
;
var
barcode
=
event
.
code
;
barcode_analyzer
(
barcode
);
debounce
(
barcode_analyzer
);
// Avoid concurrent barcode analysing
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment