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
32fe6120
Commit
32fe6120
authored
Jul 02, 2021
by
Damien Moulard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'aide_a_la_commande' into dev_cooperatic
parents
2ea80edf
0c69109c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
66 deletions
+89
-66
oders_helper_style.css
orders/static/css/oders_helper_style.css
+23
-24
orders_helper.js
orders/static/js/orders_helper.js
+52
-27
models.py
products/models.py
+4
-4
helper.html
templates/orders/helper.html
+10
-11
No files found.
orders/static/css/oders_helper_style.css
View file @
32fe6120
...
...
@@ -14,13 +14,13 @@
.pill
{
border-radius
:
30px
;
min-width
:
200px
;
min-height
:
35
px
;
min-height
:
40
px
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
padding
:
8px
15px
8px
15
px
;
margin
:
0
10px
5px
0
;
padding
:
5px
30px
5px
30
px
;
margin
:
0
10px
5px
10px
;
}
.disabled
{
...
...
@@ -84,6 +84,14 @@
/* -- Order data */
#order_data_container
{
font-size
:
1.8rem
;
}
#order_data_separator
{
margin
:
0
10px
0
10px
;
}
#order_forms_container
{
margin-top
:
30px
;
display
:
flex
;
justify-content
:
space-evenly
;
...
...
@@ -157,14 +165,7 @@
/* -- Footer */
#main_content_footer
{
margin
:
10px
0
35px
0
;
}
#footer_orders_recap
{
width
:
100%
;
display
:
flex
;
justify-content
:
space-evenly
;
margin-bottom
:
15px
;
margin
:
20px
0
40px
0
;
}
#footer_actions
{
...
...
@@ -173,28 +174,26 @@
justify-content
:
space-between
;
}
#suppliers_total_values
{
display
:
flex
;
}
.supplier_total_item
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
/* -- Suppliers list */
#suppliers_container
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
flex-wrap
:
wrap
;
margin
:
2
0px
0
20px
0
;
margin
:
3
0px
0
20px
0
;
}
.supplier_pill
{
background-color
:
#e7e9ed
;
background-color
:
#e7e9ed
c5
;
border
:
1px
solid
black
;
}
.pill_supplier_name
{
font-weight
:
bold
;
}
.supplier_total_value_container
{
font-size
:
1.5rem
;
}
.remove_supplier_icon
{
...
...
orders/static/js/orders_helper.js
View file @
32fe6120
This diff is collapsed.
Click to expand it.
products/models.py
View file @
32fe6120
...
...
@@ -468,7 +468,7 @@ class CagetteProducts(models.Model):
try
:
today
=
datetime
.
date
.
today
()
.
strftime
(
"
%
Y-
%
m-
%
d"
)
if
len
(
supplier_ids
)
>
0
:
if
supplier_ids
is
not
None
and
len
(
supplier_ids
)
>
0
:
# Get products/supplier relation
f
=
[
"product_tmpl_id"
,
'date_start'
,
'date_end'
,
'package_qty'
,
'price'
,
'name'
]
c
=
[[
'name'
,
'in'
,
[
int
(
x
)
for
x
in
supplier_ids
]]]
...
...
@@ -503,8 +503,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
)
...
...
@@ -515,7 +515,7 @@ class CagetteProducts(models.Model):
# Add supplier data to product data
for
i
,
fp
in
enumerate
(
filtered_products_t
):
if
len
(
supplier_ids
)
>
0
:
if
supplier_ids
is
not
None
and
len
(
supplier_ids
)
>
0
:
psi_item
=
next
(
item
for
item
in
psi
if
item
[
"product_tmpl_id"
]
is
not
False
and
item
[
"product_tmpl_id"
][
0
]
==
fp
[
"id"
])
filtered_products_t
[
i
][
'suppliersinfo'
]
=
[{
'supplier_id'
:
int
(
psi_item
[
"name"
][
0
]),
...
...
templates/orders/helper.html
View file @
32fe6120
...
...
@@ -41,10 +41,14 @@
<div
class=
"header txtcenter"
>
<h1>
Aide à la commande
</h1>
<i>
Commande :
<span
class=
"order_name_container"
></span></i>
<p
id=
"order_data_container"
>
Commande :
<span
class=
"order_name_container"
></span>
<span
id=
"order_data_separator"
>
|
</span>
Total HT :
<span
id=
"order_total_value"
>
0
</span>
€
</p>
</div>
<div
class=
"txtcenter"
id=
"order_
data
_container"
>
<div
class=
"txtcenter"
id=
"order_
forms
_container"
>
<form
action=
"javascript:;"
id=
"coverage_form"
>
<input
type=
"number"
name=
"coverage_days"
id=
"coverage_days_input"
placeholder=
"Nb jours de couverture"
min=
"1"
>
<button
type=
"submit"
class=
'btn--primary'
>
Calculer les besoins
</button>
...
...
@@ -55,7 +59,7 @@
</form>
</div>
<div
class=
"txtcenter"
id=
"suppliers_container"
></div>
<div
id=
"suppliers_container"
></div>
<div
class=
"main"
style=
"display:none;"
>
<div
class=
"table_area"
>
...
...
@@ -64,14 +68,6 @@
</div>
<div
id=
"main_content_footer"
style=
"display:none;"
>
<div
id=
"footer_orders_recap"
>
<div
id=
"suppliers_total_values"
>
<h4>
Total /fournisseur :
</h4><div
id=
"suppliers_total_values_container"
></div>
</div>
<div
id=
"order_total_value_container"
>
<h4>
Total :
<span
id=
"order_total_value"
></span></h4>
</div>
</div>
<div
id=
"footer_actions"
>
<div
class=
"add_product_container"
>
<div
id=
"product_form_container"
>
...
...
@@ -121,6 +117,9 @@
<span
class=
"pill_supplier_name"
></span>
<i
class=
"fas fa-times remove_supplier_icon"
></i>
</div>
<div
class=
"supplier_total_value_container"
>
Total:
<span
class=
"supplier_total_value"
>
0
</span>
€
</div>
</div>
</div>
...
...
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