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
7dfcbf2f
Commit
7dfcbf2f
authored
May 05, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adaptations suite remarques PR 171
parent
0d39f02b
Pipeline
#2182
passed with stage
in 1 minute 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletions
+26
-1
shelf_inventory.js
shelfs/static/js/shelf_inventory.js
+26
-1
No files found.
shelfs/static/js/shelf_inventory.js
View file @
7dfcbf2f
...
...
@@ -106,7 +106,11 @@ function barcode_analyzer(chars) {
function
reset_previous_value
()
{
if
(
editing_item
!==
null
)
{
if
(
typeof
editing_item
.
added_qties
!==
"undefined"
)
{
editing_item
.
qty
-=
editing_item
.
added_qties
.
pop
();
}
$
(
'#edition_input'
).
val
(
editing_item
.
qty
);
$
(
"#reset_to_previous_qty"
).
hide
();
}
}
function
refresh
()
{
...
...
@@ -181,7 +185,8 @@ function select_product_from_bc(barcode) {
}
editing_item
.
added_qties
.
push
(
qty
);
// TODO : add an action icon to view added quantities
edition_input
.
val
(
get_added_qties_sum
(
editing_item
));
editing_item
.
qty
=
get_added_qties_sum
(
editing_item
);
edition_input
.
val
(
editing_item
.
qty
);
}
}
...
...
@@ -885,7 +890,27 @@ function init() {
}
})
.
on
(
'blur'
,
function
()
{
const
current_val
=
$
(
this
).
val
();
$
(
this
).
off
(
'wheel.disableScroll'
);
if
(
editing_item
!==
null
)
{
//Let's verify if quantity have be changed
if
(
current_val
!=
editing_item
.
qty
)
{
if
(
typeof
editing_item
.
added_qties
!==
"undefined"
)
{
// total may have been affected by manual typing
const
total
=
get_added_qties_sum
(
editing_item
);
if
(
current_val
!=
total
)
{
// add difference in added_qties array
editing_item
.
added_qties
.
push
(
current_val
-
total
);
}
}
else
{
// Init added_qties to take change into account
editing_item
.
added_qties
=
[
editing_item
.
qty
,
current_val
-
editing_item
.
qty
];
}
}
editing_item
.
qty
=
current_val
;
}
});
// client-side validation of numeric inputs, optionally replacing separator sign(s).
...
...
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