Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
62b58fce
Commit
62b58fce
authored
Jan 21, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only put the TaxID for Invoices, not Credit Card based receipts
parent
ab53bad8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
lms/djangoapps/shoppingcart/pdf.py
+17
-7
lms/djangoapps/shoppingcart/tests/test_pdf.py
+1
-1
No files found.
lms/djangoapps/shoppingcart/pdf.py
View file @
62b58fce
...
...
@@ -369,24 +369,34 @@ class PDFInvoice(object):
totals_data
=
[
[(
_
(
'Total'
)),
self
.
total_cost
],
[(
_
(
'Payment Received'
)),
self
.
payment_received
],
[(
_
(
'Balance'
)),
self
.
balance
],
[
''
,
'{tax_label}: {tax_id}'
.
format
(
tax_label
=
self
.
tax_label
,
tax_id
=
self
.
tax_id
)]
[(
_
(
'Balance'
)),
self
.
balance
]
]
if
self
.
is_invoice
:
# only print TaxID if we are generating an Invoice
totals_data
.
append
(
[
''
,
'{tax_label}: {tax_id}'
.
format
(
tax_label
=
self
.
tax_label
,
tax_id
=
self
.
tax_id
)]
)
heights
=
8
*
mm
totals_table
=
Table
(
totals_data
,
40
*
mm
,
heights
)
totals_table
.
setStyle
(
TableStyle
(
[
styles
=
[
# Styling for the totals table.
(
'ALIGN'
,
(
0
,
0
),
(
-
1
,
-
1
),
'RIGHT'
),
(
'VALIGN'
,
(
0
,
0
),
(
-
1
,
-
1
),
'MIDDLE'
),
(
'TEXTCOLOR'
,
(
0
,
0
),
(
-
1
,
-
1
),
colors
.
black
),
# Styling for the Amounts cells
(
'RIGHTPADDING'
,
(
-
1
,
0
),
(
-
1
,
-
2
),
7
*
mm
),
(
'GRID'
,
(
-
1
,
0
),
(
-
1
,
-
2
),
3.0
,
colors
.
white
),
(
'BACKGROUND'
,
(
-
1
,
0
),
(
-
1
,
-
2
),
'#EEEEEE'
),
]))
# NOTE: since we are not printing the TaxID for Credit Card
# based receipts, we need to change the cell range for
# these formatting rules
(
'RIGHTPADDING'
,
(
-
1
,
0
),
(
-
1
,
-
2
if
self
.
is_invoice
else
-
1
),
7
*
mm
),
(
'GRID'
,
(
-
1
,
0
),
(
-
1
,
-
2
if
self
.
is_invoice
else
-
1
),
3.0
,
colors
.
white
),
(
'BACKGROUND'
,
(
-
1
,
0
),
(
-
1
,
-
2
if
self
.
is_invoice
else
-
1
),
'#EEEEEE'
),
]
totals_table
.
setStyle
(
TableStyle
(
styles
))
__
,
rendered_height
=
totals_table
.
wrap
(
0
,
0
)
...
...
lms/djangoapps/shoppingcart/tests/test_pdf.py
View file @
62b58fce
...
...
@@ -83,7 +83,7 @@ class TestPdfFile(unittest.TestCase):
self
.
assertTrue
(
any
(
str
(
self
.
total_cost
)
in
s
for
s
in
pdf_content
))
self
.
assertTrue
(
any
(
str
(
self
.
payment_received
)
in
s
for
s
in
pdf_content
))
self
.
assertTrue
(
any
(
str
(
self
.
balance
)
in
s
for
s
in
pdf_content
))
self
.
assert
Tru
e
(
any
(
'edX Tax ID'
in
s
for
s
in
pdf_content
))
self
.
assert
Fals
e
(
any
(
'edX Tax ID'
in
s
for
s
in
pdf_content
))
# PDF_RECEIPT_TERMS_AND_CONDITIONS not displayed in the receipt pdf
self
.
assertFalse
(
any
(
...
...
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