CR changes, switch net to gross prices
This commit is contained in:
parent
cfb5bb5168
commit
2c2d07be0c
2 changed files with 237 additions and 237 deletions
|
@ -181,18 +181,18 @@ const OrderDraftDetailsProducts: React.FC<OrderDraftDetailsProductsProps> = prop
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.colPrice}>
|
<TableCell className={classes.colPrice}>
|
||||||
{maybe(() => line.unitPrice.net) ? (
|
{maybe(() => line.unitPrice.gross) ? (
|
||||||
<Money money={line.unitPrice.net} />
|
<Money money={line.unitPrice.gross} />
|
||||||
) : (
|
) : (
|
||||||
<Skeleton />
|
<Skeleton />
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.colTotal}>
|
<TableCell className={classes.colTotal}>
|
||||||
{maybe(() => line.unitPrice.net && line.quantity) ? (
|
{maybe(() => line.unitPrice.gross && line.quantity) ? (
|
||||||
<Money
|
<Money
|
||||||
money={{
|
money={{
|
||||||
amount: line.unitPrice.net.amount * line.quantity,
|
amount: line.unitPrice.gross.amount * line.quantity,
|
||||||
currency: line.unitPrice.net.currency
|
currency: line.unitPrice.gross.currency
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -126,6 +126,9 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
|
||||||
return <NotFoundPage onBack={handleBack} />;
|
return <NotFoundPage onBack={handleBack} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isOrderUnconfirmed = order?.status === OrderStatus.UNCONFIRMED;
|
||||||
|
const isOrderDraft = order?.status === OrderStatus.DRAFT;
|
||||||
|
|
||||||
const handleSubmit = async (data: MetadataFormData) => {
|
const handleSubmit = async (data: MetadataFormData) => {
|
||||||
if (order?.status === OrderStatus.UNCONFIRMED) {
|
if (order?.status === OrderStatus.UNCONFIRMED) {
|
||||||
await orderConfirm({ variables: { id: order?.id } });
|
await orderConfirm({ variables: { id: order?.id } });
|
||||||
|
@ -212,8 +215,7 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
|
||||||
orderInvoiceSend
|
orderInvoiceSend
|
||||||
}) => (
|
}) => (
|
||||||
<>
|
<>
|
||||||
{order?.status !== OrderStatus.DRAFT &&
|
{!isOrderDraft && !isOrderUnconfirmed && (
|
||||||
order?.status !== OrderStatus.UNCONFIRMED && (
|
|
||||||
<>
|
<>
|
||||||
<WindowTitle
|
<WindowTitle
|
||||||
title={intl.formatMessage(
|
title={intl.formatMessage(
|
||||||
|
@ -284,8 +286,7 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
|
||||||
onPaymentCapture={() => openModal("capture")}
|
onPaymentCapture={() => openModal("capture")}
|
||||||
onPaymentVoid={() => openModal("void")}
|
onPaymentVoid={() => openModal("void")}
|
||||||
onPaymentRefund={() => navigate(orderRefundUrl(id))}
|
onPaymentRefund={() => navigate(orderRefundUrl(id))}
|
||||||
onProductClick={id => () =>
|
onProductClick={id => () => navigate(productUrl(id))}
|
||||||
navigate(productUrl(id))}
|
|
||||||
onBillingAddressEdit={() =>
|
onBillingAddressEdit={() =>
|
||||||
openModal("edit-billing-address")
|
openModal("edit-billing-address")
|
||||||
}
|
}
|
||||||
|
@ -298,9 +299,8 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
|
||||||
}
|
}
|
||||||
onInvoiceClick={id =>
|
onInvoiceClick={id =>
|
||||||
window.open(
|
window.open(
|
||||||
order.invoices.find(
|
order.invoices.find(invoice => invoice.id === id)
|
||||||
invoice => invoice.id === id
|
?.url,
|
||||||
)?.url,
|
|
||||||
"_blank"
|
"_blank"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{order?.status === OrderStatus.DRAFT && (
|
{isOrderDraft && (
|
||||||
<>
|
<>
|
||||||
<WindowTitle
|
<WindowTitle
|
||||||
title={intl.formatMessage(
|
title={intl.formatMessage(
|
||||||
|
@ -590,7 +590,7 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{order?.status === OrderStatus.UNCONFIRMED && (
|
{isOrderUnconfirmed && (
|
||||||
<>
|
<>
|
||||||
<WindowTitle
|
<WindowTitle
|
||||||
title={intl.formatMessage(
|
title={intl.formatMessage(
|
||||||
|
|
Loading…
Reference in a new issue