Merge branch 'master' into Production

This commit is contained in:
Martin Pépin 2017-04-05 23:33:20 +01:00
commit 387edd2fd5
4 changed files with 58 additions and 36 deletions

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('kfet', '0052_category_addcost'),
]
operations = [
migrations.AlterField(
model_name='account',
name='created_at',
field=models.DateTimeField(default=django.utils.timezone.now),
),
]

View file

@ -41,7 +41,7 @@ class Account(models.Model):
max_digits = 6, decimal_places = 2, max_digits = 6, decimal_places = 2,
default = 0) default = 0)
is_frozen = models.BooleanField("est gelé", default = False) is_frozen = models.BooleanField("est gelé", default = False)
created_at = models.DateTimeField(auto_now_add = True, null = True) created_at = models.DateTimeField(default=timezone.now)
# Optional # Optional
PROMO_CHOICES = [(r,r) for r in range(1980, date.today().year+1)] PROMO_CHOICES = [(r,r) for r in range(1980, date.today().year+1)]
promo = models.IntegerField( promo = models.IntegerField(

View file

@ -23,6 +23,7 @@
<div class="column-row"> <div class="column-row">
<div class="column-sm-1 column-md-2 column-lg-3"> <div class="column-sm-1 column-md-2 column-lg-3">
<div class="unbreakable carte-inverted"> <div class="unbreakable carte-inverted">
{% if pressions %}
<h3>Pressions du moment</h3> <h3>Pressions du moment</h3>
<ul class="carte"> <ul class="carte">
{% for article in pressions %} {% for article in pressions %}
@ -33,6 +34,7 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %}
</div><!-- endblock unbreakable --> </div><!-- endblock unbreakable -->
{% for article in articles %} {% for article in articles %}
{% ifchanged article.category %} {% ifchanged article.category %}
@ -49,7 +51,7 @@
<span class="carte-label">{{ article.name }}</span> <span class="carte-label">{{ article.name }}</span>
<span class="carte-ukf">{{ article.price | ukf:False}} UKF</span> <span class="carte-ukf">{{ article.price | ukf:False}} UKF</span>
</li> </li>
{% if foorloop.last %} {% if forloop.last %}
</ul> </ul>
</div><!-- endblock unbreakable --> </div><!-- endblock unbreakable -->
{% endif %} {% endif %}

View file

@ -839,7 +839,7 @@ $(document).ready(function() {
var reduc_divisor = 1; var reduc_divisor = 1;
if (account_data['is_cof']) if (account_data['is_cof'])
reduc_divisor = 1 + settings['subvention_cof'] / 100; reduc_divisor = 1 + settings['subvention_cof'] / 100;
return amount_euro / reduc_divisor; return (amount_euro / reduc_divisor).toFixed(2);
} }
function addPurchase(id, nb) { function addPurchase(id, nb) {
@ -853,7 +853,7 @@ $(document).ready(function() {
} }
}); });
if (!existing) { if (!existing) {
var amount_euro = amountEuroPurchase(id, nb).toFixed(2); var amount_euro = amountEuroPurchase(id, nb);
var index = addPurchaseToFormset(article_data[1], nb, amount_euro); var index = addPurchaseToFormset(article_data[1], nb, amount_euro);
article_basket_html = $(item_basket_default_html); article_basket_html = $(item_basket_default_html);
article_basket_html article_basket_html