Commit 91684ae1 authored by Patrick's avatar Patrick

release used in production

parent 8db31f0d
No preview for this file type
...@@ -83,14 +83,14 @@ Install Required libs for Django installation ...@@ -83,14 +83,14 @@ Install Required libs for Django installation
.. code:: bash .. code:: bash
sudo apt-get install gettext unzip sudo apt-get install gettext unzip
sudo apt-get python-setuptools sudo apt-get install python-setuptools
# vv For the PostgreSQL connector # vv For the PostgreSQL connector
sudo apt-get install libpq-dev python-dev sudo apt-get install libpq-dev python-dev
# vv for Pillow # vv for Pillow
sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms1-dev libwebp-dev tcl8.5-dev tk8.5-dev sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms1-dev libwebp-dev tcl8.5-dev tk8.5-dev
# vv for docx # vv for docx
sudo apt-get install libxml2-dev libxslt1-dev sudo apt-get install libxml2-dev libxslt1-dev
......
...@@ -57,13 +57,13 @@ Check if CMS install is ok ...@@ -57,13 +57,13 @@ Check if CMS install is ok
python manage.py cms check --settings=ptidej.ptidej_settings python manage.py cms check --settings=ptidej.ptidej_settings
Compile translation files .. Compile translation files
.. code:: bash .. .. code:: bash
cd ~/v1/mysite/repanier .. cd ~/v1/mysite/repanier
export DJANGO_SETTINGS_MODULE= .. export DJANGO_SETTINGS_MODULE=
django-admin.py compilemessages .. django-admin.py compilemessages
If you want, initialize the DB with test content : copy the content of /install/createdb into ~/v1/mysite/ If you want, initialize the DB with test content : copy the content of /install/createdb into ~/v1/mysite/
...@@ -95,6 +95,10 @@ Restart Nginx and Uwsgi ...@@ -95,6 +95,10 @@ Restart Nginx and Uwsgi
# Start Uwsgi # Start Uwsgi
sudo /etc/init.d/uwsgi start sudo /etc/init.d/uwsgi start
# The same Stop, Clean, Start Uwsgi in one line
sudo /etc/init.d/uwsgi stop && rm -rf /var/tmp/django_cache/* && sudo /etc/init.d/uwsgi start
The surf on your sites The surf on your sites
When needed, upgrade the DB with south for a new version of specific INSTALLED_APPS (eg repanier) When needed, upgrade the DB with south for a new version of specific INSTALLED_APPS (eg repanier)
......
...@@ -16,6 +16,7 @@ pip install psycopg2 ...@@ -16,6 +16,7 @@ pip install psycopg2
# ELSE installing the latest development version # ELSE installing the latest development version
# pip install https://github.com/divio/django-cms/archive/develop.zip # pip install https://github.com/divio/django-cms/archive/develop.zip
# OR UPGRADE # OR UPGRADE
pip install -U django
pip install -U https://github.com/divio/django-cms/archive/develop.zip pip install -U https://github.com/divio/django-cms/archive/develop.zip
# ELSE installing a specific version # ELSE installing a specific version
# pip install https://github.com/divio/django-cms/archive/3.0.0.beta3.zip # pip install https://github.com/divio/django-cms/archive/3.0.0.beta3.zip
...@@ -37,10 +38,12 @@ pip install -U django_compressor ...@@ -37,10 +38,12 @@ pip install -U django_compressor
pip install -U django-admin-sortable2 pip install -U django-admin-sortable2
pip install -U openpyxl pip install -U openpyxl
# pip install -U django-hvad # pip install -U django-hvad
pip install -U docx # pip install -U docx
# pip install django_debug_toolbar # pip install django_debug_toolbar
# pip install django-dajaxice ! not working with Django 1.6 # pip install django-dajaxice ! not working with Django 1.6
# pip install django-custom-user # pip install django-custom-user
# pip install django-registration # pip install django-registration
pip install -U django-crispy-forms pip install -U django-crispy-forms
pip install -U django-celery # pip install -U django-celery
# pip install -U celery
pip install -U django-password-reset
\ No newline at end of file
...@@ -19,7 +19,13 @@ ADMINS = ( ...@@ -19,7 +19,13 @@ ADMINS = (
os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_EMAIL','') os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_EMAIL','')
), ),
) )
SERVER_EMAIL = os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_EMAIL','')
# MANAGERS = (
# (
# os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_NAME',''),
# os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_EMAIL','')
# ),
# )
###################### ######################
DATABASES = { DATABASES = {
...@@ -208,6 +214,11 @@ LOGOUT_URL = "/leave_repanier/" ...@@ -208,6 +214,11 @@ LOGOUT_URL = "/leave_repanier/"
# ], # ],
# } # }
CKEDITOR_SETTINGS = {
'language': '{{ language }}',
'toolbar': 'HTMLField',
}
TEXT_SAVE_IMAGE_FUNCTION='cmsplugin_filer_image.integrations.ckeditor.create_image_plugin' TEXT_SAVE_IMAGE_FUNCTION='cmsplugin_filer_image.integrations.ckeditor.create_image_plugin'
FILER_ENABLE_LOGGING = False FILER_ENABLE_LOGGING = False
......
...@@ -8,8 +8,13 @@ ...@@ -8,8 +8,13 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
{% addtoblock "css" %}<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">{% endaddtoblock %} {% addtoblock "css" %}<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">{% endaddtoblock %}
{% addtoblock "css" %}<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">{% endaddtoblock %}
{% addtoblock "css" %}<link rel="stylesheet" href="{{ STATIC_URL}}bootstrap/css/custom.css">{% endaddtoblock %} {% addtoblock "css" %}<link rel="stylesheet" href="{{ STATIC_URL}}bootstrap/css/custom.css">{% endaddtoblock %}
{% addtoblock "css" %} {% addtoblock "css" %}
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css"> <style type="text/css">
a.skip_link{ a.skip_link{
position:absolute; position:absolute;
...@@ -52,23 +57,31 @@ ...@@ -52,23 +57,31 @@
<li><a href="{% url "logout_form" %}">{% trans "Logout" %}</a></li> <li><a href="{% url "logout_form" %}">{% trans "Logout" %}</a></li>
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="?offeritem=purchased"><span id="my_basket">{{ prepared_amount }}</span> &euro; <span class="glyphicon glyphicon-shopping-cart"></span></a>
</li>
{% else %} {% else %}
<li class="dropdown"> <li class="dropdown">
<a href="{% url "login_form" %}">{% trans "Login" %}</a> <a href="{% url "login_form" %}">{% trans "Login" %}</a>
</li> </li>
{% endif %} {% endif %}
{% if languages.len > 1 %}
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Language" %} <b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Language" %} <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% language_chooser "native" %} {% language_chooser "native" %}
</ul> </ul>
</li> </li>
{% endif %}
</ul> </ul>
</div><!--/.nav-collapse --> </div><!--/.nav-collapse -->
</div> </div>
</div> </div>
<!-- Begin page content --> <!-- Begin page content -->
<a name="content"></a> <a name="content"></a>
<!--[if lt IE 9]>
<h1>{% trans "It will be easier for you to crawl this website with a newer browser. For example" %} <a href="http://www.mozilla.org/fr/">Firefox</a> {% trans "or" %} <a href="http://www.google.be/intl/fr/chrome/browser/">Chrome</a>.</h1>
<![endif]-->
{% block base_content%}{% endblock %} {% block base_content%}{% endblock %}
<!-- Footer --> <!-- Footer -->
<div id="footer" class="container"> <div id="footer" class="container">
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<p>Repanier est un outil de gestion du cycle des permamnences destiné aux groupements d'achats et aux producteurs locaux.</p> <p>Repanier est un outil de gestion du cycle des permamnences destiné aux groupements d'achats et aux producteurs locaux.</p>
<p>Contraction de repas et panier, repanier est le fruit de l'expérience des membres de plusieurs groupements d'achats</p> <p>Contraction de repas et panier, repanier est le fruit de l'expérience des membres de plusieurs groupements d'achats</p>
<ul> <ul>
<li><a href="http://ptidej.gasath.be/">Gasath, groupe ptidej</a>, une trentaine d'acheteurs de produits locaux, de préférence bio, sur Ath</li> <li><a href="http://ptidej.repanier.be/">Gasath, groupe ptidej</a>, une trentaine d'acheteurs de produits locaux, de préférence bio, sur Ath</li>
<li><a href="http://apero.gasath.be/">Gasath, groupe apéro</a>, une trentaine d'acheteurs de produits locaux et bio sur Ath</li> <li><a href="http://apero.repanier.be/">Gasath, groupe apéro</a>, une trentaine d'acheteurs de produits locaux et bio sur Ath</li>
<li><a href="http://www.lepanierlensois.be/">Le Panier Lensois</a>, une trentaine d'acheteurs de produits locaux et bio sur Lens</li> <li><a href="http://www.lepanierlensois.be/">Le Panier Lensois</a>, une trentaine d'acheteurs de produits locaux et bio sur Lens</li>
<li><a href="http://www.lebiodici.be/">Le Bio d'Ici</a>, une quinzaine de maraîchers bio regroupés pour les restaurants, collectivités locales, ...</li> <li><a href="http://www.lebiodici.be/">Le Bio d'Ici</a>, une quinzaine de maraîchers bio regroupés pour les restaurants, collectivités locales, ...</li>
</ul> </ul>
......
{% load menu_tags i18n %} {% load menu_tags i18n %}
{% for language in languages %} {% for language in languages %}
<li><a href="{% page_language_url language.0 %}" {% ifequal current_language language.0 %} class="active"{% endifequal %}>{{ language.1 }}</a></li> <li><a href="{% page_language_url language.0 %}" {% ifequal current_language language.0 %} class="active"{% endifequal %}>{{ language.1 }}</a></li>
{% if not forloop.last %}
<!-- <li role="presentation" class="divider"></li> -->
{% endif %}
{% endfor %} {% endfor %}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -3,14 +3,11 @@ from decimal import * ...@@ -3,14 +3,11 @@ from decimal import *
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.conf import settings from django.conf import settings
SITE_ID_REPANIER = 1
SITE_ID_PRODUCER = 2
SITE_ID_EPI_D_ICI = 6
DECIMAL_ZERO = Decimal('0') DECIMAL_ZERO = Decimal('0')
DECIMAL_ONE = Decimal('1') DECIMAL_ONE = Decimal('1')
DECIMAL_0_01 = Decimal('.01') DECIMAL_0_01 = Decimal('.01')
DECIMAL_0_001 = Decimal('.001') DECIMAL_0_001 = Decimal('.001')
DECIMAL_0_0001 = Decimal('.0001')
PERMANENCE_DISABLED = '050' PERMANENCE_DISABLED = '050'
PERMANENCE_PLANIFIED = '100' PERMANENCE_PLANIFIED = '100'
...@@ -24,58 +21,76 @@ PERMANENCE_DONE = '800' ...@@ -24,58 +21,76 @@ PERMANENCE_DONE = '800'
PERMANENCE_CANCELED = '900' PERMANENCE_CANCELED = '900'
LUT_PERMANENCE_STATUS = ( LUT_PERMANENCE_STATUS = (
(PERMANENCE_DISABLED, _('disabled')), (PERMANENCE_DISABLED, unicode(_('disabled'))),
(PERMANENCE_PLANIFIED, _('planified')), (PERMANENCE_PLANIFIED, unicode(_('planified'))),
(PERMANENCE_WAIT_FOR_OPEN, _('wait for open')), (PERMANENCE_WAIT_FOR_OPEN, unicode(_('wait for open'))),
(PERMANENCE_OPENED, _('orders opened')), (PERMANENCE_OPENED, unicode(_('orders opened'))),
(PERMANENCE_WAIT_FOR_SEND, _('wait for send')), (PERMANENCE_WAIT_FOR_SEND, unicode(_('wait for send'))),
(PERMANENCE_SEND, _('orders send to producers')), (PERMANENCE_SEND, unicode(_('orders send to producers'))),
(PERMANENCE_WAIT_FOR_DONE, _('wait for done')), (PERMANENCE_WAIT_FOR_DONE, unicode(_('wait for done'))),
(PERMANENCE_INVOICES_VALIDATION_FAILED, _('invoices validation test failed')), (PERMANENCE_INVOICES_VALIDATION_FAILED, unicode(_('invoices validation test failed'))),
(PERMANENCE_DONE, _('done')) (PERMANENCE_DONE, unicode(_('done')))
) )
PRODUCT_PLACEMENT_FREEZER = '100' PRODUCT_PLACEMENT_FREEZER = '100'
PRODUCT_PLACEMENT_FRIDGE = '200' PRODUCT_PLACEMENT_FRIDGE = '200'
PRODUCT_PLACEMENT_OUT_OF_BASKET = '300' PRODUCT_PLACEMENT_OUT_OF_BASKET = '300'
PRODUCT_PLACEMENT_BASKET_BOTTOM = '400' PRODUCT_PLACEMENT_BASKET = '400'
PRODUCT_PLACEMENT_BASKET_MIDDLE = '500'
PRODUCT_PLACEMENT_BASKET_TOP = '600'
LUT_PRODUCT_PLACEMENT = ( LUT_PRODUCT_PLACEMENT = (
(PRODUCT_PLACEMENT_FREEZER, _('freezer')), (PRODUCT_PLACEMENT_FREEZER, unicode(_('freezer'))),
(PRODUCT_PLACEMENT_FRIDGE, _('fridge')), (PRODUCT_PLACEMENT_FRIDGE, unicode(_('fridge'))),
(PRODUCT_PLACEMENT_OUT_OF_BASKET, _('loose, out of the basket')), (PRODUCT_PLACEMENT_OUT_OF_BASKET, unicode(_('loose, out of the basket'))),
(PRODUCT_PLACEMENT_BASKET_BOTTOM, _('bottom of basket')), (PRODUCT_PLACEMENT_BASKET, unicode(_('into the basket'))),
(PRODUCT_PLACEMENT_BASKET_MIDDLE, _('middle of basket')), )
(PRODUCT_PLACEMENT_BASKET_TOP, _('top of basket')),
PRODUCT_ORDER_UNIT_LOOSE_PC = '100'
PRODUCT_ORDER_UNIT_LOOSE_KG = '120'
PRODUCT_ORDER_UNIT_LOOSE_PC_KG = '140'
PRODUCT_ORDER_UNIT_NAMED_PC = '200'
PRODUCT_ORDER_UNIT_NAMED_KG = '220'
PRODUCT_ORDER_UNIT_NAMED_PC_KG = '240'
PRODUCT_ORDER_UNIT_DEPOSIT = '300'
PRODUCT_ORDER_UNIT_SUBSCRIPTION = '400'
PRODUCT_ORDER_UNIT_TRANSPORTATION = '500'
LUT_PRODUCT_ORDER_UNIT = (
(PRODUCT_ORDER_UNIT_LOOSE_PC, unicode(_("/piece (loose)"))),
(PRODUCT_ORDER_UNIT_LOOSE_KG, unicode(_("/Kg (loose)"))),
(PRODUCT_ORDER_UNIT_LOOSE_PC_KG, unicode(_("/piece -> Kg (loose)"))),
(PRODUCT_ORDER_UNIT_NAMED_PC, unicode(_("/piece (named)"))),
(PRODUCT_ORDER_UNIT_NAMED_KG, unicode(_("/Kg (named)"))),
(PRODUCT_ORDER_UNIT_NAMED_PC_KG, unicode(_("/piece -> Kg (named)"))),
(PRODUCT_ORDER_UNIT_DEPOSIT, unicode(_('As a deposit, a bag : always add this product to preparation list when the customer has purchased something.'))),
(PRODUCT_ORDER_UNIT_SUBSCRIPTION, unicode(_('As a subscription, common expense : add the minimal order quantity of this product to each customer of the group'))),
(PRODUCT_ORDER_UNIT_TRANSPORTATION, unicode(_('As a transportation cost : add the minimal order quantity of this product to the basket representing the group.'))),
)
LUT_PRODUCT_ORDER_UNIT_REVERSE = (
(unicode(_("/piece (loose)")), PRODUCT_ORDER_UNIT_LOOSE_PC),
(unicode(_("/Kg (loose)")), PRODUCT_ORDER_UNIT_LOOSE_KG),
(unicode(_("/piece -> Kg (loose)")), PRODUCT_ORDER_UNIT_LOOSE_PC_KG),
(unicode(_("/piece (named)")), PRODUCT_ORDER_UNIT_NAMED_PC),
(unicode(_("/Kg (named)")), PRODUCT_ORDER_UNIT_NAMED_KG),
(unicode(_("/piece -> Kg (named)")), PRODUCT_ORDER_UNIT_NAMED_PC_KG),
(unicode(_('As a deposit, a bag : always add this product to preparation list when the customer has purchased something.')), PRODUCT_ORDER_UNIT_DEPOSIT),
(unicode(_('As a subscription, common expense : add the minimal order quantity of this product to each customer of the group')), PRODUCT_ORDER_UNIT_SUBSCRIPTION),
(unicode(_('As a transportation cost : add the minimal order quantity of this product to the basket representing the group.')), PRODUCT_ORDER_UNIT_TRANSPORTATION),
) )
ADD_PORDUCT_MANUALY = '100' # zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
ADD_PRODUCT_MANUALY = '100'
ADD_PRODUCT_TO_CUSTOMER_BASKET_0 = '200' ADD_PRODUCT_TO_CUSTOMER_BASKET_0 = '200'
ADD_PRODUCT_TO_CUSTOMER_BASKET = '300' ADD_PRODUCT_TO_CUSTOMER_BASKET = '300'
ADD_PRODUCT_TO_GROUP_BASKET = '400' ADD_PRODUCT_TO_GROUP_BASKET = '400'
# ADD_PRODUCT_ADDED_WHEN_CREATING_A_PURCHASE_IN_ADMIN = "700"
# ADD_PRODUCT_DEACTIVATED_ADDED_WHEN_CREATING_A_PURCHASE_IN_ADMIN = "800"
LUT_ADD_PRODUCT = ( LUT_ADD_PRODUCT = (
(ADD_PORDUCT_MANUALY, _("As usual, let customers freely order it.")), (ADD_PRODUCT_MANUALY, _("As usual, let customers freely order it.")),
(ADD_PRODUCT_TO_CUSTOMER_BASKET_0, _('As a deposit, a bag : always add this product to preparation list when the customer has purchased something.')), (ADD_PRODUCT_TO_CUSTOMER_BASKET_0, _('As a deposit, a bag : always add this product to preparation list when the customer has purchased something.')),
(ADD_PRODUCT_TO_CUSTOMER_BASKET, _('As a subscription, common expense : add the minimal order quantity of this product to each customer of the group')), (ADD_PRODUCT_TO_CUSTOMER_BASKET, _('As a subscription, common expense : add the minimal order quantity of this product to each customer of the group')),
(ADD_PRODUCT_TO_GROUP_BASKET, _('As a transportation cost : add the minimal order quantity of this product to the basket representing the group.')), (ADD_PRODUCT_TO_GROUP_BASKET, _('As a transportation cost : add the minimal order quantity of this product to the basket representing the group.')),
) )
# zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
# LUT_ADD_PRODUCT_DISPLAY = (
# (ADD_PORDUCT_MANUALY, _("As usual, let customers freely order it.")),
# (ADD_PRODUCT_TO_CUSTOMER_BASKET_0, _('As a deposit, a bag : always add this product to preparation list when the customer has purchased something.')),
# (ADD_PRODUCT_TO_CUSTOMER_BASKET, _('As a subscription, common expense : add the minimal order quantity of this product to each customer of the group')),
# (ADD_PRODUCT_TO_GROUP_BASKET, _('As a transportation cost : add the minimal order quantity of this product to the basket representing the group.')),
# # (ADD_PRODUCT_TO_PERMANENCE_TEAM_MEMBER_BASKET, _('As a permanance team expense, motivation : add this product to permanence team members.')),
# # (ADD_PRODUCT_TO_STAFF_MEMBER_BASKET, _('As a staff expense : add this product to permanence staff member.')),
# (ADD_PRODUCT_ADDED_WHEN_CREATING_A_PURCHASE_IN_ADMIN, _('Product added when manually adding a purchase in the admin interface.')),
# (ADD_PRODUCT_DEACTIVATED_ADDED_WHEN_CREATING_A_PURCHASE_IN_ADMIN, _('Deactivated product added when manually adding a purchase in the admin interface.')),
# )
VAT_100 = '100' VAT_100 = '100'
VAT_200 = '200' VAT_200 = '200'
...@@ -85,12 +100,12 @@ VAT_500 = '500' ...@@ -85,12 +100,12 @@ VAT_500 = '500'
VAT_600 = '600' VAT_600 = '600'
LUT_VAT = ( LUT_VAT = (
(VAT_100, _('none')), (VAT_100, unicode(_('none'))),
(VAT_200, _('compensation 2%')), (VAT_200, unicode(_('compensation 2%'))),
(VAT_300, _('compensation 6%')), (VAT_300, unicode(_('compensation 6%'))),
(VAT_400, _('vat 6%')), (VAT_400, unicode(_('vat 6%'))),
(VAT_500, _('vat 12%')), (VAT_500, unicode(_('vat 12%'))),
(VAT_600, _('vat 21%')), (VAT_600, unicode(_('vat 21%'))),
) )
LUT_VAT_REVERSE = ( LUT_VAT_REVERSE = (
...@@ -101,3 +116,17 @@ LUT_VAT_REVERSE = ( ...@@ -101,3 +116,17 @@ LUT_VAT_REVERSE = (
( unicode(_('vat 12%')), VAT_500), ( unicode(_('vat 12%')), VAT_500),
( unicode(_('vat 21%')), VAT_600), ( unicode(_('vat 21%')), VAT_600),
) )
BANK_NOT_LATEST_TOTAL = '100'
# BANK_CALCULTAING_LATEST_TOTAL = '200'
BANK_NEXT_LATEST_TOTAL = '300'
BANK_LATEST_TOTAL = '400'
# update repanier_bankaccount set operation_status = '200' where operation_status = '400';
LUT_BANK_TOTAL = (
(BANK_NOT_LATEST_TOTAL, unicode(_('This is not the latest total'))),
# (BANK_CALCULTAING_LATEST_TOTAL, unicode(_('This is the previous latest total. The system is calculating the new one.'))),
(BANK_NEXT_LATEST_TOTAL, unicode(_('This is the next lastest bank total'))),
(BANK_LATEST_TOTAL, unicode(_('This is the lastest bank total'))),
)
\ No newline at end of file
This diff is collapsed.
...@@ -7,6 +7,8 @@ class Command(BaseCommand): ...@@ -7,6 +7,8 @@ class Command(BaseCommand):
help = 'Closes now orders on due date' help = 'Closes now orders on due date'
def handle(self, *args, **options): def handle(self, *args, **options):
something_to_close = tasks.close_orders_async_now() something_to_close = tasks.close_orders_now()
if something_to_close: if something_to_close:
self.stdout.write('At least on order being closed') self.stdout.write('At least on order being closed')
else:
self.stdout.write('Nothing to close')
...@@ -20,11 +20,45 @@ from django.core.urlresolvers import reverse ...@@ -20,11 +20,45 @@ from django.core.urlresolvers import reverse
import logging import logging
class PermanenceMenu(Menu):
class AccountMenu(Menu):
def get_nodes(self, request): def get_nodes(self, request):
nodes = [] nodes = []
master_id = 1 master_id = 1
last_customer_invoice_set = CustomerInvoice.objects.filter(customer__user_id=request.user.id).order_by('-id')[:1]
if last_customer_invoice_set:
last_customer_invoice = last_customer_invoice_set[0]
if last_customer_invoice.balance < 0:
node = NavigationNode(
_('My saldo : ') + '<font color="red">' + number_format(last_customer_invoice.balance, 2) + ' &euro;</font>',
reverse('invoice_view', args=(0,)),
id = master_id,
attr={'visible_for_authenticated' : True,
'visible_for_anonymous' : True, },
visible=True
)
else:
node = NavigationNode(
_('My saldo : ') + '<font color="green">' + number_format(last_customer_invoice.balance, 2) + ' &euro;</font>',
reverse('invoice_view', args=(0,)),
id = master_id,
attr={'visible_for_authenticated' : True,
'visible_for_anonymous' : True, },
visible=True
)
nodes.append(node)
separator = True
return nodes
menu_pool.register_menu(AccountMenu)
class PermanenceMenu(Menu):
def get_nodes(self, request):
nodes = []
master_id = 2
node = NavigationNode( node = NavigationNode(
_('Permanence'), _('Permanence'),
"/", "/",
...@@ -60,44 +94,7 @@ class PermanenceMenu(Menu): ...@@ -60,44 +94,7 @@ class PermanenceMenu(Menu):
visible=True visible=True
) )
nodes.append(node) nodes.append(node)
separator = True submenu_id += 1
last_customer_invoice_set = CustomerInvoice.objects.filter(customer__user_id=request.user.id).order_by('-id')[:1]
if last_customer_invoice_set:
last_customer_invoice = last_customer_invoice_set[0]
if(separator):
node = NavigationNode(
('------'),
"/",
id = submenu_id, parent_id = master_id,
attr={'visible_for_authenticated' : True,
'visible_for_anonymous' : True, },
visible=True
)
nodes.append(node)
submenu_id += 1
if last_customer_invoice.balance < 0:
node = NavigationNode(
_('My invoices (saldo : ') + '<font color="red">' + number_format(last_customer_invoice.balance, 2) + ' &euro;</font>)',
reverse('invoice_view', args=(0,)),
id = submenu_id, parent_id = master_id,
attr={'visible_for_authenticated' : True,
'visible_for_anonymous' : True, },
visible=True
)
submenu_id += 1
else:
node = NavigationNode(
_('My invoices (saldo : ') + '<font color="green">' + number_format(last_customer_invoice.balance, 2) + ' &euro;</font>)',
reverse('invoice_view', args=(0,)),
id = submenu_id, parent_id = master_id,
attr={'visible_for_authenticated' : True,
'visible_for_anonymous' : True, },
visible=True
)
submenu_id += 1
nodes.append(node)
separator = True separator = True
# node = NavigationNode( # node = NavigationNode(
...@@ -123,9 +120,9 @@ class PermanenceMenu(Menu): ...@@ -123,9 +120,9 @@ class PermanenceMenu(Menu):
# submenu_id += 1 # submenu_id += 1
msg = unicode(_(' (opened)')) msg = unicode(_(' (opened)'))
permanence_in_menu = False first_pass = True
for permanence in Permanence.objects.all().is_opened().order_by('distribution_date'): for permanence in Permanence.objects.all().is_opened().order_by('distribution_date'):
if(separator): if first_pass and separator:
node = NavigationNode( node = NavigationNode(
('------'), ('------'),
"/", "/",
...@@ -136,8 +133,7 @@ class PermanenceMenu(Menu): ...@@ -136,8 +133,7 @@ class PermanenceMenu(Menu):
) )
nodes.append(node) nodes.append(node)
submenu_id += 1 submenu_id += 1
separator = False first_pass = False
permanence_in_menu = True
node = NavigationNode( node = NavigationNode(
permanence.__unicode__() + msg, permanence.__unicode__() + msg,
reverse('order_view', args=(permanence.id,)), reverse('order_view', args=(permanence.id,)),
...@@ -148,12 +144,11 @@ class PermanenceMenu(Menu): ...@@ -148,12 +144,11 @@ class PermanenceMenu(Menu):
) )
nodes.append(node) nodes.append(node)
submenu_id += 1 submenu_id += 1
separator = permanence_in_menu
msg = unicode(_(' (closed)')) msg = unicode(_(' (closed)'))
permanence_in_menu = False first_pass = True
for permanence in Permanence.objects.all().is_send(): for permanence in Permanence.objects.all().is_send().order_by('-distribution_date'):
if(separator): if first_pass and separator:
node = NavigationNode( node = NavigationNode(
('------'), ('------'),
"/", "/",
...@@ -164,8 +159,7 @@ class PermanenceMenu(Menu): ...@@ -164,8 +159,7 @@ class PermanenceMenu(Menu):
) )
nodes.append(node) nodes.append(node)
submenu_id += 1 submenu_id += 1
separator = False first_pass = False
permanence_in_menu = True
node = NavigationNode( node = NavigationNode(
permanence.__unicode__() + msg, permanence.__unicode__() + msg,
reverse('order_view', args=(permanence.id,)), reverse('order_view', args=(permanence.id,)),
...@@ -176,7 +170,7 @@ class PermanenceMenu(Menu): ...@@ -176,7 +170,7 @@ class PermanenceMenu(Menu):
) )
nodes.append(node) nodes.append(node)
submenu_id += 1 submenu_id += 1
separator = permanence_in_menu
# for node in nodes: # for node in nodes:
# logging.debug('Node before : %s' % node.get_menu_title()) # logging.debug('Node before : %s' % node.get_menu_title())
# for attr in (x for x in dir(node) if not x.startswith('__')): # for attr in (x for x in dir(node) if not x.startswith('__')):
......
This diff is collapsed.
This diff is collapsed.
{% extends 'subpage_base.html' %} {% extends 'subpage_base_wo_cms_toolbar.html' %}
{% load cms_tags sekizai_tags i18n l10n repanier_tags %} {% load cms_tags sekizai_tags i18n l10n repanier_tags %}
{% block sub_content %} {% block sub_content %}
<div class="container"> <div class="container">
{# {% debug %} #} {# {% debug %} #}
<div class="panel {% if object.balance < 0 %}panel-danger{% else %}panel-success{% endif %}">
<div class="panel-heading">
<h4>{% trans "New balance" %} {{ object.customer.long_basket_name }} : {{ object.balance }}&nbsp;&euro; <small>({{ object.date_balance | date:"DATE_FORMAT" }})</small></h4>
</div>
</div>
{% if bank_account_set %} {% if bank_account_set %}
<h4>{% trans "Bank movement(s) :" %}</h4> <h4>{% trans "Bank movement(s) :" %}</h4>
<table class="table table-hover" > <table class="table table-hover table-bordered" >
<tr> <tr>
<thead>
<th> <th>
{% trans "Date" %} {% trans "Date" %}
</th> </th>
...@@ -20,16 +26,18 @@ ...@@ -20,16 +26,18 @@
{% trans "Comment" %} {% trans "Comment" %}
</th> </th>
<tr> <tr>
</thead>
<tbody>
{% for bank_account in bank_account_set %} {% for bank_account in bank_account_set %}
<tr> <tr>
<td> <td>
{{ bank_account.operation_date }} {{ bank_account.operation_date }}
</td> </td>
<td align="right"> <td align="right">
{{ bank_account.bank_amount_in }} &euro; {{ bank_account.bank_amount_in }}&nbsp;&euro;
</td> </td>
<td align="right"> <td align="right">
{{ bank_account.bank_amount_out }} &euro; {{ bank_account.bank_amount_out }}&nbsp;&euro;
</td> </td>
<td> <td>
{% if bank_account.operation_comment %} {% if bank_account.operation_comment %}
...@@ -38,13 +46,20 @@ ...@@ -38,13 +46,20 @@
</td> </td>
<tr> <tr>
{% endfor %} {% endfor %}
</tbody>
</table> </table>
{% else %} {% else %}
<h4>{% trans "No bank movement found" %}</h4> <h4>{% trans "No bank movement found" %}</h4>
{% endif %} {% endif %}
{% if purchase_set %} {% if purchase_set %}
<h4>{% trans "Purchase(s) :" %}</h4> <h4>{{ object.permanence }} - {% trans "Purchase(s) :" %} {{ object.total_price_with_tax }}&nbsp;&euro;</h4>
<table class="table table-hover" > {% if object.total_vat != 0 or object.total_compensation != 0 or object.total_deposit != 0 %}
<h4><small>{% trans "This price include" %} <span class="glyphicon glyphicon-arrow-right"></span> {% if object.total_vat != 0 %}{% trans "Vat" %} : {{ object.total_vat }}&nbsp;&euro;{% endif %}</small></h4>
<h4><small>{% if object.total_compensation != 0 %}{% if object.total_vat != 0 %}, {% endif %}{% trans "Compensation" %} : {{ object.total_compensation }}&nbsp;&euro;{% endif %}</small></h4>
<h4><small>{% if object.total_deposit != 0 %}{% if object.total_vat != 0 or object.total_compensation != 0 %}, {% endif %}{% trans "Deposit" %} : {{ object.total_deposit }}&nbsp;&euro;{% endif %}</small></h4>
{% endif %}
<table class="table table-hover table-bordered" >
<thead>
<tr> <tr>
<th> <th>
{% trans "Date" %} {% trans "Date" %}
...@@ -68,6 +83,8 @@ ...@@ -68,6 +83,8 @@
{% trans "Comment" %} {% trans "Comment" %}
</th>