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
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
Alexis AOUN
third-party
Commits
cdbd0c05
Commit
cdbd0c05
authored
Jul 02, 2021
by
Damien Moulard
Committed by
Alexis Aoun
Jul 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interface fixes & make sure new product supplier has lowest priority
parent
5ec398e9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
oders_helper_style.css
orders/static/css/oders_helper_style.css
+4
-0
orders_helper.js
orders/static/js/orders_helper.js
+7
-6
models.py
products/models.py
+4
-3
helper.html
templates/orders/helper.html
+1
-1
No files found.
orders/static/css/oders_helper_style.css
View file @
cdbd0c05
...
...
@@ -154,6 +154,10 @@
cursor
:
pointer
;
}
.product_not_from_supplier
:hover
{
background-color
:
#c7cace
;
}
.product_name
,
.supplier_name
,
.product_npa
{
font-weight
:
bold
;
}
...
...
orders/static/js/orders_helper.js
View file @
cdbd0c05
...
...
@@ -186,7 +186,7 @@ function check_products_data() {
"Vérfication des informations produits..."
,
{
globalPosition
:
"top left"
,
className
:
"
warning
"
className
:
"
info
"
}
);
...
...
@@ -822,6 +822,8 @@ function create_orders() {
contentType
:
"application/json; charset=utf-8"
,
data
:
JSON
.
stringify
(
orders_data
),
success
:
(
result
)
=>
{
$
(
'#created_orders_area'
).
empty
();
// Display new orders
for
(
let
new_order
of
result
.
res
.
created
)
{
const
supplier_name
=
suppliers_list
.
find
(
s
=>
s
.
id
==
new_order
.
supplier_id
).
display_name
;
...
...
@@ -1036,12 +1038,11 @@ function _compute_product_data(product) {
let
days_covered
=
0
;
if
(
product
.
daily_conso
!==
0
)
{
qty_not_covered
=
product
.
daily_conso
*
order_doc
.
coverage_days
-
product
.
qty_available
-
product
.
incoming_qty
-
purchase_qty
;
days_covered
=
qty_not_covered
/
product
.
daily_conso
;
qty_not_covered
=
-
Math
.
ceil
(
qty_not_covered
);
// round up, so if a value is not fully covered display it
qty_not_covered
=
(
qty_not_covered
>
0
)
?
0
:
qty_not_covered
;
// only display qty not covered (neg value)
days_covered
=
-
Math
.
ceil
(
days_covered
);
days_covered
=
(
product
.
qty_available
+
product
.
incoming_qty
+
purchase_qty
)
/
product
.
daily_conso
;
days_covered
=
Math
.
floor
(
days_covered
);
}
item
.
qty_not_covered
=
qty_not_covered
;
...
...
@@ -1468,7 +1469,7 @@ function display_total_values() {
let
order_total_value
=
0
;
for
(
let
supplier
of
selected_suppliers
)
{
$
(
`#pill_supplier_
${
supplier
.
id
}
`
).
find
(
'.supplier_total_value'
).
text
(
supplier
.
total_value
);
$
(
`#pill_supplier_
${
supplier
.
id
}
`
).
find
(
'.supplier_total_value'
).
text
(
parseFloat
(
supplier
.
total_value
).
toFixed
(
2
)
);
order_total_value
+=
supplier
.
total_value
;
}
...
...
products/models.py
View file @
cdbd0c05
...
...
@@ -148,7 +148,8 @@ class CagetteProduct(models.Model):
'product_purchase_ok'
:
product
[
"purchase_ok"
],
'price'
:
price
,
'base_price'
:
price
,
'package_qty'
:
package_qty
'package_qty'
:
package_qty
,
'sequence'
:
1000
# lowest priority for the new suppliers
}
res
=
api
.
create
(
'product.supplierinfo'
,
f
)
...
...
@@ -503,8 +504,8 @@ class CagetteProducts(models.Model):
sales_average_params
=
{
'ids'
:
ptids
,
#
'from': '2019-04-10',
#
'to': '2019-08-10',
'from'
:
'2019-04-10'
,
'to'
:
'2019-08-10'
,
}
sales
=
CagetteProducts
.
get_template_products_sales_average
(
sales_average_params
)
...
...
templates/orders/helper.html
View file @
cdbd0c05
...
...
@@ -20,7 +20,7 @@
<h2>
Créer une nouvelle commande
</h2>
<form
id=
"new_order_form"
>
<input
type=
"text"
id=
"new_order_name"
placeholder=
"Nom de la commande..."
>
<button
type=
"submit"
class=
"btn btn--primary"
>
Valider
</button>
<button
type=
"submit"
class=
"btn btn--primary"
>
C'est parti !
</button>
</form>
</div>
<div
id=
"existing_orders_area"
>
...
...
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