-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: Order receipt design tweaks (#2833)
* style: Order receipt design tweaks
- Loading branch information
1 parent
484a9fb
commit 06a151a
Showing
11 changed files
with
93 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,46 @@ | ||
{% extends "email_base.html" %} | ||
{% load format_discount %} | ||
|
||
{% block pre-logo-text %} | ||
<div class="rec-head" style="color: rgba(0,0,0,0.85); font: 14px/20px 'Arial', sans-serif; max-width: 696px; "> | ||
<p style="font-weight: normal; margin: 0 0 20px;">Dear {{ purchaser.name }},</p> | ||
<p style="font-weight: normal; margin: 0 0 20px;">You have been enrolled {% if content_title %} in {{ content_title }}{% endif %}. | ||
The course should now appear on your MIT xPRO <a href="{{ base_url }}{% url 'user-dashboard' %}" style="color: #0070DA">dashboard</a>. You can also access your receipt by <a style="color: #0070DA" href="{{ base_url }}/receipt/{{order.id }}">clicking here</a>. | ||
</p> | ||
<p style="font-weight: normal; margin: 0 0 20px;">Below you will find a copy of your receipt:</p> | ||
|
||
</div> | ||
{% endblock %} | ||
|
||
{% block post-logo-text %} | ||
<div className="receipt-mit-info"> | ||
<p> | ||
600 Technology Square | ||
<br /> | ||
NE49-2000 | ||
<br /> | ||
Cambridge, MA 02139 USA | ||
<br /> | ||
{% if enable_taxes_display %} | ||
GSTIN: Pending | ||
<br /> | ||
{% endif %} | ||
Support: | ||
<a href="mailto:[email protected]"> | ||
[email protected] | ||
</a> | ||
<br /> | ||
</p> | ||
</div> | ||
|
||
{% endblock %} | ||
|
||
|
||
{% block content %} | ||
<tr class="receipt-new-wrapper" style="font: 14px/22px 'Arial', sans-serif; margin: 0 auto; padding: 0 20px"> | ||
<table style="margin: 0 20px !important;"> | ||
<td class="rec-head" style="color: rgba(0,0,0,0.85); font: 14px/20px 'Arial', sans-serif; max-width: 696px; "> | ||
<p style="font-weight: normal; margin: 0 0 20px;">Dear {{ purchaser.name }},</p> | ||
<p style="font-weight: normal; margin: 0 0 20px;">You have been enrolled {% if content_title %} in {{ content_title }}{% endif %}. | ||
The course should now appear on your MIT xPRO <a href="{{ base_url }}{% url 'user-dashboard' %}" style="color: #0070DA">dashboard</a>. You can also access your receipt by <a style="color: #0070DA" href="{{ base_url }}/receipt/{{order.id }}">clicking here</a>. | ||
</p> | ||
<p style="font-weight: normal; margin: 0 0 20px;">Below you will find a copy of your receipt:</p> | ||
</td> | ||
<tr> | ||
<td> | ||
<h1 style="color: #000000; font-size: 24px; font-weight: 700; line-height: 26px; margin: 0 0 24px;">MIT xPRO</h1> | ||
<h2 style="color: #000000; font-size: 22px; font-weight: 700; line-height: 24px; margin: 0 0 22px;">Receipt</h2> | ||
<h3 style="color: #000000; font-size: 16px; font-weight: 700; line-height: 18px; margin: 0 0 20px;">Order Information</h3> | ||
<p> | ||
|
@@ -24,6 +51,9 @@ <h3 style="color: #000000; font-size: 16px; font-weight: 700; line-height: 18px; | |
{% for line in lines %} | ||
<p> | ||
<strong style="font-weight: 700;">Order Item:</strong> {{ line.content_title }}<br> | ||
{% if enable_taxes_display %} | ||
<strong style="font-weight: 700;">HSN:</strong> 9992<br> | ||
{% endif %} | ||
<strong style="font-weight: 700;">Product Number:</strong> {{ line.readable_id }}<br> | ||
<strong style="font-weight: 700;">Dates:</strong> {{ line.start_date|date:"F j, Y" }} - {{ line.end_date|date:"F j, Y" }} | ||
</p> | ||
|
@@ -32,7 +62,8 @@ <h3 style="color: #000000; font-size: 16px; font-weight: 700; line-height: 18px; | |
<strong style="font-weight: 700;">Unit Price:</strong> ${{ line.price }}<br> | ||
<strong style="font-weight: 700;">Discount:</strong> {{ line.discount|format_discount }}<br> | ||
{% if enable_taxes_display %} | ||
<strong style="font-weight: 700;">Tax ({{ order.tax_rate|floatformat:"-2" }}%):</strong> ${{ line.tax_paid|floatformat:2 }}<br> | ||
<strong style="font-weight: 700;">Total Before Tax:</strong> ${{ line.total_before_tax|floatformat:2 }}<br> | ||
<strong style="font-weight: 700;">Tax ({{ order.tax_rate|floatformat:"-2" }}%):</strong> ${{ line.tax_paid|floatformat:2 }}<br> | ||
{% endif %} | ||
<strong style="font-weight: 700;">Total Paid:</strong> ${{ line.total_paid|floatformat:2 }} | ||
</p> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import { pathOr } from "ramda" | |
|
||
import queries from "../../lib/queries" | ||
import { formatPrettyDate, parseDateString } from "../../lib/util" | ||
import { formatNumber, formatDiscount } from "../../lib/ecommerce" | ||
import { formatNumber, formatDiscount, formatPrice } from "../../lib/ecommerce" | ||
import type Moment from "moment" | ||
import type { Match } from "react-router" | ||
import type { OrderReceiptResponse } from "../../flow/ecommerceTypes" | ||
|
@@ -111,25 +111,17 @@ export class ReceiptPage extends React.Component<Props> { | |
NE49-2000 | ||
<br /> | ||
Cambridge, MA 02139 USA | ||
<br /> | ||
{SETTINGS.enable_taxes_display ? <div>GSTIN: Pending</div> : null} | ||
Support:{" "} | ||
<a href="mailto:[email protected]"> | ||
[email protected] | ||
</a> | ||
<br /> | ||
<a | ||
target="_blank" | ||
href="https://xpro.mit.edu" | ||
rel="noreferrer" | ||
> | ||
xpro.mit.edu | ||
<a href={`mailto:${SETTINGS.support_email}`}> | ||
{ SETTINGS.support_email } | ||
</a> | ||
</p> | ||
</div> | ||
</div> | ||
<div className="receipt-col p-t-50"> | ||
<dl> | ||
<dt>Order Number:</dt> | ||
<dt>Invoice Number:</dt> | ||
<dd id="orderNumber"> | ||
{orderReceipt.order.reference_number} | ||
</dd> | ||
|
@@ -254,6 +246,7 @@ export class ReceiptPage extends React.Component<Props> { | |
<th>Quantity</th> | ||
<th>Unit Price</th> | ||
<th>Discount</th> | ||
{SETTINGS.enable_taxes_display ? <th>Total Before Tax</th> : null} | ||
{SETTINGS.enable_taxes_display ? <th>Tax ({formatNumber(orderReceipt.order.tax_rate)}%)</th> : null} | ||
<th>Total Paid</th> | ||
</tr> | ||
|
@@ -265,6 +258,7 @@ export class ReceiptPage extends React.Component<Props> { | |
return ( | ||
<tr key={line.readable_id}> | ||
<td> | ||
<p>Title</p> | ||
<div> | ||
{line.content_title} <br /> | ||
{line.readable_id} <br /> | ||
|
@@ -278,28 +272,46 @@ export class ReceiptPage extends React.Component<Props> { | |
</div> | ||
</td> | ||
<td> | ||
<p>Quantity</p> | ||
<div>{line.quantity}</div> | ||
</td> | ||
<td> | ||
<p>Unit Price</p> | ||
<div>${line.price}</div> | ||
</td> | ||
<td> | ||
<p>Discount</p> | ||
<div>{formatDiscount(line.discount)}</div> | ||
</td> | ||
{SETTINGS.enable_taxes_display ? ( | ||
<td> | ||
<p>Total Before Tax</p> | ||
<div>{formatPrice(line.total_before_tax)}</div> | ||
</td> | ||
) : null} | ||
|
||
{SETTINGS.enable_taxes_display ? ( | ||
<td> | ||
<p>Tax ({formatNumber(orderReceipt.order.tax_rate)}%)</p> | ||
<div>${line.tax_paid}</div> | ||
</td> | ||
) : null} | ||
<td> | ||
<p>Total Paid</p> | ||
<div>${line.total_paid}</div> | ||
</td> | ||
</tr> | ||
) | ||
})} | ||
</tbody> | ||
</table> | ||
{SETTINGS.enable_taxes_display ? <div className="receipt-hsn">HSN: 9992</div> : null} | ||
</div> | ||
{ SETTINGS.enable_taxes_display ? <div className="footnote-signature"> | ||
<img src="static/images/receipts/signature_only.png" alt=""></img> | ||
<small>Bryan Adkison</small> | ||
<small>MIT Open Learning - A/R Manager</small> | ||
</div> : null } | ||
</div> | ||
)} | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters