Browse Source

refactor(admin-ui): Use new OrderLine fields

Michael Bromley 5 years ago
parent
commit
321040bf31

+ 2 - 2
packages/admin-ui/src/lib/core/src/common/generated-types.ts

@@ -5066,7 +5066,7 @@ export type FulfillmentFragment = (
 
 
 export type OrderLineFragment = (
 export type OrderLineFragment = (
   { __typename?: 'OrderLine' }
   { __typename?: 'OrderLine' }
-  & Pick<OrderLine, 'id' | 'unitPrice' | 'unitPriceWithTax' | 'quantity' | 'totalPrice'>
+  & Pick<OrderLine, 'id' | 'unitPrice' | 'unitPriceWithTax' | 'quantity' | 'linePrice' | 'lineTax' | 'linePriceWithTax'>
   & { featuredAsset?: Maybe<(
   & { featuredAsset?: Maybe<(
     { __typename?: 'Asset' }
     { __typename?: 'Asset' }
     & Pick<Asset, 'preview'>
     & Pick<Asset, 'preview'>
@@ -5078,7 +5078,7 @@ export type OrderLineFragment = (
     & AdjustmentFragment
     & AdjustmentFragment
   )>, items: Array<(
   )>, items: Array<(
     { __typename?: 'OrderItem' }
     { __typename?: 'OrderItem' }
-    & Pick<OrderItem, 'id' | 'unitPrice' | 'unitPriceIncludesTax' | 'unitPriceWithTax' | 'taxRate' | 'refundId' | 'cancelled'>
+    & Pick<OrderItem, 'id' | 'unitPrice' | 'unitPriceWithTax' | 'taxRate' | 'refundId' | 'cancelled'>
     & { fulfillment?: Maybe<(
     & { fulfillment?: Maybe<(
       { __typename?: 'Fulfillment' }
       { __typename?: 'Fulfillment' }
       & FulfillmentFragment
       & FulfillmentFragment

+ 3 - 2
packages/admin-ui/src/lib/core/src/data/definitions/order-definitions.ts

@@ -89,7 +89,6 @@ export const ORDER_LINE_FRAGMENT = gql`
         items {
         items {
             id
             id
             unitPrice
             unitPrice
-            unitPriceIncludesTax
             unitPriceWithTax
             unitPriceWithTax
             taxRate
             taxRate
             refundId
             refundId
@@ -98,7 +97,9 @@ export const ORDER_LINE_FRAGMENT = gql`
                 ...Fulfillment
                 ...Fulfillment
             }
             }
         }
         }
-        totalPrice
+        linePrice
+        lineTax
+        linePriceWithTax
     }
     }
 `;
 `;
 
 

+ 2 - 2
packages/admin-ui/src/lib/order/src/components/order-detail/order-detail.component.html

@@ -147,9 +147,9 @@
                             ></clr-icon></td
                             ></clr-icon></td
                     ></ng-container>
                     ></ng-container>
                     <td class="align-middle total">
                     <td class="align-middle total">
-                        {{ line.totalPrice / 100 | currency: order.currencyCode }}
+                        {{ line.linePriceWithTax / 100 | currency: order.currencyCode }}
                         <div class="net-price" [title]="'order.net-price' | translate">
                         <div class="net-price" [title]="'order.net-price' | translate">
-                            {{ (line.unitPrice * line.quantity) / 100 | currency: order.currencyCode }}
+                            {{ line.linePrice / 100 | currency: order.currencyCode }}
                         </div>
                         </div>
 
 
                         <ng-container *ngIf="getLinePromotions(line) as promotions">
                         <ng-container *ngIf="getLinePromotions(line) as promotions">