Skip to content

Commit c5846a9

Browse files
committed
fix invoice that had Item Price and Product Name swapped
1 parent 43ed4ba commit c5846a9

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

notebooks/exos/basic/EXO-invoice-nb.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
jupytext:
3-
cell_metadata_filter: all,-hidden,-heading_collapsed,-run_control,-trusted
4-
notebook_metadata_filter: all, -jupytext.text_representation.jupytext_version, -jupytext.text_representation.format_version,
5-
-language_info.version, -language_info.codemirror_mode.version, -language_info.codemirror_mode,
6-
-language_info.file_extension, -language_info.mimetype, -toc
73
text_representation:
84
extension: .md
95
format_name: myst

notebooks/exos/basic/invoice.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def center_address(address: str) -> str:
1616
for line in address.split("\n"):
1717
if not line:
1818
continue
19-
line = line.replace("\n", "")
2019
result += f"{line:^{WIDTH}}" + NL
2120
return result
2221

@@ -28,7 +27,7 @@ def generate_invoice(items, company_address, thanks=DEFAULT_THANKS, currency='
2827
result += center_address(company_address)
2928
result += WIDTH * '+' + NL
3029

31-
right, middle, left = "Product Name", "#", "Item Price"
30+
left, middle, right = "Product Name", "#", "Item Price"
3231
result += f"{left:>{LEFT}}{middle:^{MIDDLE}}{right:<{RIGHT}}" + NL
3332
total = 0.
3433
for what, unit_price, how_many in items:

0 commit comments

Comments
 (0)