From 9e59346042645c458f477beb4a6d12eddba36590 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Tue, 31 Mar 2015 12:39:08 +0000 Subject: [PATCH] Improved variable names consistency, cleaned up *settings.py and refactored resource aggregation --- TODO.md | 57 +++++--- orchestra/apps/accounts/settings.py | 25 +++- .../admin/accounts/account/change_form.html | 4 +- .../bills/locale/ca/LC_MESSAGES/django.mo | Bin 0 -> 1338 bytes .../bills/locale/ca/LC_MESSAGES/django.po | 127 ++++++++++++------ orchestra/apps/bills/models.py | 7 +- orchestra/apps/bills/settings.py | 77 ++++++++--- .../apps/bills/templates/bills/invoice.html | 2 +- .../bills/templates/bills/microspective.css | 2 +- .../bills/templates/bills/microspective.html | 28 ++-- orchestra/apps/contacts/settings.py | 8 +- orchestra/apps/databases/settings.py | 8 +- orchestra/apps/domains/settings.py | 62 ++++++--- orchestra/apps/domains/validators.py | 15 ++- orchestra/apps/issues/settings.py | 7 +- orchestra/apps/lists/settings.py | 30 +++-- orchestra/apps/mailboxes/settings.py | 49 ++++--- orchestra/apps/mailboxes/validators.py | 2 +- orchestra/apps/miscellaneous/admin.py | 2 +- orchestra/apps/miscellaneous/settings.py | 5 +- orchestra/apps/orchestration/admin.py | 2 +- orchestra/apps/orchestration/backends.py | 2 +- orchestra/apps/orchestration/models.py | 2 +- .../apps/orchestration/tests/test_route.py | 2 +- orchestra/apps/orders/billing.py | 2 +- orchestra/apps/orders/models.py | 11 +- orchestra/apps/orders/settings.py | 11 +- orchestra/apps/payments/actions.py | 2 +- orchestra/apps/payments/models.py | 4 +- orchestra/apps/payments/serializers.py | 4 +- orchestra/apps/payments/settings.py | 7 +- orchestra/apps/plans/models.py | 11 +- orchestra/apps/plans/rating.py | 6 + orchestra/apps/resources/helpers.py | 34 ----- orchestra/apps/resources/methods.py | 89 ++++++++++++ orchestra/apps/resources/models.py | 65 ++++----- orchestra/apps/saas/backends/bscw.py | 52 +++++++ orchestra/apps/saas/backends/gitlab.py | 4 +- orchestra/apps/saas/models.py | 4 +- orchestra/apps/saas/settings.py | 26 +++- orchestra/apps/services/admin.py | 1 + orchestra/apps/services/handlers.py | 4 +- orchestra/apps/services/models.py | 23 ++-- orchestra/apps/services/settings.py | 22 ++- .../admin/services/service/change_form.html | 52 +++++++ orchestra/apps/systemusers/settings.py | 15 ++- orchestra/apps/vps/settings.py | 8 +- orchestra/apps/webapps/admin.py | 2 +- orchestra/apps/webapps/models.py | 6 +- orchestra/apps/webapps/settings.py | 33 +++-- orchestra/apps/websites/backends/apache.py | 4 +- orchestra/apps/websites/directives.py | 2 +- orchestra/apps/websites/models.py | 4 +- orchestra/apps/websites/settings.py | 32 +++-- orchestra/management/commands/makemessages.py | 38 +++--- .../commands/postupgradeorchestra.py | 4 +- orchestra/management/commands/setupcelery.py | 8 +- orchestra/management/commands/setupnginx.py | 8 +- .../management/commands/setuppostgres.py | 4 +- orchestra/management/commands/staticcheck.py | 4 +- orchestra/plugins/admin.py | 4 +- orchestra/plugins/options.py | 6 +- orchestra/settings.py | 57 +++++--- orchestra/utils/paths.py | 10 +- 64 files changed, 839 insertions(+), 369 deletions(-) create mode 100644 orchestra/apps/bills/locale/ca/LC_MESSAGES/django.mo delete mode 100644 orchestra/apps/resources/helpers.py create mode 100644 orchestra/apps/resources/methods.py create mode 100644 orchestra/apps/saas/backends/bscw.py create mode 100644 orchestra/apps/services/templates/admin/services/service/change_form.html diff --git a/TODO.md b/TODO.md index 18c04cb1..e692f69c 100644 --- a/TODO.md +++ b/TODO.md @@ -20,7 +20,7 @@ * backend logs with hal logo -* LAST version of this shit http://wkhtmltopdf.org/downloads.html +* LAST version of this shit http://wkhtmltopdf.org/downloads.h otml * translations from django.utils import translation @@ -137,17 +137,15 @@ * Resource graph for each related object -* Service.account change and orders consistency - * SaaS model splitted into SaaSUser and SaaSSite? inherit from SaaS * prevent @pangea.org email addresses on contacts, enforce at least one email without @pangea.org * forms autocomplete="off", doesn't work in chrome - ln -s /proc/self/fd /dev/fd +* escape passwords and not allow ' on them ! POST INSTALL @@ -160,15 +158,12 @@ ssh-copy-id root@ Php binaries should have this format: /usr/bin/php5.2-cgi - * logs on panel/logs/ ? mkdir ~webapps, backend post save signal? * transaction fault tolerant on backend.execute() * and other IfModule on backend SecRule - * Orchestra global search box on the page head, based https://github.com/django/django/blob/master/django/contrib/admin/options.py#L866 and iterating over all registered services and inspectin its admin.search_fields - * contain error on plugin missing key (plugin dissabled): NOP, fail hard is better than silently, perhaps fail at starttime? apploading machinary * contact.alternative_phone on a phone.tooltip, email:to @@ -223,7 +218,7 @@ require_once(‘/etc/moodles/’.$moodle_host.‘config.php’);``` moodle/drupl * autoexpand mailbox.filter according to filtering options * allow empty metric pack for default rates? changes on rating algo -* IMPORTANT make sure no order is created for mailboxes that include disk? or just don't produce lines with cost == 0 or quantity 0 ? +* IMPORTANT make sure no order is created for mailboxes that include disk? or just don't produce lines with cost == 0 or quantity 0 ? maybe minimal quantity for billing? like 0.1 ? or minimal price? per line or per bill? * Improve performance of admin change lists with debug toolbar and prefech_related * and miscellaneous.service.name == 'domini-registre' @@ -231,39 +226,44 @@ require_once(‘/etc/moodles/’.$moodle_host.‘config.php’);``` moodle/drupl * lines too long on invoice, double lines or cut, and make margin wider * PHP_TIMEOUT env variable in sync with fcgid idle timeout + http://foaa.de/old-blog/2010/11/php-apache-and-fastcgi-a-comprehensive-overview/trackback/index.html#pni-top0 * payment methods icons * use server.name | server.address on python backends, like gitlab instead of settings? * saas change password feature (the only way of re.running a backend) * TODO raise404, here and everywhere -* display subline links on billlines -* update service orders on a celery task? +* display subline links on billlines, to show that they exists. +* update service orders on a celery task? because it take alot +* * billline quantity eval('10x100') instead of miningless description '(10*100)' -* order metric increases inside billed until period -* do more test, make sure billed until doesn't get uodated whhen services are billed with les metric, and don't upgrade billed_until when undoing under this circumstances +* IMPORTANT do more test, make sure billed until doesn't get uodated whhen services are billed with les metric, and don't upgrade billed_until when undoing under this circumstances + * line 513: change threshold and one time service metric change should update last value if not billed, only record for recurring invoicing. postpay services should store the last metric for pricing period. + * add ini, end dates on bill lines and breakup quanity into size(defaut:1) and metric + * threshold for significative metric accountancy on services.handler * move normurlpath to orchestra.utils from websites.utils -* one time service metric change should update last value, only record for recurring invoicing. - * write down insights -* pluggable rate algorithms, with help_text, and change some services to match price - -* translation app, with generates the trans files from models * use english on services defs and so on, an translate them on render time -* (miscellaneous.service.ident or '').startswith() +* websites directives get_location() and use it on last change view validation stage to compare with contents.location and also on the backend ? + +* modeladmin Default filter + search isn't working, prepend filter when searching + +* IMPORTANT do all modles.py TODOs and create migrations for finished apps + +* create service templates based on urlqwargs with the most basic services. + +* Base price: domini propi (all domains) + extra for other domains Translation ----------- -python manage.py makemessages -l ca --domain database - mkdir locale django-admin.py makemessages -l ca django-admin.py compilemessages -l ca @@ -273,5 +273,20 @@ https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#joining-strings-s from django.utils.translation import ugettext from django.utils import translation translation.activate('ca') -ugettext("Fuck you") +ugettext("Description") + +Object = disk*15 +bscw quota +root@web:/home/pangea/bscw/bin ./bsadmin quota report + Disk Objects +User usage soft hard time usage soft hard time +xxx2 -- 0 20M 22M 9 200 300 +xxxxxxxxxxxxx -- 0 20M 22M 8 200 300 +xxxxx -- 0 20M 22M 7 200 300 +xxxxx -- 0 20M 22M 7 200 300 + + +* saas validate_creation generic approach, for all backends. standard output + +* html code x: × diff --git a/orchestra/apps/accounts/settings.py b/orchestra/apps/accounts/settings.py index 68de9753..838020b6 100644 --- a/orchestra/apps/accounts/settings.py +++ b/orchestra/apps/accounts/settings.py @@ -1,6 +1,8 @@ from django.conf import settings from django.utils.translation import ugettext_lazy as _ +from orchestra.settings import BASE_DOMAIN + ACCOUNTS_TYPES = getattr(settings, 'ACCOUNTS_TYPES', ( ('INDIVIDUAL', _("Individual")), @@ -11,7 +13,10 @@ ACCOUNTS_TYPES = getattr(settings, 'ACCOUNTS_TYPES', ( ('STAFF', _("Staff")), )) -ACCOUNTS_DEFAULT_TYPE = getattr(settings, 'ACCOUNTS_DEFAULT_TYPE', 'INDIVIDUAL') + +ACCOUNTS_DEFAULT_TYPE = getattr(settings, 'ACCOUNTS_DEFAULT_TYPE', + 'INDIVIDUAL' +) ACCOUNTS_LANGUAGES = getattr(settings, 'ACCOUNTS_LANGUAGES', ( @@ -20,13 +25,18 @@ ACCOUNTS_LANGUAGES = getattr(settings, 'ACCOUNTS_LANGUAGES', ( ACCOUNTS_SYSTEMUSER_MODEL = getattr(settings, 'ACCOUNTS_SYSTEMUSER_MODEL', - 'systemusers.SystemUser') + 'systemusers.SystemUser' +) -ACCOUNTS_DEFAULT_LANGUAGE = getattr(settings, 'ACCOUNTS_DEFAULT_LANGUAGE', 'EN') +ACCOUNTS_DEFAULT_LANGUAGE = getattr(settings, 'ACCOUNTS_DEFAULT_LANGUAGE', + 'EN' +) -ACCOUNTS_MAIN_PK = getattr(settings, 'ACCOUNTS_MAIN_PK', 1) +ACCOUNTS_MAIN_PK = getattr(settings, 'ACCOUNTS_MAIN_PK', + 1 +) ACCOUNTS_CREATE_RELATED = getattr(settings, 'ACCOUNTS_CREATE_RELATED', ( @@ -42,12 +52,13 @@ ACCOUNTS_CREATE_RELATED = getattr(settings, 'ACCOUNTS_CREATE_RELATED', ( ('domains.Domain', 'name', { - 'name': '"%s.orchestra.lan" % account.username.replace("_", "-")', + 'name': '"%s.{}" % account.username.replace("_", "-")'.format(BASE_DOMAIN), }, - _("Designates whether to creates a related subdomain <username>.orchestra.lan or not."), + _("Designates whether to creates a related subdomain <username>.{} or not.".format(BASE_DOMAIN)), ), )) ACCOUNTS_SERVICE_REPORT_TEMPLATE = getattr(settings, 'ACCOUNTS_SERVICE_REPORT_TEMPLATE', - 'admin/accounts/account/service_report.html') + 'admin/accounts/account/service_report.html' +) diff --git a/orchestra/apps/accounts/templates/admin/accounts/account/change_form.html b/orchestra/apps/accounts/templates/admin/accounts/account/change_form.html index 2b3f0525..66962963 100644 --- a/orchestra/apps/accounts/templates/admin/accounts/account/change_form.html +++ b/orchestra/apps/accounts/templates/admin/accounts/account/change_form.html @@ -22,7 +22,7 @@ {% block object-tools-items %} {% if services %}
  • - + {% for account in accounts %} {% endfor %} diff --git a/orchestra/apps/bills/locale/ca/LC_MESSAGES/django.mo b/orchestra/apps/bills/locale/ca/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..a3fd9f38377eda7a16453f8c1783138f7b8b1a6c GIT binary patch literal 1338 zcmZvaKa3Mc6vl^e3E(6o{0UG*$xt9AIt^zZAdx*TVq>o_t9Wf=uPq$~(y*R01NM$@ zW_-t0NGa1qij*dzprT2WDCrX^MIt(+hzgKWph!tU6^WAXnRSkWr+xF=nSJxUH?!~Y z;e~G*>;(LM_(S+9`0YIyVCB~s+Y45}x50DZA+QSW2YcX~;FV&29i(^%?gO_$JnU96 z|FYm$-~p_E15*5Lums)#7r^g}^&dde{~08`UqQ{$222@O8|e zg0$~Hko2E{w0{8~i3htpBtU`o%sZ$^HB|Cl$-20{9X7_IQ{3h;3$1&M`#R3BNmQTK7f0^q0~z=oo^YP zDOPPINz_cctfpLM^~7tFvzpn?M@9}<9ed&;vT0a5T&G~xmOCWLF7={r8n>EV)(=y1 zo=?YDm1TXcw%NLJZ19rmHS3l({SMol%G_(bSn1VlSejU>#mk$_?@SbHTXS7yUc>{@ zSJt7VfVacy7vWmO`%$Nhl%6VcfVF)@q%o+x--w`EV+SN~B7T1KtRmYdtFYLZfkUq)!_=+>Jr0Nt{Hx z=c}A9m#QZBxL1+l5(4hkO}{i5Nu96o?3%Pr`PE)p7w325sH_cTMU-b|pz~qC&tKKP z)E-T(9ErNIV;AszGMl>9\n" "Language-Team: LANGUAGE \n" @@ -20,11 +20,11 @@ msgstr "" #: actions.py:35 msgid "Download" -msgstr "Blod" +msgstr "Descarrega" #: actions.py:45 msgid "View" -msgstr "" +msgstr "Vista" #: actions.py:53 msgid "Selected bills should be in open state" @@ -62,11 +62,11 @@ msgstr "" msgid "Resend" msgstr "" -#: actions.py:129 models.py:308 +#: actions.py:129 models.py:309 msgid "Not enough information stored for undoing" msgstr "" -#: actions.py:132 models.py:310 +#: actions.py:132 models.py:311 msgid "Dates don't match" msgstr "" @@ -92,7 +92,7 @@ msgstr "" #: admin.py:69 msgid "Description" -msgstr "" +msgstr "Descripció" #: admin.py:77 msgid "Subtotal" @@ -115,37 +115,37 @@ msgstr "" msgid "lines" msgstr "" -#: admin.py:152 +#: admin.py:152 templates/bills/microspective.html:107 msgid "total" msgstr "" -#: admin.py:160 models.py:85 models.py:339 +#: admin.py:160 models.py:85 models.py:340 msgid "type" -msgstr "" +msgstr "tipus" #: admin.py:177 msgid "Payment" -msgstr "" +msgstr "Pagament" #: filters.py:17 msgid "All" -msgstr "" +msgstr "Tot" #: filters.py:18 models.py:75 msgid "Invoice" -msgstr "" +msgstr "Factura" #: filters.py:19 models.py:76 msgid "Amendment invoice" -msgstr "" +msgstr "Factura rectificativa" #: filters.py:20 models.py:77 msgid "Fee" -msgstr "" +msgstr "Quota de soci" #: filters.py:21 msgid "Amendment fee" -msgstr "" +msgstr "Rectificació de quota de soci" #: filters.py:22 msgid "Pro-forma" @@ -157,11 +157,11 @@ msgstr "" #: filters.py:47 msgid "Yes" -msgstr "" +msgstr "Si" #: filters.py:48 msgid "No" -msgstr "" +msgstr "No" #: forms.py:9 msgid "Number" @@ -227,7 +227,7 @@ msgstr "" #: models.py:32 msgid "VAT number" -msgstr "" +msgstr "NIF" #: models.py:64 msgid "Paid" @@ -285,62 +285,113 @@ msgstr "" msgid "HTML" msgstr "" -#: models.py:270 +#: models.py:271 msgid "bill" msgstr "" -#: models.py:271 models.py:336 +#: models.py:272 models.py:337 templates/bills/microspective.html:73 msgid "description" -msgstr "" - -#: models.py:272 -msgid "rate" -msgstr "" +msgstr "descripció" #: models.py:273 -msgid "quantity" -msgstr "" +msgid "rate" +msgstr "tarifa" #: models.py:274 +msgid "quantity" +msgstr "quantitat" + +#: models.py:275 templates/bills/microspective.html:76 msgid "subtotal" msgstr "" -#: models.py:275 +#: models.py:276 msgid "tax" -msgstr "" +msgstr "impostos" -#: models.py:281 +#: models.py:282 msgid "Informative link back to the order" msgstr "" -#: models.py:282 +#: models.py:283 msgid "order billed" msgstr "" -#: models.py:283 +#: models.py:284 msgid "order billed until" msgstr "" -#: models.py:284 +#: models.py:285 msgid "created" msgstr "" -#: models.py:286 +#: models.py:287 msgid "amended line" msgstr "" -#: models.py:329 +#: models.py:330 msgid "Volume" msgstr "" -#: models.py:330 +#: models.py:331 msgid "Compensation" msgstr "" -#: models.py:331 +#: models.py:332 msgid "Other" msgstr "" -#: models.py:335 +#: models.py:336 msgid "bill line" msgstr "" + +#: templates/bills/microspective.html:74 +msgid "hrs/qty" +msgstr "hrs/quant" + +#: templates/bills/microspective.html:75 +msgid "rate/price" +msgstr "tarifa/preu" + +#: templates/bills/microspective.html:100 +#: templates/bills/microspective.html:103 +msgid "VAT" +msgstr "IVA" + +#: templates/bills/microspective.html:103 +msgid "taxes" +msgstr "" + +#: templates/bills/microspective.html:119 +msgid "COMMENTS" +msgstr "COMENTARIS" + +#: templates/bills/microspective.html:125 +msgid "PAYMENT" +msgstr "PAGAMENT" + +#: templates/bills/microspective.html:129 +#, python-format +msgid "" +"\n" +" You can pay our %(type)s by bank transfer.
    \n" +" Please make sure to state your name and the " +"%(bill.get_type_display.lower)s number.\n" +" Our bank account number is
    \n" +" " +msgstr "" + +#: templates/bills/microspective.html:138 +msgid "QUESTIONS" +msgstr "PREGUNTES" + +#: templates/bills/microspective.html:139 +#, python-format +msgid "" +"\n" +" If you have any question about your %(type)s, please\n" +" feel free to contact us at your convinience. We will reply as " +"soon as we get\n" +" your message.\n" +" " +msgstr "" diff --git a/orchestra/apps/bills/models.py b/orchestra/apps/bills/models.py index dc4e781f..ddee9f28 100644 --- a/orchestra/apps/bills/models.py +++ b/orchestra/apps/bills/models.py @@ -3,7 +3,7 @@ from dateutil.relativedelta import relativedelta from django.core.validators import ValidationError, RegexValidator from django.db import models from django.template import loader, Context -from django.utils import timezone +from django.utils import timezone, translation from django.utils.encoding import force_text from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ @@ -191,7 +191,7 @@ class Bill(models.Model): self.is_sent = True self.save(update_fields=['is_sent']) - def render(self, payment=False): + def render(self, payment=False, language=None): if payment is False: payment = self.account.paymentsources.get_default() context = Context({ @@ -213,7 +213,8 @@ class Bill(models.Model): template_name = 'BILLS_%s_TEMPLATE' % self.get_type() template = getattr(settings, template_name, settings.BILLS_DEFAULT_TEMPLATE) bill_template = loader.get_template(template) - html = bill_template.render(context) + with translation.override(language or self.account.language): + html = bill_template.render(context) html = html.replace('-pageskip-', '') return html diff --git a/orchestra/apps/bills/settings.py b/orchestra/apps/bills/settings.py index 3357ada8..6b116ccb 100644 --- a/orchestra/apps/bills/settings.py +++ b/orchestra/apps/bills/settings.py @@ -1,66 +1,99 @@ from django.conf import settings from django_countries import data - -BILLS_NUMBER_LENGTH = getattr(settings, 'BILLS_NUMBER_LENGTH', 4) +from orchestra.settings import BASE_DOMAIN -BILLS_INVOICE_NUMBER_PREFIX = getattr(settings, 'BILLS_INVOICE_NUMBER_PREFIX', 'I') +BILLS_NUMBER_LENGTH = getattr(settings, 'BILLS_NUMBER_LENGTH', + 4 +) -BILLS_AMENDMENT_INVOICE_NUMBER_PREFIX = getattr(settings, 'BILLS_AMENDMENT_INVOICE_NUMBER_PREFIX', 'A') +BILLS_INVOICE_NUMBER_PREFIX = getattr(settings, 'BILLS_INVOICE_NUMBER_PREFIX', + 'I' +) -BILLS_FEE_NUMBER_PREFIX = getattr(settings, 'BILLS_FEE_NUMBER_PREFIX', 'F') +BILLS_AMENDMENT_INVOICE_NUMBER_PREFIX = getattr(settings, 'BILLS_AMENDMENT_INVOICE_NUMBER_PREFIX', + 'A' +) -BILLS_AMENDMENT_FEE_NUMBER_PREFIX = getattr(settings, 'BILLS_AMENDMENT_FEE_NUMBER_PREFIX', 'B') +BILLS_FEE_NUMBER_PREFIX = getattr(settings, 'BILLS_FEE_NUMBER_PREFIX', + 'F' +) -BILLS_PROFORMA_NUMBER_PREFIX = getattr(settings, 'BILLS_PROFORMA_NUMBER_PREFIX', 'P') +BILLS_AMENDMENT_FEE_NUMBER_PREFIX = getattr(settings, 'BILLS_AMENDMENT_FEE_NUMBER_PREFIX', + 'B' +) + + +BILLS_PROFORMA_NUMBER_PREFIX = getattr(settings, 'BILLS_PROFORMA_NUMBER_PREFIX', + 'P' +) BILLS_DEFAULT_TEMPLATE = getattr(settings, 'BILLS_DEFAULT_TEMPLATE', - 'bills/microspective.html') + 'bills/microspective.html' +) BILLS_FEE_TEMPLATE = getattr(settings, 'BILLS_FEE_TEMPLATE', - 'bills/microspective-fee.html') + 'bills/microspective-fee.html' +) BILLS_PROFORMA_TEMPLATE = getattr(settings, 'BILLS_PROFORMA_TEMPLATE', - 'bills/microspective-proforma.html') + 'bills/microspective-proforma.html' +) -BILLS_CURRENCY = getattr(settings, 'BILLS_CURRENCY', 'euro') +BILLS_CURRENCY = getattr(settings, 'BILLS_CURRENCY', + 'euro' +) -BILLS_SELLER_PHONE = getattr(settings, 'BILLS_SELLER_PHONE', '111-112-11-222') +BILLS_SELLER_PHONE = getattr(settings, 'BILLS_SELLER_PHONE', + '111-112-11-222' +) -BILLS_SELLER_EMAIL = getattr(settings, 'BILLS_SELLER_EMAIL', 'sales@orchestra.lan') +BILLS_SELLER_EMAIL = getattr(settings, 'BILLS_SELLER_EMAIL', + 'sales@{}'.format(BASE_DOMAIN) +) -BILLS_SELLER_WEBSITE = getattr(settings, 'BILLS_SELLER_WEBSITE', 'www.orchestra.lan') +BILLS_SELLER_WEBSITE = getattr(settings, 'BILLS_SELLER_WEBSITE', + 'www.{}'.format(BASE_DOMAIN) +) BILLS_SELLER_BANK_ACCOUNT = getattr(settings, 'BILLS_SELLER_BANK_ACCOUNT', - '0000 0000 00 00000000 (Orchestra Bank)') + '0000 0000 00 00000000 (Orchestra Bank)' +) BILLS_EMAIL_NOTIFICATION_TEMPLATE = getattr(settings, 'BILLS_EMAIL_NOTIFICATION_TEMPLATE', - 'bills/bill-notification.email') + 'bills/bill-notification.email' +) -BILLS_ORDER_MODEL = getattr(settings, 'BILLS_ORDER_MODEL', 'orders.Order') +BILLS_ORDER_MODEL = getattr(settings, 'BILLS_ORDER_MODEL', + 'orders.Order' +) -BILLS_CONTACT_DEFAULT_CITY = getattr(settings, 'BILLS_CONTACT_DEFAULT_CITY', 'Barcelona') +BILLS_CONTACT_DEFAULT_CITY = getattr(settings, 'BILLS_CONTACT_DEFAULT_CITY', + 'Barcelona' +) -BILLS_CONTACT_COUNTRIES = getattr(settings, 'BILLS_CONTACT_COUNTRIES', ((k,v) for k,v in data.COUNTRIES.iteritems())) - - -BILLS_CONTACT_DEFAULT_COUNTRY = getattr(settings, 'BILLS_CONTACT_DEFAULT_COUNTRY', 'ES') +BILLS_CONTACT_COUNTRIES = getattr(settings, 'BILLS_CONTACT_COUNTRIES', + ((k,v) for k,v in data.COUNTRIES.iteritems()) +) +BILLS_CONTACT_DEFAULT_COUNTRY = getattr(settings, 'BILLS_CONTACT_DEFAULT_COUNTRY', + 'ES' +) diff --git a/orchestra/apps/bills/templates/bills/invoice.html b/orchestra/apps/bills/templates/bills/invoice.html index 65ced6b2..1b751682 100644 --- a/orchestra/apps/bills/templates/bills/invoice.html +++ b/orchestra/apps/bills/templates/bills/invoice.html @@ -123,7 +123,7 @@ div#simple table{ - + diff --git a/orchestra/apps/bills/templates/bills/microspective.css b/orchestra/apps/bills/templates/bills/microspective.css index f04ba7c3..eb984dcd 100644 --- a/orchestra/apps/bills/templates/bills/microspective.css +++ b/orchestra/apps/bills/templates/bills/microspective.css @@ -1,6 +1,6 @@ body { /* max-width: 650px;*/ - max-width: 670px; + max-width: 820px; margin: 40 auto !important; /* margin-bottom: 30 !important;*/ float: none !important; diff --git a/orchestra/apps/bills/templates/bills/microspective.html b/orchestra/apps/bills/templates/bills/microspective.html index 1916bd2d..cd555390 100644 --- a/orchestra/apps/bills/templates/bills/microspective.html +++ b/orchestra/apps/bills/templates/bills/microspective.html @@ -1,4 +1,5 @@ {% extends 'bills/base.html' %} +{% load i18n %} {% block head %}
    IDDescription{% trans Description %} Amount Price