Random fixes

This commit is contained in:
Marc Aymerich 2015-10-29 18:19:00 +00:00
parent 6531bcc4be
commit 5365cbeb0a
11 changed files with 511 additions and 281 deletions

View File

@ -439,3 +439,8 @@ mkhomedir_helper or create ssh homes with bash.rc and such
with database_ready: with database_ready:
shit_happend, otherwise schedule for first query shit_happend, otherwise schedule for first query
# Entry.objects.filter()[:1].first() (LIMIT 1) # Entry.objects.filter()[:1].first() (LIMIT 1)
# put "Coordinate Apache restart" inside a bash function for clarity
# mailscanner phishing, spam, whitelist choices

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-07 10:18+0000\n" "POT-Creation-Date: 2015-10-29 10:51+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,37 +18,33 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: actions.py:40 #: actions.py:31
msgid "Download"
msgstr "Descarrega"
#: actions.py:50
msgid "View" msgid "View"
msgstr "Vista" msgstr "Vista"
#: actions.py:58 #: actions.py:42
msgid "Selected bills should be in open state" msgid "Selected bills should be in open state"
msgstr "Les factures seleccionades han d'estar en estat obert" msgstr "Les factures seleccionades han d'estar en estat obert"
#: actions.py:76 #: actions.py:57
msgid "Selected bills have been closed" msgid "Selected bills have been closed"
msgstr "Les factures seleccionades han estat tancades" msgstr "Les factures seleccionades han estat tancades"
#: actions.py:89 #: actions.py:70
#, python-format #, python-format
msgid "<a href=\"%(url)s\">One related transaction</a> has been created" msgid "<a href=\"%(url)s\">One related transaction</a> has been created"
msgstr "S'ha creat una <a href=\"%(url)s\">transacció</a>" msgstr "S'ha creat una <a href=\"%(url)s\">transacció</a>"
#: actions.py:90 #: actions.py:71
#, python-format #, python-format
msgid "<a href=\"%(url)s\">%(num)i related transactions</a> have been created" msgid "<a href=\"%(url)s\">%(num)i related transactions</a> have been created"
msgstr "S'han creat les <a href=\"%(url)s\">%(num)i següents transaccions</a>" msgstr "S'han creat les <a href=\"%(url)s\">%(num)i següents transaccions</a>"
#: actions.py:96 #: actions.py:77
msgid "Are you sure about closing the following bills?" msgid "Are you sure about closing the following bills?"
msgstr "Estàs a punt de tancar les següents factures, estàs segur?" msgstr "Estàs a punt de tancar les següents factures, estàs segur?"
#: actions.py:97 #: actions.py:78
msgid "" msgid ""
"Once a bill is closed it can not be further modified.</p><p>Please select a " "Once a bill is closed it can not be further modified.</p><p>Please select a "
"payment source for the selected bills" "payment source for the selected bills"
@ -56,183 +52,248 @@ msgstr ""
"Una vegada la factura estigui tancada no podrà ser modificada.</p><p>Si us " "Una vegada la factura estigui tancada no podrà ser modificada.</p><p>Si us "
"plau selecciona un mètode de pagament per les factures seleccionades" "plau selecciona un mètode de pagament per les factures seleccionades"
#: actions.py:110 #: actions.py:91
msgid "Close" msgid "Close"
msgstr "Tanca" msgstr "Tanca"
#: actions.py:124 #: actions.py:109
msgid "One bill has been sent." msgid "One bill has been sent."
msgstr "S'ha creat una factura" msgstr "S'ha creat una factura"
#: actions.py:125 #: actions.py:110
#, python-format #, python-format
msgid "%i bills have been sent." msgid "%i bills have been sent."
msgstr "S'han enviat %i factures." msgstr "S'han enviat %i factures."
#: actions.py:127 #: actions.py:117
msgid "Resend" msgid "Resend"
msgstr "Reenviat" msgstr "Reenviat"
#: actions.py:188 #: actions.py:137
msgid "Download"
msgstr "Descarrega"
#: actions.py:153
msgid "C.S.D."
msgstr ""
#: actions.py:155
msgid "Close, send and download bills in one shot."
msgstr ""
#: actions.py:216
#, python-format #, python-format
msgid "%(norders)s orders and %(nlines)s lines undoed." msgid "%(norders)s orders and %(nlines)s lines undoed."
msgstr "%(norders)s ordres i %(nlines)s línies desfetes." msgstr "%(norders)s ordres i %(nlines)s línies desfetes."
#: actions.py:207 #: actions.py:235
msgid "Lines moved" msgid "Lines moved"
msgstr "Línies mogudes" msgstr "Línies mogudes"
#: actions.py:219 #: actions.py:248
msgid "Selected bills should be in closed state" msgid "Selected bills should be in closed state"
msgstr "Les factures seleccionades han d'estar en estat obert" msgstr "Les factures seleccionades han d'estar en estat obert"
#: actions.py:236 #: actions.py:265
#, python-format #, python-format
msgid "%(type)s of %(related_type)s %(number)s and creation date %(date)s" msgid "%(type)s of %(related_type)s %(number)s and creation date %(date)s"
msgstr "%(type)s de %(related_type)s %(number)s amb data de creació %(date)s" msgstr "%(type)s de %(related_type)s %(number)s amb data de creació %(date)s"
#: actions.py:243 #: actions.py:272
#, python-format #, python-format
msgid "%(related_type)s %(number)s subtotal for tax %(tax)s%%" msgid "%(related_type)s %(number)s subtotal for tax %(tax)s%%"
msgstr "%(related_type)s %(number)s subtotal %(tax)s%%" msgstr "%(related_type)s %(number)s subtotal %(tax)s%%"
#: actions.py:259 #: actions.py:288
#, python-format #, python-format
msgid "<a href=\"%(url)s\">One amendment bill</a> have been generated." msgid "<a href=\"%(url)s\">One amendment bill</a> have been generated."
msgstr "S'ha creat una <a href=\"%(url)s\">transacció</a>" msgstr "S'ha creat una <a href=\"%(url)s\">transacció</a>"
#: actions.py:260 #: actions.py:289
#, python-format #, python-format
msgid "<a href=\"%(url)s\">%(num)i amendment bills</a> have been generated." msgid "<a href=\"%(url)s\">%(num)i amendment bills</a> have been generated."
msgstr "S'han creat les <a href=\"%(url)s\">%(num)i següents transaccions</a>" msgstr "S'han creat les <a href=\"%(url)s\">%(num)i següents transaccions</a>"
#: actions.py:263 #: actions.py:292
msgid "Amend" msgid "Amend"
msgstr "" msgstr ""
#: admin.py:54 admin.py:98 admin.py:133 forms.py:11 #: admin.py:58 admin.py:103 admin.py:140 forms.py:11
#: templates/admin/bills/report.html:43 #: templates/admin/bills/bill/report.html:43
#: templates/admin/bills/bill/report.html:70
msgid "Total" msgid "Total"
msgstr "Total" msgstr "Total"
#: admin.py:85 #: admin.py:89
msgid "Description" msgid "Description"
msgstr "Descripció" msgstr "Descripció"
#: admin.py:93 #: admin.py:97
msgid "Subtotal" msgid "Subtotal"
msgstr "Subtotal" msgstr "Subtotal"
#: admin.py:123 #: admin.py:130
msgid "Is open" msgid "Is open"
msgstr "És oberta" msgstr "És oberta"
#: admin.py:128 #: admin.py:135
msgid "Subline" msgid "Subline"
msgstr "Sublínia" msgstr "Sublínia"
#: admin.py:162 #: admin.py:167
msgid "No bills selected." msgid "No bills selected."
msgstr "No hi ha factures seleccionades" msgstr "No hi ha factures seleccionades"
#: admin.py:169 #: admin.py:174
#, python-format #, python-format
msgid "Manage %s bill lines." msgid "Manage %s bill lines."
msgstr "Gestiona %s línies de factura." msgstr "Gestiona %s línies de factura."
#: admin.py:171 #: admin.py:176
msgid "Bill not in open state." msgid "Bill not in open state."
msgstr "La factura no està en estat obert" msgstr "La factura no està en estat obert"
#: admin.py:174 #: admin.py:179
msgid "Not all bills are in open state." msgid "Not all bills are in open state."
msgstr "No totes les factures estan en estat obert" msgstr "No totes les factures estan en estat obert"
#: admin.py:175 #: admin.py:180
msgid "Manage bill lines of multiple bills." msgid "Manage bill lines of multiple bills."
msgstr "Gestiona línies de factura de multiples factures." msgstr "Gestiona línies de factura de multiples factures."
#: admin.py:195 #: admin.py:204
msgid "Dates"
msgstr ""
#: admin.py:209
msgid "Raw" msgid "Raw"
msgstr "Raw" msgstr "Raw"
#: admin.py:214 models.py:72 #: admin.py:235 models.py:73
msgid "Created" msgid "Created"
msgstr "Creada" msgstr "Creada"
#: admin.py:220 #: admin.py:236
#, fuzzy
#| msgid "Close"
msgid "Closed"
msgstr "Tanca"
#: admin.py:237
#, fuzzy
#| msgid "updated on"
msgid "Updated"
msgstr "actualitzada el"
#: admin.py:246
#, fuzzy
#| msgid "amended line"
msgid "Amends"
msgstr "línia rectificada"
#: admin.py:252
msgid "lines" msgid "lines"
msgstr "línies" msgstr "línies"
#: admin.py:225 filters.py:44 templates/bills/microspective.html:118 #: admin.py:257 filters.py:46 templates/bills/microspective.html:118
msgid "total" msgid "total"
msgstr "total" msgstr "total"
#: admin.py:233 models.py:103 models.py:446 #: admin.py:265 models.py:104 models.py:460
msgid "type" msgid "type"
msgstr "tipus" msgstr "tipus"
#: admin.py:250 #: admin.py:282
msgid "This bill has been amended, this value may not be valid."
msgstr ""
#: admin.py:287
msgid "Payment" msgid "Payment"
msgstr "Pagament" msgstr "Pagament"
#: filters.py:19 #: filters.py:21
msgid "All" msgid "All"
msgstr "Tot" msgstr "Tot"
#: filters.py:20 models.py:87 #: filters.py:22 models.py:88
msgid "Invoice" msgid "Invoice"
msgstr "Factura" msgstr "Factura"
#: filters.py:21 models.py:88 #: filters.py:23 models.py:90
msgid "Amendment invoice"
msgstr "Factura rectificativa"
#: filters.py:22 models.py:89
msgid "Fee" msgid "Fee"
msgstr "Quota de soci" msgstr "Quota de soci"
#: filters.py:23
msgid "Amendment fee"
msgstr "Rectificació de quota de soci"
#: filters.py:24 #: filters.py:24
msgid "Pro-forma" msgid "Pro-forma"
msgstr "Pro-forma" msgstr "Pro-forma"
#: filters.py:66 #: filters.py:25
msgid "Amendment fee"
msgstr "Rectificació de quota de soci"
#: filters.py:26 models.py:89
msgid "Amendment invoice"
msgstr "Factura rectificativa"
#: filters.py:68
msgid "has bill contact" msgid "has bill contact"
msgstr "té contacte de facturació" msgstr "té contacte de facturació"
#: filters.py:71 #: filters.py:73
msgid "Yes" msgid "Yes"
msgstr "Si" msgstr "Si"
#: filters.py:72 #: filters.py:74
msgid "No" msgid "No"
msgstr "No" msgstr "No"
#: filters.py:83 #: filters.py:85
msgid "payment state" msgid "payment state"
msgstr "Pagament" msgstr "Pagament"
#: filters.py:88 models.py:71 #: filters.py:90 models.py:72
msgid "Open" msgid "Open"
msgstr "" msgstr ""
#: filters.py:89 models.py:75 #: filters.py:91 models.py:76
msgid "Paid" msgid "Paid"
msgstr "Pagat" msgstr "Pagat"
#: filters.py:90 #: filters.py:92
msgid "Pending" msgid "Pending"
msgstr "Pendent" msgstr "Pendent"
#: filters.py:91 models.py:78 #: filters.py:93 models.py:79
msgid "Bad debt" msgid "Bad debt"
msgstr "Incobrable" msgstr "Incobrable"
#: forms.py:9 templates/admin/bills/report.html:37 #: filters.py:135
#, fuzzy
#| msgid "amended line"
msgid "amended"
msgstr "línia rectificada"
#: filters.py:140
#, fuzzy
#| msgid "Due date"
msgid "Closed amends"
msgstr "Data de pagament"
#: filters.py:141
msgid "Open or closed amends"
msgstr ""
#: filters.py:142
#, fuzzy
#| msgid "closed on"
msgid "No closed amends"
msgstr "tancat el"
#: filters.py:143
msgid "No amends"
msgstr ""
#: forms.py:9 templates/admin/bills/bill/report.html:64
msgid "Number" msgid "Number"
msgstr "Número" msgstr "Número"
@ -264,99 +325,99 @@ msgstr "Relacionat"
msgid "Main" msgid "Main"
msgstr "Principal" msgstr "Principal"
#: models.py:23 models.py:99 #: models.py:24 models.py:100
msgid "account" msgid "account"
msgstr "compte" msgstr "compte"
#: models.py:25 #: models.py:26
msgid "name" msgid "name"
msgstr "nom" msgstr "nom"
#: models.py:26 #: models.py:27
msgid "Account full name will be used when left blank." msgid "Account full name will be used when left blank."
msgstr "S'emprarà el nom complet del compte quan es deixi en blanc." msgstr "S'emprarà el nom complet del compte quan es deixi en blanc."
#: models.py:27 #: models.py:28
msgid "address" msgid "address"
msgstr "adreça" msgstr "adreça"
#: models.py:28 #: models.py:29
msgid "city" msgid "city"
msgstr "ciutat" msgstr "ciutat"
#: models.py:30 #: models.py:31
msgid "zip code" msgid "zip code"
msgstr "codi postal" msgstr "codi postal"
#: models.py:31 #: models.py:32
msgid "Enter a valid zipcode." msgid "Enter a valid zipcode."
msgstr "Introdueix un codi postal vàlid." msgstr "Introdueix un codi postal vàlid."
#: models.py:32 #: models.py:33
msgid "country" msgid "country"
msgstr "país" msgstr "país"
#: models.py:35 templates/admin/bills/report.html:38 #: models.py:36 templates/admin/bills/bill/report.html:65
msgid "VAT number" msgid "VAT number"
msgstr "NIF" msgstr "NIF"
#: models.py:73 #: models.py:74
msgid "Processed" msgid "Processed"
msgstr "" msgstr ""
#: models.py:74 #: models.py:75
#, fuzzy #, fuzzy
#| msgid "amended line" #| msgid "amended line"
msgid "Amended" msgid "Amended"
msgstr "línia rectificada" msgstr "línia rectificada"
#: models.py:76 #: models.py:77
msgid "Incomplete" msgid "Incomplete"
msgstr "" msgstr ""
#: models.py:77 #: models.py:78
msgid "Executed" msgid "Executed"
msgstr "" msgstr ""
#: models.py:90 #: models.py:91
msgid "Amendment Fee" msgid "Amendment Fee"
msgstr "Rectificació de quota de soci" msgstr "Rectificació de quota de soci"
#: models.py:91 #: models.py:92
msgid "Pro forma" msgid "Pro forma"
msgstr "Pro forma" msgstr "Pro forma"
#: models.py:98 #: models.py:99
msgid "number" msgid "number"
msgstr "número" msgstr "número"
#: models.py:101 #: models.py:102
#, fuzzy #, fuzzy
#| msgid "amended line" #| msgid "amended line"
msgid "amend of" msgid "amend of"
msgstr "línia rectificada" msgstr "línia rectificada"
#: models.py:104 #: models.py:105
msgid "created on" msgid "created on"
msgstr "creat el" msgstr "creat el"
#: models.py:105 #: models.py:106
msgid "closed on" msgid "closed on"
msgstr "tancat el" msgstr "tancat el"
#: models.py:106 #: models.py:107
msgid "open" msgid "open"
msgstr "obert" msgstr "obert"
#: models.py:107 #: models.py:108
msgid "sent" msgid "sent"
msgstr "enviat" msgstr "enviat"
#: models.py:108 #: models.py:109
msgid "due on" msgid "due on"
msgstr "es deu" msgstr "es deu"
#: models.py:109 #: models.py:110
msgid "updated on" msgid "updated on"
msgstr "actualitzada el" msgstr "actualitzada el"
@ -368,113 +429,169 @@ msgstr "comentaris"
msgid "HTML" msgid "HTML"
msgstr "HTML" msgstr "HTML"
#: models.py:192 #: models.py:194
#, python-format #, python-format
msgid "Type %s is not an amendment." msgid "Type %s is not an amendment."
msgstr "" msgstr ""
#: models.py:194 #: models.py:196
msgid "Amend of related account doesn't match bill account." msgid "Amend of related account doesn't match bill account."
msgstr "" msgstr ""
#: models.py:199 #: models.py:198
#, python-format #, fuzzy
msgid "Type %s requires an amend of link." #| msgid "Bill not in open state."
msgid "Related invoice is in open state."
msgstr "La factura no està en estat obert"
#: models.py:200
msgid "Related invoice is an amendment."
msgstr "" msgstr ""
#: models.py:378 #: models.py:392
msgid "bill" msgid "bill"
msgstr "factura" msgstr "factura"
#: models.py:379 models.py:444 templates/bills/microspective.html:73 #: models.py:393 models.py:458 templates/bills/microspective.html:73
msgid "description" msgid "description"
msgstr "descripció" msgstr "descripció"
#: models.py:380 #: models.py:394
msgid "rate" msgid "rate"
msgstr "tarifa" msgstr "tarifa"
#: models.py:381 #: models.py:395
msgid "quantity" msgid "quantity"
msgstr "quantitat" msgstr "quantitat"
#: models.py:383 #: models.py:397
#, fuzzy #, fuzzy
#| msgid "quantity" #| msgid "quantity"
msgid "Verbose quantity" msgid "Verbose quantity"
msgstr "quantitat" msgstr "quantitat"
#: models.py:384 templates/bills/microspective.html:77 #: models.py:398 templates/admin/bills/bill/report.html:47
#: templates/bills/microspective.html:77
#: templates/bills/microspective.html:111 #: templates/bills/microspective.html:111
msgid "subtotal" msgid "subtotal"
msgstr "subtotal" msgstr "subtotal"
#: models.py:385 #: models.py:399
msgid "tax" msgid "tax"
msgstr "impostos" msgstr "impostos"
#: models.py:386 #: models.py:400
msgid "start" msgid "start"
msgstr "iniciar" msgstr "iniciar"
#: models.py:387 #: models.py:401
msgid "end" msgid "end"
msgstr "finalitzar" msgstr "finalitzar"
#: models.py:389 #: models.py:403
msgid "Informative link back to the order" msgid "Informative link back to the order"
msgstr "Enllaç informatiu de l'ordre" msgstr "Enllaç informatiu de l'ordre"
#: models.py:390 #: models.py:404
msgid "order billed" msgid "order billed"
msgstr "ordre facturada" msgstr "ordre facturada"
#: models.py:391 #: models.py:405
msgid "order billed until" msgid "order billed until"
msgstr "ordre facturada fins a" msgstr "ordre facturada fins a"
#: models.py:392 #: models.py:406
msgid "created" msgid "created"
msgstr "creada" msgstr "creada"
#: models.py:394 #: models.py:408
msgid "amended line" msgid "amended line"
msgstr "línia rectificada" msgstr "línia rectificada"
#: models.py:437 #: models.py:451
msgid "Volume" msgid "Volume"
msgstr "Volum" msgstr "Volum"
#: models.py:438 #: models.py:452
msgid "Compensation" msgid "Compensation"
msgstr "Compensació" msgstr "Compensació"
#: models.py:439 #: models.py:453
msgid "Other" msgid "Other"
msgstr "Altre" msgstr "Altre"
#: models.py:443 #: models.py:457
msgid "bill line" msgid "bill line"
msgstr "línia de factura" msgstr "línia de factura"
#: templates/admin/bills/report.html:39 #: templates/admin/bills/bill/report.html:42
msgid "Summary"
msgstr ""
#: templates/admin/bills/bill/report.html:47
#: templates/admin/bills/bill/report.html:51
#: templates/admin/bills/bill/report.html:69
#: templates/bills/microspective.html:111
#: templates/bills/microspective.html:114
msgid "VAT"
msgstr "IVA"
#: templates/admin/bills/bill/report.html:51
#: templates/bills/microspective.html:114
msgid "taxes"
msgstr "impostos"
#: templates/admin/bills/bill/report.html:56
#: templates/admin/bills/billline/report.html:60
#: templates/bills/microspective.html:53
msgid "TOTAL"
msgstr "TOTAL"
#: templates/admin/bills/bill/report.html:66
msgid "Contact" msgid "Contact"
msgstr "" msgstr ""
#: templates/admin/bills/report.html:40 #: templates/admin/bills/bill/report.html:67
#, fuzzy #, fuzzy
#| msgid "Due date" #| msgid "Due date"
msgid "Close date" msgid "Close date"
msgstr "Data de pagament" msgstr "Data de pagament"
#: templates/admin/bills/report.html:41 #: templates/admin/bills/bill/report.html:68
msgid "Base" msgid "Base"
msgstr "" msgstr ""
#: templates/admin/bills/report.html:42 templates/bills/microspective.html:111 #: templates/admin/bills/billline/report.html:42
#: templates/bills/microspective.html:114 msgid "Services"
msgid "VAT" msgstr ""
msgstr "IVA"
#: templates/admin/bills/billline/report.html:43
msgid "Active"
msgstr ""
#: templates/admin/bills/billline/report.html:44
msgid "Cancelled"
msgstr ""
#: templates/admin/bills/billline/report.html:45
msgid "Nominal price"
msgstr ""
#: templates/admin/bills/billline/report.html:46
#, fuzzy
#| msgid "quantity"
msgid "Quantity"
msgstr "quantitat"
#: templates/admin/bills/billline/report.html:47
msgid "Profit"
msgstr ""
#: templates/admin/bills/change_list.html:9
#, fuzzy
#| msgid "bill"
msgid "Add bill"
msgstr "factura"
#: templates/bills/microspective-fee.html:107 #: templates/bills/microspective-fee.html:107
msgid "Due date" msgid "Due date"
@ -502,10 +619,6 @@ msgstr ""
msgid "DUE DATE" msgid "DUE DATE"
msgstr "VENCIMENT" msgstr "VENCIMENT"
#: templates/bills/microspective.html:53
msgid "TOTAL"
msgstr "TOTAL"
#: templates/bills/microspective.html:57 #: templates/bills/microspective.html:57
#, python-format #, python-format
msgid "%(bill_type)s DATE" msgid "%(bill_type)s DATE"
@ -523,19 +636,15 @@ msgstr "hrs/qnt"
msgid "rate/price" msgid "rate/price"
msgstr "tarifa/preu" msgstr "tarifa/preu"
#: templates/bills/microspective.html:114 #: templates/bills/microspective.html:131
msgid "taxes"
msgstr "impostos"
#: templates/bills/microspective.html:130
msgid "COMMENTS" msgid "COMMENTS"
msgstr "COMENTARIS" msgstr "COMENTARIS"
#: templates/bills/microspective.html:136 #: templates/bills/microspective.html:138
msgid "PAYMENT" msgid "PAYMENT"
msgstr "PAGAMENT" msgstr "PAGAMENT"
#: templates/bills/microspective.html:140 #: templates/bills/microspective.html:142
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"
@ -549,11 +658,11 @@ msgstr ""
"Pots pagar aquesta <i>%(type)s</i> per transferència bancaria.<br>Inclou el " "Pots pagar aquesta <i>%(type)s</i> per transferència bancaria.<br>Inclou el "
"teu nom i el número de <i>%(type)s</i>. El nostre compte bancari és" "teu nom i el número de <i>%(type)s</i>. El nostre compte bancari és"
#: templates/bills/microspective.html:149 #: templates/bills/microspective.html:151
msgid "QUESTIONS" msgid "QUESTIONS"
msgstr "PREGUNTES" msgstr "PREGUNTES"
#: templates/bills/microspective.html:150 #: templates/bills/microspective.html:152
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-07 10:10+0000\n" "POT-Creation-Date: 2015-10-29 10:51+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,37 +18,33 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: actions.py:40 #: actions.py:31
msgid "Download"
msgstr "Descarga"
#: actions.py:50
msgid "View" msgid "View"
msgstr "Vista" msgstr "Vista"
#: actions.py:58 #: actions.py:42
msgid "Selected bills should be in open state" msgid "Selected bills should be in open state"
msgstr "Las facturas seleccionadas están en estado abierto" msgstr "Las facturas seleccionadas están en estado abierto"
#: actions.py:76 #: actions.py:57
msgid "Selected bills have been closed" msgid "Selected bills have been closed"
msgstr "Las facturas seleccionadas han sido cerradas" msgstr "Las facturas seleccionadas han sido cerradas"
#: actions.py:89 #: actions.py:70
#, python-format #, python-format
msgid "<a href=\"%(url)s\">One related transaction</a> has been created" msgid "<a href=\"%(url)s\">One related transaction</a> has been created"
msgstr "Se ha creado una <a href=\"%(url)s\">transacción</a>" msgstr "Se ha creado una <a href=\"%(url)s\">transacción</a>"
#: actions.py:90 #: actions.py:71
#, python-format #, python-format
msgid "<a href=\"%(url)s\">%(num)i related transactions</a> have been created" msgid "<a href=\"%(url)s\">%(num)i related transactions</a> have been created"
msgstr "Se han creado <a href=\"%(url)s\">%(num)i transacciones</a>" msgstr "Se han creado <a href=\"%(url)s\">%(num)i transacciones</a>"
#: actions.py:96 #: actions.py:77
msgid "Are you sure about closing the following bills?" msgid "Are you sure about closing the following bills?"
msgstr "Estás a punto de cerrar las sigüientes facturas. ¿Estás seguro?" msgstr "Estás a punto de cerrar las sigüientes facturas. ¿Estás seguro?"
#: actions.py:97 #: actions.py:78
msgid "" msgid ""
"Once a bill is closed it can not be further modified.</p><p>Please select a " "Once a bill is closed it can not be further modified.</p><p>Please select a "
"payment source for the selected bills" "payment source for the selected bills"
@ -56,180 +52,248 @@ msgstr ""
"Una vez cerrada la factura ya no se podrá modificar.</p><p>Por favor " "Una vez cerrada la factura ya no se podrá modificar.</p><p>Por favor "
"seleciona un metodo de pago para las facturas seleccionadas" "seleciona un metodo de pago para las facturas seleccionadas"
#: actions.py:110 #: actions.py:91
msgid "Close" msgid "Close"
msgstr "Cerrar" msgstr "Cerrar"
#: actions.py:124 #: actions.py:109
msgid "One bill has been sent." msgid "One bill has been sent."
msgstr "Se ha enviado una factura" msgstr "Se ha enviado una factura"
#: actions.py:125 #: actions.py:110
#, python-format #, python-format
msgid "%i bills have been sent." msgid "%i bills have been sent."
msgstr "" msgstr ""
#: actions.py:127 #: actions.py:117
msgid "Resend" msgid "Resend"
msgstr "" msgstr ""
#: actions.py:188 #: actions.py:137
msgid "Download"
msgstr "Descarga"
#: actions.py:153
msgid "C.S.D."
msgstr ""
#: actions.py:155
msgid "Close, send and download bills in one shot."
msgstr ""
#: actions.py:216
#, python-format #, python-format
msgid "%(norders)s orders and %(nlines)s lines undoed." msgid "%(norders)s orders and %(nlines)s lines undoed."
msgstr "" msgstr ""
#: actions.py:207 #: actions.py:235
msgid "Lines moved" msgid "Lines moved"
msgstr "" msgstr ""
#: actions.py:219 #: actions.py:248
msgid "Selected bills should be in closed state" msgid "Selected bills should be in closed state"
msgstr "Las facturas seleccionadas están en estado abierto" msgstr "Las facturas seleccionadas están en estado abierto"
#: actions.py:236 #: actions.py:265
#, python-format #, python-format
msgid "%(type)s of %(related_type)s %(number)s and creation date %(date)s" msgid "%(type)s of %(related_type)s %(number)s and creation date %(date)s"
msgstr "%(type)s de %(related_type)s %(number)s con fecha de creación %(date)s" msgstr "%(type)s de %(related_type)s %(number)s con fecha de creación %(date)s"
#: actions.py:243 #: actions.py:272
#, python-format
msgid "%(related_type)s %(number)s subtotal for tax %(tax)s%%" msgid "%(related_type)s %(number)s subtotal for tax %(tax)s%%"
msgstr "%(related_type)s %(number)s subtotal %(tax)s%%" msgstr "%(related_type)s %(number)s subtotal %(tax)s%%"
#: actions.py:255 #: actions.py:288
#, python-format
msgid "<a href=\"%(url)s\">One amendment bill</a> have been generated." msgid "<a href=\"%(url)s\">One amendment bill</a> have been generated."
msgstr "Se ha creado una <a href=\"%(url)s\">transacción</a>" msgstr "Se ha creado una <a href=\"%(url)s\">transacción</a>"
#: actions.py:256 #: actions.py:289
#, python-format
msgid "<a href=\"%(url)s\">%(num)i amendment bills</a> have been generated." msgid "<a href=\"%(url)s\">%(num)i amendment bills</a> have been generated."
msgstr "Se han creado <a href=\"%(url)s\">%(num)i transacciones</a>" msgstr "Se han creado <a href=\"%(url)s\">%(num)i transacciones</a>"
#: actions.py:259 #: actions.py:292
msgid "Amend" msgid "Amend"
msgstr "" msgstr ""
#: admin.py:54 admin.py:98 admin.py:133 forms.py:11 #: admin.py:58 admin.py:103 admin.py:140 forms.py:11
#: templates/admin/bills/report.html:43 #: templates/admin/bills/bill/report.html:43
#: templates/admin/bills/bill/report.html:70
msgid "Total" msgid "Total"
msgstr "" msgstr ""
#: admin.py:85 #: admin.py:89
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: admin.py:93 #: admin.py:97
msgid "Subtotal" msgid "Subtotal"
msgstr "" msgstr ""
#: admin.py:123 #: admin.py:130
msgid "Is open" msgid "Is open"
msgstr "" msgstr ""
#: admin.py:128 #: admin.py:135
msgid "Subline" msgid "Subline"
msgstr "" msgstr ""
#: admin.py:162 #: admin.py:167
msgid "No bills selected." msgid "No bills selected."
msgstr "" msgstr ""
#: admin.py:169 #: admin.py:174
#, python-format #, python-format
msgid "Manage %s bill lines." msgid "Manage %s bill lines."
msgstr "" msgstr ""
#: admin.py:171 #: admin.py:176
msgid "Bill not in open state." msgid "Bill not in open state."
msgstr "" msgstr ""
#: admin.py:174 #: admin.py:179
msgid "Not all bills are in open state." msgid "Not all bills are in open state."
msgstr "" msgstr ""
#: admin.py:175 #: admin.py:180
msgid "Manage bill lines of multiple bills." msgid "Manage bill lines of multiple bills."
msgstr "" msgstr ""
#: admin.py:195 #: admin.py:204
msgid "Dates"
msgstr ""
#: admin.py:209
msgid "Raw" msgid "Raw"
msgstr "" msgstr ""
#: admin.py:214 models.py:72 #: admin.py:235 models.py:73
msgid "Created" msgid "Created"
msgstr "" msgstr ""
#: admin.py:220 #: admin.py:236
#, fuzzy
#| msgid "Close"
msgid "Closed"
msgstr "Cerrar"
#: admin.py:237
#, fuzzy
#| msgid "updated on"
msgid "Updated"
msgstr "actualizada en"
#: admin.py:246
#, fuzzy
#| msgid "Amended"
msgid "Amends"
msgstr "Quota rectificativa"
#: admin.py:252
msgid "lines" msgid "lines"
msgstr "" msgstr ""
#: admin.py:225 filters.py:44 templates/bills/microspective.html:118 #: admin.py:257 filters.py:46 templates/bills/microspective.html:118
msgid "total" msgid "total"
msgstr "" msgstr ""
#: admin.py:233 models.py:103 models.py:446 #: admin.py:265 models.py:104 models.py:460
msgid "type" msgid "type"
msgstr "" msgstr ""
#: admin.py:250 #: admin.py:282
msgid "This bill has been amended, this value may not be valid."
msgstr ""
#: admin.py:287
msgid "Payment" msgid "Payment"
msgstr "Pago" msgstr "Pago"
#: filters.py:19 #: filters.py:21
msgid "All" msgid "All"
msgstr "" msgstr ""
#: filters.py:20 models.py:87 #: filters.py:22 models.py:88
msgid "Invoice" msgid "Invoice"
msgstr "Factura" msgstr "Factura"
#: filters.py:21 models.py:88 #: filters.py:23 models.py:90
msgid "Amendment invoice"
msgstr "Factura rectificativa"
#: filters.py:22 models.py:89
msgid "Fee" msgid "Fee"
msgstr "Quota de socio" msgstr "Cuota de socio"
#: filters.py:23
msgid "Amendment fee"
msgstr "Quota rectificativa"
#: filters.py:24 #: filters.py:24
msgid "Pro-forma" msgid "Pro-forma"
msgstr "" msgstr ""
#: filters.py:66 #: filters.py:25
msgid "Amendment fee"
msgstr "Cuota rectificativa"
#: filters.py:26 models.py:89
msgid "Amendment invoice"
msgstr "Factura rectificativa"
#: filters.py:68
msgid "has bill contact" msgid "has bill contact"
msgstr "" msgstr ""
#: filters.py:71 #: filters.py:73
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""
#: filters.py:72 #: filters.py:74
msgid "No" msgid "No"
msgstr "" msgstr ""
#: filters.py:83 #: filters.py:85
msgid "payment state" msgid "payment state"
msgstr "Pago" msgstr "Pago"
#: filters.py:88 models.py:71 #: filters.py:90 models.py:72
msgid "Open" msgid "Open"
msgstr "" msgstr ""
#: filters.py:89 models.py:75 #: filters.py:91 models.py:76
msgid "Paid" msgid "Paid"
msgstr "" msgstr ""
#: filters.py:90 #: filters.py:92
msgid "Pending" msgid "Pending"
msgstr "" msgstr ""
#: filters.py:91 models.py:78 #: filters.py:93 models.py:79
msgid "Bad debt" msgid "Bad debt"
msgstr "" msgstr ""
#: forms.py:9 templates/admin/bills/report.html:37 #: filters.py:135
#, fuzzy
#| msgid "Amended"
msgid "amended"
msgstr "Quota rectificativa"
#: filters.py:140
#, fuzzy
#| msgid "Due date"
msgid "Closed amends"
msgstr "Fecha de pago"
#: filters.py:141
msgid "Open or closed amends"
msgstr ""
#: filters.py:142
#, fuzzy
#| msgid "closed on"
msgid "No closed amends"
msgstr "cerrada en"
#: filters.py:143
msgid "No amends"
msgstr ""
#: forms.py:9 templates/admin/bills/bill/report.html:64
msgid "Number" msgid "Number"
msgstr "" msgstr ""
@ -259,95 +323,95 @@ msgstr ""
msgid "Main" msgid "Main"
msgstr "" msgstr ""
#: models.py:23 models.py:99 #: models.py:24 models.py:100
msgid "account" msgid "account"
msgstr "" msgstr ""
#: models.py:25 #: models.py:26
msgid "name" msgid "name"
msgstr "" msgstr ""
#: models.py:26 #: models.py:27
msgid "Account full name will be used when left blank." msgid "Account full name will be used when left blank."
msgstr "" msgstr ""
#: models.py:27 #: models.py:28
msgid "address" msgid "address"
msgstr "" msgstr ""
#: models.py:28 #: models.py:29
msgid "city" msgid "city"
msgstr "" msgstr ""
#: models.py:30 #: models.py:31
msgid "zip code" msgid "zip code"
msgstr "" msgstr ""
#: models.py:31 #: models.py:32
msgid "Enter a valid zipcode." msgid "Enter a valid zipcode."
msgstr "" msgstr ""
#: models.py:32 #: models.py:33
msgid "country" msgid "country"
msgstr "" msgstr ""
#: models.py:35 templates/admin/bills/report.html:38 #: models.py:36 templates/admin/bills/bill/report.html:65
msgid "VAT number" msgid "VAT number"
msgstr "" msgstr ""
#: models.py:73 #: models.py:74
msgid "Processed" msgid "Processed"
msgstr "" msgstr ""
#: models.py:74 #: models.py:75
msgid "Amended" msgid "Amended"
msgstr "Quota rectificativa" msgstr "Quota rectificativa"
#: models.py:76 #: models.py:77
msgid "Incomplete" msgid "Incomplete"
msgstr "" msgstr ""
#: models.py:77 #: models.py:78
msgid "Executed" msgid "Executed"
msgstr "" msgstr ""
#: models.py:90 #: models.py:91
msgid "Amendment Fee" msgid "Amendment Fee"
msgstr "" msgstr ""
#: models.py:91 #: models.py:92
msgid "Pro forma" msgid "Pro forma"
msgstr "" msgstr ""
#: models.py:98 #: models.py:99
msgid "number" msgid "number"
msgstr "número" msgstr "número"
#: models.py:101 #: models.py:102
msgid "amend of" msgid "amend of"
msgstr "rectificación de" msgstr "rectificación de"
#: models.py:104 #: models.py:105
msgid "created on" msgid "created on"
msgstr "creado en" msgstr "creado en"
#: models.py:105 #: models.py:106
msgid "closed on" msgid "closed on"
msgstr "cerrada en" msgstr "cerrada en"
#: models.py:106 #: models.py:107
msgid "open" msgid "open"
msgstr "abierta" msgstr "abierta"
#: models.py:107 #: models.py:108
msgid "sent" msgid "sent"
msgstr "enviada" msgstr "enviada"
#: models.py:108 #: models.py:109
msgid "due on" msgid "due on"
msgstr "vencimiento" msgstr "vencimiento"
#: models.py:109 #: models.py:110
msgid "updated on" msgid "updated on"
msgstr "actualizada en" msgstr "actualizada en"
@ -359,111 +423,167 @@ msgstr "comentarios"
msgid "HTML" msgid "HTML"
msgstr "HTML" msgstr "HTML"
#: models.py:192 #: models.py:194
#, python-format #, python-format
msgid "Type %s is not an amendment." msgid "Type %s is not an amendment."
msgstr "" msgstr ""
#: models.py:194 #: models.py:196
msgid "Amend of related account doesn't match bill account." msgid "Amend of related account doesn't match bill account."
msgstr "" msgstr ""
#: models.py:199 #: models.py:198
#, python-format #, fuzzy
msgid "Type %s requires an amend of link." #| msgid "Selected bills should be in open state"
msgid "Related invoice is in open state."
msgstr "Las facturas seleccionadas están en estado abierto"
#: models.py:200
msgid "Related invoice is an amendment."
msgstr "" msgstr ""
#: models.py:378 #: models.py:392
msgid "bill" msgid "bill"
msgstr "factura" msgstr "factura"
#: models.py:379 models.py:444 templates/bills/microspective.html:73 #: models.py:393 models.py:458 templates/bills/microspective.html:73
msgid "description" msgid "description"
msgstr "descripción" msgstr "descripción"
#: models.py:380 #: models.py:394
msgid "rate" msgid "rate"
msgstr "tarifa" msgstr "tarifa"
#: models.py:381 #: models.py:395
msgid "quantity" msgid "quantity"
msgstr "cantidad" msgstr "cantidad"
#: models.py:383 #: models.py:397
msgid "Verbose quantity" msgid "Verbose quantity"
msgstr "Cantidad" msgstr "Cantidad"
#: models.py:384 templates/bills/microspective.html:77 #: models.py:398 templates/admin/bills/bill/report.html:47
#: templates/bills/microspective.html:77
#: templates/bills/microspective.html:111 #: templates/bills/microspective.html:111
msgid "subtotal" msgid "subtotal"
msgstr "subtotal" msgstr "subtotal"
#: models.py:385 #: models.py:399
msgid "tax" msgid "tax"
msgstr "impuesto" msgstr "impuesto"
#: models.py:386 #: models.py:400
msgid "start" msgid "start"
msgstr "inicio" msgstr "inicio"
#: models.py:387 #: models.py:401
msgid "end" msgid "end"
msgstr "fín" msgstr "fín"
#: models.py:389 #: models.py:403
msgid "Informative link back to the order" msgid "Informative link back to the order"
msgstr "" msgstr ""
#: models.py:390 #: models.py:404
msgid "order billed" msgid "order billed"
msgstr "" msgstr ""
#: models.py:391 #: models.py:405
msgid "order billed until" msgid "order billed until"
msgstr "" msgstr ""
#: models.py:392 #: models.py:406
msgid "created" msgid "created"
msgstr "creado" msgstr "creado"
#: models.py:394 #: models.py:408
msgid "amended line" msgid "amended line"
msgstr "linea rectificativa" msgstr "linea rectificativa"
#: models.py:437 #: models.py:451
msgid "Volume" msgid "Volume"
msgstr "Volumen" msgstr "Volumen"
#: models.py:438 #: models.py:452
msgid "Compensation" msgid "Compensation"
msgstr "Compensación" msgstr "Compensación"
#: models.py:439 #: models.py:453
msgid "Other" msgid "Other"
msgstr "Otro" msgstr "Otro"
#: models.py:443 #: models.py:457
msgid "bill line" msgid "bill line"
msgstr "linea de factura" msgstr "linea de factura"
#: templates/admin/bills/report.html:39 #: templates/admin/bills/bill/report.html:42
msgid "Summary"
msgstr ""
#: templates/admin/bills/bill/report.html:47
#: templates/admin/bills/bill/report.html:51
#: templates/admin/bills/bill/report.html:69
#: templates/bills/microspective.html:111
#: templates/bills/microspective.html:114
msgid "VAT"
msgstr "IVA"
#: templates/admin/bills/bill/report.html:51
#: templates/bills/microspective.html:114
msgid "taxes"
msgstr "impuestos"
#: templates/admin/bills/bill/report.html:56
#: templates/admin/bills/billline/report.html:60
#: templates/bills/microspective.html:53
msgid "TOTAL"
msgstr "TOTAL"
#: templates/admin/bills/bill/report.html:66
msgid "Contact" msgid "Contact"
msgstr "Contacto" msgstr "Contacto"
#: templates/admin/bills/report.html:40 #: templates/admin/bills/bill/report.html:67
#, fuzzy #, fuzzy
#| msgid "Due date" #| msgid "Due date"
msgid "Close date" msgid "Close date"
msgstr "Fecha de pago" msgstr "Fecha de pago"
#: templates/admin/bills/report.html:41 #: templates/admin/bills/bill/report.html:68
msgid "Base" msgid "Base"
msgstr "Base" msgstr "Base"
#: templates/admin/bills/report.html:42 templates/bills/microspective.html:111 #: templates/admin/bills/billline/report.html:42
#: templates/bills/microspective.html:114 msgid "Services"
msgid "VAT" msgstr ""
msgstr "IVA"
#: templates/admin/bills/billline/report.html:43
msgid "Active"
msgstr ""
#: templates/admin/bills/billline/report.html:44
msgid "Cancelled"
msgstr ""
#: templates/admin/bills/billline/report.html:45
msgid "Nominal price"
msgstr ""
#: templates/admin/bills/billline/report.html:46
#, fuzzy
#| msgid "quantity"
msgid "Quantity"
msgstr "cantidad"
#: templates/admin/bills/billline/report.html:47
msgid "Profit"
msgstr ""
#: templates/admin/bills/change_list.html:9
#, fuzzy
#| msgid "bill"
msgid "Add bill"
msgstr "factura"
#: templates/bills/microspective-fee.html:107 #: templates/bills/microspective-fee.html:107
msgid "Due date" msgid "Due date"
@ -489,10 +609,6 @@ msgstr ""
msgid "DUE DATE" msgid "DUE DATE"
msgstr "VENCIMIENTO" msgstr "VENCIMIENTO"
#: templates/bills/microspective.html:53
msgid "TOTAL"
msgstr "TOTAL"
#: templates/bills/microspective.html:57 #: templates/bills/microspective.html:57
#, python-format #, python-format
msgid "%(bill_type)s DATE" msgid "%(bill_type)s DATE"
@ -510,19 +626,15 @@ msgstr "hrs/cant"
msgid "rate/price" msgid "rate/price"
msgstr "tarifa/precio" msgstr "tarifa/precio"
#: templates/bills/microspective.html:114 #: templates/bills/microspective.html:131
msgid "taxes"
msgstr "impuestos"
#: templates/bills/microspective.html:130
msgid "COMMENTS" msgid "COMMENTS"
msgstr "COMENTARIOS" msgstr "COMENTARIOS"
#: templates/bills/microspective.html:136 #: templates/bills/microspective.html:138
msgid "PAYMENT" msgid "PAYMENT"
msgstr "PAGO" msgstr "PAGO"
#: templates/bills/microspective.html:140 #: templates/bills/microspective.html:142
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"
@ -533,14 +645,14 @@ msgid ""
" " " "
msgstr "" msgstr ""
"\n" "\n"
"Puedes pagar esta <i>%(type)s</i> por transferencia bancaria.<br>Incloye tu " "Puedes pagar esta <i>%(type)s</i> por transferencia bancaria.<br>Incluye tu "
"nombre y el número de <i>%(type)s</i>. Nuestra cuenta bancaria es" "nombre y el número de <i>%(type)s</i>. Nuestra cuenta bancaria es"
#: templates/bills/microspective.html:149 #: templates/bills/microspective.html:151
msgid "QUESTIONS" msgid "QUESTIONS"
msgstr "PREGUNTAS" msgstr "PREGUNTAS"
#: templates/bills/microspective.html:150 #: templates/bills/microspective.html:152
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"

