Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
repanier
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chris
repanier
Commits
a5306895
Commit
a5306895
authored
Sep 06, 2014
by
Patrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set
parent
7c845626
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
repanier/email/email_invoice.py
repanier/email/email_invoice.py
+7
-2
repanier/email/email_offer.py
repanier/email/email_offer.py
+6
-1
No files found.
repanier/email/email_invoice.py
View file @
a5306895
...
...
@@ -5,6 +5,7 @@ from django.core import urlresolvers
from
django.core.mail
import
EmailMultiAlternatives
from
django.utils.html
import
strip_tags
from
django.utils.translation
import
ugettext_lazy
as
_
from
parler.models
import
TranslationDoesNotExist
from
openpyxl.writer.excel
import
save_virtual_workbook
from
repanier.models
import
Customer
from
repanier.models
import
Permanence
...
...
@@ -83,6 +84,10 @@ def send(permanence_id, current_site_name):
filename
=
(
unicode
(
_
(
"Invoice"
))
+
u
" - "
+
permanence
.
__unicode__
()
+
u
'.xlsx'
).
encode
(
'ascii'
,
errors
=
'replace'
).
replace
(
'?'
,
'_'
)
try
:
invoice_description
=
permanence
.
invoice_description
except
TranslationDoesNotExist
:
invoice_description
=
""
customer_set
=
Customer
.
objects
.
filter
(
purchase__permanence
=
permanence_id
,
represent_this_buyinggroup
=
False
).
order_by
().
distinct
()
for
customer
in
customer_set
:
...
...
@@ -91,7 +96,7 @@ def send(permanence_id, current_site_name):
if
wb
is
not
None
:
html_content
=
unicode
(
_
(
'Dear'
))
+
" "
+
long_basket_name
+
",<br/><br/>"
+
unicode
(
_
(
'Your invoice of'
))
+
\
" "
+
unicode
(
permanence
)
+
" "
+
unicode
(
_
(
"is now available in attachment"
))
+
".<br/>"
+
permanence
.
invoice_description
+
\
_
(
"is now available in attachment"
))
+
".<br/>"
+
invoice_description
+
\
"<br/><br/>"
+
signature
+
\
"<br/>"
+
sender_function
+
\
"<br/>"
+
current_site_name
...
...
@@ -119,7 +124,7 @@ def send(permanence_id, current_site_name):
if
wb
is
not
None
:
html_content
=
unicode
(
_
(
'Dear staff member'
))
+
",<br/><br/>"
+
unicode
(
_
(
'The invoices of'
))
+
\
" "
+
unicode
(
permanence
)
+
" "
+
unicode
(
_
(
"are now available in attachment"
))
+
".<br/>"
+
permanence
.
invoice_description
+
\
_
(
"are now available in attachment"
))
+
".<br/>"
+
invoice_description
+
\
"<br/><br/>"
+
signature
+
\
"<br/>"
+
sender_function
+
\
"<br/>"
+
current_site_name
...
...
repanier/email/email_offer.py
View file @
a5306895
...
...
@@ -4,6 +4,7 @@ from django.conf import settings
from
django.core.mail
import
EmailMultiAlternatives
from
django.utils.html
import
strip_tags
from
django.utils.translation
import
ugettext_lazy
as
_
from
parler.models
import
TranslationDoesNotExist
from
repanier.models
import
Permanence
from
repanier.models
import
Staff
from
repanier.tools
import
*
...
...
@@ -32,9 +33,13 @@ def send(permanence_id, current_site_name):
for
customer
in
Customer
.
objects
.
filter
(
is_active
=
True
,
represent_this_buyinggroup
=
False
,
may_order
=
True
).
order_by
():
cc_email_staff
.
append
(
customer
.
user
.
email
)
try
:
offer_description
=
permanence
.
offer_description
except
TranslationDoesNotExist
:
offer_description
=
""
html_content
=
unicode
(
_
(
'Hello'
))
+
",<br/><br/>"
+
unicode
(
_
(
'The order of'
))
+
\
" "
+
unicode
(
permanence
)
+
" "
+
unicode
(
_
(
"are now opened."
))
+
"<br/>"
+
permanence
.
offer_description
+
\
_
(
"are now opened."
))
+
"<br/>"
+
offer_description
+
\
"<br/><br/>"
+
signature
+
\
"<br/>"
+
sender_function
+
\
"<br/>"
+
current_site_name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment