Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backoffice/print invoice in order detail #704

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions backoffice/modules/order/components/AddressTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Table } from 'react-bootstrap';
import { OrderAddress } from '../models/OrderAddress';
import styles from '@styles/print-hidden.module.css';

type Props = {
address: OrderAddress;
isShowOnGoogleMap: boolean;
Expand Down Expand Up @@ -33,7 +35,6 @@ const AddressTable = ({ address, isShowOnGoogleMap }: Props) => {
<td className="d-flex justify-content-center">Address line 2</td>
<td>{address.addressLine2}</td>
</tr>

<tr>
<td className="d-flex justify-content-center">Zip code</td>
<td>{address.zipCode}</td>
Expand All @@ -54,18 +55,17 @@ const AddressTable = ({ address, isShowOnGoogleMap }: Props) => {
<td className="d-flex justify-content-center">Country name</td>
<td>{address.countryName}</td>
</tr>
{isShowOnGoogleMap ? (
<tr>

<tr className={`${styles['print-hidden']}`}>
{isShowOnGoogleMap ? (
<td style={{ cursor: 'pointer' }}>
<i className="fa fa-map-marker me-3 mt-2" aria-hidden="true"></i>View on Google Maps
</td>
</tr>
) : (
<tr>
) : (
<td style={{ height: '40px' }}></td>
</tr>
)}
<tr className="mt-5">
)}
</tr>
<tr className={`mt-5 ${styles['print-hidden']}`}>
<td>
<button className="mt-2 btn btn-dark">Edit</button>
</td>
Expand Down
6 changes: 4 additions & 2 deletions backoffice/modules/order/components/BillingNShippingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Order } from '../models/Order';
import Link from 'next/link';
import { Stack, Table } from 'react-bootstrap';
import AddressTable from './AddressTable';
import styles from '@styles/print-hidden.module.css';

type Props = {
order: Order;
};
Expand Down Expand Up @@ -52,7 +54,7 @@ const BillingNShippingInfo = ({ order }: Props) => {
<th>Total weight</th>
<th>Date shipped</th>
<th>Date delivered</th>
<th>Actions</th>
<th className={`${styles['print-hidden']}`}>Actions</th>
</tr>
</thead>
<tbody>
Expand All @@ -63,7 +65,7 @@ const BillingNShippingInfo = ({ order }: Props) => {
<td>2.00 [lb(s)]</td>
<td>3/13/2017 4:20:10 AM</td>
<td>8-24-2001</td>
<td style={{ width: '12%' }}>
<td style={{ width: '12%' }} className={`${styles['print-hidden']}`}>
<Stack direction="horizontal" gap={3}>
<Link href={`/sales/orders/${order.id}/edit`}>
<button className="btn btn-outline-primary btn-sm" type="button">
Expand Down
13 changes: 13 additions & 0 deletions backoffice/modules/order/components/HeaderPdf.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type Props = {
text: string;
};

const HeaderPdf = ({ text }: Props) => {
return (
<>
<div className={`my-3 ms-3`} dangerouslySetInnerHTML={{ __html: text }}></div>
</>
);
};

export default HeaderPdf;
13 changes: 10 additions & 3 deletions backoffice/modules/order/components/OrderBriefInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import moment from 'moment';
import { Order } from '../models/Order';
import { formatPriceVND } from 'utils/formatPrice';
import styles from '@styles/print-hidden.module.css';
type Props = {
order: Order;
};
Expand Down Expand Up @@ -101,7 +102,9 @@ const OrderBriefInfo = ({ order }: Props) => {
<p className="col-8 ms-3"></p>
</div>
<div className="d-flex justify-content-center me-5">
<button className="me-5 btn btn-dark">Edit Order totals</button>
<button className={`me-5 btn btn-dark ${styles['print-hidden']}`}>
Edit Order totals
</button>
</div>
<div className="d-flex flex-row">
<h6 className="col-4 d-flex flex-row-reverse text-dark font-weight-bold mb-3">
Expand All @@ -116,8 +119,12 @@ const OrderBriefInfo = ({ order }: Props) => {
<p className="col-8 font-weight-bold ms-3">{order.paymentStatus}</p>
</div>
<div className="d-flex justify-content-center me-5">
<button className="me-2 btn btn-dark">Refund</button>
<button className="me-1 btn btn-dark">Partial refund</button>
<button className={`me-2 btn btn-dark ${styles['print-hidden']}`}>
Refund
</button>
<button className={`me-1 btn btn-dark ${styles['print-hidden']}`}>
Partial refund
</button>
</div>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions backoffice/modules/order/components/OrderProductInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Order } from '../models/Order';
import { formatPriceVND } from 'utils/formatPrice';
import { Stack, Table } from 'react-bootstrap';
import Link from 'next/link';
import styles from '@styles/print-hidden.module.css';

type Props = {
order: Order;
};
Expand Down Expand Up @@ -39,7 +41,7 @@ const OrderProductInfo = ({ order }: Props) => {
<th>Quantity </th>
<th>Discount</th>
<th>Total</th>
<th>Actions</th>
<th className={`${styles['print-hidden']}`}>Actions</th>
</tr>
</thead>
<tbody>
Expand All @@ -50,7 +52,7 @@ const OrderProductInfo = ({ order }: Props) => {
<td>{item.quantity}</td>
<td>{item.discountAmount}</td>
<td>{formatPriceVND(item.productPrice * item.quantity)}</td>
<td style={{ width: '12%' }}>
<td style={{ width: '12%' }} className={`${styles['print-hidden']}`}>
<Stack direction="vertical" gap={3}>
<Link href={`/sales/orders/${order.id}/edit`}>
<button className="btn btn-outline-primary btn-sm" type="button">
Expand Down
Loading