mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
Mise à jour de février (#581)
Co-authored-by: Thomas Girod <thgirod@hotmail.com> Co-authored-by: Julien Constant <julienconstant190@gmail.com> Co-authored-by: Skia <skia@hya.sk>
This commit is contained in:
@ -245,12 +245,13 @@ class Invoice(models.Model):
|
||||
def validate(self):
|
||||
if self.validated:
|
||||
raise DataError(_("Invoice already validated"))
|
||||
customer, created = Customer.get_or_create(user=self.user)
|
||||
eboutic = Counter.objects.filter(type="EBOUTIC").first()
|
||||
for i in self.items.all():
|
||||
if i.type_id == settings.SITH_COUNTER_PRODUCTTYPE_REFILLING:
|
||||
new = Refilling(
|
||||
counter=eboutic,
|
||||
customer=self.user.customer,
|
||||
customer=customer,
|
||||
operator=self.user,
|
||||
amount=i.product_unit_price * i.quantity,
|
||||
payment_method="CARD",
|
||||
@ -266,7 +267,7 @@ class Invoice(models.Model):
|
||||
club=product.club,
|
||||
product=product,
|
||||
seller=self.user,
|
||||
customer=self.user.customer,
|
||||
customer=customer,
|
||||
unit_price=i.product_unit_price,
|
||||
quantity=i.quantity,
|
||||
payment_method="CARD",
|
||||
|
@ -111,7 +111,7 @@
|
||||
<i class="fa fa-2x fa-picture-o product-image" ></i>
|
||||
{% endif %}
|
||||
<div class="product-description">
|
||||
<h4>{{ p.name }}</strong></h4>
|
||||
<h4>{{ p.name }}</h4>
|
||||
<p>{{ p.selling_price }} €</p>
|
||||
</div>
|
||||
</button>
|
||||
|
Reference in New Issue
Block a user