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
.. code:: bash
sudo apt-get install gettext unzip
sudo apt-get python-setuptools
# vv For the PostgreSQL connector
sudo apt-get install libpq-dev python-dev
# 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
# vv for docx
sudo apt-get install libxml2-dev libxslt1-dev
sudo apt-get install gettext unzip
sudo apt-get install python-setuptools
# vv For the PostgreSQL connector
sudo apt-get install libpq-dev python-dev
# 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
# vv for docx
sudo apt-get install libxml2-dev libxslt1-dev
......
......@@ -57,13 +57,13 @@ Check if CMS install is ok
python manage.py cms check --settings=ptidej.ptidej_settings
Compile translation files
.. Compile translation files
.. code:: bash
.. .. code:: bash
cd ~/v1/mysite/repanier
export DJANGO_SETTINGS_MODULE=
django-admin.py compilemessages
.. cd ~/v1/mysite/repanier
.. export DJANGO_SETTINGS_MODULE=
.. django-admin.py compilemessages
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
# Start Uwsgi
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
When needed, upgrade the DB with south for a new version of specific INSTALLED_APPS (eg repanier)
......
......@@ -16,6 +16,7 @@ pip install psycopg2
# ELSE installing the latest development version
# pip install https://github.com/divio/django-cms/archive/develop.zip
# OR UPGRADE
pip install -U django
pip install -U https://github.com/divio/django-cms/archive/develop.zip
# ELSE installing a specific version
# pip install https://github.com/divio/django-cms/archive/3.0.0.beta3.zip
......@@ -37,10 +38,12 @@ pip install -U django_compressor
pip install -U django-admin-sortable2
pip install -U openpyxl
# pip install -U django-hvad
pip install -U docx
# pip install -U docx
# pip install django_debug_toolbar
# pip install django-dajaxice ! not working with Django 1.6
# pip install django-custom-user
# pip install django-registration
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 = (
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 = {
......@@ -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'
FILER_ENABLE_LOGGING = False
......
......@@ -8,8 +8,13 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<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-theme.min.css">{% endaddtoblock %}
{% addtoblock "css" %}<link rel="stylesheet" href="{{ STATIC_URL}}bootstrap/css/custom.css">{% endaddtoblock %}
{% 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">
a.skip_link{
position:absolute;
......@@ -52,23 +57,31 @@
<li><a href="{% url "logout_form" %}">{% trans "Logout" %}</a></li>
</ul>
</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 %}
<li class="dropdown">
<a href="{% url "login_form" %}">{% trans "Login" %}</a>
</li>
{% endif %}
{% if languages.len > 1 %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Language" %} <b class="caret"></b></a>
<ul class="dropdown-menu">
{% language_chooser "native" %}
</ul>
</li>
{% endif %}
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<!-- Begin page content -->
<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 %}
<!-- Footer -->
<div id="footer" class="container">
......
......@@ -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>Contraction de repas et panier, repanier est le fruit de l'expérience des membres de plusieurs groupements d'achats</p>
<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://apero.gasath.be/">Gasath, groupe apéro</a>, une trentaine d'acheteurs de produits locaux et 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.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.lebiodici.be/">Le Bio d'Ici</a>, une quinzaine de maraîchers bio regroupés pour les restaurants, collectivités locales, ...</li>
</ul>
......
{% load menu_tags i18n %}
{% for language in languages %}
<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 %}
\ 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 *
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
SITE_ID_REPANIER = 1
SITE_ID_PRODUCER = 2
SITE_ID_EPI_D_ICI = 6
DECIMAL_ZERO = Decimal('0')
DECIMAL_ONE = Decimal('1')
DECIMAL_0_01 = Decimal('.01')
DECIMAL_0_001 = Decimal('.001')
DECIMAL_0_0001 = Decimal('.0001')
PERMANENCE_DISABLED = '050'
PERMANENCE_PLANIFIED = '100'
......@@ -24,58 +21,76 @@ PERMANENCE_DONE = '800'
PERMANENCE_CANCELED = '900'
LUT_PERMANENCE_STATUS = (
(PERMANENCE_DISABLED, _('disabled')),
(PERMANENCE_PLANIFIED, _('planified')),
(PERMANENCE_WAIT_FOR_OPEN, _('wait for open')),
(PERMANENCE_OPENED, _('orders opened')),
(PERMANENCE_WAIT_FOR_SEND, _('wait for send')),
(PERMANENCE_SEND, _('orders send to producers')),
(PERMANENCE_WAIT_FOR_DONE, _('wait for done')),
(PERMANENCE_INVOICES_VALIDATION_FAILED, _('invoices validation test failed')),
(PERMANENCE_DONE, _('done'))
(PERMANENCE_DISABLED, unicode(_('disabled'))),
(PERMANENCE_PLANIFIED, unicode(_('planified'))),
(PERMANENCE_WAIT_FOR_OPEN, unicode(_('wait for open'))),
(PERMANENCE_OPENED, unicode(_('orders opened'))),
(PERMANENCE_WAIT_FOR_SEND, unicode(_('wait for send'))),
(PERMANENCE_SEND, unicode(_('orders send to producers'))),
(PERMANENCE_WAIT_FOR_DONE, unicode(_('wait for done'))),
(PERMANENCE_INVOICES_VALIDATION_FAILED, unicode(_('invoices validation test failed'))),
(PERMANENCE_DONE, unicode(_('done')))
)
PRODUCT_PLACEMENT_FREEZER = '100'
PRODUCT_PLACEMENT_FRIDGE = '200'
PRODUCT_PLACEMENT_OUT_OF_BASKET = '300'
PRODUCT_PLACEMENT_BASKET_BOTTOM = '400'
PRODUCT_PLACEMENT_BASKET_MIDDLE = '500'
PRODUCT_PLACEMENT_BASKET_TOP = '600'
PRODUCT_PLACEMENT_BASKET = '400'
LUT_PRODUCT_PLACEMENT = (
(PRODUCT_PLACEMENT_FREEZER, _('freezer')),
(PRODUCT_PLACEMENT_FRIDGE, _('fridge')),
(PRODUCT_PLACEMENT_OUT_OF_BASKET, _('loose, out of the basket')),
(PRODUCT_PLACEMENT_BASKET_BOTTOM, _('bottom of basket')),
(PRODUCT_PLACEMENT_BASKET_MIDDLE, _('middle of basket')),
(PRODUCT_PLACEMENT_BASKET_TOP, _('top of basket')),
(PRODUCT_PLACEMENT_FREEZER, unicode(_('freezer'))),
(PRODUCT_PLACEMENT_FRIDGE, unicode(_('fridge'))),
(PRODUCT_PLACEMENT_OUT_OF_BASKET, unicode(_('loose, out of the basket'))),
(PRODUCT_PLACEMENT_BASKET, unicode(_('into the 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 = '300'
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 = (
(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, _('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.')),
)
# 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.')),
# )
# zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
VAT_100 = '100'
VAT_200 = '200'
......@@ -85,12 +100,12 @@ VAT_500 = '500'
VAT_600 = '600'
LUT_VAT = (
(VAT_100, _('none')),
(VAT_200, _('compensation 2%')),
(VAT_300, _('compensation 6%')),
(VAT_400, _('vat 6%')),
(VAT_500, _('vat 12%')),
(VAT_600, _('vat 21%')),
(VAT_100, unicode(_('none'))),
(VAT_200, unicode(_('compensation 2%'))),
(VAT_300, unicode(_('compensation 6%'))),
(VAT_400, unicode(_('vat 6%'))),
(VAT_500, unicode(_('vat 12%'))),
(VAT_600, unicode(_('vat 21%'))),
)
LUT_VAT_REVERSE = (
......@@ -101,3 +116,17 @@ LUT_VAT_REVERSE = (
( unicode(_('vat 12%')), VAT_500),
( 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):
help = 'Closes now orders on due date'
def handle(self, *args, **options):
something_to_close = tasks.close_orders_async_now()
something_to_close = tasks.close_orders_now()
if something_to_close:
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
import logging
class PermanenceMenu(Menu):
class AccountMenu(Menu):
def get_nodes(self, request):
nodes = []
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(
_('Permanence'),
"/",
......@@ -60,44 +94,7 @@ class PermanenceMenu(Menu):
visible=True
)
nodes.append(node)
separator = True
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)
submenu_id += 1
separator = True
# node = NavigationNode(
......@@ -123,9 +120,9 @@ class PermanenceMenu(Menu):
# submenu_id += 1
msg = unicode(_(' (opened)'))
permanence_in_menu = False
first_pass = True
for permanence in Permanence.objects.all().is_opened().order_by('distribution_date'):
if(separator):
if first_pass and separator:
node = NavigationNode(
('------'),
"/",
......@@ -136,8 +133,7 @@ class PermanenceMenu(Menu):
)
nodes.append(node)
submenu_id += 1
separator = False
permanence_in_menu = True
first_pass = False
node = NavigationNode(
permanence.__unicode__() + msg,
reverse('order_view', args=(permanence.id,)),
......@@ -148,12 +144,11 @@ class PermanenceMenu(Menu):
)
nodes.append(node)
submenu_id += 1
separator = permanence_in_menu
msg = unicode(_(' (closed)'))
permanence_in_menu = False
for permanence in Permanence.objects.all().is_send():
if(separator):
first_pass = True
for permanence in Permanence.objects.all().is_send().order_by('-distribution_date'):
if first_pass and separator:
node = NavigationNode(
('------'),
"/",
......@@ -164,8 +159,7 @@ class PermanenceMenu(Menu):
)
nodes.append(node)
submenu_id += 1
separator = False
permanence_in_menu = True
first_pass = False
node = NavigationNode(
permanence.__unicode__() + msg,
reverse('order_view', args=(permanence.id,)),
......@@ -176,7 +170,7 @@ class PermanenceMenu(Menu):
)
nodes.append(node)
submenu_id += 1
separator = permanence_in_menu
# for node in nodes:
# logging.debug('Node before : %s' % node.get_menu_title())
# 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 %}
{% block sub_content %}
<div class="container">
{# {% 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 %}
<h4>{% trans "Bank movement(s) :" %}</h4>
<table class="table table-hover" >
<table class="table table-hover table-bordered" >
<tr>
<thead>
<th>
{% trans "Date" %}
</th>
......@@ -20,16 +26,18 @@
{% trans "Comment" %}
</th>
<tr>
</thead>
<tbody>
{% for bank_account in bank_account_set %}
<tr>
<td>
{{ bank_account.operation_date }}
</td>
<td align="right">
{{ bank_account.bank_amount_in }} &euro;
{{ bank_account.bank_amount_in }}&nbsp;&euro;
</td>
<td align="right">
{{ bank_account.bank_amount_out }} &euro;
{{ bank_account.bank_amount_out }}&nbsp;&euro;
</td>
<td>
{% if bank_account.operation_comment %}
......@@ -38,13 +46,20 @@
</td>
<tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h4>{% trans "No bank movement found" %}</h4>
{% endif %}
{% if purchase_set %}
<h4>{% trans "Purchase(s) :" %}</h4>
<table class="table table-hover" >
<h4>{{ object.permanence }} - {% trans "Purchase(s) :" %} {{ object.total_price_with_tax }}&nbsp;&euro;</h4>
{% 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>
<th>
{% trans "Date" %}
......@@ -68,6 +83,8 @@
{% trans "Comment" %}
</th>
<tr>
</thead>
<tbody>
{% for purchase in purchase_set %}
<tr>
<td>
......@@ -80,13 +97,13 @@
{{ purchase.long_name }}
</td>
<td align="right">
{{ purchase.quantity }}
{{ purchase.quantity | floatformat:3 }}
</td>
<td align="right">
{{ purchase.original_unit_price }} &euro;{% if purchase.unit_deposit %} <span class="glyphicon glyphicon-plus"></span> {{ purchase.unit_deposit }} &euro; <span class="glyphicon glyphicon-leaf"></span>{% endif %}
{{ purchase.real_unit_price }}&nbsp;&euro;{% if purchase.unit_deposit %} <span class="glyphicon glyphicon-plus"></span> {{ purchase.unit_deposit }}&nbsp;&euro; <span class="glyphicon glyphicon-leaf"></span>{% endif %}
</td>
<td align="right">
{{ purchase.price_with_tax }} &euro;
{% if purchase.invoiced_price_with_compensation %}{{ purchase.price_with_compensation }}{% else %}{{ purchase.price_with_vat }}{% endif %}&nbsp;&euro;
</td>
<td>
{% if purchase.comment %}
......@@ -95,43 +112,28 @@
</td>
<tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h4>{% trans "No purchase found" %}</h4>
{% endif %}
<h4>{% trans "Previous balance" %} : {{ object.previous_balance }}&nbsp;&euro; <small>({{ object.date_previous_balance | date:"DATE_FORMAT" }})</small></h4>
</div>
{% endblock %}
{% block footer %}
<div class="btn-group">
{% if previous_customer_invoice_id %}
<a href="{% url 'invoice_view' previous_customer_invoice_id %}" class="btn btn-disabled"><span class="glyphicon glyphicon-arrow-left"></span></a>
<a href="{% url 'invoice_view' previous_customer_invoice_id %}" class="btn btn-success btn-disabled"><span class="glyphicon glyphicon-arrow-left"></span></a>
{% else %}
<a href="#" class="btn btn-disabled"></a>
{% endif %}
{% if previous_customer_invoice_id or next_customer_invoice_id %}
<a href="#" class="btn btn-disabled">{% trans "Page " %}</a>
<a href="#" class="btn btn-disabled"> {% trans "Invoice" %} </a>
{% endif %}
{% if next_customer_invoice_id %}
<a href="{% url 'invoice_view' next_customer_invoice_id %}" class="btn btn-disabled"><span class="glyphicon glyphicon-arrow-right"></span></a>
<a href="{% url 'invoice_view' next_customer_invoice_id %}" class="btn btn-success btn-disabled"><span class="glyphicon glyphicon-arrow-right"></span></a>
{% else %}
<a href="#" class="btn btn-disabled"></a>
{% endif %}
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary disabled">{% trans "Previous balance" %} {{ object.previous_balance }} &euro;</button>
{% if object.bank_amount_in != 0 %}
<button type="button" class="btn btn-primary disabled"> + </button>
<button type="button" class="btn btn-primary disabled">{% trans "Payment" %} {{ object.bank_amount_in }} &euro;</button>
{% endif %}
{% if object.bank_amount_out != 0 %}
<button type="button" class="btn btn-primary disabled"> - </button>
<button type="button" class="btn btn-primary disabled">{% trans "Refund" %} {{ object.bank_amount_out }} &euro;</button>
{% endif %}
{% if object.total_price_with_tax != 0 %}
<button type="button" class="btn btn-primary disabled"> - </button>
<button type="button" class="btn btn-primary disabled">{% trans "Purchase" %} {{ object.total_price_with_tax }} &euro;</button>
{% endif %}
<button type="button" class="btn btn-primary disabled"> = </button>
<button type="button" class="btn {% if object.balance < 0 %}btn-danger{% else %}btn-success{% endif %}">{% trans "New balance" %} {{ object.balance }} &euro;</button>
</div>
{% endblock %}
\ No newline at end of file
This diff is collapsed.
{% extends 'subpage_base.html' %}
{% extends 'subpage_base_wo_cms_toolbar.html' %}
{% load cms_tags sekizai_tags i18n l10n repanier_tags %}
{% block sub_content %}
<div class="container">
{% if user.customer.may_order %}
{% if permanenceboard_list %}
<br/>
{# .... **End of the pagination section** .... #}
......@@ -57,6 +58,9 @@ $(document).ready(function() {
});
</script>
{% endaddtoblock %}
{% else %}
<h3>{% trans "You are not allowed to order products" %}</h3>
{% endif %}
</div>
{% endblock %}
{% block footer %}
......@@ -64,7 +68,7 @@ $(document).ready(function() {
<div class="btn-group">
<div class="btn-group">
{% if page_obj.has_previous%}
<a href="?page={{ page_obj.previous_page_number }}" class="btn btn-disabled"><span class="glyphicon glyphicon-arrow-left"></span></a>
<a href="?page={{ page_obj.previous_page_number }}" class="btn btn-success btn-disabled"><span class="glyphicon glyphicon-arrow-left"></span></a>
{% else %}
<a href="#" class="btn btn-disabled"></a>
{% endif %}
......@@ -72,7 +76,7 @@ $(document).ready(function() {
<a href="#" class="btn btn-disabled">{% trans "Page " %} {{ page_obj.number }} {% trans "of" %} {{ page_obj.paginator.num_pages }}</a>
{% endif %}
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}" class="btn btn-disabled"><span class="glyphicon glyphicon-arrow-right"></span></a>
<a href="?page={{ page_obj.next_page_number }}" class="btn btn-success btn-disabled"><span class="glyphicon glyphicon-arrow-right"></span></a>
{% else %}
<a href="#" class="btn btn-disabled"></a>
{% endif %}
......
......@@ -86,11 +86,17 @@ def repanier_select_qty(context, *args, **kwargs):
qty_display = get_qty_display(
q_valid,
q_average_weight,
offer_item.product.order_by_kg_pay_by_kg,
offer_item.product.order_by_piece_pay_by_kg
offer_item.product.order_unit
)
result += '<option value="'+ str(q_select_id) + '" '+ selected + '>'+ qty_display +'</option>'
q_valid = q_valid + q_step
if q_valid < q_step:
# 1; 2; 4; 6; 8 ... q_min = 1; q_step = 2
# 0,5; 1; 2; 3 ... q_min = 0,5; q_step = 1
q_valid = q_step
else:
# 1; 2; 3; 4 ... q_min = 1; q_step = 1
# 0,125; 0,175; 0,225 ... q_min = 0,125; q_step = 0,50
q_valid = q_valid + q_step
if q_order_is_displayed == False:
# An custom order_qty > q_alert
q_select_id = q_select_id + 1
......@@ -98,8 +104,7 @@ def repanier_select_qty(context, *args, **kwargs):
qty_display = get_qty_display(
q_order,
q_average_weight,
offer_item.product.order_by_kg_pay_by_kg,
offer_item.product.order_by_piece_pay_by_kg
offer_item.product.order_unit
)
result += '<option value="'+ str(q_select_id) + '" '+ selected + '>'+ qty_display +'</option>'
result += '</select>'
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment