Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
6f48b4a2
Commit
6f48b4a2
authored
Jan 20, 2017
by
Krophil
Browse files
small fix in pdf generation for operations
parent
27e69fd3
Pipeline
#735
passed with stage
in 3 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
accounting/views.py
View file @
6f48b4a2
...
@@ -385,7 +385,7 @@ class OperationPDFView(CanViewMixin, DetailView):
...
@@ -385,7 +385,7 @@ class OperationPDFView(CanViewMixin, DetailView):
target
=
self
.
object
.
target
.
get_display_name
()
target
=
self
.
object
.
target
.
get_display_name
()
response
=
HttpResponse
(
content_type
=
'application/pdf'
)
response
=
HttpResponse
(
content_type
=
'application/pdf'
)
response
[
'Content-Disposition'
]
=
'
attachment;
filename="op-%d(%s_on_%s).pdf"'
%
(
num
,
ti
,
club_name
)
response
[
'Content-Disposition'
]
=
'filename="op-%d(%s_on_%s).pdf"'
%
(
num
,
ti
,
club_name
)
p
=
canvas
.
Canvas
(
response
)
p
=
canvas
.
Canvas
(
response
)
p
.
setFont
(
'DejaVu'
,
12
)
p
.
setFont
(
'DejaVu'
,
12
)
...
@@ -401,8 +401,7 @@ class OperationPDFView(CanViewMixin, DetailView):
...
@@ -401,8 +401,7 @@ class OperationPDFView(CanViewMixin, DetailView):
label
=
Table
(
labelStr
,
colWidths
=
[
150
],
rowHeights
=
[
20
])
label
=
Table
(
labelStr
,
colWidths
=
[
150
],
rowHeights
=
[
20
])
label
.
setStyle
(
TableStyle
([
label
.
setStyle
(
TableStyle
([
(
'ALIGN'
,(
0
,
0
),(
-
1
,
-
1
),
'CENTER'
),
(
'ALIGN'
,(
0
,
0
),(
-
1
,
-
1
),
'RIGHT'
),
(
'BOX'
,
(
0
,
0
),
(
-
1
,
-
1
),
0.25
,
colors
.
black
),
]))
]))
w
,
h
=
label
.
wrapOn
(
label
,
0
,
0
)
w
,
h
=
label
.
wrapOn
(
label
,
0
,
0
)
label
.
drawOn
(
p
,
width
-
180
,
height
)
label
.
drawOn
(
p
,
width
-
180
,
height
)
...
...
Write
Preview
Supports
Markdown
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