Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
repanier
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chris
repanier
Commits
6c47d07a
Commit
6c47d07a
authored
Mar 29, 2017
by
Patrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display a pop up and better use of colors when a confirmed order is upgraded
parent
fbf3db27
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
199 additions
and
153 deletions
+199
-153
repanier/locale/fr/LC_MESSAGES/django.mo
repanier/locale/fr/LC_MESSAGES/django.mo
+0
-0
repanier/locale/fr/LC_MESSAGES/django.po
repanier/locale/fr/LC_MESSAGES/django.po
+109
-95
repanier/models/customer.py
repanier/models/customer.py
+2
-2
repanier/models/invoice.py
repanier/models/invoice.py
+31
-20
repanier/models/producer.py
repanier/models/producer.py
+3
-3
repanier/templates/base.html
repanier/templates/base.html
+1
-1
repanier/templates/base_wo_cms_toolbar.html
repanier/templates/base_wo_cms_toolbar.html
+1
-1
repanier/templates/repanier/communication_confirm_order.html
repanier/templates/repanier/communication_confirm_order.html
+5
-0
repanier/templates/repanier/communication_permanence_board.html
...er/templates/repanier/communication_permanence_board.html
+0
-0
repanier/templates/repanier/order_form.html
repanier/templates/repanier/order_form.html
+31
-22
repanier/tools.py
repanier/tools.py
+10
-5
repanier/urls.py
repanier/urls.py
+5
-3
repanier/views/order_init_ajax.py
repanier/views/order_init_ajax.py
+1
-1
No files found.
repanier/locale/fr/LC_MESSAGES/django.mo
View file @
6c47d07a
No preview for this file type
repanier/locale/fr/LC_MESSAGES/django.po
View file @
6c47d07a
This diff is collapsed.
Click to expand it.
repanier/models/customer.py
View file @
6c47d07a
...
...
@@ -179,14 +179,14 @@ class Customer(models.Model):
else
:
return
'<a href="'
+
urlresolvers
.
reverse
(
'customer_invoice_view'
,
args
=
(
0
,))
+
'?customer='
+
str
(
self
.
id
)
+
'" target="_blank" >'
+
(
'<span style="color:
#FF0000
">%s</span>'
%
(
balance
,))
+
'</a>'
'<span style="color:
red
">%s</span>'
%
(
balance
,))
+
'</a>'
else
:
if
balance
.
amount
>=
30
:
return
'<span style="color:#32CD32">%s</span>'
%
(
balance
,)
elif
balance
.
amount
>=
-
10
:
return
'<span style="color:#696969">%s</span>'
%
(
balance
,)
else
:
return
'<span style="color:
#FF0000
">%s</span>'
%
(
balance
,)
return
'<span style="color:
red
">%s</span>'
%
(
balance
,)
get_balance
.
short_description
=
_
(
"balance"
)
get_balance
.
allow_tags
=
True
...
...
repanier/models/invoice.py
View file @
6c47d07a
...
...
@@ -254,29 +254,40 @@ class CustomerInvoice(models.Model):
self
.
delta_transport
.
amount
=
DECIMAL_ZERO
def
cancel_confirm_order
(
self
):
self
.
is_order_confirm_send
=
False
producer_invoice_buyinggroup
=
ProducerInvoice
.
objects
.
filter
(
producer__represent_this_buyinggroup
=
True
,
permanence_id
=
self
.
permanence_id
,
).
order_by
(
'?'
).
first
()
if
producer_invoice_buyinggroup
is
None
:
producer_buyinggroup
=
producer
.
Producer
.
objects
.
filter
(
represent_this_buyinggroup
=
True
).
order_by
(
'?'
).
first
()
producer_invoice_buyinggroup
=
ProducerInvoice
.
objects
.
create
(
producer_id
=
producer_buyinggroup
.
id
,
if
self
.
delta_price_with_tax
.
amount
!=
DECIMAL_ZERO
\
or
self
.
delta_vat
.
amount
!=
DECIMAL_ZERO
\
or
self
.
delta_transport
.
amount
!=
DECIMAL_ZERO
:
producer_invoice_buyinggroup
=
ProducerInvoice
.
objects
.
filter
(
producer__represent_this_buyinggroup
=
True
,
permanence_id
=
self
.
permanence_id
,
status
=
self
.
permanence
.
status
)
producer_invoice_buyinggroup
.
delta_price_with_tax
.
amount
-=
self
.
delta_price_with_tax
.
amount
producer_invoice_buyinggroup
.
delta_vat
.
amount
-=
self
.
delta_vat
.
amount
producer_invoice_buyinggroup
.
delta_transport
.
amount
-=
self
.
delta_transport
.
amount
producer_invoice_buyinggroup
.
save
()
).
order_by
(
'?'
).
first
()
if
producer_invoice_buyinggroup
is
None
:
producer_buyinggroup
=
producer
.
Producer
.
objects
.
filter
(
represent_this_buyinggroup
=
True
).
order_by
(
'?'
).
first
()
producer_invoice_buyinggroup
=
ProducerInvoice
.
objects
.
create
(
producer_id
=
producer_buyinggroup
.
id
,
permanence_id
=
self
.
permanence_id
,
status
=
self
.
permanence
.
status
)
producer_invoice_buyinggroup
.
delta_price_with_tax
.
amount
-=
self
.
delta_price_with_tax
.
amount
producer_invoice_buyinggroup
.
delta_vat
.
amount
-=
self
.
delta_vat
.
amount
producer_invoice_buyinggroup
.
delta_transport
.
amount
-=
self
.
delta_transport
.
amount
producer_invoice_buyinggroup
.
save
()
self
.
delta_price_with_tax
.
amount
=
DECIMAL_ZERO
self
.
delta_vat
.
amount
=
DECIMAL_ZERO
self
.
delta_transport
=
DECIMAL_ZERO
self
.
delta_price_with_tax
.
amount
=
DECIMAL_ZERO
self
.
delta_vat
.
amount
=
DECIMAL_ZERO
self
.
delta_transport
=
DECIMAL_ZERO
if
self
.
is_order_confirm_send
:
# Change of confirmation status
self
.
is_order_confirm_send
=
False
return
True
else
:
# No change of confirmation status
return
False
def
__str__
(
self
):
return
'%s, %s'
%
(
self
.
customer
,
self
.
permanence
)
...
...
repanier/models/producer.py
View file @
6c47d07a
...
...
@@ -245,7 +245,7 @@ class Producer(models.Model):
elif
balance
.
amount
>
30
:
return
'<a href="'
+
urlresolvers
.
reverse
(
'producer_invoice_view'
,
args
=
(
0
,))
+
'?producer='
+
str
(
self
.
id
)
+
'" target="_blank" >'
+
(
'<span style="color:
#FF0000
">%s</span>'
%
(
balance
,))
+
'</a>'
'<span style="color:
red
">%s</span>'
%
(
balance
,))
+
'</a>'
else
:
return
'<a href="'
+
urlresolvers
.
reverse
(
'producer_invoice_view'
,
args
=
(
0
,))
+
'?producer='
+
str
(
self
.
id
)
+
'" target="_blank" >'
+
(
...
...
@@ -256,7 +256,7 @@ class Producer(models.Model):
elif
balance
.
amount
==
0
:
return
'<span style="color:#32CD32">%s</span>'
%
(
balance
,)
elif
balance
.
amount
>
30
:
return
'<span style="color:
#FF0000
">%s</span>'
%
(
balance
,)
return
'<span style="color:
red
">%s</span>'
%
(
balance
,)
else
:
return
'<span style="color:#696969">%s</span>'
%
(
balance
,)
...
...
@@ -274,7 +274,7 @@ class Producer(models.Model):
return
'<span style="color:#32CD32">%s</span>'
%
(
number_format
(
producer_last_invoice
.
total_price_with_tax
,
2
))
elif
producer_last_invoice
.
total_price_with_tax
>
30
:
return
'<span style="color:
#FF0000
">%s</span>'
%
(
return
'<span style="color:
red
">%s</span>'
%
(
number_format
(
producer_last_invoice
.
total_price_with_tax
,
2
))
else
:
return
'<span style="color:#696969">%s</span>'
%
(
...
...
repanier/templates/base.html
View file @
6c47d07a
...
...
@@ -91,7 +91,7 @@
{% if permanence %}
<li
id=
"li_my_basket"
style=
"display:none;"
class=
"dropdown"
>
{% if delivery_id %}
<a
href=
"{% url "
basket_view
"
permanence.id
delivery_id
%}"
class=
"btn btn-info"
><span
id=
"my_basket"
></span></a>
<a
href=
"{% url "
basket_
delivery_
view
"
permanence.id
delivery_id
%}"
class=
"btn btn-info"
><span
id=
"my_basket"
></span></a>
{% else %}
<a
href=
"{% url "
basket_view
"
permanence.id
%}"
class=
"btn btn-info"
><span
id=
"my_basket"
></span></a>
{% endif %}
...
...
repanier/templates/base_wo_cms_toolbar.html
View file @
6c47d07a
...
...
@@ -93,7 +93,7 @@
{% if permanence %}
<li
id=
"li_my_basket"
style=
"display:none;"
class=
"dropdown"
>
{% if delivery_id %}
<a
href=
"{% url "
basket_view
"
permanence.id
delivery_id
%}"
class=
"btn btn-info"
><span
id=
"my_basket"
></span></a>
<a
href=
"{% url "
basket_
delivery_
view
"
permanence.id
delivery_id
%}"
class=
"btn btn-info"
><span
id=
"my_basket"
></span></a>
{% else %}
<a
href=
"{% url "
basket_view
"
permanence.id
%}"
class=
"btn btn-info"
><span
id=
"my_basket"
></span></a>
{% endif %}
...
...
repanier/templates/repanier/communication_confirm_order.html
0 → 100644
View file @
6c47d07a
{% load i18n l10n %}
{% trans "Your order is no longer confirmed because you just changed it." %}
<br/>
{% trans "Do not forget to confirm it again." %}
<br/><br/>
{% trans "An unconfirmed order will be canceled." %}
<br/>
{% trans "You can increase the order quantities as long as the orders are open." %}
repanier/templates/repanier/communication.html
→
repanier/templates/repanier/communication
_permanence_board
.html
View file @
6c47d07a
File moved
repanier/templates/repanier/order_form.html
View file @
6c47d07a
This diff is collapsed.
Click to expand it.
repanier/tools.py
View file @
6c47d07a
...
...
@@ -605,7 +605,7 @@ def payment_message(customer, permanence):
# other_order_not_invoiced = REPANIER_MONEY_ZERO
if
customer_invoice
.
customer_id
!=
customer_invoice
.
customer_who_pays_id
:
customer_payment_needed
=
'<font color="
green
">%s</font>'
%
(
customer_payment_needed
=
'<font color="
#51a351
">%s</font>'
%
(
_
(
'Invoices for this delivery point are sent to %(name)s who is responsible for collecting the payments.'
)
%
{
'name'
:
customer_invoice
.
customer_who_pays
.
long_basket_name
}
...
...
@@ -646,7 +646,7 @@ def payment_message(customer, permanence):
else
:
if
customer
.
balance
.
amount
!=
DECIMAL_ZERO
:
customer_payment_needed
=
'<br/><font color="
green
">%s.</font>'
%
(
_
(
'Your account balance is sufficient'
))
customer_payment_needed
=
'<br/><font color="
#51a351
">%s.</font>'
%
(
_
(
'Your account balance is sufficient'
))
else
:
customer_payment_needed
=
EMPTY_STRING
else
:
...
...
@@ -1060,7 +1060,12 @@ def update_or_create_purchase(customer=None, offer_item_id=None, q_order=None, v
).
only
(
"id"
,
"with_delivery_point"
,
"status"
).
order_by
(
'?'
).
first
()
if
customer_invoice
is
not
None
and
permanence
is
not
None
:
order_amount
=
customer_invoice
.
get_total_price_with_tax
()
customer_invoice
.
cancel_confirm_order
()
status_changed
=
customer_invoice
.
cancel_confirm_order
()
if
apps
.
REPANIER_SETTINGS_CUSTOMERS_MUST_CONFIRM_ORDERS
and
status_changed
:
html
=
render_to_string
(
'repanier/communication_confirm_order.html'
)
option_dict
=
{
'id'
:
"#communication"
,
'html'
:
html
}
to_json
.
append
(
option_dict
)
customer_invoice
.
save
()
my_basket
(
customer_invoice
.
is_order_confirm_send
,
order_amount
,
to_json
)
if
basket
:
...
...
@@ -1082,7 +1087,7 @@ def my_basket(is_order_confirm_send, order_amount, to_json):
msg_html
=
'<span class="glyphicon glyphicon-shopping-cart"></span> %s <span class="glyphicon glyphicon-exclamation-sign"></span> <span class="glyphicon glyphicon-floppy-remove"></span></a>'
%
(
order_amount
,)
else
:
msg_html
=
'<span class="glyphicon glyphicon-shopping-cart"></span> %s <
span class="glyphicon glyphicon-floppy-saved"></span
></a>'
%
(
msg_html
=
'<span class="glyphicon glyphicon-shopping-cart"></span> %s <
font color="#32CD32"><span class="glyphicon glyphicon-floppy-saved"></span></font
></a>'
%
(
order_amount
,)
option_dict
=
{
'id'
:
"#my_basket"
,
'html'
:
msg_html
}
to_json
.
append
(
option_dict
)
...
...
@@ -1206,7 +1211,7 @@ def my_order_confirmation(permanence, customer_invoice, is_basket=False,
<div class="panel panel-default">
<div class="panel-heading">
%s
<p><font color="
green
">%s</font><p/>
<p><font color="
#51a351
">%s</font><p/>
%s
</div>
</div>
...
...
repanier/urls.py
View file @
6c47d07a
...
...
@@ -71,10 +71,12 @@ urlpatterns = [
# url(r'^order/(?P<permanence_id>\d+)/(?P<delivery_id>\d+)/$', OrderView.as_view(), name='order_view'),
# url(r'^order/(?P<permanence_id>\d+)/$', OrderView.as_view(), {'delivery_id': 0}, name='order_view'),
url
(
r'^order/(?P<permanence_id>\d+)/(?P<delivery_id>\d+)/$'
,
never_cache
(
OrderView
.
as_view
()),
name
=
'order_view'
),
url
(
r'^order/(?P<permanence_id>\d+)/$'
,
never_cache
(
OrderView
.
as_view
()),
{
'delivery_id'
:
0
},
name
=
'order_view'
),
url
(
r'^order/(?P<permanence_id>\d+)/(?P<delivery_id>\d+)/$'
,
never_cache
(
OrderView
.
as_view
()),
name
=
'order_delivery_view'
),
url
(
r'^order/(?P<permanence_id>\d+)/$'
,
never_cache
(
OrderView
.
as_view
()),
{
'delivery_id'
:
0
},
name
=
'order_view'
),
url
(
r'^basket/(?P<permanence_id>\d+)/(?P<delivery_id>\d+)/$'
,
never_cache
(
OrderView
.
as_view
()),
{
'basket'
:
True
},
name
=
'basket_view'
),
name
=
'basket_
delivery_
view'
),
url
(
r'^basket/(?P<permanence_id>\d+)/$'
,
never_cache
(
OrderView
.
as_view
()),
{
'delivery_id'
:
0
,
'basket'
:
True
},
name
=
'basket_view'
),
url
(
r'^like/(?P<permanence_id>\d+)/(?P<delivery_id>\d+)/$'
,
never_cache
(
OrderView
.
as_view
()),
{
'like'
:
True
},
...
...
repanier/views/order_init_ajax.py
View file @
6c47d07a
...
...
@@ -160,7 +160,7 @@ def order_init_ajax(request):
else
:
count_activity
=
None
html
=
render_to_string
(
'repanier/communication.html'
,
'repanier/communication
_permanence_board
.html'
,
{
'permanence_boards'
:
permanence_boards
,
'count_activity'
:
count_activity
})
option_dict
=
{
'id'
:
"#communication"
,
'html'
:
html
}
to_json
.
append
(
option_dict
)
...
...
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