View File

@ -1,6 +1,5 @@
import datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from functools import lru_cache
from django.core.validators import ValidationError, RegexValidator from django.core.validators import ValidationError, RegexValidator
from django.db import models from django.db import models
@ -15,6 +14,7 @@ from django.utils.translation import ugettext_lazy as _
from orchestra.contrib.accounts.models import Account from orchestra.contrib.accounts.models import Account
from orchestra.contrib.contacts.models import Contact from orchestra.contrib.contacts.models import Contact
from orchestra.core import validators from orchestra.core import validators
from orchestra.utils.functional import cached
from orchestra.utils.html import html_to_pdf from orchestra.utils.html import html_to_pdf
from . import settings from . import settings
@ -319,7 +319,7 @@ class Bill(models.Model):
self.number = self.get_number() self.number = self.get_number()
super(Bill, self).save(*args, **kwargs) super(Bill, self).save(*args, **kwargs)
@lru_cache() @cached
def compute_subtotals(self): def compute_subtotals(self):
subtotals = {} subtotals = {}
lines = self.lines.annotate(totals=F('subtotal') + Sum(Coalesce('sublines__total', 0))) lines = self.lines.annotate(totals=F('subtotal') + Sum(Coalesce('sublines__total', 0)))
@ -333,21 +333,21 @@ class Bill(models.Model):
result[tax] = [subtotal, round(tax/100*subtotal, 2)] result[tax] = [subtotal, round(tax/100*subtotal, 2)]
return result return result
@lru_cache() @cached
def compute_base(self): def compute_base(self):
bases = self.lines.annotate( bases = self.lines.annotate(
bases=F('subtotal') + Sum(Coalesce('sublines__total', 0)) bases=F('subtotal') + Sum(Coalesce('sublines__total', 0))
) )
return round(bases.aggregate(Sum('bases'))['bases__sum'] or 0, 2) return round(bases.aggregate(Sum('bases'))['bases__sum'] or 0, 2)
@lru_cache() @cached
def compute_tax(self): def compute_tax(self):
taxes = self.lines.annotate( taxes = self.lines.annotate(
taxes=(F('subtotal') + Coalesce(Sum('sublines__total'), 0)) * (F('tax')/100) taxes=(F('subtotal') + Coalesce(Sum('sublines__total'), 0)) * (F('tax')/100)
) )
return round(taxes.aggregate(Sum('taxes'))['taxes__sum'] or 0, 2) return round(taxes.aggregate(Sum('taxes'))['taxes__sum'] or 0, 2)
@lru_cache() @cached
def compute_total(self): def compute_total(self):
if 'lines' in getattr(self, '_prefetched_objects_cache', ()): if 'lines' in getattr(self, '_prefetched_objects_cache', ()):
total = 0 total = 0
@ -409,7 +409,7 @@ class BillLine(models.Model):
related_name='amendment_lines', null=True, blank=True) related_name='amendment_lines', null=True, blank=True)
def __str__(self): def __str__(self):
return "#%i" % self.pk return "#%i" % self.pk if self.pk else self.description
def get_verbose_quantity(self): def get_verbose_quantity(self):
return self.verbose_quantity or self.quantity return self.verbose_quantity or self.quantity
@ -430,7 +430,7 @@ class BillLine(models.Model):
return ini return ini
return "{ini} / {end}".format(ini=ini, end=end) return "{ini} / {end}".format(ini=ini, end=end)
@lru_cache() @cached
def compute_total(self): def compute_total(self):
total = self.subtotal or 0 total = self.subtotal or 0
if hasattr(self, 'subline_total'): if hasattr(self, 'subline_total'):

