Commit 598218ea authored by Patrick's avatar Patrick

More user friendly change "is into order" or not when the producer manage his/her production

parent 1d13f725
......@@ -238,6 +238,7 @@ BOX_VALUE_INT = -1
BOX_UNICODE = "📦" # http://unicode-table.com/fr/1F6CD/
LOCK_UNICODE = "🔐"
VALID_UNICODE = "✔"
BANK_NOTE_UNICODE = "💶"
LUT_CONFIRM = (
(True, LOCK_UNICODE), (False, EMPTY_STRING)
......@@ -247,6 +248,10 @@ LUT_VALID = (
(True, VALID_UNICODE), (False, EMPTY_STRING)
)
LUT_BANK_NOTE = (
(True, BANK_NOTE_UNICODE), (False, EMPTY_STRING)
)
CURRENCY_EUR = '100'
CURRENCY_CHF = '200'
CURRENCY_LOC = '300'
......
......@@ -365,7 +365,7 @@ class ProducerInvoice(models.Model):
default=DECIMAL_ZERO, max_digits=8, decimal_places=2)
calculated_invoiced_balance = ModelMoneyField(
_("calculated balance to be invoiced"), max_digits=8, decimal_places=2, default=DECIMAL_ZERO)
to_be_paid = models.BooleanField(_("to be paid"), choices=LUT_CONFIRM, default=False)
to_be_paid = models.BooleanField(_("to be paid"), choices=LUT_BANK_NOTE, default=False)
to_be_invoiced_balance = ModelMoneyField(
_("balance to be invoiced"), max_digits=8, decimal_places=2, default=DECIMAL_ZERO)
invoice_reference = models.CharField(
......
......@@ -156,17 +156,15 @@ class Permanence(TranslatableModel):
link = []
for pi in invoice.ProducerInvoice.objects.filter(permanence_id=self.id).select_related(
"producer").order_by('producer'):
label = "%s (%s) %s" % (
label = "%s (%s)" % (
pi.producer.short_profile_name,
pi.get_total_price_with_tax(),
pi.get_to_be_paid_display()
pi.get_total_price_with_tax()
)
link.append(
'<a href="%s?producer=%d" target="_blank" %s>%s</a>'
'<a href="%s?producer=%d" target="_blank">%s</a>'
% (
urlresolvers.reverse('producer_invoice_view', args=(pi.id,)),
pi.producer_id,
EMPTY_STRING if not pi.to_be_paid else '',
label.replace(' ', '&nbsp;')))
producers = ", ".join(link)
msg_html = """
......@@ -292,7 +290,7 @@ class Permanence(TranslatableModel):
args=(c.id,)
)
c_link = '&nbsp;->&nbsp;<a href="' + c_url + \
'" > target="_blank"' + c.short_basket_name.replace(' ', '&nbsp;') + '</a>'
'" target="_blank">' + c.short_basket_name.replace(' ', '&nbsp;') + '</a>'
if not first_board:
board += '<br/>'
board += r_link + c_link
......
......@@ -76,7 +76,7 @@ class Producer(models.Model):
producer_pre_opening = models.BooleanField(_("producer pre-opening"), default=False)
producer_price_are_wo_vat = models.BooleanField(_("producer price are wo vat"), default=False)
sort_products_by_reference = models.BooleanField(_("sort products by reference"), default=False)
to_be_paid = models.BooleanField(_("to be paid"), default=False)
to_be_paid = models.BooleanField(_("to be paid"), choices=LUT_BANK_NOTE, default=False)
price_list_multiplier = models.DecimalField(
_("price_list_multiplier"),
......
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