Commit 405078dd authored by Patrick's avatar Patrick

Send a copy of orders of a customer sub group to the leaders of the sub group when closing orders

parent 6c47d07a
......@@ -8,6 +8,7 @@ from django.utils.html import strip_tags
from django.utils.translation import ugettext_lazy as _
from openpyxl.writer.excel import save_virtual_workbook
from repanier.models import DeliveryBoard
from repanier.models import Customer
from repanier.models import Permanence, Configuration, CustomerInvoice
from repanier.models import PermanenceBoard
......@@ -20,7 +21,8 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr
from repanier.apps import REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_BOARD, \
REPANIER_SETTINGS_GROUP_NAME, REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_PRODUCER, \
REPANIER_SETTINGS_SEND_ABSTRACT_ORDER_MAIL_TO_PRODUCER, \
REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_CUSTOMER
REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_CUSTOMER, \
REPANIER_SETTINGS_CUSTOMERS_MUST_CONFIRM_ORDERS
cur_language = translation.get_language()
for language in settings.PARLER_LANGUAGES[settings.SITE_ID]:
language_code = language["code"]
......@@ -36,77 +38,92 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr
slugify(filename)
)
sender_email, sender_function, signature, cc_email_staff = get_signature(is_reply_to_order_email=True)
board_composition, board_composition_and_description = get_board_composition(permanence.id)
# Orders send to the preparation team
if closed_deliveries_id:
# closed_deliveries_id is not empty list and not "None"
# all_producers is True
for delivery_id in closed_deliveries_id:
delivery_board = DeliveryBoard.objects.filter(
id=delivery_id
).exclude(
delivery_point__customer_responsible=None
).order_by('?').first()
if delivery_board is not None:
# Send a recap of the orders to the responsible
delivery_point = delivery_board.delivery_point
customer = delivery_point.customer_responsible
# Orders send to the preparation group
export_order_2_1_group(config, customer, delivery_point, [delivery_id], filename, permanence,
sender_email, sender_function, signature)
group_wb = xlsx_order.export_abstract(permanence=permanence, deliveries_id=closed_deliveries_id, wb=None)
if group_wb is not None:
abstract_ws = group_wb.get_active_sheet()
else:
abstract_ws = None
if all_producers:
if group_wb is not None:
# At least one order
if all_producers and group_wb is not None:
# Orders send to the preparation team
# At least one order
group_wb = xlsx_order.export_customer_label(
permanence=permanence, deliveries_id=closed_deliveries_id, wb=group_wb
)
group_wb = xlsx_order.export_preparation(
permanence=permanence, deliveries_id=closed_deliveries_id, wb=group_wb
)
group_wb = xlsx_stock.export_permanence_stock(
permanence=permanence, customer_price=True, wb=group_wb
)
group_wb = xlsx_order.export_customer(
permanence=permanence, deliveries_id=closed_deliveries_id, deposit=True, wb=group_wb
)
group_wb = xlsx_order.export_customer(
permanence=permanence, deliveries_id=closed_deliveries_id, wb=group_wb
)
group_wb = xlsx_order.export_customer_label(
permanence=permanence, deliveries_id=closed_deliveries_id, wb=group_wb
)
group_wb = xlsx_order.export_preparation(
permanence=permanence, deliveries_id=closed_deliveries_id, wb=group_wb
)
group_wb = xlsx_stock.export_permanence_stock(
permanence=permanence, customer_price=True, wb=group_wb
)
group_wb = xlsx_order.export_customer(
permanence=permanence, deliveries_id=closed_deliveries_id, deposit=True, wb=group_wb
)
group_wb = xlsx_order.export_customer(
permanence=permanence, deliveries_id=closed_deliveries_id, wb=group_wb
)
to_email_board = []
for permanence_board in PermanenceBoard.objects.filter(
permanence=permanence.id).order_by('?'):
if permanence_board.customer:
to_email_board.append(permanence_board.customer.user.email)
to_email_board = []
for permanence_board in PermanenceBoard.objects.filter(
permanence=permanence.id).order_by('?'):
if permanence_board.customer:
to_email_board.append(permanence_board.customer.user.email)
try:
order_staff_mail = config.order_staff_mail
except TranslationDoesNotExist:
order_staff_mail = EMPTY_STRING
# order_staff_mail_subject = "%s - %s - %s" % (
# _('Permanence preparation list'), permanence, REPANIER_SETTINGS_GROUP_NAME)
order_staff_mail_subject = "%s - %s" % (REPANIER_SETTINGS_GROUP_NAME, permanence)
try:
order_staff_mail = config.order_staff_mail
except TranslationDoesNotExist:
order_staff_mail = EMPTY_STRING
order_staff_mail_subject = "%s - %s" % (REPANIER_SETTINGS_GROUP_NAME, permanence)
template = Template(order_staff_mail)
context = TemplateContext({
'permanence_link' : mark_safe('<a href="http://%s%s">%s</a>' % (
settings.ALLOWED_HOSTS[0], reverse('order_view', args=(permanence.id,)), permanence)),
'board_composition' : mark_safe(board_composition),
'board_composition_and_description': mark_safe(board_composition_and_description),
'signature' : mark_safe(
'%s<br/>%s<br/>%s' % (signature, sender_function, REPANIER_SETTINGS_GROUP_NAME))
})
html_content = template.render(context)
email = EmailMultiAlternatives(
order_staff_mail_subject,
strip_tags(html_content),
from_email=sender_email,
to=to_email_board,
cc=cc_email_staff
)
if group_wb is not None:
email.attach(group_filename,
save_virtual_workbook(group_wb),
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
email.attach_alternative(html_content, "text/html")
board_composition, board_composition_and_description = get_board_composition(permanence.id)
if not REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_BOARD:
email.to = cc_email_staff
email.cc = []
email.bcc = []
send_email(email=email)
template = Template(order_staff_mail)
context = TemplateContext({
'permanence_link' : mark_safe('<a href="http://%s%s">%s</a>' % (
settings.ALLOWED_HOSTS[0], reverse('order_view', args=(permanence.id,)), permanence)),
'board_composition' : mark_safe(board_composition),
'board_composition_and_description': mark_safe(board_composition_and_description),
'signature' : mark_safe(
'%s<br/>%s<br/>%s' % (signature, sender_function, REPANIER_SETTINGS_GROUP_NAME))
})
html_content = template.render(context)
email = EmailMultiAlternatives(
order_staff_mail_subject,
strip_tags(html_content),
from_email=sender_email,
to=to_email_board,
cc=cc_email_staff
)
if group_wb is not None:
email.attach(group_filename,
save_virtual_workbook(group_wb),
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
email.attach_alternative(html_content, "text/html")
if not REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_BOARD:
email.to = cc_email_staff
email.cc = []
email.bcc = []
send_email(email=email)
# Orders send to our producers
if REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_PRODUCER:
......@@ -136,8 +153,6 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr
order_producer_mail = config.order_producer_mail
except TranslationDoesNotExist:
order_producer_mail = EMPTY_STRING
# order_producer_mail_subject = "%s - %s - %s" % (
# _('Permanence preparation list'), permanence, REPANIER_SETTINGS_GROUP_NAME)
order_producer_mail_subject = "%s - %s" % (REPANIER_SETTINGS_GROUP_NAME, permanence)
template = Template(order_producer_mail)
......@@ -201,22 +216,18 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr
permanence_id=permanence_id,
status=PERMANENCE_OPENED
).order_by('?').exists())
if all_producers_closed:
if closed_deliveries_id is None:
customer_set = Customer.objects.filter(
represent_this_buyinggroup=False,
customerinvoice__is_order_confirm_send=False,
customerinvoice__permanence_id=permanence.id,
language=language_code
).order_by('?')
else:
customer_set = Customer.objects.filter(
represent_this_buyinggroup=False,
customerinvoice__is_order_confirm_send=False,
customerinvoice__permanence_id=permanence.id,
if all_producers_closed and not REPANIER_SETTINGS_CUSTOMERS_MUST_CONFIRM_ORDERS:
# REPANIER_SETTINGS_CUSTOMERS_MUST_CONFIRM_ORDERS -> Do not send cancelled orders
customer_set = Customer.objects.filter(
represent_this_buyinggroup=False,
customerinvoice__is_order_confirm_send=False,
customerinvoice__permanence_id=permanence.id,
language=language_code
).order_by('?')
if closed_deliveries_id is not None:
customer_set = customer_set.filter(
customerinvoice__delivery_id__in=closed_deliveries_id,
language=language_code
).order_by('?')
)
for customer in customer_set:
export_order_2_1_customer(
customer, filename, permanence, sender_email,
......@@ -231,6 +242,74 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr
translation.activate(cur_language)
def export_order_2_1_group(config, customer, delivery_point, closed_delivery_id, filename, permanence, sender_email,
sender_function, signature):
from repanier.apps import REPANIER_SETTINGS_GROUP_NAME
group_wb = xlsx_order.export_abstract(permanence=permanence, deliveries_id=closed_delivery_id, group=True, wb=None)
if group_wb is not None:
# At least one order
group_wb = xlsx_order.export_customer_label(
permanence=permanence, deliveries_id=closed_delivery_id, wb=group_wb
)
group_wb = xlsx_order.export_preparation(
permanence=permanence, deliveries_id=closed_delivery_id, wb=group_wb
)
group_wb = xlsx_order.export_customer(
permanence=permanence, deliveries_id=closed_delivery_id, deposit=True, wb=group_wb
)
group_wb = xlsx_order.export_customer(
permanence=permanence, deliveries_id=closed_delivery_id, wb=group_wb
)
try:
order_customer_mail = config.order_customer_mail
except TranslationDoesNotExist:
order_customer_mail = EMPTY_STRING
order_customer_mail_subject = "%s - %s" % (REPANIER_SETTINGS_GROUP_NAME, permanence)
to_email_customer = [customer.user.email]
if customer.email2:
to_email_customer.append(customer.email2)
long_basket_name = customer.long_basket_name if customer.long_basket_name is not None else customer.short_basket_name
template = Template(order_customer_mail)
context = TemplateContext({
'name' : long_basket_name,
'long_basket_name' : long_basket_name,
'basket_name' : customer.short_basket_name,
'short_basket_name': customer.short_basket_name,
'permanence_link' : mark_safe('<a href="http://%s%s">%s</a>' % (
settings.ALLOWED_HOSTS[0], reverse('order_view', args=(permanence.id,)), permanence)),
'last_balance_link': mark_safe('<a href="http://%s%s">%s</a>' % (
settings.ALLOWED_HOSTS[0], reverse('customer_invoice_view', args=(0,)), _("Group invoices"))),
'last_balance' : EMPTY_STRING,
'order_amount' : EMPTY_STRING,
'on_hold_movement' : EMPTY_STRING,
'payment_needed' : EMPTY_STRING,
'delivery_point' : delivery_point,
'signature' : mark_safe(
'%s<br/>%s<br/>%s' % (signature, sender_function, REPANIER_SETTINGS_GROUP_NAME))
})
html_content = template.render(context)
email = EmailMultiAlternatives(
order_customer_mail_subject,
strip_tags(html_content),
from_email=sender_email,
to=to_email_customer
)
email.attach(filename,
save_virtual_workbook(group_wb),
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
email.attach_alternative(html_content, "text/html")
send_email(email=email)
def export_order_2_1_customer(customer, filename, permanence, sender_email, sender_function, signature,
abstract_ws=None, cancel_order=False):
from repanier.apps import REPANIER_SETTINGS_SEND_CANCEL_ORDER_MAIL_TO_CUSTOMER, \
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Repanier\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-29 16:26+0200\n"
"PO-Revision-Date: 2017-03-29 16:27+0100\n"
"POT-Creation-Date: 2017-03-30 20:37+0200\n"
"PO-Revision-Date: 2017-03-30 20:38+0100\n"
"Last-Translator: Patrick Colmant <pcolmant@gmail.com>\n"
"Language-Team: Patrick Colmant <pcolmant@gmail.com>\n"
"Language: fr\n"
......@@ -19,7 +19,7 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n"
#: admin/admin_filter.py:20 models/offeritem.py:181 models/permanence.py:60
#: models/producer.py:295 xlsx/xlsx_order.py:214
#: models/producer.py:295 xlsx/xlsx_order.py:216
msgid "producers"
msgstr "Producteurs"
......@@ -45,7 +45,7 @@ msgstr "TVA"
#: models/bankaccount.py:110 models/customer.py:269 models/invoice.py:23
#: models/invoice.py:26 models/invoice.py:417 models/invoice.py:461
#: models/permanenceboard.py:15 models/purchase.py:42 models/purchase.py:44
#: xlsx/xlsx_order.py:304 xlsx/xlsx_purchase.py:45 xlsx/xlsx_purchase.py:565
#: xlsx/xlsx_order.py:306 xlsx/xlsx_purchase.py:45 xlsx/xlsx_purchase.py:565
msgid "customer"
msgstr "Consommateur"
......@@ -53,7 +53,7 @@ msgstr "Consommateur"
#: models/bankaccount.py:86 models/invoice.py:304 models/invoice.py:420
#: models/offeritem.py:62 models/producer.py:294 models/product.py:29
#: models/purchase.py:40 templates/repanier/pre_order_form.html:32
#: xlsx/xlsx_order.py:301 xlsx/xlsx_product.py:50 xlsx/xlsx_purchase.py:43
#: xlsx/xlsx_order.py:303 xlsx/xlsx_product.py:50 xlsx/xlsx_purchase.py:43
#: xlsx/xlsx_purchase.py:559 xlsx/xlsx_purchase.py:560
msgid "producer"
msgstr "Fournisseur"
......@@ -939,7 +939,7 @@ msgid "duplicate product"
msgstr "Créer un duplicata"
#: admin/purchase.py:93 models/box.py:70 models/offeritem.py:50
#: models/product.py:244 xlsx/xlsx_order.py:303 xlsx/xlsx_purchase.py:44
#: models/product.py:244 xlsx/xlsx_order.py:305 xlsx/xlsx_purchase.py:44
msgid "product"
msgstr "Produit"
......@@ -953,11 +953,11 @@ msgid "The quantity must be different than zero."
msgstr "La quantité doit être différente de zéro."
#: admin/purchase.py:169 models/offeritem.py:60 models/product.py:46
#: xlsx/xlsx_order.py:302 xlsx/xlsx_product.py:43
#: xlsx/xlsx_order.py:304 xlsx/xlsx_product.py:43
msgid "department_for_customer"
msgstr "Rayon"
#: admin/purchase.py:243 const.py:232 email/email_order.py:31
#: admin/purchase.py:243 const.py:232 email/email_order.py:33
#: models/configuration.py:299 views/btn_confirm_order_ajax.py:48
msgid "Order"
msgstr "Commande"
......@@ -1274,8 +1274,8 @@ msgid "Hygiene"
msgstr "Hygiène"
#: apps.py:213 templates/repanier/customer_invoice_form.html:26
#: templates/repanier/producer_invoice_form.html:20 xlsx/xlsx_order.py:622
#: xlsx/xlsx_order.py:895 xlsx/xlsx_order.py:1040 xlsx/xlsx_stock.py:36
#: templates/repanier/producer_invoice_form.html:20 xlsx/xlsx_order.py:624
#: xlsx/xlsx_order.py:897 xlsx/xlsx_order.py:1042 xlsx/xlsx_stock.py:36
#: xlsx/xlsx_stock.py:324
msgid "Deposit"
msgstr "Consigne"
......@@ -1631,7 +1631,7 @@ msgstr "✿"
msgid "Pre-opening of orders"
msgstr "Pré-ouverture des commandes"
#: email/email_order.py:166
#: email/email_order.py:181
#, python-format
msgid ""
"/!\\ Mail not send to our producer %s because the minimum order value has "
......@@ -1640,7 +1640,19 @@ msgstr ""
"⚠ Mail non transmis au producteur %s car le minimum de commande n'a pas été "
"atteint."
#: email/email_order.py:273
#: email/email_order.py:289 email/email_order.py:291 email/email_order.py:295
msgid "Group invoices"
msgstr "Factures du groupe"
#: email/email_order.py:292
msgid "See attachment"
msgstr "Voir pièce jointe"
#: email/email_order.py:293
msgid "Not available for groups"
msgstr "Non disponible pour les groupes"
#: email/email_order.py:354
msgid "/!\\ Order cancelled"
msgstr "⚠ Commande annulée"
......@@ -1720,7 +1732,9 @@ msgstr "dénomination du groupe"
#: models/configuration.py:33
msgid "test mode"
msgstr "Activer le mode \"Test du site\""
msgstr ""
"Activer le mode \"Test du site\". Les mails générés par Repanier sont "
"uniquement envoyés aux testeurs de l'équipe de gestion."
#: models/configuration.py:35 models/customer.py:35 models/staff.py:45
msgid "login attempt counter"
......@@ -2696,8 +2710,8 @@ msgstr "dernière facture"
#: templates/repanier/pre_order_create_product_form.html:115
#: templates/repanier/pre_order_form.html:38
#: templates/repanier/pre_order_update_product_form.html:111
#: xlsx/xlsx_order.py:836 xlsx/xlsx_order.py:861 xlsx/xlsx_order.py:986
#: xlsx/xlsx_order.py:1003
#: xlsx/xlsx_order.py:838 xlsx/xlsx_order.py:863 xlsx/xlsx_order.py:988
#: xlsx/xlsx_order.py:1005
msgid "wo tax"
msgstr "HTVA"
......@@ -2713,7 +2727,7 @@ msgstr "Produit proposé"
msgid "customer_producer_invoice"
msgstr "Facture consommateur X producteur"
#: models/purchase.py:60 xlsx/xlsx_order.py:305 xlsx/xlsx_stock.py:38
#: models/purchase.py:60 xlsx/xlsx_order.py:307 xlsx/xlsx_stock.py:38
msgid "quantity ordered"
msgstr "Qté commandée"
......@@ -3243,8 +3257,8 @@ msgstr ", facturé : "
#: templates/repanier/confirm_admin_invoice.html:110
#: templates/repanier/pre_order_create_product_form.html:115
#: templates/repanier/pre_order_update_product_form.html:111
#: xlsx/xlsx_order.py:840 xlsx/xlsx_order.py:863 xlsx/xlsx_order.py:989
#: xlsx/xlsx_order.py:1005
#: xlsx/xlsx_order.py:842 xlsx/xlsx_order.py:865 xlsx/xlsx_order.py:991
#: xlsx/xlsx_order.py:1007
msgid "w tax"
msgstr "TVAC"
......@@ -3361,7 +3375,7 @@ msgstr "Consommateur"
#: templates/repanier/customer_invoice_form.html:105
#: templates/repanier/customer_invoice_form.html:182 xlsx/xlsx_invoice.py:208
#: xlsx/xlsx_offer.py:58 xlsx/xlsx_order.py:1035 xlsx/xlsx_stock.py:320
#: xlsx/xlsx_offer.py:58 xlsx/xlsx_order.py:1037 xlsx/xlsx_stock.py:320
msgid "Producer"
msgstr "Fournisseur"
......@@ -3375,8 +3389,8 @@ msgstr "Rayon"
#: templates/repanier/customer_invoice_form.html:188
#: templates/repanier/pre_order_form.html:35
#: templates/repanier/producer_invoice_form.html:90 xlsx/xlsx_invoice.py:213
#: xlsx/xlsx_offer.py:63 xlsx/xlsx_order.py:620 xlsx/xlsx_order.py:893
#: xlsx/xlsx_order.py:1036 xlsx/xlsx_stock.py:34 xlsx/xlsx_stock.py:322
#: xlsx/xlsx_offer.py:63 xlsx/xlsx_order.py:622 xlsx/xlsx_order.py:895
#: xlsx/xlsx_order.py:1038 xlsx/xlsx_stock.py:34 xlsx/xlsx_stock.py:322
msgid "Product"
msgstr "Produit"
......@@ -4309,7 +4323,7 @@ msgstr "?"
msgid "Invoices"
msgstr "Factures"
#: xlsx/export_tools.py:94 xlsx/xlsx_order.py:298 xlsx/xlsx_purchase.py:41
#: xlsx/export_tools.py:94 xlsx/xlsx_order.py:300 xlsx/xlsx_purchase.py:41
#: xlsx/xlsx_purchase.py:542 xlsx/xlsx_purchase.py:546 xlsx/xlsx_stock.py:31
#: xlsx/xlsx_stock.py:319 xlsx/xlsx_stock.py:446
msgid "Id"
......@@ -4364,7 +4378,7 @@ msgstr "Nom"
msgid "Balance before"
msgstr "Solde précédent"
#: xlsx/xlsx_invoice.py:72 xlsx/xlsx_invoice.py:123 xlsx/xlsx_order.py:307
#: xlsx/xlsx_invoice.py:72 xlsx/xlsx_invoice.py:123 xlsx/xlsx_order.py:309
msgid "Prepared"
msgstr "Préparé"
......@@ -4372,26 +4386,26 @@ msgstr "Préparé"
msgid "Balance after"
msgstr "Solde final"
#: xlsx/xlsx_invoice.py:209 xlsx/xlsx_order.py:87 xlsx/xlsx_order.py:616
#: xlsx/xlsx_order.py:1042
#: xlsx/xlsx_invoice.py:209 xlsx/xlsx_order.py:87 xlsx/xlsx_order.py:618
#: xlsx/xlsx_order.py:1044
msgid "Basket"
msgstr "Panier"
#: xlsx/xlsx_invoice.py:214 xlsx/xlsx_order.py:617 xlsx/xlsx_order.py:890
#: xlsx/xlsx_order.py:1037
#: xlsx/xlsx_invoice.py:214 xlsx/xlsx_order.py:619 xlsx/xlsx_order.py:892
#: xlsx/xlsx_order.py:1039
msgid "Quantity"
msgstr "Quantité"
#: xlsx/xlsx_invoice.py:216 xlsx/xlsx_order.py:306 xlsx/xlsx_order.py:618
#: xlsx/xlsx_order.py:891 xlsx/xlsx_order.py:1038
#: xlsx/xlsx_invoice.py:216 xlsx/xlsx_order.py:308 xlsx/xlsx_order.py:620
#: xlsx/xlsx_order.py:893 xlsx/xlsx_order.py:1040
msgid "Unit"
msgstr "Unité"
#: xlsx/xlsx_invoice.py:303 xlsx/xlsx_order.py:623 xlsx/xlsx_order.py:836
#: xlsx/xlsx_order.py:840 xlsx/xlsx_order.py:861 xlsx/xlsx_order.py:863
#: xlsx/xlsx_order.py:896 xlsx/xlsx_order.py:986 xlsx/xlsx_order.py:989
#: xlsx/xlsx_order.py:1003 xlsx/xlsx_order.py:1005 xlsx/xlsx_order.py:1041
#: xlsx/xlsx_order.py:1289
#: xlsx/xlsx_invoice.py:303 xlsx/xlsx_order.py:625 xlsx/xlsx_order.py:838
#: xlsx/xlsx_order.py:842 xlsx/xlsx_order.py:863 xlsx/xlsx_order.py:865
#: xlsx/xlsx_order.py:898 xlsx/xlsx_order.py:988 xlsx/xlsx_order.py:991
#: xlsx/xlsx_order.py:1005 xlsx/xlsx_order.py:1007 xlsx/xlsx_order.py:1043
#: xlsx/xlsx_order.py:1291
msgid "Total Price"
msgstr "Prix total"
......@@ -4419,64 +4433,64 @@ msgstr "✆"
msgid "Permanence Board Member List"
msgstr "Permanenciers/cières"
#: xlsx/xlsx_order.py:253
#: xlsx/xlsx_order.py:255
msgid "Label"
msgstr "Etiquette"
#: xlsx/xlsx_order.py:299 xlsx/xlsx_order.py:1033 xlsx/xlsx_stock.py:32
#: xlsx/xlsx_order.py:301 xlsx/xlsx_order.py:1035 xlsx/xlsx_stock.py:32
msgid "OfferItem"
msgstr "Produit proposé"
#: xlsx/xlsx_order.py:300 xlsx/xlsx_order.py:1034
#: xlsx/xlsx_order.py:302 xlsx/xlsx_order.py:1036
msgid "Placement"
msgstr "Emplacement"
#: xlsx/xlsx_order.py:308
#: xlsx/xlsx_order.py:310
msgid "To distribute"
msgstr "À répartir"
#: xlsx/xlsx_order.py:329 xlsx/xlsx_order.py:1326
#: xlsx/xlsx_order.py:331 xlsx/xlsx_order.py:1328
msgid "Preparation"
msgstr "Préparation"
#: xlsx/xlsx_order.py:443 xlsx/xlsx_order.py:560
#: xlsx/xlsx_order.py:445 xlsx/xlsx_order.py:562
msgid "kg :"
msgstr "kg :"
#: xlsx/xlsx_order.py:619 xlsx/xlsx_order.py:892 xlsx/xlsx_stock.py:33
#: xlsx/xlsx_order.py:621 xlsx/xlsx_order.py:894 xlsx/xlsx_stock.py:33
#: xlsx/xlsx_stock.py:321
msgid "Reference"
msgstr "Référence"
#: xlsx/xlsx_order.py:621 xlsx/xlsx_order.py:894 xlsx/xlsx_order.py:1039
#: xlsx/xlsx_order.py:623 xlsx/xlsx_order.py:896 xlsx/xlsx_order.py:1041
msgid "Unit Price"
msgstr "Prix tarif"
#: xlsx/xlsx_order.py:642
#: xlsx/xlsx_order.py:644
msgid "by product"
msgstr "par produit"
#: xlsx/xlsx_order.py:915
#: xlsx/xlsx_order.py:917
msgid "by basket"
msgstr "duplicata, par panier"
#: xlsx/xlsx_order.py:1032
#: xlsx/xlsx_order.py:1034
msgid "Purchase"
msgstr "Achat"
#: xlsx/xlsx_order.py:1125 xlsx/xlsx_order.py:1132
#: xlsx/xlsx_order.py:1127 xlsx/xlsx_order.py:1134
msgid "Deposits"
msgstr "Consignes"
#: xlsx/xlsx_order.py:1141 xlsx/xlsx_order.py:1148 xlsx/xlsx_order.py:1330
#: xlsx/xlsx_order.py:1143 xlsx/xlsx_order.py:1150 xlsx/xlsx_order.py:1332
msgid "Customer check"
msgstr "Contrôle des paniers"
#: xlsx/xlsx_order.py:1340
#: xlsx/xlsx_order.py:1342
msgid "Customers"
msgstr "Consommateurs"
#: xlsx/xlsx_order.py:1361
#: xlsx/xlsx_order.py:1363
msgid "Producers"
msgstr "Producteurs"
......@@ -4623,6 +4637,11 @@ msgstr "Ligne %(row_num)d : Une colonne requise est absente du fichier."
msgid "Import stock"
msgstr "Importer, mettre à jour le stock"
#, fuzzy
#~| msgid "customers invoices"
#~ msgid "Link to your invoices"
#~ msgstr "Factures de consommateurs"
#~ msgid "Only two levels are allowed."
#~ msgstr ""
#~ "Le parent ne peut pas être lui-même un enfant. Seul deux niveaux sont "
......
......@@ -27,7 +27,7 @@ def next_purchase(purchases):
return purchase
def export_abstract(permanence, deliveries_id=None, wb=None):
def export_abstract(permanence, deliveries_id=None, group=False, wb=None):
if permanence is not None:
row_num = 1
# Customer info
......@@ -59,7 +59,7 @@ def export_abstract(permanence, deliveries_id=None, wb=None):
preparation_order += 1
row = [
"%d - %s" % (delivery_ref, delivery.get_delivery_status_display()),
"%d - %s" % (delivery_ref, delivery.get_delivery_display()),
" %d - %s" % (customer.preparation_order, customer.long_basket_name),
customer.phone1,
customer.phone2,
......@@ -208,40 +208,42 @@ def export_abstract(permanence, deliveries_id=None, wb=None):
c = ws.cell(row=row_num-1, column=col_num)
c.style.borders.bottom.border_style = Border.BORDER_THIN
c = ws.cell(row=row_num, column=0)
c.value = "-------"
c = ws.cell(row=row_num, column=1)
c.value = "%s" % (_('producers'))
c.style.alignment.wrap_text = False
c.style.font.bold = True
c = ws.cell(row=row_num, column=2)
c.value = "-------"
row_num += 1
# Producer info
for producer in Producer.objects.filter(permanence=permanence).order_by("short_profile_name"):
invoice = ProducerInvoice.objects.filter(
permanence=permanence, producer=producer