diff --git a/packages/admin-ui/i18n-coverage.json b/packages/admin-ui/i18n-coverage.json index 007dabb9d1..181d36226f 100644 --- a/packages/admin-ui/i18n-coverage.json +++ b/packages/admin-ui/i18n-coverage.json @@ -1,46 +1,46 @@ { - "generatedOn": "2020-11-24T15:53:35.931Z", - "lastCommit": "799f30643a3e221e453246534d844bf448b046e5", + "generatedOn": "2020-12-04T13:17:32.104Z", + "lastCommit": "efe640c5011072eba4471e431dc2dc503973802b", "translationStatus": { "cs": { - "tokenCount": 708, + "tokenCount": 713, "translatedCount": 688, - "percentage": 97 + "percentage": 96 }, "de": { - "tokenCount": 708, + "tokenCount": 713, "translatedCount": 597, "percentage": 84 }, "en": { - "tokenCount": 708, - "translatedCount": 703, + "tokenCount": 713, + "translatedCount": 708, "percentage": 99 }, "es": { - "tokenCount": 708, + "tokenCount": 713, "translatedCount": 455, "percentage": 64 }, "pl": { - "tokenCount": 708, + "tokenCount": 713, "translatedCount": 552, - "percentage": 78 + "percentage": 77 }, "pt_BR": { - "tokenCount": 708, + "tokenCount": 713, "translatedCount": 643, - "percentage": 91 + "percentage": 90 }, "zh_Hans": { - "tokenCount": 708, + "tokenCount": 713, "translatedCount": 536, - "percentage": 76 + "percentage": 75 }, "zh_Hant": { - "tokenCount": 708, + "tokenCount": 713, "translatedCount": 536, - "percentage": 76 + "percentage": 75 } } } \ No newline at end of file diff --git a/packages/admin-ui/src/lib/core/src/common/generated-types.ts b/packages/admin-ui/src/lib/core/src/common/generated-types.ts index 2275ae05d9..02ae64bafe 100644 --- a/packages/admin-ui/src/lib/core/src/common/generated-types.ts +++ b/packages/admin-ui/src/lib/core/src/common/generated-types.ts @@ -5259,14 +5259,14 @@ export type FulfillmentFragment = ( export type OrderLineFragment = ( { __typename?: 'OrderLine' } - & Pick + & Pick & { featuredAsset?: Maybe<( { __typename?: 'Asset' } & Pick )>, productVariant: ( { __typename?: 'ProductVariant' } & Pick - ), adjustments: Array<( + ), discounts: Array<( { __typename?: 'Adjustment' } & AdjustmentFragment )>, items: Array<( @@ -5288,7 +5288,7 @@ export type OrderDetailFragment = ( )>, lines: Array<( { __typename?: 'OrderLine' } & OrderLineFragment - )>, adjustments: Array<( + )>, discounts: Array<( { __typename?: 'Adjustment' } & AdjustmentFragment )>, promotions: Array<( @@ -5297,6 +5297,9 @@ export type OrderDetailFragment = ( )>, shippingMethod?: Maybe<( { __typename?: 'ShippingMethod' } & Pick + )>, taxSummary: Array<( + { __typename?: 'OrderTaxSummary' } + & Pick )>, shippingAddress?: Maybe<( { __typename?: 'OrderAddress' } & OrderAddressFragment @@ -7838,7 +7841,7 @@ export namespace OrderLine { export type Fragment = OrderLineFragment; export type FeaturedAsset = (NonNullable); export type ProductVariant = (NonNullable); - export type Adjustments = NonNullable<(NonNullable)[number]>; + export type Discounts = NonNullable<(NonNullable)[number]>; export type Items = NonNullable<(NonNullable)[number]>; export type Fulfillment = (NonNullable)[number]>['fulfillment']>); } @@ -7847,9 +7850,10 @@ export namespace OrderDetail { export type Fragment = OrderDetailFragment; export type Customer = (NonNullable); export type Lines = NonNullable<(NonNullable)[number]>; - export type Adjustments = NonNullable<(NonNullable)[number]>; + export type Discounts = NonNullable<(NonNullable)[number]>; export type Promotions = NonNullable<(NonNullable)[number]>; export type ShippingMethod = (NonNullable); + export type TaxSummary = NonNullable<(NonNullable)[number]>; export type ShippingAddress = (NonNullable); export type BillingAddress = (NonNullable); export type Payments = NonNullable<(NonNullable)[number]>; diff --git a/packages/admin-ui/src/lib/core/src/data/definitions/order-definitions.ts b/packages/admin-ui/src/lib/core/src/data/definitions/order-definitions.ts index e0d1ffcd13..4c7228f57e 100644 --- a/packages/admin-ui/src/lib/core/src/data/definitions/order-definitions.ts +++ b/packages/admin-ui/src/lib/core/src/data/definitions/order-definitions.ts @@ -84,7 +84,7 @@ export const ORDER_LINE_FRAGMENT = gql` trackInventory stockOnHand } - adjustments { + discounts { ...Adjustment } unitPrice @@ -104,6 +104,8 @@ export const ORDER_LINE_FRAGMENT = gql` linePrice lineTax linePriceWithTax + discountedLinePrice + discountedLinePriceWithTax } `; @@ -124,7 +126,7 @@ export const ORDER_DETAIL_FRAGMENT = gql` lines { ...OrderLine } - adjustments { + discounts { ...Adjustment } promotions { @@ -145,6 +147,11 @@ export const ORDER_DETAIL_FRAGMENT = gql` fulfillmentHandlerCode description } + taxSummary { + taxBase + taxRate + taxTotal + } shippingAddress { ...OrderAddress } @@ -179,7 +186,6 @@ export const ORDER_DETAIL_FRAGMENT = gql` fulfillments { ...Fulfillment } - total } ${ADJUSTMENT_FRAGMENT} ${ORDER_ADDRESS_FRAGMENT} diff --git a/packages/admin-ui/src/lib/order/src/components/order-detail/order-detail.component.html b/packages/admin-ui/src/lib/order/src/components/order-detail/order-detail.component.html index 4aabd47dae..f3c96bc78f 100644 --- a/packages/admin-ui/src/lib/order/src/components/order-detail/order-detail.component.html +++ b/packages/admin-ui/src/lib/order/src/components/order-detail/order-detail.component.html @@ -16,11 +16,7 @@ - @@ -36,9 +32,7 @@ (click)="cancelOrRefund(order)" > - + {{ 'order.refund-and-cancel-order' | translate }} @@ -49,7 +43,10 @@ @@ -96,6 +93,7 @@ {{ 'order.total' | translate }} + - - + +
{{ 'order.promotions-applied' | translate }}
{{ promotion.description }}{{ discount.description }}
- {{ promotion.amount / 100 | currency: order.currencyCode }} + {{ discount.amount / 100 | currency: order.currencyCode }}
@@ -176,31 +174,31 @@
- - {{ 'order.sub-total' | translate }} - - - - - {{ order.subTotal / 100 | currency: order.currencyCode }} -
- {{ order.subTotalBeforeTax / 100 | currency: order.currencyCode }} -
- - - + - {{ adjustment.description }} - {{ + {{ discount.description }} + {{ couponCode }} - {{ adjustment.amount / 100 | currency: order.currencyCode }} + {{ discount.amount / 100 | currency: order.currencyCode }} + + + + {{ 'order.sub-total' | translate }} + + + + + {{ order.subTotalWithTax / 100 | currency: order.currencyCode }} +
+ {{ order.subTotal / 100 | currency: order.currencyCode }} +
@@ -221,12 +219,31 @@ - {{ order.total / 100 | currency: order.currencyCode }} + {{ order.totalWithTax / 100 | currency: order.currencyCode }}
- {{ order.totalBeforeTax / 100 | currency: order.currencyCode }} + {{ order.total / 100 | currency: order.currencyCode }}
+ + + +

{{ 'order.tax-summary' | translate }}

+ + + + + + + + + + + + + + +
{{ 'order.tax-rate' | translate }}{{ 'order.tax-base' | translate }}{{ 'order.tax-total' | translate }}
{{ row.taxRate / 100 | percent }}{{ row.taxBase / 100 | currency: order.currencyCode }}{{ row.taxTotal / 100 | currency: order.currencyCode }}
a.type === AdjustmentType.PROMOTION); + getLineDiscounts(line: OrderDetail.Lines) { + return line.discounts.filter(a => a.type === AdjustmentType.PROMOTION); } - getPromotionLink(promotion: OrderDetail.Adjustments): any[] { + getPromotionLink(promotion: OrderDetail.Discounts): any[] { const id = promotion.adjustmentSource.split(':')[1]; return ['/marketing', 'promotions', id]; } @@ -160,7 +160,7 @@ export class OrderDetailComponent getCouponCodeForAdjustment( order: OrderDetail.Fragment, - promotionAdjustment: OrderDetail.Adjustments, + promotionAdjustment: OrderDetail.Discounts, ): string | undefined { const id = promotionAdjustment.adjustmentSource.split(':')[1]; const promotion = order.promotions.find(p => p.id === id); diff --git a/packages/admin-ui/src/lib/static/i18n-messages/cs.json b/packages/admin-ui/src/lib/static/i18n-messages/cs.json index 959fb6befa..7166657d70 100644 --- a/packages/admin-ui/src/lib/static/i18n-messages/cs.json +++ b/packages/admin-ui/src/lib/static/i18n-messages/cs.json @@ -641,6 +641,10 @@ "state": "Stav", "sub-total": "Mezisoučet", "successfully-updated-fulfillment": "Zpracování aktualizováno", + "tax-base": "", + "tax-rate": "", + "tax-summary": "", + "tax-total": "", "total": "Celkem", "tracking-code": "Kód sledování zásilky", "transaction-id": "ID transakce", @@ -674,6 +678,7 @@ "email-address": "E-mailová adresa", "filter-by-member-name": "Filtrovat dle země", "first-name": "Jméno", + "fulfillment-handler": "", "global-out-of-stock-threshold": "Globální prahová hodnota pro vyprodání zásob", "global-out-of-stock-threshold-tooltip": "Nastaví hodnotu skladu, při které je tato varianta považována za vyprodanou. Použití záporné hodnoty umožňuje objednávat \"na objednávku\". Lze přepsat u jednotlivých variant produktu.", "last-name": "Příjmení", diff --git a/packages/admin-ui/src/lib/static/i18n-messages/de.json b/packages/admin-ui/src/lib/static/i18n-messages/de.json index ba5392b716..f5f99799f4 100644 --- a/packages/admin-ui/src/lib/static/i18n-messages/de.json +++ b/packages/admin-ui/src/lib/static/i18n-messages/de.json @@ -641,6 +641,10 @@ "state": "Status", "sub-total": "Zwischensumme", "successfully-updated-fulfillment": "", + "tax-base": "", + "tax-rate": "", + "tax-summary": "", + "tax-total": "", "total": "Gesamtsumme", "tracking-code": "Sendungsverfolgungscode", "transaction-id": "Transaktions-ID", @@ -674,6 +678,7 @@ "email-address": "E-Mail-Adresse", "filter-by-member-name": "Nach Land filtern", "first-name": "Vorname", + "fulfillment-handler": "", "global-out-of-stock-threshold": "", "global-out-of-stock-threshold-tooltip": "", "last-name": "Nachname", diff --git a/packages/admin-ui/src/lib/static/i18n-messages/en.json b/packages/admin-ui/src/lib/static/i18n-messages/en.json index 62721a1367..0db107a742 100644 --- a/packages/admin-ui/src/lib/static/i18n-messages/en.json +++ b/packages/admin-ui/src/lib/static/i18n-messages/en.json @@ -641,6 +641,10 @@ "state": "State", "sub-total": "Sub total", "successfully-updated-fulfillment": "Successfully updated fulfillment", + "tax-base": "Tax base", + "tax-rate": "Tax rate", + "tax-summary": "Tax summary", + "tax-total": "Tax total", "total": "Total", "tracking-code": "Tracking code", "transaction-id": "Transaction ID", @@ -674,6 +678,7 @@ "email-address": "Email address", "filter-by-member-name": "Filter by country", "first-name": "First name", + "fulfillment-handler": "", "global-out-of-stock-threshold": "Global out-of-stock threshold", "global-out-of-stock-threshold-tooltip": "Sets the stock level at which this a variant is considered to be out of stock. Using a negative value enables backorder support. Can be overridden by product variants.", "last-name": "Last name", diff --git a/packages/admin-ui/src/lib/static/i18n-messages/es.json b/packages/admin-ui/src/lib/static/i18n-messages/es.json index 0f9dfe40a6..8626f7f33b 100644 --- a/packages/admin-ui/src/lib/static/i18n-messages/es.json +++ b/packages/admin-ui/src/lib/static/i18n-messages/es.json @@ -641,6 +641,10 @@ "state": "Estado", "sub-total": "Sub total", "successfully-updated-fulfillment": "", + "tax-base": "", + "tax-rate": "", + "tax-summary": "", + "tax-total": "", "total": "Total", "tracking-code": "", "transaction-id": "ID de transacción", @@ -674,6 +678,7 @@ "email-address": "Dirección de email", "filter-by-member-name": "Filtrar por país", "first-name": "Nombre", + "fulfillment-handler": "", "global-out-of-stock-threshold": "", "global-out-of-stock-threshold-tooltip": "", "last-name": "Apellidos", diff --git a/packages/admin-ui/src/lib/static/i18n-messages/pl.json b/packages/admin-ui/src/lib/static/i18n-messages/pl.json index 3605736b8a..6d3453075e 100644 --- a/packages/admin-ui/src/lib/static/i18n-messages/pl.json +++ b/packages/admin-ui/src/lib/static/i18n-messages/pl.json @@ -641,6 +641,10 @@ "state": "Status", "sub-total": "Sub total", "successfully-updated-fulfillment": "", + "tax-base": "", + "tax-rate": "", + "tax-summary": "", + "tax-total": "", "total": "Total", "tracking-code": "Numer przesyłki", "transaction-id": "Numer transakcji", @@ -674,6 +678,7 @@ "email-address": "Email", "filter-by-member-name": "", "first-name": "Imię", + "fulfillment-handler": "", "global-out-of-stock-threshold": "", "global-out-of-stock-threshold-tooltip": "", "last-name": "Nazwisko", diff --git a/packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json b/packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json index 0b35c518b5..ef72d3e1f3 100644 --- a/packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json +++ b/packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json @@ -641,6 +641,10 @@ "state": "Estado", "sub-total": "Subtotal", "successfully-updated-fulfillment": "", + "tax-base": "", + "tax-rate": "", + "tax-summary": "", + "tax-total": "", "total": "Total", "tracking-code": "Código de rastreio", "transaction-id": "Código ID da transação", @@ -674,6 +678,7 @@ "email-address": "Email", "filter-by-member-name": "Filtrar por país", "first-name": "Nome", + "fulfillment-handler": "", "global-out-of-stock-threshold": "", "global-out-of-stock-threshold-tooltip": "", "last-name": "Sobrenome", diff --git a/packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json b/packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json index 1b50ae08fa..bbf688c55f 100644 --- a/packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json +++ b/packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json @@ -641,6 +641,10 @@ "state": "状态", "sub-total": "小计金额", "successfully-updated-fulfillment": "", + "tax-base": "", + "tax-rate": "", + "tax-summary": "", + "tax-total": "", "total": "总计金额", "tracking-code": "物流码", "transaction-id": "交易ID", @@ -674,6 +678,7 @@ "email-address": "电子邮件", "filter-by-member-name": "", "first-name": "名", + "fulfillment-handler": "", "global-out-of-stock-threshold": "", "global-out-of-stock-threshold-tooltip": "", "last-name": "姓", diff --git a/packages/admin-ui/src/lib/static/i18n-messages/zh_Hant.json b/packages/admin-ui/src/lib/static/i18n-messages/zh_Hant.json index 434aa9d0e2..1e5846ffd1 100644 --- a/packages/admin-ui/src/lib/static/i18n-messages/zh_Hant.json +++ b/packages/admin-ui/src/lib/static/i18n-messages/zh_Hant.json @@ -641,6 +641,10 @@ "state": "狀態", "sub-total": "小計金額", "successfully-updated-fulfillment": "", + "tax-base": "", + "tax-rate": "", + "tax-summary": "", + "tax-total": "", "total": "總計金額", "tracking-code": "物流碼", "transaction-id": "交易編號", @@ -674,6 +678,7 @@ "email-address": "電子郵件", "filter-by-member-name": "", "first-name": "名", + "fulfillment-handler": "", "global-out-of-stock-threshold": "", "global-out-of-stock-threshold-tooltip": "", "last-name": "姓",