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
261
Issues
261
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Paul
third-party
Commits
91687f9f
Commit
91687f9f
authored
Jul 03, 2021
by
François C.
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ticket_221' into 'dev_principale'
Ticket 221 See merge request
cooperatic-foodcoops/third-party!39
parents
e974643a
f8dc0179
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
reception_produits.js
reception/static/js/reception_produits.js
+15
-6
No files found.
reception/static/js/reception_produits.js
View file @
91687f9f
...
...
@@ -81,10 +81,10 @@ function select_product_from_bc(barcode) {
}
});
if
(
found
.
data
!
=
null
)
{
if
(
found
.
data
=
=
null
)
{
$
.
each
(
list_processed
,
function
(
i
,
e
)
{
if
(
e
.
product_id
[
0
]
==
p
.
data
[
barcodes
[
'keys'
][
'id'
]])
{
found
.
data
=
e
;
found
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
e
))
;
found
.
place
=
'processed'
;
}
});
...
...
@@ -96,10 +96,6 @@ function select_product_from_bc(barcode) {
let
row
=
table_to_process
.
row
(
$
(
'#'
+
found
.
data
.
product_id
[
0
]));
remove_from_toProcess
(
row
,
found
.
data
);
}
else
{
let
row
=
table_processed
.
row
(
$
(
'#'
+
found
.
data
.
product_id
[
0
]));
remove_from_processed
(
row
,
found
.
data
);
}
}
}
...
...
@@ -800,12 +796,20 @@ function editProductInfo (productToEdit, value = null) {
var
index
=
searchUpdatedProduct
();
var
firstUpdate
=
false
;
let
newValue
=
value
;
var
addition
=
false
;
// If 'value' parameter not set, get value from edition input
if
(
value
==
null
)
{
newValue
=
parseFloat
(
document
.
getElementById
(
'edition_input'
).
value
.
replace
(
','
,
'.'
));
}
$
.
each
(
list_processed
,
function
(
i
,
e
)
{
if
(
e
.
product_id
[
0
]
==
productToEdit
.
product_id
[
0
])
{
addition
=
true
;
productToEdit
=
e
;
newValue
=
newValue
+
productToEdit
.
product_qty
;
}
});
// If qty edition & Check if qty changed
if
(
reception_status
==
"False"
&&
productToEdit
.
product_qty
!=
newValue
)
{
if
(
index
==
-
1
)
{
// First update
...
...
@@ -880,6 +884,11 @@ function editProductInfo (productToEdit, value = null) {
// Update local storage of product order
localStorage
.
setItem
(
"order_"
+
productToEdit
.
id_po
,
JSON
.
stringify
(
orders
[
productToEdit
.
id_po
]));
if
(
addition
){
let
row
=
table_processed
.
row
(
$
(
'#'
+
productToEdit
.
product_id
[
0
]));
remove_from_processed
(
row
,
productToEdit
);
}
add_to_processed
(
productToEdit
);
}
catch
(
e
)
{
err
=
{
msg
:
e
.
name
+
' : '
+
e
.
message
,
ctx
:
'edit product info'
};
...
...
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