View File

@ -103,7 +103,7 @@ hr {
</div> </div>
<div id="amount" class="column-2"> <div id="amount" class="column-2">
<span id="amount-value">{{ bill.get_total }} &{{ currency.lower }};</span><br> <span id="amount-value">{{ bill.compute_total }} &{{ currency.lower }};</span><br>
<span id="amount-note">{% trans "Due date" %} {{ payment.due_date| default:default_due_date | date:"F j, Y" }}<br> <span id="amount-note">{% trans "Due date" %} {{ payment.due_date| default:default_due_date | date:"F j, Y" }}<br>
{% if not payment.message %}{% blocktrans with bank_account=seller_info.bank_account %}On {{ bank_account }}{% endblocktrans %}{% endif %}<br> {% if not payment.message %}{% blocktrans with bank_account=seller_info.bank_account %}On {{ bank_account }}{% endblocktrans %}{% endif %}<br>
</span> </span>

View File

@ -65,18 +65,16 @@ def validate_zone_label(value):
def validate_mx_record(value): def validate_mx_record(value):
msg = _("%s is not an appropiate MX record value") % value msg = _("MX record format is 'priority domain.' tuple, with priority being a number.")
value = value.split() value = value.split()
if len(value) == 1: if len(value) != 2:
value = value[0] raise ValidationError(msg)
elif len(value) == 2: else:
try: try:
int(value[0]) int(value[0])
except ValueError: except ValueError:
raise ValidationError(msg) raise ValidationError(msg)
value = value[1] value = value[1]
elif len(value) > 2:
raise ValidationError(msg)
validate_zone_label(value) validate_zone_label(value)

View File

@ -1,4 +1,3 @@
from functools import lru_cache
from urllib.parse import parse_qs from urllib.parse import parse_qs
from django.apps import apps from django.apps import apps
@ -20,6 +19,7 @@ from orchestra.admin.utils import insertattr, get_modeladmin, admin_link, admin_
from orchestra.contrib.orchestration.models import Route from orchestra.contrib.orchestration.models import Route
from orchestra.core import services from orchestra.core import services
from orchestra.utils import db, sys from orchestra.utils import db, sys
from orchestra.utils.functional import cached
from .actions import run_monitor, show_history from .actions import run_monitor, show_history
from .api import history_data from .api import history_data
@ -240,7 +240,7 @@ def resource_inline_factory(resources):
def total_form_count(self, resources=resources): def total_form_count(self, resources=resources):
return len(resources) return len(resources)
@lru_cache() @cached
def get_queryset(self): def get_queryset(self):
""" Filter disabled resources """ """ Filter disabled resources """
queryset = super(ResourceInlineFormSet, self).get_queryset() queryset = super(ResourceInlineFormSet, self).get_queryset()

View File

@ -169,8 +169,13 @@ class WordpressMuBackend(ServiceController):
fi fi
elif [[ "%(custom_domain)s" != "" ]]; then elif [[ "%(custom_domain)s" != "" ]]; then
blog=( $(mysql -Nrs %(db_name)s --execute=" blog=( $(mysql -Nrs %(db_name)s --execute="
SELECT blog_id, path FROM wp_blogs WHERE domain = '%(domain)s';") ) SELECT blog_id, path
FROM wp_blogs
WHERE domain = '%(domain)s';") )
mysql %(db_name)s --execute=" mysql %(db_name)s --execute="
UPDATE wp_domain_mapping
SET active = 0
WHERE blog_id = ${blog[0]} AND active = 1;
INSERT INTO wp_domain_mapping INSERT INTO wp_domain_mapping
(blog_id, domain, active) VALUES (${blog[0]}, '%(custom_domain)s', 1);" (blog_id, domain, active) VALUES (${blog[0]}, '%(custom_domain)s', 1);"
if [[ "${blog[1]}" != "%(custom_path)s" ]]; then if [[ "${blog[1]}" != "%(custom_path)s" ]]; then

View File

@ -9,6 +9,7 @@ from orchestra.contrib.databases.models import Database, DatabaseUser
from orchestra.contrib.orchestration import Operation from orchestra.contrib.orchestration import Operation
from orchestra.contrib.websites.models import Website, WebsiteDirective from orchestra.contrib.websites.models import Website, WebsiteDirective
from orchestra.utils.apps import isinstalled from orchestra.utils.apps import isinstalled
from orchestra.utils.functional import cached
from orchestra.utils.python import import_class from orchestra.utils.python import import_class
from . import helpers from . import helpers
@ -155,7 +156,7 @@ class DBSoftwareService(SoftwareService):
def get_db_user(self): def get_db_user(self):
return self.db_user return self.db_user
@lru_cache() @cached
def get_account(self): def get_account(self):
account_model = self.instance._meta.get_field_by_name('account')[0] account_model = self.instance._meta.get_field_by_name('account')[0]
return account_model.rel.to.objects.get_main() return account_model.rel.to.objects.get_main()

View File

@ -1,12 +1,12 @@
import os import os
from collections import OrderedDict from collections import OrderedDict
from functools import lru_cache
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers from rest_framework import serializers
from orchestra.plugins.forms import PluginDataForm from orchestra.plugins.forms import PluginDataForm
from orchestra.utils.functional import cached
from .. import settings, utils from .. import settings, utils
from ..options import AppOption from ..options import AppOption
@ -58,7 +58,7 @@ class PHPApp(AppType):
def get_detail(self): def get_detail(self):
return self.instance.data.get('php_version', '') return self.instance.data.get('php_version', '')
@lru_cache() @cached
def get_options(self, merge=settings.WEBAPPS_MERGE_PHP_WEBAPPS): def get_options(self, merge=settings.WEBAPPS_MERGE_PHP_WEBAPPS):
""" adapter to webapp.get_options that performs merging of PHP options """ """ adapter to webapp.get_options that performs merging of PHP options """
kwargs = { kwargs = {

View File

@ -1,12 +1,12 @@
import os import os
from collections import OrderedDict from collections import OrderedDict
from functools import lru_cache
from django.db import models from django.db import models
from django.utils.functional import cached_property from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from orchestra.core import validators from orchestra.core import validators
from orchestra.utils.functional import cached
from . import settings from . import settings
from .directives import SiteDirective from .directives import SiteDirective
@ -72,7 +72,7 @@ class Website(models.Model):
return self.HTTP return self.HTTP
return self.HTTPS return self.HTTPS
@lru_cache() @cached
def get_directives(self): def get_directives(self):
directives = OrderedDict() directives = OrderedDict()
for opt in self.directives.all().order_by('name', 'value'): for opt in self.directives.all().order_by('name', 'value'):