@vendure/admin-ui 2.2.0-next.0 → 2.2.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/catalog/catalog.module.d.ts +4 -3
  2. package/catalog/components/create-facet-value-dialog/create-facet-value-dialog.component.d.ts +19 -0
  3. package/catalog/components/facet-detail/facet-detail.component.d.ts +9 -12
  4. package/catalog/components/product-list/product-list.component.d.ts +1 -1
  5. package/catalog/components/product-variant-list/product-variant-list.component.d.ts +3 -3
  6. package/catalog/public_api.d.ts +1 -0
  7. package/core/common/base-list.component.d.ts +1 -1
  8. package/core/common/component-registry-types.d.ts +1 -1
  9. package/core/common/generated-types.d.ts +276 -4860
  10. package/core/common/utilities/custom-field-default-value.d.ts +1 -1
  11. package/core/common/utilities/interpolate-description.d.ts +1 -1
  12. package/core/common/version.d.ts +1 -1
  13. package/core/components/app-shell/app-shell.component.d.ts +1 -0
  14. package/core/data/server-config.d.ts +4 -3
  15. package/core/data/utils/add-custom-fields.d.ts +2 -2
  16. package/core/extension/register-route-component.d.ts +1 -1
  17. package/core/providers/currency/currency.service.d.ts +10 -0
  18. package/core/public_api.d.ts +1 -0
  19. package/core/shared/components/chart/chart.component.d.ts +3 -0
  20. package/core/shared/components/chart/tooltip-plugin.d.ts +16 -1
  21. package/core/shared/components/configurable-input/configurable-input.component.d.ts +3 -0
  22. package/core/shared/components/currency-input/currency-input.component.d.ts +6 -3
  23. package/core/shared/components/custom-field-control/custom-field-control.component.d.ts +0 -2
  24. package/core/shared/components/form-field/form-field-control.directive.d.ts +1 -1
  25. package/core/shared/components/form-field/form-field.component.d.ts +3 -2
  26. package/core/shared/components/order-state-label/order-state-label.component.d.ts +1 -1
  27. package/core/shared/components/page-title/page-title.component.d.ts +2 -3
  28. package/core/shared/dynamic-form-inputs/default-form-inputs.d.ts +1 -1
  29. package/core/shared/pipes/locale-currency.pipe.d.ts +5 -2
  30. package/esm2022/catalog/catalog.module.mjs +17 -3
  31. package/esm2022/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.mjs +1 -1
  32. package/esm2022/catalog/components/collection-data-table/collection-data-table.component.mjs +1 -1
  33. package/esm2022/catalog/components/collection-detail/collection-detail.component.mjs +2 -2
  34. package/esm2022/catalog/components/collection-list/collection-list.component.mjs +3 -3
  35. package/esm2022/catalog/components/collection-tree/collection-tree-node.component.mjs +2 -2
  36. package/esm2022/catalog/components/create-facet-value-dialog/create-facet-value-dialog.component.mjs +44 -0
  37. package/esm2022/catalog/components/create-product-option-group-dialog/create-product-option-group-dialog.component.mjs +1 -1
  38. package/esm2022/catalog/components/create-product-variant-dialog/create-product-variant-dialog.component.mjs +1 -1
  39. package/esm2022/catalog/components/facet-detail/facet-detail.component.mjs +85 -120
  40. package/esm2022/catalog/components/facet-list/facet-list.component.mjs +5 -2
  41. package/esm2022/catalog/components/generate-product-variants/generate-product-variants.component.mjs +1 -1
  42. package/esm2022/catalog/components/option-value-input/option-value-input.component.mjs +1 -1
  43. package/esm2022/catalog/components/product-detail/product-detail.component.mjs +3 -3
  44. package/esm2022/catalog/components/product-list/product-list.component.mjs +26 -14
  45. package/esm2022/catalog/components/product-options-editor/product-options-editor.component.mjs +1 -1
  46. package/esm2022/catalog/components/product-variant-detail/product-variant-detail.component.mjs +1 -1
  47. package/esm2022/catalog/components/product-variant-list/product-variant-list.component.mjs +36 -15
  48. package/esm2022/catalog/components/product-variants-editor/product-variants-editor.component.mjs +1 -1
  49. package/esm2022/catalog/components/product-variants-table/product-variants-table.component.mjs +1 -1
  50. package/esm2022/catalog/components/update-product-option-dialog/update-product-option-dialog.component.mjs +1 -1
  51. package/esm2022/catalog/components/variant-price-detail/variant-price-detail.component.mjs +1 -1
  52. package/esm2022/catalog/public_api.mjs +2 -1
  53. package/esm2022/core/common/base-list.component.mjs +1 -1
  54. package/esm2022/core/common/component-registry-types.mjs +1 -1
  55. package/esm2022/core/common/generated-types.mjs +26 -22
  56. package/esm2022/core/common/introspection-result.mjs +4 -1
  57. package/esm2022/core/common/utilities/interpolate-description.mjs +3 -3
  58. package/esm2022/core/common/version.mjs +2 -2
  59. package/esm2022/core/components/app-shell/app-shell.component.mjs +4 -3
  60. package/esm2022/core/components/channel-switcher/channel-switcher.component.mjs +1 -1
  61. package/esm2022/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.mjs +1 -1
  62. package/esm2022/core/core.module.mjs +2 -2
  63. package/esm2022/core/data/definitions/facet-definitions.mjs +2 -2
  64. package/esm2022/core/data/definitions/order-definitions.mjs +5 -1
  65. package/esm2022/core/data/definitions/settings-definitions.mjs +5 -81
  66. package/esm2022/core/data/providers/base-data.service.mjs +2 -2
  67. package/esm2022/core/data/server-config.mjs +6 -2
  68. package/esm2022/core/data/utils/add-custom-fields.mjs +2 -2
  69. package/esm2022/core/providers/currency/currency.service.mjs +21 -0
  70. package/esm2022/core/public_api.mjs +2 -1
  71. package/esm2022/core/shared/components/address-form/address-form.component.mjs +1 -1
  72. package/esm2022/core/shared/components/affixed-input/percentage-suffix-input.component.mjs +1 -1
  73. package/esm2022/core/shared/components/asset-file-input/asset-file-input.component.mjs +1 -1
  74. package/esm2022/core/shared/components/asset-preview/asset-preview.component.mjs +1 -1
  75. package/esm2022/core/shared/components/assign-to-channel-dialog/assign-to-channel-dialog.component.mjs +1 -1
  76. package/esm2022/core/shared/components/chart/chart.component.mjs +12 -5
  77. package/esm2022/core/shared/components/chart/tooltip-plugin.mjs +6 -14
  78. package/esm2022/core/shared/components/configurable-input/configurable-input.component.mjs +15 -13
  79. package/esm2022/core/shared/components/currency-input/currency-input.component.mjs +17 -14
  80. package/esm2022/core/shared/components/custom-field-control/custom-field-control.component.mjs +3 -6
  81. package/esm2022/core/shared/components/data-table/data-table.component.mjs +1 -1
  82. package/esm2022/core/shared/components/data-table-2/data-table-custom-field-column.component.mjs +4 -1
  83. package/esm2022/core/shared/components/data-table-2/data-table-search.component.mjs +1 -1
  84. package/esm2022/core/shared/components/data-table-2/data-table2.component.mjs +1 -1
  85. package/esm2022/core/shared/components/data-table-column-picker/data-table-column-picker.component.mjs +1 -1
  86. package/esm2022/core/shared/components/data-table-filter-presets/add-filter-preset-button.component.mjs +1 -1
  87. package/esm2022/core/shared/components/data-table-filter-presets/rename-filter-preset-dialog.component.mjs +1 -1
  88. package/esm2022/core/shared/components/data-table-filters/data-table-filters.component.mjs +1 -1
  89. package/esm2022/core/shared/components/datetime-picker/datetime-picker.component.mjs +1 -1
  90. package/esm2022/core/shared/components/edit-note-dialog/edit-note-dialog.component.mjs +1 -1
  91. package/esm2022/core/shared/components/form-field/form-field-control.directive.mjs +3 -3
  92. package/esm2022/core/shared/components/form-field/form-field.component.mjs +8 -4
  93. package/esm2022/core/shared/components/manage-tags-dialog/manage-tags-dialog.component.mjs +1 -1
  94. package/esm2022/core/shared/components/page-header-tabs/page-header-tabs.component.mjs +2 -2
  95. package/esm2022/core/shared/components/page-title/page-title.component.mjs +5 -6
  96. package/esm2022/core/shared/components/radio-card/radio-card.component.mjs +1 -1
  97. package/esm2022/core/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.mjs +1 -1
  98. package/esm2022/core/shared/components/rich-text-editor/link-dialog/link-dialog.component.mjs +1 -1
  99. package/esm2022/core/shared/components/timeline-entry/timeline-entry.component.mjs +2 -2
  100. package/esm2022/core/shared/dynamic-form-inputs/boolean-form-input/boolean-form-input.component.mjs +1 -1
  101. package/esm2022/core/shared/dynamic-form-inputs/currency-form-input/currency-form-input.component.mjs +4 -3
  102. package/esm2022/core/shared/dynamic-form-inputs/number-form-input/number-form-input.component.mjs +1 -1
  103. package/esm2022/core/shared/dynamic-form-inputs/password-form-input/password-form-input.component.mjs +1 -1
  104. package/esm2022/core/shared/dynamic-form-inputs/relation-form-input/generic/relation-generic-input.component.mjs +1 -1
  105. package/esm2022/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.mjs +1 -1
  106. package/esm2022/core/shared/dynamic-form-inputs/text-form-input/text-form-input.component.mjs +1 -1
  107. package/esm2022/core/shared/dynamic-form-inputs/textarea-form-input/textarea-form-input.component.mjs +1 -1
  108. package/esm2022/core/shared/pipes/locale-currency.pipe.mjs +11 -7
  109. package/esm2022/customer/components/customer-detail/customer-detail.component.mjs +1 -1
  110. package/esm2022/customer/components/customer-group-detail/customer-group-detail.component.mjs +1 -1
  111. package/esm2022/customer/components/customer-group-detail-dialog/customer-group-detail-dialog.component.mjs +1 -1
  112. package/esm2022/customer/components/customer-history/customer-history.component.mjs +3 -3
  113. package/esm2022/dashboard/widgets/order-summary-widget/order-summary-widget.component.mjs +4 -4
  114. package/esm2022/login/components/login/login.component.mjs +4 -5
  115. package/esm2022/marketing/components/promotion-detail/promotion-detail.component.mjs +1 -1
  116. package/esm2022/order/common/get-refundable-payments.mjs +19 -0
  117. package/esm2022/order/common/modify-order-types.mjs +2 -0
  118. package/esm2022/order/components/add-manual-payment-dialog/add-manual-payment-dialog.component.mjs +1 -1
  119. package/esm2022/order/components/cancel-order-dialog/cancel-order-dialog.component.mjs +1 -1
  120. package/esm2022/order/components/coupon-code-selector/coupon-code-selector.component.mjs +3 -3
  121. package/esm2022/order/components/draft-order-variant-selector/draft-order-variant-selector.component.mjs +1 -1
  122. package/esm2022/order/components/fulfill-order-dialog/fulfill-order-dialog.component.mjs +1 -1
  123. package/esm2022/order/components/modification-detail/modification-detail.component.mjs +17 -6
  124. package/esm2022/order/components/order-data-table/order-data-table.component.mjs +1 -1
  125. package/esm2022/order/components/order-detail/order-detail.component.mjs +77 -29
  126. package/esm2022/order/components/order-editor/order-editor.component.mjs +201 -98
  127. package/esm2022/order/components/order-edits-preview-dialog/order-edits-preview-dialog.component.mjs +45 -7
  128. package/esm2022/order/components/order-history/order-history.component.mjs +22 -6
  129. package/esm2022/order/components/order-modification-summary/order-modification-summary.component.mjs +76 -0
  130. package/esm2022/order/components/order-payment-card/order-payment-card.component.mjs +3 -3
  131. package/esm2022/order/components/order-state-select-dialog/order-state-select-dialog.component.mjs +1 -1
  132. package/esm2022/order/components/order-table/order-table.component.mjs +3 -3
  133. package/esm2022/order/components/payment-for-refund-selector/payment-for-refund-selector.component.mjs +24 -0
  134. package/esm2022/order/components/payment-state-label/payment-state-label.component.mjs +2 -2
  135. package/esm2022/order/components/refund-detail/refund-detail.component.mjs +18 -0
  136. package/esm2022/order/components/refund-order-dialog/refund-order-dialog.component.mjs +100 -58
  137. package/esm2022/order/components/refund-state-label/refund-state-label.component.mjs +2 -2
  138. package/esm2022/order/components/select-customer-dialog/select-customer-dialog.component.mjs +14 -8
  139. package/esm2022/order/components/settle-refund-dialog/settle-refund-dialog.component.mjs +1 -1
  140. package/esm2022/order/components/simple-item-list/simple-item-list.component.mjs +3 -3
  141. package/esm2022/order/order.module.mjs +32 -2
  142. package/esm2022/order/order.routes.mjs +7 -53
  143. package/esm2022/order/providers/routing/order.guard.mjs +22 -2
  144. package/esm2022/order/public_api.mjs +6 -2
  145. package/esm2022/react/components/react-custom-column.component.mjs +3 -3
  146. package/esm2022/react/components/react-custom-detail.component.mjs +3 -3
  147. package/esm2022/react/components/react-form-input.component.mjs +3 -3
  148. package/esm2022/react/components/react-route.component.mjs +3 -3
  149. package/esm2022/settings/components/admin-detail/admin-detail.component.mjs +1 -1
  150. package/esm2022/settings/components/channel-detail/channel-detail.component.mjs +1 -1
  151. package/esm2022/settings/components/country-detail/country-detail.component.mjs +1 -1
  152. package/esm2022/settings/components/global-settings/global-settings.component.mjs +1 -1
  153. package/esm2022/settings/components/payment-method-detail/payment-method-detail.component.mjs +1 -1
  154. package/esm2022/settings/components/profile/profile.component.mjs +1 -1
  155. package/esm2022/settings/components/role-detail/role-detail.component.mjs +1 -1
  156. package/esm2022/settings/components/seller-detail/seller-detail.component.mjs +1 -1
  157. package/esm2022/settings/components/shipping-method-detail/shipping-method-detail.component.mjs +1 -1
  158. package/esm2022/settings/components/stock-location-detail/stock-location-detail.component.mjs +1 -1
  159. package/esm2022/settings/components/tax-category-detail/tax-category-detail.component.mjs +1 -1
  160. package/esm2022/settings/components/tax-rate-detail/tax-rate-detail.component.mjs +1 -1
  161. package/esm2022/settings/components/test-address-form/test-address-form.component.mjs +1 -1
  162. package/esm2022/settings/components/test-order-builder/test-order-builder.component.mjs +1 -1
  163. package/esm2022/settings/components/zone-detail/zone-detail.component.mjs +1 -1
  164. package/esm2022/settings/settings.routes.mjs +4 -4
  165. package/esm2022/system/components/job-list/job-list.component.mjs +1 -1
  166. package/fesm2022/vendure-admin-ui-catalog.mjs +215 -166
  167. package/fesm2022/vendure-admin-ui-catalog.mjs.map +1 -1
  168. package/fesm2022/vendure-admin-ui-core.mjs +156 -192
  169. package/fesm2022/vendure-admin-ui-core.mjs.map +1 -1
  170. package/fesm2022/vendure-admin-ui-customer.mjs +5 -5
  171. package/fesm2022/vendure-admin-ui-customer.mjs.map +1 -1
  172. package/fesm2022/vendure-admin-ui-dashboard.mjs +3 -3
  173. package/fesm2022/vendure-admin-ui-dashboard.mjs.map +1 -1
  174. package/fesm2022/vendure-admin-ui-login.mjs +2 -3
  175. package/fesm2022/vendure-admin-ui-login.mjs.map +1 -1
  176. package/fesm2022/vendure-admin-ui-marketing.mjs +1 -1
  177. package/fesm2022/vendure-admin-ui-marketing.mjs.map +1 -1
  178. package/fesm2022/vendure-admin-ui-order.mjs +661 -324
  179. package/fesm2022/vendure-admin-ui-order.mjs.map +1 -1
  180. package/fesm2022/vendure-admin-ui-react.mjs +8 -8
  181. package/fesm2022/vendure-admin-ui-react.mjs.map +1 -1
  182. package/fesm2022/vendure-admin-ui-settings.mjs +18 -18
  183. package/fesm2022/vendure-admin-ui-settings.mjs.map +1 -1
  184. package/fesm2022/vendure-admin-ui-system.mjs +1 -1
  185. package/fesm2022/vendure-admin-ui-system.mjs.map +1 -1
  186. package/login/components/login/login.component.d.ts +0 -1
  187. package/order/common/get-refundable-payments.d.ts +9 -0
  188. package/order/common/modify-order-types.d.ts +29 -0
  189. package/order/components/modification-detail/modification-detail.component.d.ts +4 -0
  190. package/order/components/order-detail/order-detail.component.d.ts +2 -0
  191. package/order/components/order-editor/order-editor.component.d.ts +57 -33
  192. package/order/components/order-edits-preview-dialog/order-edits-preview-dialog.component.d.ts +17 -6
  193. package/order/components/order-history/order-history.component.d.ts +6 -2
  194. package/order/components/order-modification-summary/order-modification-summary.component.d.ts +19 -0
  195. package/order/components/payment-for-refund-selector/payment-for-refund-selector.component.d.ts +14 -0
  196. package/order/components/refund-detail/refund-detail.component.d.ts +8 -0
  197. package/order/components/refund-order-dialog/refund-order-dialog.component.d.ts +13 -11
  198. package/order/components/select-customer-dialog/select-customer-dialog.component.d.ts +9 -2
  199. package/order/components/simple-item-list/simple-item-list.component.d.ts +1 -1
  200. package/order/order.module.d.ts +6 -3
  201. package/order/order.routes.d.ts +0 -2
  202. package/order/providers/routing/order.guard.d.ts +1 -0
  203. package/order/public_api.d.ts +5 -1
  204. package/package.json +20 -20
  205. package/settings/components/administrator-list/administrator-list.component.d.ts +2 -0
  206. package/settings/components/stock-location-list/stock-location-list.component.d.ts +1 -1
  207. package/static/i18n-messages/ar.json +15 -7
  208. package/static/i18n-messages/cs.json +15 -7
  209. package/static/i18n-messages/de.json +15 -7
  210. package/static/i18n-messages/en.json +18 -10
  211. package/static/i18n-messages/es.json +15 -7
  212. package/static/i18n-messages/fa.json +16 -8
  213. package/static/i18n-messages/fr.json +15 -7
  214. package/static/i18n-messages/he.json +15 -7
  215. package/static/i18n-messages/hr.json +15 -7
  216. package/static/i18n-messages/it.json +16 -8
  217. package/static/i18n-messages/nb.json +803 -0
  218. package/static/i18n-messages/ne.json +16 -8
  219. package/static/i18n-messages/pl.json +15 -7
  220. package/static/i18n-messages/pt_BR.json +16 -8
  221. package/static/i18n-messages/pt_PT.json +15 -7
  222. package/static/i18n-messages/ru.json +15 -7
  223. package/static/i18n-messages/uk.json +180 -172
  224. package/static/i18n-messages/zh_Hans.json +15 -7
  225. package/static/i18n-messages/zh_Hant.json +15 -7
  226. package/static/styles/global/_sass-overrides.scss +5 -0
  227. package/static/styles/global/_utilities.scss +4 -0
  228. package/static/styles/theme/dark.scss +9 -6
  229. package/static/styles/theme/default.scss +8 -4
  230. package/static/theme.min.css +1 -1
  231. package/static/vendure-ui-config.json +2 -1
  232. package/esm2022/order/providers/routing/order-resolver.mjs +0 -48
  233. package/order/providers/routing/order-resolver.d.ts +0 -16
@@ -1,26 +1,43 @@
1
+ import * as i2 from '@angular/forms';
2
+ import { FormControl, Validators, UntypedFormGroup, UntypedFormControl, FormGroup, UntypedFormArray } from '@angular/forms';
3
+ import { summate, notNullOrUndefined, isObject, assertNever } from '@vendure/common/lib/shared-utils';
1
4
  import * as i0 from '@angular/core';
2
5
  import { Component, ChangeDetectionStrategy, EventEmitter, Input, Output, Injectable, ContentChildren, ViewChildren, HostBinding, ViewContainerRef, ViewChild, NgModule } from '@angular/core';
3
- import * as i2 from '@angular/forms';
4
- import { UntypedFormGroup, UntypedFormControl, Validators, FormGroup, UntypedFormArray } from '@angular/forms';
5
6
  import * as i1 from '@vendure/admin-ui/core';
6
- import { GetAddManualPaymentMethodListDocument, getAppConfig, GetCouponCodeSelectorPromotionListDocument, GetCustomerAddressesDocument, HistoryEntryType, SortOrder, DataTable2ColumnComponent, DataTable2Component, AdjustmentType, TypedBaseDetailComponent, DeletionResult, configurableDefinitionToInstance, GlobalFlag, configurableOperationValueIsValid, toConfigurableOperationInput, ORDER_DETAIL_FRAGMENT, getCustomFieldsDefaults, EditNoteDialogComponent, BaseDetailComponent, transformRelationCustomFieldInputs, TypedBaseListComponent, OrderType, getOrderStateTranslationToken, GetOrderListDocument, LogicalOperator, ADDRESS_FRAGMENT, PageComponent, detailComponentWithResolver, OrderDetailQueryDocument, SharedModule, PageService } from '@vendure/admin-ui/core';
7
+ import { GetAddManualPaymentMethodListDocument, getAppConfig, GetCouponCodeSelectorPromotionListDocument, GetCustomerAddressesDocument, HistoryEntryType, SortOrder, DataTable2ColumnComponent, DataTable2Component, AdjustmentType, TypedBaseDetailComponent, DeletionResult, configurableDefinitionToInstance, GlobalFlag, configurableOperationValueIsValid, toConfigurableOperationInput, ORDER_DETAIL_FRAGMENT, getCustomFieldsDefaults, SetOrderCustomerDocument, EditNoteDialogComponent, transformRelationCustomFieldInputs, TypedBaseListComponent, OrderType, getOrderStateTranslationToken, GetOrderListDocument, LogicalOperator, ADDRESS_FRAGMENT, PageComponent, detailComponentWithResolver, OrderDetailQueryDocument, SharedModule, PageService } from '@vendure/admin-ui/core';
7
8
  import { gql } from 'apollo-angular';
8
- import * as i3 from '@ng-select/ng-select';
9
+ import * as i5 from '@ng-select/ng-select';
9
10
  import * as i2$1 from '@angular/common';
10
11
  import * as i4 from '@ngx-translate/core';
11
12
  import { marker } from '@biesbjerg/ngx-translate-extract-marker';
12
- import * as i1$1 from '@clr/angular';
13
- import { Subject, concat, of, EMPTY, combineLatest, BehaviorSubject } from 'rxjs';
14
- import { debounceTime, distinctUntilChanged, switchMap, map, startWith, tap, catchError, retryWhen, delay, take, mapTo, takeUntil, shareReplay, filter } from 'rxjs/operators';
13
+ import * as i3 from '@clr/angular';
14
+ import { Subject, concat, of, EMPTY, combineLatest, BehaviorSubject, forkJoin } from 'rxjs';
15
+ import { debounceTime, distinctUntilChanged, switchMap, map, startWith, tap, catchError, retryWhen, delay, take, mapTo, takeUntil, shareReplay } from 'rxjs/operators';
15
16
  import { pick } from '@vendure/common/lib/pick';
16
- import * as i1$2 from '@angular/router';
17
- import { ActivationStart, ROUTES, RouterModule } from '@angular/router';
18
- import { notNullOrUndefined, isObject, summate, assertNever } from '@vendure/common/lib/shared-utils';
17
+ import * as i1$1 from '@angular/router';
18
+ import { ROUTES, RouterModule } from '@angular/router';
19
19
  import * as i3$1 from '@angular/cdk/bidi';
20
- import * as i5 from 'ngx-pagination';
20
+ import * as i5$1 from 'ngx-pagination';
21
21
  import { DEFAULT_CHANNEL_CODE } from '@vendure/common/lib/shared-constants';
22
22
  import { simpleDeepClone } from '@vendure/common/lib/simple-deep-clone';
23
23
 
24
+ function getRefundablePayments(payments) {
25
+ const settledPayments = (payments || []).filter(p => p.state === 'Settled');
26
+ return settledPayments.map((payment, index) => {
27
+ const refundableAmount = payment.amount -
28
+ summate(payment.refunds.filter(r => r.state !== 'Failed'), 'total');
29
+ return {
30
+ ...payment,
31
+ refundableAmount,
32
+ amountToRefundControl: new FormControl(0, {
33
+ nonNullable: true,
34
+ validators: [Validators.min(0), Validators.max(refundableAmount)],
35
+ }),
36
+ selected: index === 0,
37
+ };
38
+ });
39
+ }
40
+
24
41
  const GET_PAYMENT_METHODS_FOR_MANUAL_ADD = gql `
25
42
  query GetAddManualPaymentMethodList($options: PaymentMethodListOptions!) {
26
43
  paymentMethods(options: $options) {
@@ -65,7 +82,7 @@ class AddManualPaymentDialogComponent {
65
82
  this.resolveWith();
66
83
  }
67
84
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AddManualPaymentDialogComponent, deps: [{ token: i1.DataService }], target: i0.ɵɵFactoryTarget.Component }); }
68
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: AddManualPaymentDialogComponent, selector: "vdr-add-manual-payment-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.add-payment-to-order' | translate }}</ng-template>\r\n<form [formGroup]=\"form\">\r\n <vdr-form-field [label]=\"'order.payment-method' | translate\" for=\"method\">\r\n <ng-select\r\n [items]=\"paymentMethods$ | async\"\r\n bindLabel=\"code\"\r\n appendTo=\"body\"\r\n autofocus\r\n bindValue=\"code\"\r\n [addTag]=\"true\"\r\n formControlName=\"method\"\r\n ></ng-select>\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'order.transaction-id' | translate\" for=\"transactionId\">\r\n <input id=\"transactionId\" type=\"text\" formControlName=\"transactionId\" />\r\n </vdr-form-field>\r\n</form>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"submit()\" class=\"btn btn-primary\" [disabled]=\"form.invalid || form.pristine\">\r\n {{ 'order.add-payment' | translate }} ({{ outstandingAmount | localeCurrency: currencyCode }})\r\n </button>\r\n</ng-template>\r\n", styles: [".ng-select{min-width:100%}\n"], dependencies: [{ kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
85
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: AddManualPaymentDialogComponent, selector: "vdr-add-manual-payment-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.add-payment-to-order' | translate }}</ng-template>\r\n<form [formGroup]=\"form\">\r\n <vdr-form-field [label]=\"'order.payment-method' | translate\" for=\"method\">\r\n <ng-select\r\n [items]=\"paymentMethods$ | async\"\r\n bindLabel=\"code\"\r\n appendTo=\"body\"\r\n autofocus\r\n bindValue=\"code\"\r\n [addTag]=\"true\"\r\n formControlName=\"method\"\r\n ></ng-select>\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'order.transaction-id' | translate\" for=\"transactionId\">\r\n <input id=\"transactionId\" type=\"text\" formControlName=\"transactionId\" />\r\n </vdr-form-field>\r\n</form>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"submit()\" class=\"btn btn-primary\" [disabled]=\"form.invalid || form.pristine\">\r\n {{ 'order.add-payment' | translate }} ({{ outstandingAmount | localeCurrency: currencyCode }})\r\n </button>\r\n</ng-template>\r\n", styles: [".ng-select{min-width:100%}\n"], dependencies: [{ kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"], outputs: ["readOnlyToggleChange"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
69
86
  }
70
87
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AddManualPaymentDialogComponent, decorators: [{
71
88
  type: Component,
@@ -135,7 +152,7 @@ class CancelOrderDialogComponent {
135
152
  .filter(l => 0 < l.quantity);
136
153
  }
137
154
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: CancelOrderDialogComponent, deps: [{ token: i1.I18nService }], target: i0.ɵɵFactoryTarget.Component }); }
138
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: CancelOrderDialogComponent, selector: "vdr-cancel-order-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.cancel-order' | translate }}</ng-template>\r\n\r\n<div class=\"fulfillment-wrapper\">\r\n <div class=\"order-lines\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th>{{ 'order.unit-price' | translate }}</th>\r\n <th>{{ 'order.cancel' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tr\r\n *ngFor=\"let line of order.lines\"\r\n class=\"order-line\"\r\n [class.is-disabled]=\"cancelAll\"\r\n [class.is-cancelled]=\"line.quantity === 0\"\r\n >\r\n <td class=\"align-middle thumb\">\r\n <img [src]=\"line.featuredAsset | assetPreview: 'tiny'\" />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle quantity\">{{ line.quantity }}</td>\r\n <td class=\"align-middle quantity\">\r\n {{ line.unitPriceWithTax | localeCurrency: order.currencyCode }}\r\n </td>\r\n <td class=\"align-middle fulfil\">\r\n <input\r\n *ngIf=\"line.quantity > 0 && !order.active; else nonEditable\"\r\n [(ngModel)]=\"lineQuantities[line.id]\"\r\n (input)=\"checkIfAllSelected()\"\r\n [disabled]=\"cancelAll\"\r\n type=\"number\"\r\n [max]=\"line.quantity\"\r\n min=\"0\"\r\n />\r\n <ng-template #nonEditable>{{ line.quantity }}</ng-template>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class=\"cancellation-details\">\r\n <ng-container *ngIf=\"order.active !== true\">\r\n <clr-radio-wrapper>\r\n <input\r\n type=\"radio\"\r\n clrRadio\r\n [value]=\"true\"\r\n [(ngModel)]=\"cancelAll\"\r\n name=\"options\"\r\n (ngModelChange)=\"radioChanged()\"\r\n />\r\n <label>{{ 'order.cancel-entire-order' | translate }}</label>\r\n </clr-radio-wrapper>\r\n <clr-radio-wrapper>\r\n <input\r\n type=\"radio\"\r\n clrRadio\r\n [value]=\"false\"\r\n [(ngModel)]=\"cancelAll\"\r\n name=\"options\"\r\n (ngModelChange)=\"radioChanged()\"\r\n />\r\n <label>{{ 'order.cancel-specified-items' | translate }}</label>\r\n </clr-radio-wrapper>\r\n </ng-container>\r\n <label class=\"clr-control-label\">{{ 'order.cancellation-reason' | translate }}</label>\r\n <ng-select\r\n [items]=\"reasons\"\r\n bindLabel=\"name\"\r\n autofocus\r\n bindValue=\"id\"\r\n [addTag]=\"true\"\r\n [(ngModel)]=\"reason\"\r\n ></ng-select>\r\n </div>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"select()\"\r\n [disabled]=\"!reason || (!order.active && selectionCount === 0)\"\r\n class=\"btn btn-primary\"\r\n >\r\n <ng-container *ngIf=\"!order.active\">\r\n {{ 'order.cancel-selected-items' | translate }}\r\n </ng-container>\r\n <ng-container *ngIf=\"order.active\">\r\n {{ 'order.cancel-order' | translate }}\r\n </ng-container>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{height:100%;display:flex;min-height:64vh}.fulfillment-wrapper{flex:1}@media screen and (min-width: 768px){.fulfillment-wrapper{display:flex;flex-direction:row}}@media screen and (min-width: 768px){.fulfillment-wrapper .cancellation-details{margin-top:0;margin-inline-start:24px;width:250px}}.fulfillment-wrapper .order-lines{flex:1;overflow-y:auto}.fulfillment-wrapper .order-lines table{margin-top:0}.fulfillment-wrapper tr.ignore{color:var(--color-grey-300)}.fulfillment-wrapper .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}.fulfillment-wrapper .is-disabled td,.fulfillment-wrapper .is-disabled td input{background-color:var(--color-component-bg-200)}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i1$1.ClrRadio, selector: "[clrRadio]" }, { kind: "component", type: i1$1.ClrRadioWrapper, selector: "clr-radio-wrapper" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
155
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: CancelOrderDialogComponent, selector: "vdr-cancel-order-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.cancel-order' | translate }}</ng-template>\r\n\r\n<div class=\"fulfillment-wrapper\">\r\n <div class=\"order-lines\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th>{{ 'order.unit-price' | translate }}</th>\r\n <th>{{ 'order.cancel' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tr\r\n *ngFor=\"let line of order.lines\"\r\n class=\"order-line\"\r\n [class.is-disabled]=\"cancelAll\"\r\n [class.is-cancelled]=\"line.quantity === 0\"\r\n >\r\n <td class=\"align-middle thumb\">\r\n <img [src]=\"line.featuredAsset | assetPreview: 'tiny'\" />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle quantity\">{{ line.quantity }}</td>\r\n <td class=\"align-middle quantity\">\r\n {{ line.unitPriceWithTax | localeCurrency: order.currencyCode }}\r\n </td>\r\n <td class=\"align-middle fulfil\">\r\n <input\r\n *ngIf=\"line.quantity > 0 && !order.active; else nonEditable\"\r\n [(ngModel)]=\"lineQuantities[line.id]\"\r\n (input)=\"checkIfAllSelected()\"\r\n [disabled]=\"cancelAll\"\r\n type=\"number\"\r\n [max]=\"line.quantity\"\r\n min=\"0\"\r\n />\r\n <ng-template #nonEditable>{{ line.quantity }}</ng-template>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class=\"cancellation-details\">\r\n <ng-container *ngIf=\"order.active !== true\">\r\n <clr-radio-wrapper>\r\n <input\r\n type=\"radio\"\r\n clrRadio\r\n [value]=\"true\"\r\n [(ngModel)]=\"cancelAll\"\r\n name=\"options\"\r\n (ngModelChange)=\"radioChanged()\"\r\n />\r\n <label>{{ 'order.cancel-entire-order' | translate }}</label>\r\n </clr-radio-wrapper>\r\n <clr-radio-wrapper>\r\n <input\r\n type=\"radio\"\r\n clrRadio\r\n [value]=\"false\"\r\n [(ngModel)]=\"cancelAll\"\r\n name=\"options\"\r\n (ngModelChange)=\"radioChanged()\"\r\n />\r\n <label>{{ 'order.cancel-specified-items' | translate }}</label>\r\n </clr-radio-wrapper>\r\n </ng-container>\r\n <label class=\"clr-control-label\">{{ 'order.cancellation-reason' | translate }}</label>\r\n <ng-select\r\n [items]=\"reasons\"\r\n bindLabel=\"name\"\r\n autofocus\r\n bindValue=\"id\"\r\n [addTag]=\"true\"\r\n [(ngModel)]=\"reason\"\r\n ></ng-select>\r\n </div>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"select()\"\r\n [disabled]=\"!reason || (!order.active && selectionCount === 0)\"\r\n class=\"btn btn-primary\"\r\n >\r\n <ng-container *ngIf=\"!order.active\">\r\n {{ 'order.cancel-selected-items' | translate }}\r\n </ng-container>\r\n <ng-container *ngIf=\"order.active\">\r\n {{ 'order.cancel-order' | translate }}\r\n </ng-container>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{height:100%;display:flex;min-height:64vh}.fulfillment-wrapper{flex:1}@media screen and (min-width: 768px){.fulfillment-wrapper{display:flex;flex-direction:row}}@media screen and (min-width: 768px){.fulfillment-wrapper .cancellation-details{margin-top:0;margin-inline-start:24px;width:250px}}.fulfillment-wrapper .order-lines{flex:1;overflow-y:auto}.fulfillment-wrapper .order-lines table{margin-top:0}.fulfillment-wrapper tr.ignore{color:var(--color-grey-300)}.fulfillment-wrapper .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}.fulfillment-wrapper .is-disabled td,.fulfillment-wrapper .is-disabled td input{background-color:var(--color-component-bg-200)}\n"], dependencies: [{ kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i3.ClrRadio, selector: "[clrRadio]" }, { kind: "component", type: i3.ClrRadioWrapper, selector: "clr-radio-wrapper" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
139
156
  }
140
157
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: CancelOrderDialogComponent, decorators: [{
141
158
  type: Component,
@@ -178,11 +195,11 @@ class CouponCodeSelectorComponent {
178
195
  }
179
196
  }
180
197
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: CouponCodeSelectorComponent, deps: [{ token: i1.DataService }], target: i0.ɵɵFactoryTarget.Component }); }
181
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: CouponCodeSelectorComponent, selector: "vdr-coupon-code-selector", inputs: { couponCodes: "couponCodes", control: "control" }, outputs: { addCouponCode: "addCouponCode", removeCouponCode: "removeCouponCode" }, ngImport: i0, template: "<ng-select\r\n [items]=\"availableCouponCodes$ | async\"\r\n appendTo=\"body\"\r\n bindLabel=\"code\"\r\n bindValue=\"code\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n [hideSelected]=\"true\"\r\n [minTermLength]=\"2\"\r\n typeToSearchText=\"\"\r\n [typeahead]=\"couponCodeInput$\"\r\n [formControl]=\"control\"\r\n (add)=\"addCouponCode.emit($event.code)\"\r\n (remove)=\"removeCouponCode.emit($event.value?.code)\"\r\n>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <vdr-chip>{{ item.code }}</vdr-chip>\r\n {{ item.promotionName }}\r\n </ng-template>\r\n</ng-select>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
198
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: CouponCodeSelectorComponent, selector: "vdr-coupon-code-selector", inputs: { couponCodes: "couponCodes", control: "control" }, outputs: { addCouponCode: "addCouponCode", removeCouponCode: "removeCouponCode" }, ngImport: i0, template: "<ng-select\r\n [items]=\"availableCouponCodes$ | async\"\r\n appendTo=\"body\"\r\n bindLabel=\"code\"\r\n bindValue=\"code\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n [hideSelected]=\"true\"\r\n [minTermLength]=\"2\"\r\n typeToSearchText=\"\"\r\n [typeahead]=\"couponCodeInput$\"\r\n [formControl]=\"control\"\r\n (add)=\"addCouponCode.emit($event.code)\"\r\n (remove)=\"removeCouponCode.emit($event.value?.code)\"\r\n>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <div class=\"flex items-center\">\r\n <vdr-chip class=\"mr-1\">{{ item.code }}</vdr-chip>\r\n <span>{{ item.promotionName }}</span>\r\n </div>\r\n </ng-template>\r\n</ng-select>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
182
199
  }
183
200
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: CouponCodeSelectorComponent, decorators: [{
184
201
  type: Component,
185
- args: [{ selector: 'vdr-coupon-code-selector', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-select\r\n [items]=\"availableCouponCodes$ | async\"\r\n appendTo=\"body\"\r\n bindLabel=\"code\"\r\n bindValue=\"code\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n [hideSelected]=\"true\"\r\n [minTermLength]=\"2\"\r\n typeToSearchText=\"\"\r\n [typeahead]=\"couponCodeInput$\"\r\n [formControl]=\"control\"\r\n (add)=\"addCouponCode.emit($event.code)\"\r\n (remove)=\"removeCouponCode.emit($event.value?.code)\"\r\n>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <vdr-chip>{{ item.code }}</vdr-chip>\r\n {{ item.promotionName }}\r\n </ng-template>\r\n</ng-select>\r\n" }]
202
+ args: [{ selector: 'vdr-coupon-code-selector', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-select\r\n [items]=\"availableCouponCodes$ | async\"\r\n appendTo=\"body\"\r\n bindLabel=\"code\"\r\n bindValue=\"code\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n [hideSelected]=\"true\"\r\n [minTermLength]=\"2\"\r\n typeToSearchText=\"\"\r\n [typeahead]=\"couponCodeInput$\"\r\n [formControl]=\"control\"\r\n (add)=\"addCouponCode.emit($event.code)\"\r\n (remove)=\"removeCouponCode.emit($event.value?.code)\"\r\n>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <div class=\"flex items-center\">\r\n <vdr-chip class=\"mr-1\">{{ item.code }}</vdr-chip>\r\n <span>{{ item.promotionName }}</span>\r\n </div>\r\n </ng-template>\r\n</ng-select>\r\n" }]
186
203
  }], ctorParameters: function () { return [{ type: i1.DataService }]; }, propDecorators: { couponCodes: [{
187
204
  type: Input
188
205
  }], control: [{
@@ -263,7 +280,7 @@ class SelectAddressDialogComponent {
263
280
  }
264
281
  }
265
282
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SelectAddressDialogComponent, deps: [{ token: i1.DataService }, { token: i2.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
266
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SelectAddressDialogComponent, selector: "vdr-select-address-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.select-address' | translate }}</ng-template>\r\n\r\n<clr-tabs *ngIf=\"addresses$ | async as addresses\">\r\n <clr-tab *ngIf=\"customerId && addresses.length\">\r\n <button clrTabLink>{{ 'order.existing-address' | translate }}</button>\r\n <ng-template [(clrIfActive)]=\"useExisting\">\r\n <clr-tab-content>\r\n <vdr-radio-card-fieldset\r\n class=\"block mt-4\"\r\n [idFn]=\"addressIdFn\"\r\n [selectedItemId]=\"selectedAddress && addressIdFn(selectedAddress)\"\r\n (selectItem)=\"selectedAddress = $event\"\r\n >\r\n <vdr-radio-card *ngFor=\"let address of addresses\" [item]=\"address\">\r\n <vdr-formatted-address [address]=\"address\"></vdr-formatted-address>\r\n </vdr-radio-card>\r\n </vdr-radio-card-fieldset>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n <clr-tab>\r\n <button clrTabLink>{{ 'customer.create-new-address' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"createNew\">\r\n <clr-tab-content>\r\n <vdr-address-form\r\n [formGroup]=\"addressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n ></vdr-address-form>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n</clr-tabs>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"select()\"\r\n [disabled]=\"(useExisting && !selectedAddress) || (createNew && addressForm.invalid)\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.okay' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ClrIfActive, selector: "[clrIfActive]", inputs: ["clrIfActive"], outputs: ["clrIfActiveChange"] }, { kind: "component", type: i1$1.ClrTabContent, selector: "clr-tab-content", inputs: ["id"] }, { kind: "component", type: i1$1.ClrTab, selector: "clr-tab" }, { kind: "component", type: i1$1.ClrTabs, selector: "clr-tabs", inputs: ["clrLayout"] }, { kind: "directive", type: i1$1.ClrTabLink, selector: "[clrTabLink]", inputs: ["id", "clrTabLinkInOverflow"] }, { kind: "directive", type: i1$1.ÇlrTabsWillyWonka, selector: "clr-tabs" }, { kind: "directive", type: i1$1.ÇlrActiveOompaLoompa, selector: "[clrTabLink], clr-tab-content" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "component", type: i1.AddressFormComponent, selector: "vdr-address-form", inputs: ["customFields", "formGroup", "availableCountries"] }, { kind: "component", type: i1.RadioCardComponent, selector: "vdr-radio-card", inputs: ["item"], exportAs: ["VdrRadioCard"] }, { kind: "component", type: i1.RadioCardFieldsetComponent, selector: "vdr-radio-card-fieldset", inputs: ["selectedItemId", "idFn"], outputs: ["selectItem"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
283
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SelectAddressDialogComponent, selector: "vdr-select-address-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.select-address' | translate }}</ng-template>\r\n\r\n<clr-tabs *ngIf=\"addresses$ | async as addresses\">\r\n <clr-tab *ngIf=\"customerId && addresses.length\">\r\n <button clrTabLink>{{ 'order.existing-address' | translate }}</button>\r\n <ng-template [(clrIfActive)]=\"useExisting\">\r\n <clr-tab-content>\r\n <vdr-radio-card-fieldset\r\n class=\"block mt-4\"\r\n [idFn]=\"addressIdFn\"\r\n [selectedItemId]=\"selectedAddress && addressIdFn(selectedAddress)\"\r\n (selectItem)=\"selectedAddress = $event\"\r\n >\r\n <vdr-radio-card *ngFor=\"let address of addresses\" [item]=\"address\">\r\n <vdr-formatted-address [address]=\"address\"></vdr-formatted-address>\r\n </vdr-radio-card>\r\n </vdr-radio-card-fieldset>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n <clr-tab>\r\n <button clrTabLink>{{ 'customer.create-new-address' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"createNew\">\r\n <clr-tab-content>\r\n <vdr-address-form\r\n [formGroup]=\"addressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n ></vdr-address-form>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n</clr-tabs>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"select()\"\r\n [disabled]=\"(useExisting && !selectedAddress) || (createNew && addressForm.invalid)\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.okay' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i3.ClrIfActive, selector: "[clrIfActive]", inputs: ["clrIfActive"], outputs: ["clrIfActiveChange"] }, { kind: "component", type: i3.ClrTabContent, selector: "clr-tab-content", inputs: ["id"] }, { kind: "component", type: i3.ClrTab, selector: "clr-tab" }, { kind: "component", type: i3.ClrTabs, selector: "clr-tabs", inputs: ["clrLayout"] }, { kind: "directive", type: i3.ClrTabLink, selector: "[clrTabLink]", inputs: ["id", "clrTabLinkInOverflow"] }, { kind: "directive", type: i3.ÇlrTabsWillyWonka, selector: "clr-tabs" }, { kind: "directive", type: i3.ÇlrActiveOompaLoompa, selector: "[clrTabLink], clr-tab-content" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "component", type: i1.AddressFormComponent, selector: "vdr-address-form", inputs: ["customFields", "formGroup", "availableCountries"] }, { kind: "component", type: i1.RadioCardComponent, selector: "vdr-radio-card", inputs: ["item"], exportAs: ["VdrRadioCard"] }, { kind: "component", type: i1.RadioCardFieldsetComponent, selector: "vdr-radio-card-fieldset", inputs: ["selectedItemId", "idFn"], outputs: ["selectItem"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
267
284
  }
268
285
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SelectAddressDialogComponent, decorators: [{
269
286
  type: Component,
@@ -274,11 +291,16 @@ class SelectCustomerDialogComponent {
274
291
  constructor(dataService, formBuilder) {
275
292
  this.dataService = dataService;
276
293
  this.formBuilder = formBuilder;
294
+ // populated by the dialog service
295
+ this.canCreateNew = true;
296
+ this.includeNoteInput = false;
297
+ this.title = marker('order.set-customer-for-order');
277
298
  this.isLoading = false;
278
299
  this.input$ = new Subject();
279
300
  this.selectedCustomer = [];
280
301
  this.useExisting = true;
281
302
  this.createNew = false;
303
+ this.note = '';
282
304
  this.customerForm = this.formBuilder.group({
283
305
  title: '',
284
306
  firstName: ['', Validators.required],
@@ -303,19 +325,19 @@ class SelectCustomerDialogComponent {
303
325
  }
304
326
  select() {
305
327
  if (this.useExisting && this.selectedCustomer.length === 1) {
306
- this.resolveWith(this.selectedCustomer[0]);
328
+ this.resolveWith({ ...this.selectedCustomer[0], note: this.note });
307
329
  }
308
- if (this.createNew && this.customerForm.valid) {
330
+ else if (this.createNew && this.customerForm.valid) {
309
331
  const formValue = this.customerForm.value;
310
- this.resolveWith(formValue);
332
+ this.resolveWith({ ...formValue, note: this.note });
311
333
  }
312
334
  }
313
335
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SelectCustomerDialogComponent, deps: [{ token: i1.DataService }, { token: i2.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
314
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SelectCustomerDialogComponent, selector: "vdr-select-customer-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.set-customer-for-order' | translate }}</ng-template>\r\n\r\n<clr-tabs>\r\n <clr-tab>\r\n <button clrTabLink>{{ 'order.existing-customer' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"useExisting\">\r\n <clr-tab-content>\r\n <div class=\"mt-4\">\r\n <ng-select\r\n [items]=\"customers$ | async\"\r\n appendTo=\"body\"\r\n bindLabel=\"name\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n [hideSelected]=\"true\"\r\n [trackByFn]=\"trackByFn\"\r\n [minTermLength]=\"2\"\r\n [loading]=\"isLoading\"\r\n [typeahead]=\"input$\"\r\n [(ngModel)]=\"selectedCustomer\"\r\n >\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"item-row\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"mx-1\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </span>\r\n </ng-template>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <span class=\"item-row\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"mx-1\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </span>\r\n </ng-template>\r\n </ng-select>\r\n </div>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n <clr-tab>\r\n <button clrTabLink>{{ 'customer.create-new-customer' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"createNew\">\r\n <clr-tab-content>\r\n <form [formGroup]=\"customerForm\">\r\n <vdr-form-field [label]=\"'customer.title' | translate\" for=\"title\">\r\n <input id=\"title\" type=\"text\" formControlName=\"title\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.first-name' | translate\" for=\"firstName\">\r\n <input id=\"firstName\" type=\"text\" formControlName=\"firstName\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.last-name' | translate\" for=\"lastName\">\r\n <input id=\"lastName\" type=\"text\" formControlName=\"lastName\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.email-address' | translate\" for=\"emailAddress\">\r\n <input id=\"emailAddress\" type=\"text\" formControlName=\"emailAddress\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.phone-number' | translate\" for=\"phoneNumber\">\r\n <input id=\"phoneNumber\" type=\"text\" formControlName=\"phoneNumber\" />\r\n </vdr-form-field>\r\n </form>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n</clr-tabs>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"select()\"\r\n [disabled]=\"(useExisting && selectedCustomer.length === 0) || (createNew && customerForm.invalid)\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.okay' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [".item-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i1$1.ClrIfActive, selector: "[clrIfActive]", inputs: ["clrIfActive"], outputs: ["clrIfActiveChange"] }, { kind: "component", type: i1$1.ClrTabContent, selector: "clr-tab-content", inputs: ["id"] }, { kind: "component", type: i1$1.ClrTab, selector: "clr-tab" }, { kind: "component", type: i1$1.ClrTabs, selector: "clr-tabs", inputs: ["clrLayout"] }, { kind: "directive", type: i1$1.ClrTabLink, selector: "[clrTabLink]", inputs: ["id", "clrTabLinkInOverflow"] }, { kind: "directive", type: i1$1.ÇlrTabsWillyWonka, selector: "clr-tabs" }, { kind: "directive", type: i1$1.ÇlrActiveOompaLoompa, selector: "[clrTabLink], clr-tab-content" }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
336
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SelectCustomerDialogComponent, selector: "vdr-select-customer-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ title | translate }}</ng-template>\r\n\r\n<ng-container *ngIf=\"!canCreateNew\">\r\n <ng-container *ngTemplateOutlet=\"customerSelect\"></ng-container>\r\n <vdr-form-field [label]=\"'common.add-note' | translate\" *ngIf=\"includeNoteInput\" class=\"mt-4\">\r\n <textarea [(ngModel)]=\"note\"></textarea>\r\n </vdr-form-field>\r\n</ng-container>\r\n\r\n<clr-tabs *ngIf=\"canCreateNew\" class=\"pt-1\">\r\n <clr-tab>\r\n <button clrTabLink>{{ 'order.existing-customer' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"useExisting\">\r\n <clr-tab-content>\r\n <div class=\"mt-4\">\r\n <ng-container *ngTemplateOutlet=\"customerSelect\"></ng-container>\r\n </div>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n <clr-tab *ngIf=\"canCreateNew\">\r\n <button clrTabLink>{{ 'customer.create-new-customer' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"createNew\">\r\n <clr-tab-content>\r\n <form [formGroup]=\"customerForm\">\r\n <vdr-form-field [label]=\"'customer.title' | translate\" for=\"title\">\r\n <input id=\"title\" type=\"text\" formControlName=\"title\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.first-name' | translate\" for=\"firstName\">\r\n <input id=\"firstName\" type=\"text\" formControlName=\"firstName\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.last-name' | translate\" for=\"lastName\">\r\n <input id=\"lastName\" type=\"text\" formControlName=\"lastName\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.email-address' | translate\" for=\"emailAddress\">\r\n <input id=\"emailAddress\" type=\"text\" formControlName=\"emailAddress\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.phone-number' | translate\" for=\"phoneNumber\">\r\n <input id=\"phoneNumber\" type=\"text\" formControlName=\"phoneNumber\" />\r\n </vdr-form-field>\r\n </form>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n</clr-tabs>\r\n\r\n<ng-template #customerSelect>\r\n <ng-select\r\n [items]=\"customers$ | async\"\r\n appendTo=\"body\"\r\n bindLabel=\"name\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n [hideSelected]=\"true\"\r\n [trackByFn]=\"trackByFn\"\r\n [minTermLength]=\"2\"\r\n [loading]=\"isLoading\"\r\n [typeahead]=\"input$\"\r\n [(ngModel)]=\"selectedCustomer\"\r\n >\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"item-row\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"mx-1\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </span>\r\n </ng-template>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <span class=\"item-row\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"mx-1\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </span>\r\n </ng-template>\r\n </ng-select>\r\n</ng-template>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"select()\"\r\n [disabled]=\"(useExisting && selectedCustomer.length === 0) || (createNew && customerForm.invalid)\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.okay' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [".item-row{display:flex;align-items:center}clr-tabs{display:block}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrIfActive, selector: "[clrIfActive]", inputs: ["clrIfActive"], outputs: ["clrIfActiveChange"] }, { kind: "component", type: i3.ClrTabContent, selector: "clr-tab-content", inputs: ["id"] }, { kind: "component", type: i3.ClrTab, selector: "clr-tab" }, { kind: "component", type: i3.ClrTabs, selector: "clr-tabs", inputs: ["clrLayout"] }, { kind: "directive", type: i3.ClrTabLink, selector: "[clrTabLink]", inputs: ["id", "clrTabLinkInOverflow"] }, { kind: "directive", type: i3.ÇlrTabsWillyWonka, selector: "clr-tabs" }, { kind: "directive", type: i3.ÇlrActiveOompaLoompa, selector: "[clrTabLink], clr-tab-content" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i5.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"], outputs: ["readOnlyToggleChange"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
315
337
  }
316
338
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SelectCustomerDialogComponent, decorators: [{
317
339
  type: Component,
318
- args: [{ selector: 'vdr-select-customer-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.set-customer-for-order' | translate }}</ng-template>\r\n\r\n<clr-tabs>\r\n <clr-tab>\r\n <button clrTabLink>{{ 'order.existing-customer' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"useExisting\">\r\n <clr-tab-content>\r\n <div class=\"mt-4\">\r\n <ng-select\r\n [items]=\"customers$ | async\"\r\n appendTo=\"body\"\r\n bindLabel=\"name\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n [hideSelected]=\"true\"\r\n [trackByFn]=\"trackByFn\"\r\n [minTermLength]=\"2\"\r\n [loading]=\"isLoading\"\r\n [typeahead]=\"input$\"\r\n [(ngModel)]=\"selectedCustomer\"\r\n >\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"item-row\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"mx-1\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </span>\r\n </ng-template>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <span class=\"item-row\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"mx-1\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </span>\r\n </ng-template>\r\n </ng-select>\r\n </div>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n <clr-tab>\r\n <button clrTabLink>{{ 'customer.create-new-customer' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"createNew\">\r\n <clr-tab-content>\r\n <form [formGroup]=\"customerForm\">\r\n <vdr-form-field [label]=\"'customer.title' | translate\" for=\"title\">\r\n <input id=\"title\" type=\"text\" formControlName=\"title\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.first-name' | translate\" for=\"firstName\">\r\n <input id=\"firstName\" type=\"text\" formControlName=\"firstName\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.last-name' | translate\" for=\"lastName\">\r\n <input id=\"lastName\" type=\"text\" formControlName=\"lastName\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.email-address' | translate\" for=\"emailAddress\">\r\n <input id=\"emailAddress\" type=\"text\" formControlName=\"emailAddress\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.phone-number' | translate\" for=\"phoneNumber\">\r\n <input id=\"phoneNumber\" type=\"text\" formControlName=\"phoneNumber\" />\r\n </vdr-form-field>\r\n </form>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n</clr-tabs>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"select()\"\r\n [disabled]=\"(useExisting && selectedCustomer.length === 0) || (createNew && customerForm.invalid)\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.okay' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [".item-row{display:flex;align-items:center}\n"] }]
340
+ args: [{ selector: 'vdr-select-customer-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ title | translate }}</ng-template>\r\n\r\n<ng-container *ngIf=\"!canCreateNew\">\r\n <ng-container *ngTemplateOutlet=\"customerSelect\"></ng-container>\r\n <vdr-form-field [label]=\"'common.add-note' | translate\" *ngIf=\"includeNoteInput\" class=\"mt-4\">\r\n <textarea [(ngModel)]=\"note\"></textarea>\r\n </vdr-form-field>\r\n</ng-container>\r\n\r\n<clr-tabs *ngIf=\"canCreateNew\" class=\"pt-1\">\r\n <clr-tab>\r\n <button clrTabLink>{{ 'order.existing-customer' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"useExisting\">\r\n <clr-tab-content>\r\n <div class=\"mt-4\">\r\n <ng-container *ngTemplateOutlet=\"customerSelect\"></ng-container>\r\n </div>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n <clr-tab *ngIf=\"canCreateNew\">\r\n <button clrTabLink>{{ 'customer.create-new-customer' | translate }}</button>\r\n\r\n <ng-template [(clrIfActive)]=\"createNew\">\r\n <clr-tab-content>\r\n <form [formGroup]=\"customerForm\">\r\n <vdr-form-field [label]=\"'customer.title' | translate\" for=\"title\">\r\n <input id=\"title\" type=\"text\" formControlName=\"title\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.first-name' | translate\" for=\"firstName\">\r\n <input id=\"firstName\" type=\"text\" formControlName=\"firstName\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.last-name' | translate\" for=\"lastName\">\r\n <input id=\"lastName\" type=\"text\" formControlName=\"lastName\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.email-address' | translate\" for=\"emailAddress\">\r\n <input id=\"emailAddress\" type=\"text\" formControlName=\"emailAddress\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'customer.phone-number' | translate\" for=\"phoneNumber\">\r\n <input id=\"phoneNumber\" type=\"text\" formControlName=\"phoneNumber\" />\r\n </vdr-form-field>\r\n </form>\r\n </clr-tab-content>\r\n </ng-template>\r\n </clr-tab>\r\n</clr-tabs>\r\n\r\n<ng-template #customerSelect>\r\n <ng-select\r\n [items]=\"customers$ | async\"\r\n appendTo=\"body\"\r\n bindLabel=\"name\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n [hideSelected]=\"true\"\r\n [trackByFn]=\"trackByFn\"\r\n [minTermLength]=\"2\"\r\n [loading]=\"isLoading\"\r\n [typeahead]=\"input$\"\r\n [(ngModel)]=\"selectedCustomer\"\r\n >\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"item-row\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"mx-1\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </span>\r\n </ng-template>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <span class=\"item-row\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"mx-1\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </span>\r\n </ng-template>\r\n </ng-select>\r\n</ng-template>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"select()\"\r\n [disabled]=\"(useExisting && selectedCustomer.length === 0) || (createNew && customerForm.invalid)\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.okay' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [".item-row{display:flex;align-items:center}clr-tabs{display:block}\n"] }]
319
341
  }], ctorParameters: function () { return [{ type: i1.DataService }, { type: i2.UntypedFormBuilder }]; } });
320
342
 
321
343
  class SelectShippingMethodDialogComponent {
@@ -358,7 +380,7 @@ class OrderStateSelectDialogComponent {
358
380
  this.resolveWith();
359
381
  }
360
382
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderStateSelectDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
361
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderStateSelectDialogComponent, selector: "vdr-order-state-select-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.select-state' | translate }}</ng-template>\r\n<p>{{ message | translate }}</p>\r\n<vdr-form-field>\r\n <select name=\"state\" [(ngModel)]=\"selectedState\">\r\n <option *ngFor=\"let state of nextStates\" [value]=\"state\">\r\n {{ state | stateI18nToken | translate }}\r\n </option>\r\n </select>\r\n</vdr-form-field>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"submit\" *ngIf=\"cancellable\" (click)=\"cancel()\" class=\"btn btn-secondary\">\r\n {{ 'common.cancel' | translate }}\r\n </button>\r\n <button type=\"submit\" (click)=\"select()\" class=\"btn btn-primary\" [disabled]=\"!selectedState\">\r\n {{ 'order.transition-to-state' | translate: { state: (selectedState | stateI18nToken | translate) } }}\r\n </button>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
383
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderStateSelectDialogComponent, selector: "vdr-order-state-select-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.select-state' | translate }}</ng-template>\r\n<p>{{ message | translate }}</p>\r\n<vdr-form-field>\r\n <select name=\"state\" [(ngModel)]=\"selectedState\">\r\n <option *ngFor=\"let state of nextStates\" [value]=\"state\">\r\n {{ state | stateI18nToken | translate }}\r\n </option>\r\n </select>\r\n</vdr-form-field>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"submit\" *ngIf=\"cancellable\" (click)=\"cancel()\" class=\"btn btn-secondary\">\r\n {{ 'common.cancel' | translate }}\r\n </button>\r\n <button type=\"submit\" (click)=\"select()\" class=\"btn btn-primary\" [disabled]=\"!selectedState\">\r\n {{ 'order.transition-to-state' | translate: { state: (selectedState | stateI18nToken | translate) } }}\r\n </button>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"], outputs: ["readOnlyToggleChange"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
362
384
  }
363
385
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderStateSelectDialogComponent, decorators: [{
364
386
  type: Component,
@@ -512,7 +534,7 @@ class OrderCustomFieldsCardComponent {
512
534
  }
513
535
  }
514
536
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderCustomFieldsCardComponent, deps: [{ token: i2.UntypedFormBuilder }, { token: i1.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
515
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderCustomFieldsCardComponent, selector: "vdr-order-custom-fields-card", inputs: { customFieldsConfig: "customFieldsConfig", customFieldValues: "customFieldValues" }, outputs: { updateClick: "updateClick" }, ngImport: i0, template: "<div class=\"card\" *ngIf=\"customFieldsConfig.length\">\r\n <div class=\"card-header\">\r\n {{ 'common.custom-fields' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text custom-field-form\" [class.editable]=\"editable\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Order\"\r\n [customFields]=\"customFieldsConfig\"\r\n [customFieldsFormGroup]=\"customFieldForm\"\r\n [readonly]=\"!editable\"\r\n [compact]=\"true\"\r\n ></vdr-tabbed-custom-fields>\r\n </div>\r\n </div>\r\n <div class=\"card-footer\">\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"editable = true\" *ngIf=\"!editable\">\r\n <clr-icon shape=\"pencil\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <button\r\n class=\"btn btn-sm btn-primary\"\r\n (click)=\"onUpdateClick()\"\r\n *ngIf=\"editable\"\r\n [disabled]=\"customFieldForm.pristine || customFieldForm.invalid\"\r\n >\r\n <clr-icon shape=\"check\"></clr-icon>\r\n {{ 'common.update' | translate }}\r\n </button>\r\n <button\r\n class=\"btn btn-sm btn-secondary\"\r\n (click)=\"onCancelClick()\"\r\n *ngIf=\"editable\"\r\n >\r\n <clr-icon shape=\"times\"></clr-icon>\r\n {{ 'common.cancel' | translate }}\r\n </button>\r\n </div>\r\n</div>\r\n", styles: ["vdr-custom-field-control{margin-bottom:6px;display:block}.custom-field-form ::ng-deep .clr-control-label{color:var(--color-grey-400)}.custom-field-form.editable ::ng-deep .clr-control-label{color:inherit}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
537
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderCustomFieldsCardComponent, selector: "vdr-order-custom-fields-card", inputs: { customFieldsConfig: "customFieldsConfig", customFieldValues: "customFieldValues" }, outputs: { updateClick: "updateClick" }, ngImport: i0, template: "<div class=\"card\" *ngIf=\"customFieldsConfig.length\">\r\n <div class=\"card-header\">\r\n {{ 'common.custom-fields' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text custom-field-form\" [class.editable]=\"editable\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Order\"\r\n [customFields]=\"customFieldsConfig\"\r\n [customFieldsFormGroup]=\"customFieldForm\"\r\n [readonly]=\"!editable\"\r\n [compact]=\"true\"\r\n ></vdr-tabbed-custom-fields>\r\n </div>\r\n </div>\r\n <div class=\"card-footer\">\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"editable = true\" *ngIf=\"!editable\">\r\n <clr-icon shape=\"pencil\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <button\r\n class=\"btn btn-sm btn-primary\"\r\n (click)=\"onUpdateClick()\"\r\n *ngIf=\"editable\"\r\n [disabled]=\"customFieldForm.pristine || customFieldForm.invalid\"\r\n >\r\n <clr-icon shape=\"check\"></clr-icon>\r\n {{ 'common.update' | translate }}\r\n </button>\r\n <button\r\n class=\"btn btn-sm btn-secondary\"\r\n (click)=\"onCancelClick()\"\r\n *ngIf=\"editable\"\r\n >\r\n <clr-icon shape=\"times\"></clr-icon>\r\n {{ 'common.cancel' | translate }}\r\n </button>\r\n </div>\r\n</div>\r\n", styles: ["vdr-custom-field-control{margin-bottom:6px;display:block}.custom-field-form ::ng-deep .clr-control-label{color:var(--color-grey-400)}.custom-field-form.editable ::ng-deep .clr-control-label{color:inherit}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
516
538
  }
517
539
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderCustomFieldsCardComponent, decorators: [{
518
540
  type: Component,
@@ -567,7 +589,7 @@ class LineFulfillmentComponent {
567
589
  .filter(notNullOrUndefined) ?? []);
568
590
  }
569
591
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: LineFulfillmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
570
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: { line: "line", allOrderFulfillments: "allOrderFulfillments", orderState: "orderState" }, usesOnChanges: true, ngImport: i0, template: "<vdr-dropdown class=\"search-settings-menu\" *ngIf=\"fulfilledCount || orderState === 'PartiallyDelivered'\">\r\n <button type=\"button\" class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon *ngIf=\"fulfillmentStatus === 'full'\" class=\"item-fulfilled\" shape=\"check-circle\"></clr-icon>\r\n <clr-icon\r\n *ngIf=\"fulfillmentStatus === 'partial'\"\r\n class=\"item-partially-fulfilled\"\r\n shape=\"check-circle\"\r\n ></clr-icon>\r\n <clr-icon\r\n *ngIf=\"fulfillmentStatus === 'none'\"\r\n class=\"item-not-fulfilled\"\r\n shape=\"exclamation-circle\"\r\n ></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <label class=\"dropdown-header\" *ngIf=\"fulfillmentStatus === 'full'\">\r\n {{ 'order.line-fulfillment-all' | translate }}\r\n </label>\r\n <label class=\"dropdown-header\" *ngIf=\"fulfillmentStatus === 'partial'\">\r\n {{\r\n 'order.line-fulfillment-partial' | translate: { total: line.quantity, count: fulfilledCount }\r\n }}\r\n </label>\r\n <label class=\"dropdown-header\" *ngIf=\"fulfillmentStatus === 'none'\">\r\n {{ 'order.line-fulfillment-none' | translate }}\r\n </label>\r\n <div class=\"fulfillment-detail\" *ngFor=\"let item of fulfillments\">\r\n <div class=\"fulfillment-title\">\r\n {{ 'order.fulfillment' | translate }} #{{ item.fulfillment.id }} ({{\r\n 'order.item-count' | translate: { count: item.count }\r\n }})\r\n </div>\r\n <vdr-labeled-data [label]=\"'common.created-at' | translate\">\r\n {{ item.fulfillment.createdAt | localeDate: 'medium' }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.fulfillment-method' | translate\">\r\n {{ item.fulfillment.method }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data\r\n *ngIf=\"item.fulfillment.trackingCode\"\r\n [label]=\"'order.tracking-code' | translate\"\r\n >\r\n {{ item.fulfillment.trackingCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n </vdr-dropdown-menu>\r\n</vdr-dropdown>\r\n", styles: [".item-fulfilled{color:var(--color-success-700)}.item-partially-fulfilled{color:var(--color-warning-700)}.item-not-fulfilled{color:var(--color-error-700)}.fulfillment-detail{margin:6px 12px}.fulfillment-detail:not(:last-of-type){border-bottom:1px dashed var(--color-component-border-200)}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i1$1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
592
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: { line: "line", allOrderFulfillments: "allOrderFulfillments", orderState: "orderState" }, usesOnChanges: true, ngImport: i0, template: "<vdr-dropdown class=\"search-settings-menu\" *ngIf=\"fulfilledCount || orderState === 'PartiallyDelivered'\">\r\n <button type=\"button\" class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon *ngIf=\"fulfillmentStatus === 'full'\" class=\"item-fulfilled\" shape=\"check-circle\"></clr-icon>\r\n <clr-icon\r\n *ngIf=\"fulfillmentStatus === 'partial'\"\r\n class=\"item-partially-fulfilled\"\r\n shape=\"check-circle\"\r\n ></clr-icon>\r\n <clr-icon\r\n *ngIf=\"fulfillmentStatus === 'none'\"\r\n class=\"item-not-fulfilled\"\r\n shape=\"exclamation-circle\"\r\n ></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <label class=\"dropdown-header\" *ngIf=\"fulfillmentStatus === 'full'\">\r\n {{ 'order.line-fulfillment-all' | translate }}\r\n </label>\r\n <label class=\"dropdown-header\" *ngIf=\"fulfillmentStatus === 'partial'\">\r\n {{\r\n 'order.line-fulfillment-partial' | translate: { total: line.quantity, count: fulfilledCount }\r\n }}\r\n </label>\r\n <label class=\"dropdown-header\" *ngIf=\"fulfillmentStatus === 'none'\">\r\n {{ 'order.line-fulfillment-none' | translate }}\r\n </label>\r\n <div class=\"fulfillment-detail\" *ngFor=\"let item of fulfillments\">\r\n <div class=\"fulfillment-title\">\r\n {{ 'order.fulfillment' | translate }} #{{ item.fulfillment.id }} ({{\r\n 'order.item-count' | translate: { count: item.count }\r\n }})\r\n </div>\r\n <vdr-labeled-data [label]=\"'common.created-at' | translate\">\r\n {{ item.fulfillment.createdAt | localeDate: 'medium' }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.fulfillment-method' | translate\">\r\n {{ item.fulfillment.method }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data\r\n *ngIf=\"item.fulfillment.trackingCode\"\r\n [label]=\"'order.tracking-code' | translate\"\r\n >\r\n {{ item.fulfillment.trackingCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n </vdr-dropdown-menu>\r\n</vdr-dropdown>\r\n", styles: [".item-fulfilled{color:var(--color-success-700)}.item-partially-fulfilled{color:var(--color-warning-700)}.item-not-fulfilled{color:var(--color-error-700)}.fulfillment-detail{margin:6px 12px}.fulfillment-detail:not(:last-of-type){border-bottom:1px dashed var(--color-component-border-200)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
571
593
  }
572
594
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: LineFulfillmentComponent, decorators: [{
573
595
  type: Component,
@@ -591,7 +613,7 @@ class LineRefundsComponent {
591
613
  .reduce((sum, i) => sum + i.quantity, 0);
592
614
  }
593
615
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: LineRefundsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
594
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: { line: "line", payments: "payments" }, ngImport: i0, template: "<span *ngIf=\"getRefundedCount()\" [title]=\"'order.refunded-count' | translate: { count: getRefundedCount() }\">\r\n <clr-icon shape=\"redo\" class=\"is-solid\" dir=\"down\"></clr-icon>\r\n</span>\r\n", styles: [":host{color:var(--color-error-500)}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
616
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: { line: "line", payments: "payments" }, ngImport: i0, template: "<span *ngIf=\"getRefundedCount()\" [title]=\"'order.refunded-count' | translate: { count: getRefundedCount() }\">\r\n <clr-icon shape=\"redo\" class=\"is-solid\" dir=\"down\"></clr-icon>\r\n</span>\r\n", styles: [":host{color:var(--color-error-500)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
595
617
  }
596
618
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: LineRefundsComponent, decorators: [{
597
619
  type: Component,
@@ -656,7 +678,7 @@ class OrderDataTableComponent extends DataTable2Component {
656
678
  }
657
679
  }
658
680
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderDataTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
659
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderDataTableComponent, selector: "vdr-order-data-table", inputs: { order: "order" }, queries: [{ propertyName: "totalColumns", predicate: OrderTotalColumnComponent }], usesInheritance: true, ngImport: i0, template: "<div class=\"bulk-actions\">\r\n <ng-content select=\"vdr-bulk-action-menu\"></ng-content>\r\n</div>\r\n<div class=\"table-wrapper\">\r\n <table\r\n class=\"\"\r\n [class.no-select]=\"disableSelect\"\r\n >\r\n <thead [class.items-selected]=\"selectionManager?.selection.length\">\r\n <tr class=\"heading-row\">\r\n <th *ngIf=\"selectionManager\" class=\"selection-col\">\r\n <input\r\n type=\"checkbox\"\r\n clrCheckbox\r\n [checked]=\"selectionManager?.areAllCurrentItemsSelected()\"\r\n (change)=\"onToggleAllClick()\"\r\n />\r\n </th>\r\n <th\r\n *ngFor=\"let column of visibleSortedColumns; last as isLast\"\r\n [class.expand]=\"column.expand\"\r\n >\r\n <div class=\"cell-content\" [ngClass]=\"column.align\">\r\n <vdr-ui-extension-point\r\n [locationId]=\"id\"\r\n [metadata]=\"column.id\"\r\n api=\"dataTable\"\r\n [topPx]=\"-6\"\r\n [leftPx]=\"-24\"\r\n display=\"block\"\r\n >\r\n <span>{{ column.heading }}</span>\r\n </vdr-ui-extension-point>\r\n <div *ngIf=\"column.sort as sort\" class=\"sort-toggle\">\r\n <button (click)=\"sort.toggleSortOrder()\" [class.active]=\"sort.sortOrder\">\r\n <clr-icon *ngIf=\"!sort.sortOrder\" shape=\"two-way-arrows left\"></clr-icon>\r\n <clr-icon *ngIf=\"sort.sortOrder === 'ASC'\" shape=\"arrow up\"></clr-icon>\r\n <clr-icon *ngIf=\"sort.sortOrder === 'DESC'\" shape=\"arrow down\"></clr-icon>\r\n </button>\r\n <div class=\"sort-label\" *ngIf=\"sort.sortOrder\">{{ sort.sortOrder }}</div>\r\n </div>\r\n </div>\r\n </th>\r\n <th>\r\n <div class=\"column-picker\">\r\n <vdr-data-table-colum-picker\r\n [uiLanguage]=\"uiLanguage$ | async\"\r\n [columns]=\"sortedColumns\"\r\n (reorder)=\"onColumnReorder($event)\"\r\n (resetColumns)=\"onColumnsReset()\"\r\n ></vdr-data-table-colum-picker>\r\n </div>\r\n </th>\r\n </tr>\r\n <tr *ngIf=\"searchComponent || customSearchTemplate || filters?.length\">\r\n <th\r\n [attr.colspan]=\"visibleSortedColumns.length + (selectionManager ? 2 : 1)\"\r\n class=\"filter-row\"\r\n [class.active]=\"showSearchFilterRow\"\r\n >\r\n <button\r\n class=\"button-ghost toggle-search-filter-row\"\r\n [class.active]=\"showSearchFilterRow\"\r\n (click)=\"toggleSearchFilterRow()\"\r\n [title]=\"'common.search-and-filter-list' | translate\"\r\n >\r\n <clr-icon shape=\"search\"></clr-icon>\r\n </button>\r\n <div class=\"filter-row-wrapper\" [class.hidden]=\"!showSearchFilterRow\">\r\n <ng-container *ngTemplateOutlet=\"searchComponent?.template\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"customSearchTemplate\"></ng-container>\r\n <ng-container *ngIf=\"filters\">\r\n <div class=\"filters\">\r\n <vdr-data-table-filters\r\n *ngFor=\"let activeFilter of filters.activeFilters\"\r\n [filterWithValue]=\"activeFilter\"\r\n [filters]=\"filters\"\r\n class=\"mt-1\"\r\n ></vdr-data-table-filters>\r\n <vdr-data-table-filters\r\n *ngIf=\"filters.length\"\r\n [filters]=\"filters\"\r\n class=\"mt-1\"\r\n ></vdr-data-table-filters>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n *ngFor=\"\r\n let item of items\r\n | paginate\r\n : {\r\n id: id,\r\n itemsPerPage: itemsPerPage,\r\n currentPage: currentPage,\r\n totalItems: totalItems\r\n };\r\n index as i;\r\n trackBy: trackByFn\r\n \"\r\n >\r\n <td *ngIf=\"selectionManager\" class=\"selection-col\" [class.active]=\"activeIndex === i\">\r\n <input\r\n type=\"checkbox\"\r\n clrCheckbox\r\n [checked]=\"selectionManager?.isSelected(item)\"\r\n (click)=\"onRowClick(item, $event)\"\r\n />\r\n </td>\r\n <td *ngFor=\"let column of visibleSortedColumns\" [class.active]=\"activeIndex === i\">\r\n <div class=\"cell-content\" [ngClass]=\"column.align\">\r\n <ng-container\r\n *ngIf=\"customComponents.get(column.id) as componentConfig; else defaultComponent\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"\r\n componentConfig.config.component;\r\n inputs: { rowItem: item };\r\n injector: componentConfig.injector\r\n \"\r\n ></ng-container>\r\n </ng-container>\r\n <ng-template #defaultComponent>\r\n <ng-container\r\n *ngTemplateOutlet=\"column.template; context: { item: item, index: i }\"\r\n ></ng-container>\r\n </ng-template>\r\n </div>\r\n </td>\r\n <td [class.active]=\"activeIndex === i\"><!-- column select --></td>\r\n </tr>\r\n <ng-container>\r\n <tr *ngIf=\"!items?.length\">\r\n <td [attr.colspan]=\"visibleSortedColumns.length + (selectionManager ? 2 : 1)\">\r\n <vdr-empty-placeholder [emptyStateLabel]=\"'order.order-is-empty' | translate\"></vdr-empty-placeholder>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <tr class=\"surcharge\" *ngFor=\"let surcharge of order.surcharges\">\r\n <td class=\"align-middle name left\" colspan=\"2\">{{ surcharge.description }}</td>\r\n <td class=\"align-middle sku\">{{ surcharge.sku }}</td>\r\n <td class=\"align-middle\" [attr.colspan]=\"visibleSortedColumns.length - 4\"></td>\r\n <td class=\"align-middle total\">\r\n {{ surcharge.priceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ surcharge.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n <ng-container *ngFor=\"let discount of order.discounts\">\r\n <tr class=\"order-adjustment\" *ngIf=\"discount.type !== 'OTHER'\">\r\n <td [attr.colspan]=\"visibleSortedColumns.length - 1\" class=\"\">\r\n <a [routerLink]=\"getPromotionLink(discount)\">{{ discount.description }}</a>\r\n <vdr-chip *ngIf=\"getCouponCodeForAdjustment(order, discount) as couponCode\">{{\r\n couponCode\r\n }}</vdr-chip>\r\n </td>\r\n <td class=\"\">\r\n {{ discount.amountWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n </ng-container>\r\n <tr class=\"sub-total\">\r\n <td class=\"\">{{ 'order.sub-total' | translate }}</td>\r\n <td [attr.colspan]=\"visibleSortedColumns.length - 2\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.subTotalWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.subTotal | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n <tr class=\"shipping\">\r\n <td class=\"\">{{ 'order.shipping' | translate }}</td>\r\n <td [attr.colspan]=\"visibleSortedColumns.length - 2\">\r\n <vdr-chip *ngFor=\"let shippingLine of order.shippingLines\" class=\"shipping-method-name\">\r\n {{ shippingLine.shippingMethod.name }}\r\n </vdr-chip>\r\n </td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.shippingWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.shipping | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n <tr class=\"total\">\r\n <td class=\"\">{{ 'order.total' | translate }}</td>\r\n <td [attr.colspan]=\"visibleSortedColumns.length - 2\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.totalWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.total | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n", styles: [":host{display:block;max-width:100%;position:relative;margin-bottom:calc(var(--space-unit) * 4);container-type:inline-size}th{border-bottom:1px solid var(--color-table-header-border);font-size:var(--font-size-xs);font-weight:600;text-transform:uppercase;position:relative;white-space:nowrap}th,td{padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 1)}tr td:first-of-type,tr th:first-of-type{text-align:center}@media screen and (min-width: 992px){tr td:first-of-type,tr th:first-of-type{padding-inline-start:var(--surface-margin-left);text-align:start}}th:last-of-type,td:last-of-type{border-inline-end:1px solid var(--color-table-header-border)}tr:first-of-type th:last-of-type{border-image:linear-gradient(0deg,var(--color-table-header-border),transparent) 1}tr:last-of-type td:last-of-type{border-image:linear-gradient(180deg,var(--color-table-header-border),transparent) 1}tbody td{border-bottom:1px solid var(--color-table-row-separator)}tbody tr:hover{background-color:var(--color-table-row-hover-bg)}.bulk-actions{margin-inline-start:calc(var(--space-unit) * 5);background-color:var(--color-surface-bg);z-index:10;display:flex;position:absolute;top:5px;height:40px}@media screen and (min-width: 992px){.bulk-actions{margin-inline-start:calc(var(--space-unit) * 8.5)}}@media screen and (min-width: 1280px){.bulk-actions{margin-inline-start:calc(var(--space-unit) * 10.5)}}.table-wrapper{display:block;overflow-y:hidden;overflow-x:auto;position:relative;width:100%;max-width:var(--surface-width)}table{width:100%}table.no-select{-webkit-user-select:none;user-select:none}.column-picker{width:24px}.sort-toggle{display:flex;align-items:center;margin-inline-start:calc(var(--space-unit) * .5)}.sort-toggle button{border:0;border-radius:var(--border-radius-lg);color:var(--color-weight-500);padding:0 2px;cursor:pointer;background-color:transparent}.sort-toggle button.active{color:var(--color-primary-700)}.sort-toggle .sort-label{margin-inline-start:calc(var(--space-unit) * .5);font-size:10px;color:var(--color-primary-600);font-weight:400}.toggle-search-filter-row{position:absolute;top:-12px;left:4px}@media screen and (min-width: 1280px){.toggle-search-filter-row{left:8px}}.toggle-search-filter-row.active{background-color:var(--color-primary-700);color:var(--color-primary-100);border-color:var(--color-primary-700)}th.filter-row{position:relative;font-size:var(--font-size-base);font-weight:400;background-color:var(--color-weight-100);box-shadow:var(--data-table-filter-box-shadow);border-left-width:0;border-right-width:0;text-align:initial;padding:0}th.filter-row input{width:100%}th.filter-row.active{border-bottom:1px solid var(--color-table-header-border)}th.filter-row .filters{margin-top:calc(var(--space-unit) * 1);display:flex;flex-wrap:wrap;gap:calc(var(--space-unit) * .5)}.filter-row-wrapper{padding:calc(var(--space-unit) * 4);padding-inline-start:0;max-height:150px;transition:max-height .2s,padding .2s,opacity .2s}.filter-row-wrapper.hidden{max-height:0px;padding-top:0;padding-bottom:0;overflow:hidden;opacity:0}.cell-link{display:block;width:100%;height:100%}td.active{background-color:var(--color-table-row-active-bg)}.cell-content{display:flex;align-items:center;line-height:var(--font-size-sm);color:var(--color-weight-700)}.cell-content.left{justify-content:flex-start}.cell-content.center{justify-content:center}.cell-content.right{justify-content:flex-end}.selection-col{width:calc(var(--space-unit) * 8)}vdr-empty-placeholder{width:100%}.table-footer{display:flex;align-items:baseline;justify-content:space-between;margin-top:var(--space-unit);margin-inline-start:var(--surface-margin-left);margin-inline-end:var(--space-unit)}.total-items-count{font-size:var(--font-size-xs)}@container (max-width: 500px){.total-items-count{display:none}}\n", ":host .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}:host .sub-total td{border-top:1px dashed var(--color-component-border-200)}:host .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}:host td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}:host img{border-radius:var(--border-radius-img)}:host .order-line-custom-fields{display:flex;flex-wrap:wrap}:host .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}:host .draft-qty{max-width:48px}:host .order-line-custom-field{background-color:var(--color-component-bg-100)}:host .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}:host .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}:host .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}:host .thumb img{width:50px;height:50px}:host .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}:host .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrDatagridItemsTrackBy, selector: "[ngForTrackBy]", inputs: ["ngForTrackBy"] }, { kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i1$1.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "component", type: i1.EmptyPlaceholderComponent, selector: "vdr-empty-placeholder", inputs: ["emptyStateLabel"] }, { kind: "component", type: i1.UiExtensionPointComponent, selector: "vdr-ui-extension-point", inputs: ["locationId", "metadata", "topPx", "leftPx", "display", "api"] }, { kind: "component", type: i1.DataTableFiltersComponent, selector: "vdr-data-table-filters", inputs: ["filters", "filterWithValue"] }, { kind: "component", type: i1.DataTableColumnPickerComponent, selector: "vdr-data-table-colum-picker", inputs: ["columns", "uiLanguage"], outputs: ["reorder", "resetColumns"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.PaginatePipe, name: "paginate" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
681
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderDataTableComponent, selector: "vdr-order-data-table", inputs: { order: "order" }, queries: [{ propertyName: "totalColumns", predicate: OrderTotalColumnComponent }], usesInheritance: true, ngImport: i0, template: "<div class=\"bulk-actions\">\r\n <ng-content select=\"vdr-bulk-action-menu\"></ng-content>\r\n</div>\r\n<div class=\"table-wrapper\">\r\n <table\r\n class=\"\"\r\n [class.no-select]=\"disableSelect\"\r\n >\r\n <thead [class.items-selected]=\"selectionManager?.selection.length\">\r\n <tr class=\"heading-row\">\r\n <th *ngIf=\"selectionManager\" class=\"selection-col\">\r\n <input\r\n type=\"checkbox\"\r\n clrCheckbox\r\n [checked]=\"selectionManager?.areAllCurrentItemsSelected()\"\r\n (change)=\"onToggleAllClick()\"\r\n />\r\n </th>\r\n <th\r\n *ngFor=\"let column of visibleSortedColumns; last as isLast\"\r\n [class.expand]=\"column.expand\"\r\n >\r\n <div class=\"cell-content\" [ngClass]=\"column.align\">\r\n <vdr-ui-extension-point\r\n [locationId]=\"id\"\r\n [metadata]=\"column.id\"\r\n api=\"dataTable\"\r\n [topPx]=\"-6\"\r\n [leftPx]=\"-24\"\r\n display=\"block\"\r\n >\r\n <span>{{ column.heading }}</span>\r\n </vdr-ui-extension-point>\r\n <div *ngIf=\"column.sort as sort\" class=\"sort-toggle\">\r\n <button (click)=\"sort.toggleSortOrder()\" [class.active]=\"sort.sortOrder\">\r\n <clr-icon *ngIf=\"!sort.sortOrder\" shape=\"two-way-arrows left\"></clr-icon>\r\n <clr-icon *ngIf=\"sort.sortOrder === 'ASC'\" shape=\"arrow up\"></clr-icon>\r\n <clr-icon *ngIf=\"sort.sortOrder === 'DESC'\" shape=\"arrow down\"></clr-icon>\r\n </button>\r\n <div class=\"sort-label\" *ngIf=\"sort.sortOrder\">{{ sort.sortOrder }}</div>\r\n </div>\r\n </div>\r\n </th>\r\n <th>\r\n <div class=\"column-picker\">\r\n <vdr-data-table-colum-picker\r\n [uiLanguage]=\"uiLanguage$ | async\"\r\n [columns]=\"sortedColumns\"\r\n (reorder)=\"onColumnReorder($event)\"\r\n (resetColumns)=\"onColumnsReset()\"\r\n ></vdr-data-table-colum-picker>\r\n </div>\r\n </th>\r\n </tr>\r\n <tr *ngIf=\"searchComponent || customSearchTemplate || filters?.length\">\r\n <th\r\n [attr.colspan]=\"visibleSortedColumns.length + (selectionManager ? 2 : 1)\"\r\n class=\"filter-row\"\r\n [class.active]=\"showSearchFilterRow\"\r\n >\r\n <button\r\n class=\"button-ghost toggle-search-filter-row\"\r\n [class.active]=\"showSearchFilterRow\"\r\n (click)=\"toggleSearchFilterRow()\"\r\n [title]=\"'common.search-and-filter-list' | translate\"\r\n >\r\n <clr-icon shape=\"search\"></clr-icon>\r\n </button>\r\n <div class=\"filter-row-wrapper\" [class.hidden]=\"!showSearchFilterRow\">\r\n <ng-container *ngTemplateOutlet=\"searchComponent?.template\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"customSearchTemplate\"></ng-container>\r\n <ng-container *ngIf=\"filters\">\r\n <div class=\"filters\">\r\n <vdr-data-table-filters\r\n *ngFor=\"let activeFilter of filters.activeFilters\"\r\n [filterWithValue]=\"activeFilter\"\r\n [filters]=\"filters\"\r\n class=\"mt-1\"\r\n ></vdr-data-table-filters>\r\n <vdr-data-table-filters\r\n *ngIf=\"filters.length\"\r\n [filters]=\"filters\"\r\n class=\"mt-1\"\r\n ></vdr-data-table-filters>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n *ngFor=\"\r\n let item of items\r\n | paginate\r\n : {\r\n id: id,\r\n itemsPerPage: itemsPerPage,\r\n currentPage: currentPage,\r\n totalItems: totalItems\r\n };\r\n index as i;\r\n trackBy: trackByFn\r\n \"\r\n >\r\n <td *ngIf=\"selectionManager\" class=\"selection-col\" [class.active]=\"activeIndex === i\">\r\n <input\r\n type=\"checkbox\"\r\n clrCheckbox\r\n [checked]=\"selectionManager?.isSelected(item)\"\r\n (click)=\"onRowClick(item, $event)\"\r\n />\r\n </td>\r\n <td *ngFor=\"let column of visibleSortedColumns\" [class.active]=\"activeIndex === i\">\r\n <div class=\"cell-content\" [ngClass]=\"column.align\">\r\n <ng-container\r\n *ngIf=\"customComponents.get(column.id) as componentConfig; else defaultComponent\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"\r\n componentConfig.config.component;\r\n inputs: { rowItem: item };\r\n injector: componentConfig.injector\r\n \"\r\n ></ng-container>\r\n </ng-container>\r\n <ng-template #defaultComponent>\r\n <ng-container\r\n *ngTemplateOutlet=\"column.template; context: { item: item, index: i }\"\r\n ></ng-container>\r\n </ng-template>\r\n </div>\r\n </td>\r\n <td [class.active]=\"activeIndex === i\"><!-- column select --></td>\r\n </tr>\r\n <ng-container>\r\n <tr *ngIf=\"!items?.length\">\r\n <td [attr.colspan]=\"visibleSortedColumns.length + (selectionManager ? 2 : 1)\">\r\n <vdr-empty-placeholder [emptyStateLabel]=\"'order.order-is-empty' | translate\"></vdr-empty-placeholder>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <tr class=\"surcharge\" *ngFor=\"let surcharge of order.surcharges\">\r\n <td class=\"align-middle name left\" colspan=\"2\">{{ surcharge.description }}</td>\r\n <td class=\"align-middle sku\">{{ surcharge.sku }}</td>\r\n <td class=\"align-middle\" [attr.colspan]=\"visibleSortedColumns.length - 4\"></td>\r\n <td class=\"align-middle total\">\r\n {{ surcharge.priceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ surcharge.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n <ng-container *ngFor=\"let discount of order.discounts\">\r\n <tr class=\"order-adjustment\" *ngIf=\"discount.type !== 'OTHER'\">\r\n <td [attr.colspan]=\"visibleSortedColumns.length - 1\" class=\"\">\r\n <a [routerLink]=\"getPromotionLink(discount)\">{{ discount.description }}</a>\r\n <vdr-chip *ngIf=\"getCouponCodeForAdjustment(order, discount) as couponCode\">{{\r\n couponCode\r\n }}</vdr-chip>\r\n </td>\r\n <td class=\"\">\r\n {{ discount.amountWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n </ng-container>\r\n <tr class=\"sub-total\">\r\n <td class=\"\">{{ 'order.sub-total' | translate }}</td>\r\n <td [attr.colspan]=\"visibleSortedColumns.length - 2\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.subTotalWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.subTotal | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n <tr class=\"shipping\">\r\n <td class=\"\">{{ 'order.shipping' | translate }}</td>\r\n <td [attr.colspan]=\"visibleSortedColumns.length - 2\">\r\n <vdr-chip *ngFor=\"let shippingLine of order.shippingLines\" class=\"shipping-method-name\">\r\n {{ shippingLine.shippingMethod.name }}\r\n </vdr-chip>\r\n </td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.shippingWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.shipping | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n <tr class=\"total\">\r\n <td class=\"\">{{ 'order.total' | translate }}</td>\r\n <td [attr.colspan]=\"visibleSortedColumns.length - 2\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.totalWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.total | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td><!-- column select --></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n", styles: [":host{display:block;max-width:100%;position:relative;margin-bottom:calc(var(--space-unit) * 4);container-type:inline-size}th{border-bottom:1px solid var(--color-table-header-border);font-size:var(--font-size-xs);font-weight:600;text-transform:uppercase;position:relative;white-space:nowrap}th,td{padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 1)}tr td:first-of-type,tr th:first-of-type{text-align:center}@media screen and (min-width: 992px){tr td:first-of-type,tr th:first-of-type{padding-inline-start:var(--surface-margin-left);text-align:start}}th:last-of-type,td:last-of-type{border-inline-end:1px solid var(--color-table-header-border)}tr:first-of-type th:last-of-type{border-image:linear-gradient(0deg,var(--color-table-header-border),transparent) 1}tr:last-of-type td:last-of-type{border-image:linear-gradient(180deg,var(--color-table-header-border),transparent) 1}tbody td{border-bottom:1px solid var(--color-table-row-separator)}tbody tr:hover{background-color:var(--color-table-row-hover-bg)}.bulk-actions{margin-inline-start:calc(var(--space-unit) * 5);background-color:var(--color-surface-bg);z-index:10;display:flex;position:absolute;top:5px;height:40px}@media screen and (min-width: 992px){.bulk-actions{margin-inline-start:calc(var(--space-unit) * 8.5)}}@media screen and (min-width: 1280px){.bulk-actions{margin-inline-start:calc(var(--space-unit) * 10.5)}}.table-wrapper{display:block;overflow-y:hidden;overflow-x:auto;position:relative;width:100%;max-width:var(--surface-width)}table{width:100%}table.no-select{-webkit-user-select:none;user-select:none}.column-picker{width:24px}.sort-toggle{display:flex;align-items:center;margin-inline-start:calc(var(--space-unit) * .5)}.sort-toggle button{border:0;border-radius:var(--border-radius-lg);color:var(--color-weight-500);padding:0 2px;cursor:pointer;background-color:transparent}.sort-toggle button.active{color:var(--color-primary-700)}.sort-toggle .sort-label{margin-inline-start:calc(var(--space-unit) * .5);font-size:10px;color:var(--color-primary-600);font-weight:400}.toggle-search-filter-row{position:absolute;top:-12px;left:4px}@media screen and (min-width: 1280px){.toggle-search-filter-row{left:8px}}.toggle-search-filter-row.active{background-color:var(--color-primary-700);color:var(--color-primary-100);border-color:var(--color-primary-700)}th.filter-row{position:relative;font-size:var(--font-size-base);font-weight:400;background-color:var(--color-weight-100);box-shadow:var(--data-table-filter-box-shadow);border-left-width:0;border-right-width:0;text-align:initial;padding:0}th.filter-row input{width:100%}th.filter-row.active{border-bottom:1px solid var(--color-table-header-border)}th.filter-row .filters{margin-top:calc(var(--space-unit) * 1);display:flex;flex-wrap:wrap;gap:calc(var(--space-unit) * .5)}.filter-row-wrapper{padding:calc(var(--space-unit) * 4);padding-inline-start:0;max-height:150px;transition:max-height .2s,padding .2s,opacity .2s}.filter-row-wrapper.hidden{max-height:0px;padding-top:0;padding-bottom:0;overflow:hidden;opacity:0}.cell-link{display:block;width:100%;height:100%}td.active{background-color:var(--color-table-row-active-bg)}.cell-content{display:flex;align-items:center;line-height:var(--font-size-sm);color:var(--color-weight-700)}.cell-content.left{justify-content:flex-start}.cell-content.center{justify-content:center}.cell-content.right{justify-content:flex-end}.selection-col{width:calc(var(--space-unit) * 8)}vdr-empty-placeholder{width:100%}.table-footer{display:flex;align-items:baseline;justify-content:space-between;margin-top:var(--space-unit);margin-inline-start:var(--surface-margin-left);margin-inline-end:var(--space-unit)}.total-items-count{font-size:var(--font-size-xs)}@container (max-width: 500px){.total-items-count{display:none}}\n", ":host .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}:host .sub-total td{border-top:1px dashed var(--color-component-border-200)}:host .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}:host td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}:host img{border-radius:var(--border-radius-img)}:host .order-line-custom-fields{display:flex;flex-wrap:wrap}:host .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}:host .draft-qty{max-width:48px}:host .order-line-custom-field{background-color:var(--color-component-bg-100)}:host .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}:host .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}:host .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}:host .thumb img{width:50px;height:50px}:host .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}:host .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}\n"], dependencies: [{ kind: "directive", type: i3.ClrDatagridItemsTrackBy, selector: "[ngForTrackBy]", inputs: ["ngForTrackBy"] }, { kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "component", type: i1.EmptyPlaceholderComponent, selector: "vdr-empty-placeholder", inputs: ["emptyStateLabel"] }, { kind: "component", type: i1.UiExtensionPointComponent, selector: "vdr-ui-extension-point", inputs: ["locationId", "metadata", "topPx", "leftPx", "display", "api"] }, { kind: "component", type: i1.DataTableFiltersComponent, selector: "vdr-data-table-filters", inputs: ["filters", "filterWithValue"] }, { kind: "component", type: i1.DataTableColumnPickerComponent, selector: "vdr-data-table-colum-picker", inputs: ["columns", "uiLanguage"], outputs: ["reorder", "resetColumns"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5$1.PaginatePipe, name: "paginate" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
660
682
  }
661
683
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderDataTableComponent, decorators: [{
662
684
  type: Component,
@@ -734,11 +756,11 @@ class OrderTableComponent {
734
756
  }
735
757
  }
736
758
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
737
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderTableComponent, selector: "vdr-order-table", inputs: { order: "order", orderLineCustomFields: "orderLineCustomFields", isDraft: "isDraft" }, outputs: { adjust: "adjust", remove: "remove" }, ngImport: i0, template: "<vdr-order-data-table id=\"order-detail-list\" [items]=\"order.lines\" [order]=\"order\">\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"line.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.product-name' | translate\" id=\"product-name\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.name }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.product-sku' | translate\" id=\"product-sku\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.unit-price' | translate\" id=\"unit-price\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"unit-price\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.quantity' | translate\" id=\"quantity\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <ng-container *ngIf=\"!isDraft; else draft\">\r\n <div class=\"flex\">\r\n <div\r\n *ngIf=\"line.orderPlacedQuantity && line.quantity !== line.orderPlacedQuantity\"\r\n class=\"order-placed-quantity\"\r\n [title]=\"'order.original-quantity-at-checkout' | translate\"\r\n >\r\n {{ line.orderPlacedQuantity }}\r\n </div>\r\n <div>{{ line.quantity }}</div>\r\n </div>\r\n </ng-container>\r\n <ng-template #draft>\r\n <div class=\"flex\">\r\n <input\r\n class=\"draft-qty\"\r\n type=\"number\"\r\n min=\"0\"\r\n #qtyInput\r\n [value]=\"line.quantity\"\r\n (blur)=\"draftInputBlur(line, qtyInput.valueAsNumber)\"\r\n />\r\n <button class=\"icon-button\" (click)=\"remove.emit({ lineId: line.id })\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </div>\r\n </ng-template>\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [orderState]=\"order.state\"\r\n [allOrderFulfillments]=\"order.fulfillments\"\r\n ></vdr-line-fulfillment>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of orderLineCustomFields\"\r\n [customField]=\"customField\"\r\n />\r\n <vdr-order-total-column [heading]=\"'order.total' | translate\" id=\"total\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"unit-price\">\r\n {{ line.linePriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.linePrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getLineDiscounts(line) as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n {{ 'order.promotions-applied' | translate }}\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n <a class=\"promotion-name\" [routerLink]=\"getPromotionLink(discount)\">{{\r\n discount.description\r\n }}</a>\r\n <div class=\"promotion-amount\">\r\n {{ discount.amountWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </ng-template>\r\n </vdr-order-total-column>\r\n</vdr-order-data-table>\r\n", styles: [":host .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}:host .sub-total td{border-top:1px dashed var(--color-component-border-200)}:host .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}:host td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}:host img{border-radius:var(--border-radius-img)}:host .order-line-custom-fields{display:flex;flex-wrap:wrap}:host .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}:host .draft-qty{max-width:48px}:host .order-line-custom-field{background-color:var(--color-component-bg-100)}:host .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}:host .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}:host .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}:host .thumb img{width:50px;height:50px}:host .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}:host .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-inline-start:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.DataTableCustomFieldColumnComponent, selector: "vdr-dt2-custom-field-column", inputs: ["customField", "sorts"], exportAs: ["row"] }, { kind: "component", type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: ["line", "allOrderFulfillments", "orderState"] }, { kind: "component", type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { kind: "component", type: OrderDataTableComponent, selector: "vdr-order-data-table", inputs: ["order"] }, { kind: "component", type: OrderTotalColumnComponent, selector: "vdr-order-total-column", exportAs: ["row"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
759
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderTableComponent, selector: "vdr-order-table", inputs: { order: "order", orderLineCustomFields: "orderLineCustomFields", isDraft: "isDraft" }, outputs: { adjust: "adjust", remove: "remove" }, ngImport: i0, template: "<vdr-order-data-table id=\"order-detail-list\" [items]=\"order.lines\" [order]=\"order\">\r\n <vdr-dt2-column id=\"id\" [heading]=\"'common.id' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"created-at\"\r\n [heading]=\"'common.created-at' | translate\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"updated-at\"\r\n [heading]=\"'common.updated-at' | translate\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"line.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.product-name' | translate\" id=\"product-name\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.name }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.product-sku' | translate\" id=\"product-sku\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.unit-price' | translate\" id=\"unit-price\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"unit-price\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.quantity' | translate\" id=\"quantity\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <ng-container *ngIf=\"!isDraft; else draft\">\r\n <div class=\"flex\">\r\n <div\r\n *ngIf=\"line.orderPlacedQuantity && line.quantity !== line.orderPlacedQuantity\"\r\n class=\"order-placed-quantity\"\r\n [title]=\"'order.original-quantity-at-checkout' | translate\"\r\n >\r\n {{ line.orderPlacedQuantity }}\r\n </div>\r\n <div>{{ line.quantity }}</div>\r\n </div>\r\n </ng-container>\r\n <ng-template #draft>\r\n <div class=\"flex\">\r\n <input\r\n class=\"draft-qty\"\r\n type=\"number\"\r\n min=\"0\"\r\n #qtyInput\r\n [value]=\"line.quantity\"\r\n (blur)=\"draftInputBlur(line, qtyInput.valueAsNumber)\"\r\n />\r\n <button class=\"icon-button\" (click)=\"remove.emit({ lineId: line.id })\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </div>\r\n </ng-template>\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [orderState]=\"order.state\"\r\n [allOrderFulfillments]=\"order.fulfillments\"\r\n ></vdr-line-fulfillment>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of orderLineCustomFields\"\r\n [customField]=\"customField\"\r\n />\r\n <vdr-order-total-column [heading]=\"'order.total' | translate\" id=\"total\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"unit-price\">\r\n {{ line.linePriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.linePrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getLineDiscounts(line) as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n {{ 'order.promotions-applied' | translate }}\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n <a class=\"promotion-name\" [routerLink]=\"getPromotionLink(discount)\">{{\r\n discount.description\r\n }}</a>\r\n <div class=\"promotion-amount\">\r\n {{ discount.amountWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </ng-template>\r\n </vdr-order-total-column>\r\n</vdr-order-data-table>\r\n", styles: [":host .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}:host .sub-total td{border-top:1px dashed var(--color-component-border-200)}:host .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}:host td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}:host img{border-radius:var(--border-radius-img)}:host .order-line-custom-fields{display:flex;flex-wrap:wrap}:host .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}:host .draft-qty{max-width:48px}:host .order-line-custom-field{background-color:var(--color-component-bg-100)}:host .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}:host .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}:host .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}:host .thumb img{width:50px;height:50px}:host .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}:host .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-inline-start:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.DataTableCustomFieldColumnComponent, selector: "vdr-dt2-custom-field-column", inputs: ["customField", "sorts"], exportAs: ["row"] }, { kind: "component", type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: ["line", "allOrderFulfillments", "orderState"] }, { kind: "component", type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { kind: "component", type: OrderDataTableComponent, selector: "vdr-order-data-table", inputs: ["order"] }, { kind: "component", type: OrderTotalColumnComponent, selector: "vdr-order-total-column", exportAs: ["row"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
738
760
  }
739
761
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderTableComponent, decorators: [{
740
762
  type: Component,
741
- args: [{ selector: 'vdr-order-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-order-data-table id=\"order-detail-list\" [items]=\"order.lines\" [order]=\"order\">\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"line.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.product-name' | translate\" id=\"product-name\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.name }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.product-sku' | translate\" id=\"product-sku\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.unit-price' | translate\" id=\"unit-price\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"unit-price\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.quantity' | translate\" id=\"quantity\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <ng-container *ngIf=\"!isDraft; else draft\">\r\n <div class=\"flex\">\r\n <div\r\n *ngIf=\"line.orderPlacedQuantity && line.quantity !== line.orderPlacedQuantity\"\r\n class=\"order-placed-quantity\"\r\n [title]=\"'order.original-quantity-at-checkout' | translate\"\r\n >\r\n {{ line.orderPlacedQuantity }}\r\n </div>\r\n <div>{{ line.quantity }}</div>\r\n </div>\r\n </ng-container>\r\n <ng-template #draft>\r\n <div class=\"flex\">\r\n <input\r\n class=\"draft-qty\"\r\n type=\"number\"\r\n min=\"0\"\r\n #qtyInput\r\n [value]=\"line.quantity\"\r\n (blur)=\"draftInputBlur(line, qtyInput.valueAsNumber)\"\r\n />\r\n <button class=\"icon-button\" (click)=\"remove.emit({ lineId: line.id })\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </div>\r\n </ng-template>\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [orderState]=\"order.state\"\r\n [allOrderFulfillments]=\"order.fulfillments\"\r\n ></vdr-line-fulfillment>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of orderLineCustomFields\"\r\n [customField]=\"customField\"\r\n />\r\n <vdr-order-total-column [heading]=\"'order.total' | translate\" id=\"total\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"unit-price\">\r\n {{ line.linePriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.linePrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getLineDiscounts(line) as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n {{ 'order.promotions-applied' | translate }}\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n <a class=\"promotion-name\" [routerLink]=\"getPromotionLink(discount)\">{{\r\n discount.description\r\n }}</a>\r\n <div class=\"promotion-amount\">\r\n {{ discount.amountWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </ng-template>\r\n </vdr-order-total-column>\r\n</vdr-order-data-table>\r\n", styles: [":host .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}:host .sub-total td{border-top:1px dashed var(--color-component-border-200)}:host .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}:host td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}:host img{border-radius:var(--border-radius-img)}:host .order-line-custom-fields{display:flex;flex-wrap:wrap}:host .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}:host .draft-qty{max-width:48px}:host .order-line-custom-field{background-color:var(--color-component-bg-100)}:host .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}:host .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}:host .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}:host .thumb img{width:50px;height:50px}:host .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}:host .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-inline-start:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"] }]
763
+ args: [{ selector: 'vdr-order-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-order-data-table id=\"order-detail-list\" [items]=\"order.lines\" [order]=\"order\">\r\n <vdr-dt2-column id=\"id\" [heading]=\"'common.id' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"created-at\"\r\n [heading]=\"'common.created-at' | translate\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"updated-at\"\r\n [heading]=\"'common.updated-at' | translate\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"line.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.product-name' | translate\" id=\"product-name\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.name }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.product-sku' | translate\" id=\"product-sku\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.unit-price' | translate\" id=\"unit-price\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"unit-price\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.quantity' | translate\" id=\"quantity\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <ng-container *ngIf=\"!isDraft; else draft\">\r\n <div class=\"flex\">\r\n <div\r\n *ngIf=\"line.orderPlacedQuantity && line.quantity !== line.orderPlacedQuantity\"\r\n class=\"order-placed-quantity\"\r\n [title]=\"'order.original-quantity-at-checkout' | translate\"\r\n >\r\n {{ line.orderPlacedQuantity }}\r\n </div>\r\n <div>{{ line.quantity }}</div>\r\n </div>\r\n </ng-container>\r\n <ng-template #draft>\r\n <div class=\"flex\">\r\n <input\r\n class=\"draft-qty\"\r\n type=\"number\"\r\n min=\"0\"\r\n #qtyInput\r\n [value]=\"line.quantity\"\r\n (blur)=\"draftInputBlur(line, qtyInput.valueAsNumber)\"\r\n />\r\n <button class=\"icon-button\" (click)=\"remove.emit({ lineId: line.id })\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </div>\r\n </ng-template>\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [orderState]=\"order.state\"\r\n [allOrderFulfillments]=\"order.fulfillments\"\r\n ></vdr-line-fulfillment>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of orderLineCustomFields\"\r\n [customField]=\"customField\"\r\n />\r\n <vdr-order-total-column [heading]=\"'order.total' | translate\" id=\"total\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"unit-price\">\r\n {{ line.linePriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.linePrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getLineDiscounts(line) as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n {{ 'order.promotions-applied' | translate }}\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n <a class=\"promotion-name\" [routerLink]=\"getPromotionLink(discount)\">{{\r\n discount.description\r\n }}</a>\r\n <div class=\"promotion-amount\">\r\n {{ discount.amountWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </ng-template>\r\n </vdr-order-total-column>\r\n</vdr-order-data-table>\r\n", styles: [":host .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}:host .sub-total td{border-top:1px dashed var(--color-component-border-200)}:host .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}:host td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}:host img{border-radius:var(--border-radius-img)}:host .order-line-custom-fields{display:flex;flex-wrap:wrap}:host .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}:host .draft-qty{max-width:48px}:host .order-line-custom-field{background-color:var(--color-component-bg-100)}:host .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}:host .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}:host .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}:host .thumb img{width:50px;height:50px}:host .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}:host .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-inline-start:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"] }]
742
764
  }], propDecorators: { order: [{
743
765
  type: Input
744
766
  }], orderLineCustomFields: [{
@@ -788,7 +810,7 @@ class DraftOrderVariantSelectorComponent {
788
810
  }
789
811
  }
790
812
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: DraftOrderVariantSelectorComponent, deps: [{ token: i1.DataService }], target: i0.ɵɵFactoryTarget.Component }); }
791
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: DraftOrderVariantSelectorComponent, selector: "vdr-draft-order-variant-selector", inputs: { currencyCode: "currencyCode", orderLineCustomFields: "orderLineCustomFields" }, outputs: { addItem: "addItem" }, ngImport: i0, template: "<div class=\"card\">\r\n <div class=\"card-block\">\r\n <h4 class=\"card-title\">{{ 'order.add-item-to-order' | translate }}</h4>\r\n <vdr-product-variant-selector\r\n (productSelected)=\"selectedVariantId$.next($event.productVariantId)\"\r\n ></vdr-product-variant-selector>\r\n </div>\r\n <div class=\"card-block\" *ngIf=\"selectedVariant$ | async as selectedVariant\">\r\n <div class=\"variant-details\">\r\n <img class=\"mr-2\" [src]=\"selectedVariant.featuredAsset || selectedVariant.product.featuredAsset | assetPreview: 32\">\r\n <div class=\"details\">\r\n <div>{{ selectedVariant?.name }}</div>\r\n <div class=\"small\">{{ selectedVariant?.sku }}</div>\r\n </div>\r\n <div class=\"details ml-4\">\r\n <div class=\"small\">\r\n {{ 'catalog.stock-on-hand' | translate }}: {{ selectedVariant.stockOnHand }}\r\n </div>\r\n <div class=\"small\">\r\n {{ 'catalog.stock-allocated' | translate }}: {{ selectedVariant.stockAllocated }}\r\n </div>\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <div class=\"details\">\r\n <div>{{ selectedVariant?.priceWithTax | localeCurrency: currencyCode }}</div>\r\n <div class=\"small\" [title]=\"'order.net-price' | translate\">\r\n {{ selectedVariant?.price | localeCurrency: currencyCode }}\r\n </div>\r\n </div>\r\n <div>\r\n <input [disabled]=\"!selectedVariant\" type=\"number\" min=\"0\" [(ngModel)]=\"quantity\" />\r\n </div>\r\n <button\r\n [disabled]=\"!selectedVariant\"\r\n class=\"btn btn-small btn-primary\"\r\n (click)=\"addItemClick(selectedVariant)\"\r\n >\r\n {{ 'order.add-item-to-order' | translate }}\r\n </button>\r\n </div>\r\n <ng-container *ngIf=\"orderLineCustomFields.length\">\r\n <div class=\"custom-field\" *ngFor=\"let field of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [readonly]=\"false\"\r\n [customField]=\"field\"\r\n [customFieldsFormGroup]=\"customFieldsFormGroup\"\r\n ></vdr-custom-field-control>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</div>\r\n", styles: [".variant-details{display:flex;align-items:center}.variant-details img{border-radius:var(--border-radius-img);width:32px;height:32px}.variant-details .details{font-size:.65rem;line-height:.7rem}.variant-details input{width:48px;margin:0 6px}.variant-details .small{font-size:11px;color:var(--color-text-300)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "component", type: i1.ProductVariantSelectorComponent, selector: "vdr-product-variant-selector", outputs: ["productSelected"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
813
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: DraftOrderVariantSelectorComponent, selector: "vdr-draft-order-variant-selector", inputs: { currencyCode: "currencyCode", orderLineCustomFields: "orderLineCustomFields" }, outputs: { addItem: "addItem" }, ngImport: i0, template: "<div class=\"card\">\r\n <div class=\"card-block\">\r\n <h4 class=\"card-title\">{{ 'order.add-item-to-order' | translate }}</h4>\r\n <vdr-product-variant-selector\r\n (productSelected)=\"selectedVariantId$.next($event.productVariantId)\"\r\n ></vdr-product-variant-selector>\r\n </div>\r\n <div class=\"card-block\" *ngIf=\"selectedVariant$ | async as selectedVariant\">\r\n <div class=\"variant-details\">\r\n <img class=\"mr-2\" [src]=\"selectedVariant.featuredAsset || selectedVariant.product.featuredAsset | assetPreview: 32\">\r\n <div class=\"details\">\r\n <div>{{ selectedVariant?.name }}</div>\r\n <div class=\"small\">{{ selectedVariant?.sku }}</div>\r\n </div>\r\n <div class=\"details ml-4\">\r\n <div class=\"small\">\r\n {{ 'catalog.stock-on-hand' | translate }}: {{ selectedVariant.stockOnHand }}\r\n </div>\r\n <div class=\"small\">\r\n {{ 'catalog.stock-allocated' | translate }}: {{ selectedVariant.stockAllocated }}\r\n </div>\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <div class=\"details\">\r\n <div>{{ selectedVariant?.priceWithTax | localeCurrency: currencyCode }}</div>\r\n <div class=\"small\" [title]=\"'order.net-price' | translate\">\r\n {{ selectedVariant?.price | localeCurrency: currencyCode }}\r\n </div>\r\n </div>\r\n <div>\r\n <input [disabled]=\"!selectedVariant\" type=\"number\" min=\"0\" [(ngModel)]=\"quantity\" />\r\n </div>\r\n <button\r\n [disabled]=\"!selectedVariant\"\r\n class=\"btn btn-small btn-primary\"\r\n (click)=\"addItemClick(selectedVariant)\"\r\n >\r\n {{ 'order.add-item-to-order' | translate }}\r\n </button>\r\n </div>\r\n <ng-container *ngIf=\"orderLineCustomFields.length\">\r\n <div class=\"custom-field\" *ngFor=\"let field of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [readonly]=\"false\"\r\n [customField]=\"field\"\r\n [customFieldsFormGroup]=\"customFieldsFormGroup\"\r\n ></vdr-custom-field-control>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</div>\r\n", styles: [".variant-details{display:flex;align-items:center}.variant-details img{border-radius:var(--border-radius-img);width:32px;height:32px}.variant-details .details{font-size:.65rem;line-height:.7rem}.variant-details input{width:48px;margin:0 6px}.variant-details .small{font-size:11px;color:var(--color-text-300)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "component", type: i1.ProductVariantSelectorComponent, selector: "vdr-product-variant-selector", outputs: ["productSelected"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
792
814
  }
793
815
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: DraftOrderVariantSelectorComponent, decorators: [{
794
816
  type: Component,
@@ -957,7 +979,7 @@ class DraftOrderDetailComponent extends TypedBaseDetailComponent {
957
979
  // empty
958
980
  }
959
981
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: DraftOrderDetailComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.DataService }, { token: i1.NotificationService }, { token: i1.ModalService }, { token: OrderTransitionService }], target: i0.ɵɵFactoryTarget.Component }); }
960
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: DraftOrderDetailComponent, selector: "vdr-draft-order-detail", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left>\r\n <div class=\"flex clr-align-items-center\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </div>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"draft-order-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n (click)=\"completeOrder()\"\r\n [disabled]=\"!order.customer || !order.lines.length || !order.shippingLines.length\"\r\n >\r\n <clr-icon shape=\"check\"></clr-icon>\r\n {{ 'order.complete-draft-order' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button type=\"button\" vdrDropdownItem (click)=\"deleteOrder()\">\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'order.delete-draft-order' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-detail-layout *ngIf=\"entity$ | async as order\">\r\n <vdr-page-detail-sidebar>\r\n <vdr-card [title]=\"'order.customer' | translate\">\r\n <ng-template vdrCardControls>\r\n <clr-icon *ngIf=\"!order.customer\" shape=\"unknown-status\" class=\"is-warning\"></clr-icon>\r\n <clr-icon *ngIf=\"order.customer\" shape=\"check\" class=\"is-success\"></clr-icon>\r\n </ng-template>\r\n <vdr-customer-label\r\n class=\"block mb-2\"\r\n *ngIf=\"order.customer\"\r\n [customer]=\"order.customer\"\r\n ></vdr-customer-label>\r\n <button class=\"button-small\" (click)=\"setCustomer()\">\r\n {{ 'order.set-customer-for-order' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.billing-address' | translate\">\r\n <ng-template vdrCardControls>\r\n <clr-icon\r\n *ngIf=\"!order.billingAddress.streetLine1\"\r\n shape=\"unknown-status\"\r\n class=\"is-warning\"\r\n ></clr-icon>\r\n <clr-icon\r\n *ngIf=\"order.billingAddress.streetLine1\"\r\n shape=\"check\"\r\n class=\"is-success\"\r\n ></clr-icon>\r\n </ng-template>\r\n <vdr-formatted-address\r\n class=\"block mb-2\"\r\n *ngIf=\"order.billingAddress\"\r\n [address]=\"order.billingAddress\"\r\n ></vdr-formatted-address>\r\n <button class=\"button-small\" (click)=\"setBillingAddress()\">\r\n {{ 'order.set-billing-address' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.shipping' | translate\">\r\n <ng-template vdrCardControls>\r\n <clr-icon\r\n *ngIf=\"!order.shippingAddress.streetLine1 || !order.shippingLines.length\"\r\n shape=\"unknown-status\"\r\n class=\"is-warning\"\r\n ></clr-icon>\r\n <clr-icon\r\n *ngIf=\"order.shippingAddress.streetLine1 && order.shippingLines.length\"\r\n shape=\"check\"\r\n class=\"is-success\"\r\n ></clr-icon>\r\n </ng-template>\r\n <vdr-formatted-address\r\n class=\"block mb-2\"\r\n *ngIf=\"order.shippingAddress\"\r\n [address]=\"order.shippingAddress\"\r\n ></vdr-formatted-address>\r\n <button class=\"button-small mr-2\" (click)=\"setShippingAddress()\">\r\n {{ 'order.set-shipping-address' | translate }}\r\n </button>\r\n\r\n <div *ngFor=\"let shippingLine of order.shippingLines\">\r\n {{ shippingLine.shippingMethod.name }}\r\n </div>\r\n <button class=\"button-small\" (click)=\"setShippingMethod()\">\r\n {{ 'order.set-shipping-method' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-card>\r\n <button\r\n *ngIf=\"order.couponCodes.length === 0 && !displayCouponCodeInput\"\r\n class=\"button-small\"\r\n (click)=\"displayCouponCodeInput = !displayCouponCodeInput\"\r\n >\r\n {{ 'order.set-coupon-codes' | translate }}\r\n </button>\r\n <div *ngIf=\"order.couponCodes.length || displayCouponCodeInput\">\r\n <label>{{ 'order.set-coupon-codes' | translate }}</label>\r\n <vdr-coupon-code-selector\r\n [couponCodes]=\"order.couponCodes\"\r\n (addCouponCode)=\"applyCouponCode($event)\"\r\n (removeCouponCode)=\"removeCouponCode($event)\"\r\n ></vdr-coupon-code-selector>\r\n </div>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <vdr-page-block>\r\n <vdr-card>\r\n <vdr-draft-order-variant-selector\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n [currencyCode]=\"order.currencyCode\"\r\n (addItem)=\"addItemToOrder($event)\"\r\n ></vdr-draft-order-variant-selector>\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n [isDraft]=\"true\"\r\n (adjust)=\"adjustOrderLine($event)\"\r\n (remove)=\"removeOrderLine($event)\"\r\n ></vdr-order-table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.tax-summary' | translate\">\r\n <ng-container *ngIf=\"order.taxSummary.length\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'common.description' | translate }}</th>\r\n <th>{{ 'order.tax-rate' | translate }}</th>\r\n <th>{{ 'order.tax-base' | translate }}</th>\r\n <th>{{ 'order.tax-total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let row of order.taxSummary\">\r\n <td>{{ row.description }}</td>\r\n <td>{{ row.taxRate / 100 | percent }}</td>\r\n <td>{{ row.taxBase | localeCurrency : order.currencyCode }}</td>\r\n <td>{{ row.taxTotal | localeCurrency : order.currencyCode }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </ng-container>\r\n </vdr-card>\r\n <vdr-custom-detail-component-host\r\n locationId=\"draft-order-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-order-custom-fields-card\r\n [customFieldsConfig]=\"customFields\"\r\n [customFieldValues]=\"order.customFields\"\r\n (updateClick)=\"updateCustomFields($event)\"\r\n ></vdr-order-custom-fields-card>\r\n </vdr-page-block>\r\n</vdr-page-detail-layout>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i1$1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.CustomDetailComponentHostComponent, selector: "vdr-custom-detail-component-host", inputs: ["locationId", "entity$", "detailForm"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "component", type: i1.PageEntityInfoComponent, selector: "vdr-page-entity-info", inputs: ["entity"] }, { kind: "component", type: i1.PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: i1.PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "directive", type: i1.CardControlsDirective, selector: "[vdrCardControls]" }, { kind: "component", type: OrderCustomFieldsCardComponent, selector: "vdr-order-custom-fields-card", inputs: ["customFieldsConfig", "customFieldValues"], outputs: ["updateClick"] }, { kind: "component", type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { kind: "component", type: DraftOrderVariantSelectorComponent, selector: "vdr-draft-order-variant-selector", inputs: ["currencyCode", "orderLineCustomFields"], outputs: ["addItem"] }, { kind: "component", type: CouponCodeSelectorComponent, selector: "vdr-coupon-code-selector", inputs: ["couponCodes", "control"], outputs: ["addCouponCode", "removeCouponCode"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.PercentPipe, name: "percent" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
982
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: DraftOrderDetailComponent, selector: "vdr-draft-order-detail", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left>\r\n <div class=\"flex clr-align-items-center\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </div>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"draft-order-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n (click)=\"completeOrder()\"\r\n [disabled]=\"!order.customer || !order.lines.length || !order.shippingLines.length\"\r\n >\r\n <clr-icon shape=\"check\"></clr-icon>\r\n {{ 'order.complete-draft-order' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button type=\"button\" vdrDropdownItem (click)=\"deleteOrder()\">\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'order.delete-draft-order' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-detail-layout *ngIf=\"entity$ | async as order\">\r\n <vdr-page-detail-sidebar>\r\n <vdr-card [title]=\"'order.customer' | translate\">\r\n <ng-template vdrCardControls>\r\n <clr-icon *ngIf=\"!order.customer\" shape=\"unknown-status\" class=\"is-warning\"></clr-icon>\r\n <clr-icon *ngIf=\"order.customer\" shape=\"check\" class=\"is-success\"></clr-icon>\r\n </ng-template>\r\n <vdr-customer-label\r\n class=\"block mb-2\"\r\n *ngIf=\"order.customer\"\r\n [customer]=\"order.customer\"\r\n ></vdr-customer-label>\r\n <button class=\"button-small\" (click)=\"setCustomer()\">\r\n {{ 'order.set-customer-for-order' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.billing-address' | translate\">\r\n <ng-template vdrCardControls>\r\n <clr-icon\r\n *ngIf=\"!order.billingAddress.streetLine1\"\r\n shape=\"unknown-status\"\r\n class=\"is-warning\"\r\n ></clr-icon>\r\n <clr-icon\r\n *ngIf=\"order.billingAddress.streetLine1\"\r\n shape=\"check\"\r\n class=\"is-success\"\r\n ></clr-icon>\r\n </ng-template>\r\n <vdr-formatted-address\r\n class=\"block mb-2\"\r\n *ngIf=\"order.billingAddress\"\r\n [address]=\"order.billingAddress\"\r\n ></vdr-formatted-address>\r\n <button class=\"button-small\" (click)=\"setBillingAddress()\">\r\n {{ 'order.set-billing-address' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.shipping' | translate\">\r\n <ng-template vdrCardControls>\r\n <clr-icon\r\n *ngIf=\"!order.shippingAddress.streetLine1 || !order.shippingLines.length\"\r\n shape=\"unknown-status\"\r\n class=\"is-warning\"\r\n ></clr-icon>\r\n <clr-icon\r\n *ngIf=\"order.shippingAddress.streetLine1 && order.shippingLines.length\"\r\n shape=\"check\"\r\n class=\"is-success\"\r\n ></clr-icon>\r\n </ng-template>\r\n <vdr-formatted-address\r\n class=\"block mb-2\"\r\n *ngIf=\"order.shippingAddress\"\r\n [address]=\"order.shippingAddress\"\r\n ></vdr-formatted-address>\r\n <button class=\"button-small mr-2\" (click)=\"setShippingAddress()\">\r\n {{ 'order.set-shipping-address' | translate }}\r\n </button>\r\n\r\n <div *ngFor=\"let shippingLine of order.shippingLines\">\r\n {{ shippingLine.shippingMethod.name }}\r\n </div>\r\n <button class=\"button-small\" (click)=\"setShippingMethod()\">\r\n {{ 'order.set-shipping-method' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-card>\r\n <button\r\n *ngIf=\"order.couponCodes.length === 0 && !displayCouponCodeInput\"\r\n class=\"button-small\"\r\n (click)=\"displayCouponCodeInput = !displayCouponCodeInput\"\r\n >\r\n {{ 'order.set-coupon-codes' | translate }}\r\n </button>\r\n <div *ngIf=\"order.couponCodes.length || displayCouponCodeInput\">\r\n <label>{{ 'order.set-coupon-codes' | translate }}</label>\r\n <vdr-coupon-code-selector\r\n [couponCodes]=\"order.couponCodes\"\r\n (addCouponCode)=\"applyCouponCode($event)\"\r\n (removeCouponCode)=\"removeCouponCode($event)\"\r\n ></vdr-coupon-code-selector>\r\n </div>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <vdr-page-block>\r\n <vdr-card>\r\n <vdr-draft-order-variant-selector\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n [currencyCode]=\"order.currencyCode\"\r\n (addItem)=\"addItemToOrder($event)\"\r\n ></vdr-draft-order-variant-selector>\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n [isDraft]=\"true\"\r\n (adjust)=\"adjustOrderLine($event)\"\r\n (remove)=\"removeOrderLine($event)\"\r\n ></vdr-order-table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.tax-summary' | translate\">\r\n <ng-container *ngIf=\"order.taxSummary.length\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'common.description' | translate }}</th>\r\n <th>{{ 'order.tax-rate' | translate }}</th>\r\n <th>{{ 'order.tax-base' | translate }}</th>\r\n <th>{{ 'order.tax-total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let row of order.taxSummary\">\r\n <td>{{ row.description }}</td>\r\n <td>{{ row.taxRate / 100 | percent }}</td>\r\n <td>{{ row.taxBase | localeCurrency : order.currencyCode }}</td>\r\n <td>{{ row.taxTotal | localeCurrency : order.currencyCode }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </ng-container>\r\n </vdr-card>\r\n <vdr-custom-detail-component-host\r\n locationId=\"draft-order-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-order-custom-fields-card\r\n [customFieldsConfig]=\"customFields\"\r\n [customFieldValues]=\"order.customFields\"\r\n (updateClick)=\"updateCustomFields($event)\"\r\n ></vdr-order-custom-fields-card>\r\n </vdr-page-block>\r\n</vdr-page-detail-layout>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.CustomDetailComponentHostComponent, selector: "vdr-custom-detail-component-host", inputs: ["locationId", "entity$", "detailForm"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "component", type: i1.PageEntityInfoComponent, selector: "vdr-page-entity-info", inputs: ["entity"] }, { kind: "component", type: i1.PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: i1.PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "directive", type: i1.CardControlsDirective, selector: "[vdrCardControls]" }, { kind: "component", type: OrderCustomFieldsCardComponent, selector: "vdr-order-custom-fields-card", inputs: ["customFieldsConfig", "customFieldValues"], outputs: ["updateClick"] }, { kind: "component", type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { kind: "component", type: DraftOrderVariantSelectorComponent, selector: "vdr-draft-order-variant-selector", inputs: ["currencyCode", "orderLineCustomFields"], outputs: ["addItem"] }, { kind: "component", type: CouponCodeSelectorComponent, selector: "vdr-coupon-code-selector", inputs: ["couponCodes", "control"], outputs: ["addCouponCode", "removeCouponCode"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.PercentPipe, name: "percent" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
961
983
  }
962
984
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: DraftOrderDetailComponent, decorators: [{
963
985
  type: Component,
@@ -1028,7 +1050,7 @@ class FulfillOrderDialogComponent {
1028
1050
  this.resolveWith();
1029
1051
  }
1030
1052
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: FulfillOrderDialogComponent, deps: [{ token: i1.DataService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1031
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: FulfillOrderDialogComponent, selector: "vdr-fulfill-order-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.fulfill-order' | translate }}</ng-template>\r\n\r\n<div class=\"fulfillment-wrapper\">\r\n <div class=\"order-table\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.unfulfilled' | translate }}</th>\r\n <th>{{ 'catalog.stock-on-hand' | translate }}</th>\r\n <th>{{ 'order.fulfill' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tr\r\n *ngFor=\"let line of order.lines\"\r\n class=\"order-line\"\r\n [class.ignore]=\"getUnfulfilledCount(line) === 0\"\r\n >\r\n <td class=\"align-middle thumb\">\r\n <img *ngIf=\"line.featuredAsset\" [src]=\"line.featuredAsset | assetPreview: 'tiny'\" />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle quantity\">{{ getUnfulfilledCount(line) }}</td>\r\n <td class=\"align-middle quantity\">{{ line.productVariant.stockOnHand }}</td>\r\n <td class=\"align-middle fulfil\">\r\n <input\r\n *ngIf=\"fulfillmentQuantities[line.id]\"\r\n [disabled]=\"getUnfulfilledCount(line) === 0\"\r\n [(ngModel)]=\"fulfillmentQuantities[line.id].fulfillCount\"\r\n type=\"number\"\r\n [max]=\"fulfillmentQuantities[line.id].max\"\r\n min=\"0\"\r\n />\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class=\"shipping-details\">\r\n <vdr-formatted-address [address]=\"order.shippingAddress\"></vdr-formatted-address>\r\n <h6>{{ 'order.shipping-method' | translate }}</h6>\r\n {{ order.shippingLines[0]?.shippingMethod?.name }}\r\n <strong>{{ order.shipping | localeCurrency: order.currencyCode }}</strong>\r\n <vdr-configurable-input\r\n [operationDefinition]=\"fulfillmentHandlerDef\"\r\n [operation]=\"fulfillmentHandler\"\r\n [formControl]=\"fulfillmentHandlerControl\"\r\n [removable]=\"false\"\r\n ></vdr-configurable-input>\r\n </div>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"select()\" [disabled]=\"!canSubmit()\" class=\"btn btn-primary\">\r\n {{ 'order.create-fulfillment' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [":host{height:100%;display:flex;min-height:64vh}:host .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}:host .sub-total td{border-top:1px dashed var(--color-component-border-200)}:host .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}:host td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}:host img{border-radius:var(--border-radius-img)}:host .order-line-custom-fields{display:flex;flex-wrap:wrap}:host .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}:host .draft-qty{max-width:48px}:host .order-line-custom-field{background-color:var(--color-component-bg-100)}:host .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}:host .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}:host .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}:host .thumb img{width:50px;height:50px}:host .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}:host .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}.fulfillment-wrapper{flex:1}@media screen and (min-width: 768px){.fulfillment-wrapper{display:flex;flex-direction:row}}.fulfillment-wrapper .shipping-details{margin-top:24px}@media screen and (min-width: 768px){.fulfillment-wrapper .shipping-details{margin-top:0;margin-inline-start:24px;width:250px}}.fulfillment-wrapper .shipping-details clr-input-container{margin-top:24px}.fulfillment-wrapper .order-table{flex:1;overflow-y:auto}.fulfillment-wrapper .order-table table{margin-top:0}.fulfillment-wrapper tr.ignore{color:var(--color-grey-300)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i1.ConfigurableInputComponent, selector: "vdr-configurable-input", inputs: ["operation", "operationDefinition", "readonly", "removable", "position"], outputs: ["remove"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1053
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: FulfillOrderDialogComponent, selector: "vdr-fulfill-order-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.fulfill-order' | translate }}</ng-template>\r\n\r\n<div class=\"fulfillment-wrapper\">\r\n <div class=\"order-table\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.unfulfilled' | translate }}</th>\r\n <th>{{ 'catalog.stock-on-hand' | translate }}</th>\r\n <th>{{ 'order.fulfill' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tr\r\n *ngFor=\"let line of order.lines\"\r\n class=\"order-line\"\r\n [class.ignore]=\"getUnfulfilledCount(line) === 0\"\r\n >\r\n <td class=\"align-middle thumb\">\r\n <img *ngIf=\"line.featuredAsset\" [src]=\"line.featuredAsset | assetPreview: 'tiny'\" />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle quantity\">{{ getUnfulfilledCount(line) }}</td>\r\n <td class=\"align-middle quantity\">{{ line.productVariant.stockOnHand }}</td>\r\n <td class=\"align-middle fulfil\">\r\n <input\r\n *ngIf=\"fulfillmentQuantities[line.id]\"\r\n [disabled]=\"getUnfulfilledCount(line) === 0\"\r\n [(ngModel)]=\"fulfillmentQuantities[line.id].fulfillCount\"\r\n type=\"number\"\r\n [max]=\"fulfillmentQuantities[line.id].max\"\r\n min=\"0\"\r\n />\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class=\"shipping-details\">\r\n <vdr-formatted-address [address]=\"order.shippingAddress\"></vdr-formatted-address>\r\n <h6>{{ 'order.shipping-method' | translate }}</h6>\r\n {{ order.shippingLines[0]?.shippingMethod?.name }}\r\n <strong>{{ order.shipping | localeCurrency: order.currencyCode }}</strong>\r\n <vdr-configurable-input\r\n [operationDefinition]=\"fulfillmentHandlerDef\"\r\n [operation]=\"fulfillmentHandler\"\r\n [formControl]=\"fulfillmentHandlerControl\"\r\n [removable]=\"false\"\r\n ></vdr-configurable-input>\r\n </div>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"select()\" [disabled]=\"!canSubmit()\" class=\"btn btn-primary\">\r\n {{ 'order.create-fulfillment' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [":host{height:100%;display:flex;min-height:64vh}:host .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}:host .sub-total td{border-top:1px dashed var(--color-component-border-200)}:host .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}:host td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}:host img{border-radius:var(--border-radius-img)}:host .order-line-custom-fields{display:flex;flex-wrap:wrap}:host .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}:host .draft-qty{max-width:48px}:host .order-line-custom-field{background-color:var(--color-component-bg-100)}:host .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}:host .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}:host .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}:host .thumb img{width:50px;height:50px}:host .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}:host .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}.fulfillment-wrapper{flex:1}@media screen and (min-width: 768px){.fulfillment-wrapper{display:flex;flex-direction:row}}.fulfillment-wrapper .shipping-details{margin-top:24px}@media screen and (min-width: 768px){.fulfillment-wrapper .shipping-details{margin-top:0;margin-inline-start:24px;width:250px}}.fulfillment-wrapper .shipping-details clr-input-container{margin-top:24px}.fulfillment-wrapper .order-table{flex:1;overflow-y:auto}.fulfillment-wrapper .order-table table{margin-top:0}.fulfillment-wrapper tr.ignore{color:var(--color-grey-300)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i1.ConfigurableInputComponent, selector: "vdr-configurable-input", inputs: ["operation", "operationDefinition", "readonly", "removable", "position"], outputs: ["remove"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1032
1054
  }
1033
1055
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: FulfillOrderDialogComponent, decorators: [{
1034
1056
  type: Component,
@@ -1037,11 +1059,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImpor
1037
1059
 
1038
1060
  class SimpleItemListComponent {
1039
1061
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SimpleItemListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1040
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SimpleItemListComponent, selector: "vdr-simple-item-list", inputs: { items: "items" }, ngImport: i0, template: "<div class=\"items-list\">\r\n <ul>\r\n <li *ngFor=\"let item of items\" [title]=\"item.name\">\r\n <div class=\"quantity\">{{ item.quantity }}</div>\r\n <clr-icon shape=\"times\" size=\"12\"></clr-icon>\r\n {{ item.name }}\r\n </li>\r\n </ul>\r\n</div>\r\n", styles: [".items-list{font-size:12px}.items-list ul{margin-top:6px;list-style-type:none;margin-inline-start:2px}.items-list ul li{line-height:14px;text-overflow:ellipsis;overflow:hidden}.items-list .quantity{min-width:16px;display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1062
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SimpleItemListComponent, selector: "vdr-simple-item-list", inputs: { items: "items" }, ngImport: i0, template: "<div class=\"items-list\">\r\n <ul>\r\n <li *ngFor=\"let item of items\" [title]=\"item.name\">\r\n <div class=\"quantity\" *ngIf=\"item.quantity != null\">{{ item.quantity }}</div>\r\n <clr-icon shape=\"times\" size=\"12\" *ngIf=\"item.quantity != null\"></clr-icon>\r\n {{ item.name }}\r\n </li>\r\n </ul>\r\n</div>\r\n", styles: [".items-list{font-size:12px}.items-list ul{margin-top:6px;list-style-type:none;margin-inline-start:2px}.items-list ul li{line-height:14px;text-overflow:ellipsis;overflow:hidden}.items-list .quantity{min-width:16px;display:inline-block}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1041
1063
  }
1042
1064
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SimpleItemListComponent, decorators: [{
1043
1065
  type: Component,
1044
- args: [{ selector: 'vdr-simple-item-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"items-list\">\r\n <ul>\r\n <li *ngFor=\"let item of items\" [title]=\"item.name\">\r\n <div class=\"quantity\">{{ item.quantity }}</div>\r\n <clr-icon shape=\"times\" size=\"12\"></clr-icon>\r\n {{ item.name }}\r\n </li>\r\n </ul>\r\n</div>\r\n", styles: [".items-list{font-size:12px}.items-list ul{margin-top:6px;list-style-type:none;margin-inline-start:2px}.items-list ul li{line-height:14px;text-overflow:ellipsis;overflow:hidden}.items-list .quantity{min-width:16px;display:inline-block}\n"] }]
1066
+ args: [{ selector: 'vdr-simple-item-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"items-list\">\r\n <ul>\r\n <li *ngFor=\"let item of items\" [title]=\"item.name\">\r\n <div class=\"quantity\" *ngIf=\"item.quantity != null\">{{ item.quantity }}</div>\r\n <clr-icon shape=\"times\" size=\"12\" *ngIf=\"item.quantity != null\"></clr-icon>\r\n {{ item.name }}\r\n </li>\r\n </ul>\r\n</div>\r\n", styles: [".items-list{font-size:12px}.items-list ul{margin-top:6px;list-style-type:none;margin-inline-start:2px}.items-list ul li{line-height:14px;text-overflow:ellipsis;overflow:hidden}.items-list .quantity{min-width:16px;display:inline-block}\n"] }]
1045
1067
  }], propDecorators: { items: [{
1046
1068
  type: Input
1047
1069
  }] } });
@@ -1101,7 +1123,7 @@ class FulfillmentStateLabelComponent {
1101
1123
  }
1102
1124
  }
1103
1125
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: FulfillmentStateLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1104
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: FulfillmentStateLabelComponent, selector: "vdr-fulfillment-state-label", inputs: { state: "state" }, ngImport: i0, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Delivered'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{font-size:14px}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1126
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: FulfillmentStateLabelComponent, selector: "vdr-fulfillment-state-label", inputs: { state: "state" }, ngImport: i0, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Delivered'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{font-size:14px}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1105
1127
  }
1106
1128
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: FulfillmentStateLabelComponent, decorators: [{
1107
1129
  type: Component,
@@ -1137,7 +1159,7 @@ class FulfillmentCardComponent {
1137
1159
  return this.fulfillment.nextStates.filter(s => s !== suggested);
1138
1160
  }
1139
1161
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: FulfillmentCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1140
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: FulfillmentCardComponent, selector: "vdr-fulfillment-card", inputs: { fulfillment: "fulfillment", order: "order" }, outputs: { transitionState: "transitionState" }, ngImport: i0, template: "<div class=\"card\">\r\n <div class=\"card-header fulfillment-header\">\r\n <div>{{ 'order.fulfillment' | translate }}</div>\r\n <div class=\"fulfillment-state\">\r\n <vdr-fulfillment-state-label [state]=\"fulfillment?.state\"></vdr-fulfillment-state-label>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-fulfillment-detail\r\n *ngIf=\"!!fulfillment\"\r\n [fulfillmentId]=\"fulfillment?.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </div>\r\n <div class=\"card-footer\" *ngIf=\"fulfillment?.nextStates.length\">\r\n <ng-container *ngIf=\"nextSuggestedState() as suggestedState\">\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"transitionState.emit(suggestedState)\">\r\n {{ 'order.set-fulfillment-state' | translate: { state: (suggestedState | stateI18nToken | translate) } }}\r\n </button>\r\n </ng-container>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container *ngFor=\"let nextState of nextOtherStates()\">\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionState.emit(nextState)\"\r\n >\r\n <ng-container *ngIf=\"nextState !== 'Cancelled'; else cancel\">\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{ 'order.transition-to-state' | translate: { state: (nextState | stateI18nToken | translate) } }}\r\n </ng-container>\r\n <ng-template #cancel>\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n {{ 'order.cancel-fulfillment' | translate }}\r\n </ng-template>\r\n </button>\r\n </ng-container>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n</div>\r\n", styles: [".fulfillment-header{display:flex;justify-content:space-between;align-items:center}.card-footer{display:flex;align-items:center;justify-content:flex-end}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: FulfillmentDetailComponent, selector: "vdr-fulfillment-detail", inputs: ["fulfillmentId", "order"] }, { kind: "component", type: FulfillmentStateLabelComponent, selector: "vdr-fulfillment-state-label", inputs: ["state"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1162
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: FulfillmentCardComponent, selector: "vdr-fulfillment-card", inputs: { fulfillment: "fulfillment", order: "order" }, outputs: { transitionState: "transitionState" }, ngImport: i0, template: "<div class=\"card\">\r\n <div class=\"card-header fulfillment-header\">\r\n <div>{{ 'order.fulfillment' | translate }}</div>\r\n <div class=\"fulfillment-state\">\r\n <vdr-fulfillment-state-label [state]=\"fulfillment?.state\"></vdr-fulfillment-state-label>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-fulfillment-detail\r\n *ngIf=\"!!fulfillment\"\r\n [fulfillmentId]=\"fulfillment?.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </div>\r\n <div class=\"card-footer\" *ngIf=\"fulfillment?.nextStates.length\">\r\n <ng-container *ngIf=\"nextSuggestedState() as suggestedState\">\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"transitionState.emit(suggestedState)\">\r\n {{ 'order.set-fulfillment-state' | translate: { state: (suggestedState | stateI18nToken | translate) } }}\r\n </button>\r\n </ng-container>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container *ngFor=\"let nextState of nextOtherStates()\">\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionState.emit(nextState)\"\r\n >\r\n <ng-container *ngIf=\"nextState !== 'Cancelled'; else cancel\">\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{ 'order.transition-to-state' | translate: { state: (nextState | stateI18nToken | translate) } }}\r\n </ng-container>\r\n <ng-template #cancel>\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n {{ 'order.cancel-fulfillment' | translate }}\r\n </ng-template>\r\n </button>\r\n </ng-container>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n</div>\r\n", styles: [".fulfillment-header{display:flex;justify-content:space-between;align-items:center}.card-footer{display:flex;align-items:center;justify-content:flex-end}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: FulfillmentDetailComponent, selector: "vdr-fulfillment-detail", inputs: ["fulfillmentId", "order"] }, { kind: "component", type: FulfillmentStateLabelComponent, selector: "vdr-fulfillment-state-label", inputs: ["state"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1141
1163
  }
1142
1164
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: FulfillmentCardComponent, decorators: [{
1143
1165
  type: Component,
@@ -1154,11 +1176,13 @@ class ModificationDetailComponent {
1154
1176
  constructor() {
1155
1177
  this.addedItems = new Map();
1156
1178
  this.removedItems = new Map();
1179
+ this.modifiedItems = new Set();
1157
1180
  }
1158
1181
  ngOnChanges() {
1159
- const { added, removed } = this.getModifiedLines();
1182
+ const { added, removed, modified } = this.getModifiedLines();
1160
1183
  this.addedItems = added;
1161
1184
  this.removedItems = removed;
1185
+ this.modifiedItems = modified;
1162
1186
  }
1163
1187
  getSurcharge(id) {
1164
1188
  return this.order.surcharges.find(m => m.id === id);
@@ -1175,29 +1199,38 @@ class ModificationDetailComponent {
1175
1199
  quantity: count,
1176
1200
  }));
1177
1201
  }
1202
+ getModifiedItems() {
1203
+ return [...this.modifiedItems].map(line => ({
1204
+ name: line.productVariant.name,
1205
+ }));
1206
+ }
1178
1207
  getModifiedLines() {
1179
1208
  const added = new Map();
1180
1209
  const removed = new Map();
1210
+ const modified = new Set();
1181
1211
  for (const modificationLine of this.modification.lines || []) {
1182
1212
  const line = this.order.lines.find(l => l.id === modificationLine.orderLineId);
1183
1213
  if (!line) {
1184
1214
  continue;
1185
1215
  }
1186
- if (modificationLine.quantity < 0) {
1216
+ if (modificationLine.quantity === 0) {
1217
+ modified.add(line);
1218
+ }
1219
+ else if (modificationLine.quantity < 0) {
1187
1220
  removed.set(line, -modificationLine.quantity);
1188
1221
  }
1189
1222
  else {
1190
1223
  added.set(line, modificationLine.quantity);
1191
1224
  }
1192
1225
  }
1193
- return { added, removed };
1226
+ return { added, removed, modified };
1194
1227
  }
1195
1228
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: ModificationDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1196
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: ModificationDetailComponent, selector: "vdr-modification-detail", inputs: { order: "order", modification: "modification" }, usesOnChanges: true, ngImport: i0, template: "<vdr-labeled-data [label]=\"'common.ID' | translate\">{{ modification.id }}</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"modification.note\" [label]=\"'order.note' | translate\">{{\r\n modification.note\r\n}}</vdr-labeled-data>\r\n<vdr-labeled-data *ngFor=\"let surcharge of modification.surcharges\" [label]=\"'order.surcharges' | translate\">\r\n {{ getSurcharge(surcharge.id)?.description }}\r\n {{ getSurcharge(surcharge.id)?.priceWithTax | localeCurrency: order.currencyCode }}</vdr-labeled-data\r\n>\r\n<vdr-labeled-data *ngIf=\"getAddedItems().length\" [label]=\"'order.added-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getAddedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"getRemovedItems().length\" [label]=\"'order.removed-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getRemovedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: SimpleItemListComponent, selector: "vdr-simple-item-list", inputs: ["items"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1229
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: ModificationDetailComponent, selector: "vdr-modification-detail", inputs: { order: "order", modification: "modification" }, usesOnChanges: true, ngImport: i0, template: "<vdr-labeled-data [label]=\"'common.ID' | translate\">{{ modification.id }}</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"modification.note\" [label]=\"'order.note' | translate\">{{\r\n modification.note\r\n}}</vdr-labeled-data>\r\n<vdr-labeled-data *ngFor=\"let surcharge of modification.surcharges\" [label]=\"'order.surcharges' | translate\">\r\n {{ getSurcharge(surcharge.id)?.description }}\r\n {{ getSurcharge(surcharge.id)?.priceWithTax | localeCurrency: order.currencyCode }}</vdr-labeled-data\r\n>\r\n<vdr-labeled-data *ngIf=\"getAddedItems().length\" [label]=\"'order.added-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getAddedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"getRemovedItems().length\" [label]=\"'order.removed-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getRemovedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"getModifiedItems().length\" [label]=\"'order.modified-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getModifiedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: SimpleItemListComponent, selector: "vdr-simple-item-list", inputs: ["items"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1197
1230
  }
1198
1231
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: ModificationDetailComponent, decorators: [{
1199
1232
  type: Component,
1200
- args: [{ selector: 'vdr-modification-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-labeled-data [label]=\"'common.ID' | translate\">{{ modification.id }}</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"modification.note\" [label]=\"'order.note' | translate\">{{\r\n modification.note\r\n}}</vdr-labeled-data>\r\n<vdr-labeled-data *ngFor=\"let surcharge of modification.surcharges\" [label]=\"'order.surcharges' | translate\">\r\n {{ getSurcharge(surcharge.id)?.description }}\r\n {{ getSurcharge(surcharge.id)?.priceWithTax | localeCurrency: order.currencyCode }}</vdr-labeled-data\r\n>\r\n<vdr-labeled-data *ngIf=\"getAddedItems().length\" [label]=\"'order.added-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getAddedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"getRemovedItems().length\" [label]=\"'order.removed-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getRemovedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n" }]
1233
+ args: [{ selector: 'vdr-modification-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-labeled-data [label]=\"'common.ID' | translate\">{{ modification.id }}</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"modification.note\" [label]=\"'order.note' | translate\">{{\r\n modification.note\r\n}}</vdr-labeled-data>\r\n<vdr-labeled-data *ngFor=\"let surcharge of modification.surcharges\" [label]=\"'order.surcharges' | translate\">\r\n {{ getSurcharge(surcharge.id)?.description }}\r\n {{ getSurcharge(surcharge.id)?.priceWithTax | localeCurrency: order.currencyCode }}</vdr-labeled-data\r\n>\r\n<vdr-labeled-data *ngIf=\"getAddedItems().length\" [label]=\"'order.added-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getAddedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"getRemovedItems().length\" [label]=\"'order.removed-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getRemovedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"getModifiedItems().length\" [label]=\"'order.modified-items' | translate\">\r\n <vdr-simple-item-list [items]=\"getModifiedItems()\"></vdr-simple-item-list>\r\n</vdr-labeled-data>\r\n" }]
1201
1234
  }], propDecorators: { order: [{
1202
1235
  type: Input
1203
1236
  }], modification: [{
@@ -1238,7 +1271,7 @@ class OrderProcessNodeComponent {
1238
1271
  };
1239
1272
  }
1240
1273
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderProcessNodeComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
1241
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderProcessNodeComponent, selector: "vdr-order-process-node", inputs: { node: "node", index: "index", active: "active" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"node-wrapper\" [ngStyle]=\"getStyle()\" [class.active]=\"active$ | async\">\r\n <div\r\n class=\"node\"\r\n [class.active-target]=\"activeTarget$ | async\"\r\n >\r\n {{ node.name | stateI18nToken | translate }}\r\n </div>\r\n <div class=\"cancelled-wrapper\" *ngIf=\"isCancellable\">\r\n <div class=\"cancelled-edge\">\r\n </div>\r\n <clr-icon shape=\"dot-circle\"></clr-icon>\r\n <div class=\"cancelled-node\">\r\n {{ cancelledState | stateI18nToken | translate }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}.node-wrapper{position:absolute;z-index:1;display:flex;align-items:center}.node{display:inline-block;border:2px solid var(--color-component-border-200);border-radius:3px;padding:3px 6px;z-index:1;background-color:var(--color-component-bg-100);opacity:.7;transition:opacity .2s,background-color .2s,color .2s;cursor:default}.node.active-target{border-color:var(--color-primary-500);opacity:.9}.cancelled-wrapper{display:flex;align-items:center;color:var(--color-grey-300);transition:color .2s,opacity .2s;opacity:.7}.cancelled-edge{width:48px;height:2px;background-color:var(--color-component-bg-300);transition:background-color .2s}clr-icon{margin-inline-start:-1px}.cancelled-node{margin-inline-start:6px}.active .cancelled-wrapper{opacity:1}.active .node{opacity:1;background-color:var(--color-primary-600);border-color:var(--color-primary-600);color:var(--color-primary-100)}.active .cancelled-wrapper{color:var(--color-error-500)}.active .cancelled-edge{background-color:var(--color-error-500)}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1274
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderProcessNodeComponent, selector: "vdr-order-process-node", inputs: { node: "node", index: "index", active: "active" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"node-wrapper\" [ngStyle]=\"getStyle()\" [class.active]=\"active$ | async\">\r\n <div\r\n class=\"node\"\r\n [class.active-target]=\"activeTarget$ | async\"\r\n >\r\n {{ node.name | stateI18nToken | translate }}\r\n </div>\r\n <div class=\"cancelled-wrapper\" *ngIf=\"isCancellable\">\r\n <div class=\"cancelled-edge\">\r\n </div>\r\n <clr-icon shape=\"dot-circle\"></clr-icon>\r\n <div class=\"cancelled-node\">\r\n {{ cancelledState | stateI18nToken | translate }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}.node-wrapper{position:absolute;z-index:1;display:flex;align-items:center}.node{display:inline-block;border:2px solid var(--color-component-border-200);border-radius:3px;padding:3px 6px;z-index:1;background-color:var(--color-component-bg-100);opacity:.7;transition:opacity .2s,background-color .2s,color .2s;cursor:default}.node.active-target{border-color:var(--color-primary-500);opacity:.9}.cancelled-wrapper{display:flex;align-items:center;color:var(--color-grey-300);transition:color .2s,opacity .2s;opacity:.7}.cancelled-edge{width:48px;height:2px;background-color:var(--color-component-bg-300);transition:background-color .2s}clr-icon{margin-inline-start:-1px}.cancelled-node{margin-inline-start:6px}.active .cancelled-wrapper{opacity:1}.active .node{opacity:1;background-color:var(--color-primary-600);border-color:var(--color-primary-600);color:var(--color-primary-100)}.active .cancelled-wrapper{color:var(--color-error-500)}.active .cancelled-edge{background-color:var(--color-error-500)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1242
1275
  }
1243
1276
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderProcessNodeComponent, decorators: [{
1244
1277
  type: Component,
@@ -1278,7 +1311,7 @@ class OrderProcessEdgeComponent {
1278
1311
  };
1279
1312
  }
1280
1313
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderProcessEdgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1281
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderProcessEdgeComponent, selector: "vdr-order-process-edge", inputs: { from: "from", to: "to", index: "index" }, ngImport: i0, template: "<div\r\n [attr.data-from]=\"from.node.name\"\r\n [attr.data-to]=\"to.node.name\"\r\n [ngStyle]=\"getStyle()\"\r\n [class.active]=\"active$ | async\"\r\n class=\"edge\">\r\n <clr-icon shape=\"arrow\" flip=\"vertical\" class=\"arrow\"></clr-icon>\r\n</div>\r\n", styles: [".edge{position:absolute;border:1px solid var(--color-component-border-200);background-color:var(--color-component-bg-300);opacity:.3;transition:border .2s,opacity .2s,background-color .2s}.edge.active{border-color:var(--color-primary-500);background-color:var(--color-primary-500);opacity:1}.edge.active .arrow{color:var(--color-primary-500)}.edge .arrow{position:absolute;bottom:-4px;left:-8px;color:var(--color-grey-300)}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1314
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderProcessEdgeComponent, selector: "vdr-order-process-edge", inputs: { from: "from", to: "to", index: "index" }, ngImport: i0, template: "<div\r\n [attr.data-from]=\"from.node.name\"\r\n [attr.data-to]=\"to.node.name\"\r\n [ngStyle]=\"getStyle()\"\r\n [class.active]=\"active$ | async\"\r\n class=\"edge\">\r\n <clr-icon shape=\"arrow\" flip=\"vertical\" class=\"arrow\"></clr-icon>\r\n</div>\r\n", styles: [".edge{position:absolute;border:1px solid var(--color-component-border-200);background-color:var(--color-component-bg-300);opacity:.3;transition:border .2s,opacity .2s,background-color .2s}.edge.active{border-color:var(--color-primary-500);background-color:var(--color-primary-500);opacity:1}.edge.active .arrow{color:var(--color-primary-500)}.edge .arrow{position:absolute;bottom:-4px;left:-8px;color:var(--color-grey-300)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1282
1315
  }
1283
1316
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderProcessEdgeComponent, decorators: [{
1284
1317
  type: Component,
@@ -1394,34 +1427,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImpor
1394
1427
  args: [{ selector: 'vdr-order-process-graph-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.order-state-diagram' | translate }}</ng-template>\r\n\r\n<vdr-order-process-graph [states]=\"states\" [initialState]=\"activeState\"></vdr-order-process-graph>\r\n" }]
1395
1428
  }], ctorParameters: function () { return [{ type: i1.ServerConfigService }]; } });
1396
1429
 
1430
+ class PaymentForRefundSelectorComponent {
1431
+ constructor() {
1432
+ this.paymentSelected = new EventEmitter();
1433
+ }
1434
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: PaymentForRefundSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1435
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: PaymentForRefundSelectorComponent, selector: "vdr-payment-for-refund-selector", inputs: { refundablePayments: "refundablePayments", order: "order" }, outputs: { paymentSelected: "paymentSelected" }, ngImport: i0, template: "<vdr-card\r\n [title]=\"'order.payment' | translate\"\r\n [class.selected]=\"payment.selected\"\r\n [class.unselected]=\"!payment.selected\"\r\n *ngFor=\"let payment of refundablePayments\"\r\n>\r\n <ng-template vdrCardControls>\r\n <vdr-select-toggle\r\n size=\"small\"\r\n [title]=\"'order.refund-this-payment' | translate\"\r\n [label]=\"'order.refund-this-payment' | translate\"\r\n [disabled]=\"refundablePayments.length === 1\"\r\n [(selected)]=\"payment.selected\"\r\n (selectedChange)=\"paymentSelected.emit({ payment: payment, selected: $event })\"\r\n ></vdr-select-toggle>\r\n </ng-template>\r\n <div class=\"form-grid\">\r\n <vdr-labeled-data [label]=\"'order.payment-method' | translate\">\r\n {{ payment.method }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.transaction-id' | translate\">\r\n {{ payment.transactionId }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.payment-amount' | translate\">\r\n {{ payment.amount | localeCurrency : order.currencyCode }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refundable-amount' | translate\">\r\n {{ payment.refundableAmount | localeCurrency : order.currencyCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n <vdr-form-field [label]=\"'order.refund-amount' | translate\">\r\n <vdr-currency-input\r\n [readonly]=\"!payment.selected\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [formControl]=\"payment.amountToRefundControl\"\r\n ></vdr-currency-input>\r\n </vdr-form-field>\r\n</vdr-card>", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"], outputs: ["readOnlyToggleChange"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "component", type: i1.SelectToggleComponent, selector: "vdr-select-toggle", inputs: ["size", "selected", "hiddenWhenOff", "disabled", "label"], outputs: ["selectedChange"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "directive", type: i1.CardControlsDirective, selector: "[vdrCardControls]" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
1436
+ }
1437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: PaymentForRefundSelectorComponent, decorators: [{
1438
+ type: Component,
1439
+ args: [{ selector: 'vdr-payment-for-refund-selector', changeDetection: ChangeDetectionStrategy.Default, template: "<vdr-card\r\n [title]=\"'order.payment' | translate\"\r\n [class.selected]=\"payment.selected\"\r\n [class.unselected]=\"!payment.selected\"\r\n *ngFor=\"let payment of refundablePayments\"\r\n>\r\n <ng-template vdrCardControls>\r\n <vdr-select-toggle\r\n size=\"small\"\r\n [title]=\"'order.refund-this-payment' | translate\"\r\n [label]=\"'order.refund-this-payment' | translate\"\r\n [disabled]=\"refundablePayments.length === 1\"\r\n [(selected)]=\"payment.selected\"\r\n (selectedChange)=\"paymentSelected.emit({ payment: payment, selected: $event })\"\r\n ></vdr-select-toggle>\r\n </ng-template>\r\n <div class=\"form-grid\">\r\n <vdr-labeled-data [label]=\"'order.payment-method' | translate\">\r\n {{ payment.method }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.transaction-id' | translate\">\r\n {{ payment.transactionId }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.payment-amount' | translate\">\r\n {{ payment.amount | localeCurrency : order.currencyCode }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refundable-amount' | translate\">\r\n {{ payment.refundableAmount | localeCurrency : order.currencyCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n <vdr-form-field [label]=\"'order.refund-amount' | translate\">\r\n <vdr-currency-input\r\n [readonly]=\"!payment.selected\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [formControl]=\"payment.amountToRefundControl\"\r\n ></vdr-currency-input>\r\n </vdr-form-field>\r\n</vdr-card>", styles: [":host{display:block}\n"] }]
1440
+ }], propDecorators: { refundablePayments: [{
1441
+ type: Input
1442
+ }], order: [{
1443
+ type: Input
1444
+ }], paymentSelected: [{
1445
+ type: Output
1446
+ }] } });
1447
+
1397
1448
  class RefundOrderDialogComponent {
1398
1449
  constructor(i18nService) {
1399
1450
  this.i18nService = i18nService;
1400
1451
  this.lineQuantities = {};
1401
- this.refundShipping = false;
1402
- this.adjustment = 0;
1452
+ this.refundablePayments = [];
1453
+ this.refundShippingLineIds = [];
1403
1454
  this.reasons = getAppConfig().cancellationReasons ?? [
1404
1455
  marker('order.refund-reason-customer-request'),
1405
1456
  marker('order.refund-reason-not-available'),
1406
1457
  ];
1458
+ this.manuallySetRefundTotal = false;
1459
+ this.refundTotal = 0;
1407
1460
  this.reasons = this.reasons.map(r => this.i18nService.translate(r));
1408
1461
  }
1409
- get refundTotal() {
1410
- const itemTotal = this.order.lines.reduce((total, line) => {
1411
- const lineRef = this.lineQuantities[line.id];
1412
- const refundCount = (lineRef.refund && lineRef.quantity) || 0;
1413
- return total + line.proratedUnitPriceWithTax * refundCount;
1414
- }, 0);
1415
- return itemTotal + (this.refundShipping ? this.order.shippingWithTax : 0) + this.adjustment;
1416
- }
1417
- get settledPaymentsTotal() {
1418
- return this.settledPayments
1419
- .map(payment => {
1420
- const paymentTotal = payment.amount;
1421
- const alreadyRefundedTotal = summate(payment.refunds.filter(r => r.state !== 'Failed'), 'total');
1422
- return paymentTotal - alreadyRefundedTotal;
1423
- })
1424
- .reduce((sum, amount) => sum + amount, 0);
1462
+ get totalRefundableAmount() {
1463
+ return summate(this.refundablePayments, 'refundableAmount');
1464
+ }
1465
+ get amountToRefundTotal() {
1466
+ return this.refundablePayments.reduce((total, payment) => total + payment.amountToRefundControl.value, 0);
1425
1467
  }
1426
1468
  lineCanBeRefundedOrCancelled(line) {
1427
1469
  const refundedCount = this.order.payments
@@ -1430,30 +1472,86 @@ class RefundOrderDialogComponent {
1430
1472
  .reduce((all, refund) => [...all, ...refund.lines], [])
1431
1473
  .filter(refundLine => refundLine.orderLineId === line.id)
1432
1474
  .reduce((sum, refundLine) => sum + refundLine.quantity, 0) ?? 0;
1433
- return refundedCount < line.quantity;
1475
+ return refundedCount < line.orderPlacedQuantity;
1434
1476
  }
1435
1477
  ngOnInit() {
1436
1478
  this.lineQuantities = this.order.lines.reduce((result, line) => ({
1437
1479
  ...result,
1438
1480
  [line.id]: {
1439
1481
  quantity: 0,
1440
- refund: false,
1482
+ refund: true,
1441
1483
  cancel: false,
1442
1484
  },
1443
1485
  }), {});
1444
- this.settledPayments = (this.order.payments || []).filter(p => p.state === 'Settled');
1445
- if (this.settledPayments.length) {
1446
- this.selectedPayment = this.settledPayments[0];
1486
+ this.refundablePayments = getRefundablePayments(this.order.payments);
1487
+ }
1488
+ updateRefundTotal() {
1489
+ if (!this.manuallySetRefundTotal) {
1490
+ const itemTotal = this.order.lines.reduce((total, line) => {
1491
+ const lineRef = this.lineQuantities[line.id];
1492
+ const refundCount = lineRef.quantity || 0;
1493
+ return total + line.proratedUnitPriceWithTax * refundCount;
1494
+ }, 0);
1495
+ const shippingTotal = this.order.shippingLines.reduce((total, line) => {
1496
+ if (this.refundShippingLineIds.includes(line.id)) {
1497
+ return total + line.discountedPriceWithTax;
1498
+ }
1499
+ else {
1500
+ return total;
1501
+ }
1502
+ }, 0);
1503
+ this.refundTotal = itemTotal + shippingTotal;
1504
+ }
1505
+ // allocate the refund total across the refundable payments
1506
+ const refundablePayments = this.refundablePayments.filter(p => p.selected);
1507
+ let refundsAllocated = 0;
1508
+ for (const payment of refundablePayments) {
1509
+ const amountToRefund = Math.min(payment.refundableAmount, this.refundTotal - refundsAllocated);
1510
+ payment.amountToRefundControl.setValue(amountToRefund);
1511
+ refundsAllocated += amountToRefund;
1512
+ }
1513
+ }
1514
+ toggleShippingRefund(lineId) {
1515
+ const index = this.refundShippingLineIds.indexOf(lineId);
1516
+ if (index === -1) {
1517
+ this.refundShippingLineIds.push(lineId);
1518
+ }
1519
+ else {
1520
+ this.refundShippingLineIds.splice(index, 1);
1521
+ }
1522
+ this.updateRefundTotal();
1523
+ }
1524
+ onRefundQuantityChange(orderLineId, quantity) {
1525
+ this.manuallySetRefundTotal = false;
1526
+ const selectionLine = this.lineQuantities[orderLineId];
1527
+ if (selectionLine) {
1528
+ const previousQuantity = selectionLine.quantity;
1529
+ if (quantity === 0) {
1530
+ selectionLine.cancel = false;
1531
+ }
1532
+ else if (previousQuantity === 0 && quantity > 0) {
1533
+ selectionLine.cancel = true;
1534
+ }
1535
+ selectionLine.quantity = quantity;
1536
+ this.updateRefundTotal();
1447
1537
  }
1448
1538
  }
1449
- handleZeroQuantity(line) {
1450
- if (line?.quantity === 0) {
1451
- line.cancel = false;
1452
- line.refund = false;
1539
+ onPaymentSelected(payment, selected) {
1540
+ if (selected) {
1541
+ const outstandingRefundAmount = this.refundTotal -
1542
+ this.refundablePayments
1543
+ .filter(p => p.id !== payment.id)
1544
+ .reduce((total, p) => total + p.amountToRefundControl.value, 0);
1545
+ if (0 < outstandingRefundAmount) {
1546
+ payment.amountToRefundControl.setValue(Math.min(outstandingRefundAmount, payment.refundableAmount));
1547
+ }
1548
+ }
1549
+ else {
1550
+ payment.amountToRefundControl.setValue(0);
1453
1551
  }
1454
1552
  }
1455
1553
  isRefunding() {
1456
- const result = Object.values(this.lineQuantities).reduce((isRefunding, line) => isRefunding || (0 < line.quantity && line.refund), false);
1554
+ const result = Object.values(this.lineQuantities).reduce((isRefunding, line) => isRefunding || 0 < line.quantity, false);
1457
1555
  return result;
1458
1556
  }
1459
1557
  isCancelling() {
@@ -1461,38 +1559,31 @@ class RefundOrderDialogComponent {
1461
1559
  return result;
1462
1560
  }
1463
1561
  canSubmit() {
1464
- if (this.isRefunding()) {
1465
- return !!(this.selectedPayment &&
1466
- this.reason &&
1467
- 0 < this.refundTotal &&
1468
- this.refundTotal <= this.settledPaymentsTotal);
1469
- }
1470
- else if (this.isCancelling()) {
1471
- return !!this.reason;
1472
- }
1473
- return false;
1562
+ return 0 < this.refundTotal && this.amountToRefundTotal === this.refundTotal && !!this.reason;
1474
1563
  }
1475
1564
  select() {
1476
- const payment = this.selectedPayment;
1477
- if (payment) {
1478
- const refundLines = this.getOrderLineInput(line => line.refund);
1479
- const cancelLines = this.getOrderLineInput(line => line.cancel);
1480
- this.resolveWith({
1481
- refund: {
1565
+ const refundLines = this.getOrderLineInput(() => true);
1566
+ const cancelLines = this.getOrderLineInput(line => line.cancel);
1567
+ this.resolveWith({
1568
+ refunds: this.refundablePayments
1569
+ .filter(rp => rp.selected && 0 < rp.amountToRefundControl.value)
1570
+ .map(payment => {
1571
+ return {
1482
1572
  lines: refundLines,
1483
1573
  reason: this.reason,
1484
- shipping: this.refundShipping ? this.order.shippingWithTax : 0,
1485
- adjustment: this.adjustment,
1486
1574
  paymentId: payment.id,
1487
- },
1488
- cancel: {
1489
- lines: cancelLines,
1490
- orderId: this.order.id,
1491
- reason: this.reason,
1492
- cancelShipping: this.refundShipping,
1493
- },
1494
- });
1495
- }
1575
+ amount: payment.amountToRefundControl.value,
1576
+ shipping: 0,
1577
+ adjustment: 0,
1578
+ };
1579
+ }),
1580
+ cancel: {
1581
+ lines: cancelLines,
1582
+ orderId: this.order.id,
1583
+ reason: this.reason,
1584
+ cancelShipping: this.refundShippingLineIds.length > 0,
1585
+ },
1586
+ });
1496
1587
  }
1497
1588
  cancel() {
1498
1589
  this.resolveWith();
@@ -1506,11 +1597,11 @@ class RefundOrderDialogComponent {
1506
1597
  }));
1507
1598
  }
1508
1599
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: RefundOrderDialogComponent, deps: [{ token: i1.I18nService }], target: i0.ɵɵFactoryTarget.Component }); }
1509
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: RefundOrderDialogComponent, selector: "vdr-refund-order-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.refund-and-cancel-order' | translate }}</ng-template>\r\n\r\n<div class=\"refund-wrapper\">\r\n <div class=\"order-table\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th>{{ 'order.unit-price' | translate }}</th>\r\n <th>{{ 'order.prorated-unit-price' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th>{{ 'order.refund' | translate }}</th>\r\n <th>{{ 'order.cancel' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tr *ngFor=\"let line of order.lines\" class=\"order-line\">\r\n <td class=\"align-middle thumb\">\r\n <img [src]=\"line.featuredAsset | assetPreview: 'tiny'\" />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle quantity\">\r\n {{ line.quantity }}\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n {{ line.unitPriceWithTax | localeCurrency: order.currencyCode }}\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n <div class=\"prorated-wrapper\">\r\n {{ line.proratedUnitPriceWithTax | localeCurrency: order.currencyCode }}\r\n <ng-container *ngIf=\"line.discounts as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n <button class=\"icon-button\"><clr-icon shape=\"info\"></clr-icon></button>\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n {{ discount.description }}\r\n <div class=\"promotion-amount\">\r\n {{\r\n discount.amount / 100 / line.quantity\r\n | number: '1.0-2'\r\n | currency: order.currencyCode\r\n }}\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td class=\"align-middle quantity-col\">\r\n <input\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n [(ngModel)]=\"lineQuantities[line.id].quantity\"\r\n type=\"number\"\r\n [max]=\"line.quantity\"\r\n min=\"0\"\r\n (input)=\"handleZeroQuantity(lineQuantities[line.id])\"\r\n />\r\n </td>\r\n <td class=\"align-middle\">\r\n <div class=\"cancel-checkbox-wrapper\">\r\n <input\r\n type=\"checkbox\"\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n clrCheckbox\r\n [disabled]=\"0 === lineQuantities[line.id].quantity\"\r\n [(ngModel)]=\"lineQuantities[line.id].refund\"\r\n />\r\n </div>\r\n </td>\r\n <td class=\"align-middle\">\r\n <div class=\"cancel-checkbox-wrapper\">\r\n <input\r\n type=\"checkbox\"\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n clrCheckbox\r\n [disabled]=\"0 === lineQuantities[line.id].quantity\"\r\n [(ngModel)]=\"lineQuantities[line.id].cancel\"\r\n />\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class=\"refund-details mt-4\" [class.faded]=\"!isRefunding() && !isCancelling()\">\r\n <div>\r\n <label class=\"clr-control-label\">{{ 'order.refund-cancellation-reason' | translate }}</label>\r\n <ng-select\r\n [disabled]=\"!isRefunding() && !isCancelling()\"\r\n [items]=\"reasons\"\r\n bindLabel=\"name\"\r\n autofocus\r\n [placeholder]=\"'order.refund-cancellation-reason-required' | translate\"\r\n bindValue=\"id\"\r\n [addTag]=\"true\"\r\n [(ngModel)]=\"reason\"\r\n ></ng-select>\r\n </div>\r\n\r\n <div>\r\n <clr-select-container>\r\n <label>{{ 'order.payment-to-refund' | translate }}</label>\r\n <select clrSelect name=\"options\" [(ngModel)]=\"selectedPayment\" [disabled]=\"!isRefunding()\">\r\n <option\r\n *ngFor=\"let payment of settledPayments\"\r\n [ngValue]=\"payment\"\r\n [disabled]=\"payment.state !== 'Settled'\"\r\n >\r\n #{{ payment.id }} {{ payment.method }}:\r\n {{ payment.amount | localeCurrency: order.currencyCode }}\r\n </option>\r\n </select>\r\n </clr-select-container>\r\n\r\n <clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"refundShipping\" [disabled]=\"!isRefunding()\" />\r\n <label>\r\n {{ 'order.refund-shipping' | translate }} ({{\r\n order.shippingWithTax | localeCurrency: order.currencyCode\r\n }})\r\n </label>\r\n </clr-checkbox-wrapper>\r\n <clr-input-container>\r\n <label>{{ 'order.refund-adjustment' | translate }}</label>\r\n <vdr-currency-input\r\n clrInput\r\n [disabled]=\"!isRefunding()\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [(ngModel)]=\"adjustment\"\r\n ></vdr-currency-input>\r\n </clr-input-container>\r\n <div class=\"totals\" [class.disabled]=\"!isRefunding()\">\r\n <div class=\"order-total\">\r\n {{ 'order.payment-amount' | translate }}:\r\n {{ selectedPayment.amount | localeCurrency: order.currencyCode }}\r\n </div>\r\n <div class=\"refund-total\">\r\n {{ 'order.refund-total' | translate }}:\r\n {{ refundTotal | localeCurrency: order.currencyCode }}\r\n </div>\r\n <div class=\"refund-total-error\" *ngIf=\"refundTotal < 0 || settledPaymentsTotal < refundTotal\">\r\n {{\r\n 'order.refund-total-error'\r\n | translate\r\n : {\r\n min: 0 | currency: order.currencyCode,\r\n max: settledPaymentsTotal | localeCurrency: order.currencyCode\r\n }\r\n }}\r\n </div>\r\n <div class=\"refund-total-warning\" *ngIf=\"selectedPayment.amount < refundTotal\">\r\n {{ 'order.refund-total-warning' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"select()\" [disabled]=\"!canSubmit()\" class=\"btn btn-primary\">\r\n <ng-container *ngIf=\"isRefunding(); else cancelling\">\r\n {{\r\n 'order.refund-with-amount'\r\n | translate: { amount: refundTotal | localeCurrency: order.currencyCode }\r\n }}\r\n </ng-container>\r\n <ng-template #cancelling>\r\n {{ 'order.cancel-selected-items' | translate }}\r\n </ng-template>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{height:100%;display:flex;min-height:64vh}.refund-wrapper{flex:1;flex-direction:column}.refund-wrapper .order-table{flex:1;overflow-y:auto}.refund-wrapper .order-table table{margin-top:0}.refund-wrapper tr.ignore{color:var(--color-grey-300)}.quantity-col{background-color:var(--color-warning-100)}.cancel-checkbox-wrapper{display:flex;align-items:center;justify-content:center}clr-checkbox-wrapper{margin-top:12px;margin-bottom:12px;display:block}.refund-details{display:flex;justify-content:space-between}.refund-details.faded{opacity:.5}.totals{margin-top:48px}.totals .refund-total{font-size:18px}.totals .refund-total-error{color:var(--color-error-500)}.totals .refund-total-warning{color:var(--color-warning-600);max-width:250px}.totals.disabled{color:var(--color-grey-300)}.prorated-wrapper{display:flex;justify-content:center}.line-promotion{display:flex;justify-content:space-between;font-size:12px;padding:3px 6px}.line-promotion .promotion-amount{margin-inline-start:12px}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i1$1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i1$1.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i1$1.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "directive", type: i1$1.ClrInput, selector: "[clrInput]" }, { kind: "component", type: i1$1.ClrInputContainer, selector: "clr-input-container" }, { kind: "directive", type: i1$1.ClrSelect, selector: "[clrSelect]" }, { kind: "component", type: i1$1.ClrSelectContainer, selector: "clr-select-container" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "component", type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { kind: "pipe", type: i2$1.DecimalPipe, name: "number" }, { kind: "pipe", type: i2$1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1600
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: RefundOrderDialogComponent, selector: "vdr-refund-order-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.refund-and-cancel-order' | translate }}</ng-template>\r\n\r\n<div class=\"refund-wrapper\">\r\n <vdr-data-table-2 id=\"refund-order\" [items]=\"order.lines\">\r\n <!-- Here we define all the available columns -->\r\n <vdr-dt2-column id=\"id\" [heading]=\"'common.id' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"created-at\" [heading]=\"'common.created-at' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"updated-at\" [heading]=\"'common.updated-at' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"line.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"product-name\" [heading]=\"'order.product-name' | translate\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.name }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"product-sku\" [heading]=\"'order.product-sku' | translate\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"unit-price\" [heading]=\"'order.unit-price' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"prorated-unit-price\" [heading]=\"'order.prorated-unit-price' | translate\">\r\n <ng-template let-line=\"item\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n <ng-container *ngIf=\"line.discounts as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n <button class=\"icon-button\"><clr-icon shape=\"info\"></clr-icon></button>\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n {{ discount.description }}\r\n <div class=\"promotion-amount\">\r\n {{\r\n discount.amount / 100 / line.quantity\r\n | number : '1.0-2'\r\n | currency : order.currencyCode\r\n }}\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"quantity\" [heading]=\"'order.quantity' | translate\">\r\n <ng-template let-line=\"item\">\r\n {{ line.quantity }}\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"refund-quantity\" [heading]=\"'order.refund' | translate\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <input\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n [ngModel]=\"lineQuantities[line.id].quantity\"\r\n type=\"number\"\r\n [max]=\"line.quantity\"\r\n min=\"0\"\r\n (ngModelChange)=\"onRefundQuantityChange(line.id, $event)\"\r\n />\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"cancel\" [heading]=\"'order.return-to-stock' | translate\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"cancel-checkbox-wrapper\">\r\n <label class=\"flex center\">\r\n <input\r\n type=\"checkbox\"\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n clrCheckbox\r\n [disabled]=\"0 === lineQuantities[line.id].quantity\"\r\n [(ngModel)]=\"lineQuantities[line.id].cancel\"\r\n />\r\n <span class=\"ml-1\">{{ 'order.return-to-stock' | translate }}</span></label\r\n >\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n </vdr-data-table-2>\r\n\r\n <div class=\"refund-details mt-4\">\r\n <div>\r\n <vdr-card>\r\n <label class=\"flex mb-2\" *ngFor=\"let shippingLine of order.shippingLines\">\r\n <input type=\"checkbox\" clrCheckbox (change)=\"toggleShippingRefund(shippingLine.id)\" />\r\n <div class=\"ml-1\">\r\n {{ 'order.refund-shipping' | translate }}\r\n <span>{{ shippingLine.shippingMethod.name }}:</span>\r\n <span class=\"ml-1\"\r\n >{{ shippingLine.discountedPriceWithTax | localeCurrency : order.currencyCode }}\r\n </span>\r\n </div></label\r\n >\r\n <vdr-form-field [label]=\"'order.refund-cancellation-reason' | translate\" class=\"mb-2\">\r\n <ng-select\r\n [items]=\"reasons\"\r\n bindLabel=\"name\"\r\n autofocus\r\n [placeholder]=\"'order.refund-cancellation-reason-required' | translate\"\r\n bindValue=\"id\"\r\n [addTag]=\"true\"\r\n [(ngModel)]=\"reason\"\r\n ></ng-select>\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"'order.refund-total' | translate\"\r\n [readOnlyToggle]=\"true\"\r\n (readOnlyToggleChange)=\"manuallySetRefundTotal = !$event\"\r\n >\r\n <vdr-currency-input\r\n [readonly]=\"!manuallySetRefundTotal\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [(ngModel)]=\"refundTotal\"\r\n (ngModelChange)=\"updateRefundTotal()\"\r\n ></vdr-currency-input>\r\n </vdr-form-field>\r\n </vdr-card>\r\n </div>\r\n <div class=\"\">\r\n <vdr-payment-for-refund-selector\r\n [refundablePayments]=\"refundablePayments\"\r\n (paymentSelected)=\"onPaymentSelected($event.payment, $event.selected)\"\r\n [order]=\"order\"\r\n ></vdr-payment-for-refund-selector>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <div>\r\n <div class=\"errors\">\r\n <clr-alert\r\n *ngIf=\"refundTotal < 0 || totalRefundableAmount < refundTotal\"\r\n [clrAlertType]=\"'danger'\"\r\n [clrAlertClosable]=\"false\"\r\n >\r\n <clr-alert-item>\r\n {{\r\n 'order.refund-total-error'\r\n | translate\r\n : {\r\n min: 0 | currency : order.currencyCode,\r\n max: totalRefundableAmount | localeCurrency : order.currencyCode\r\n }\r\n }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n <clr-alert\r\n *ngIf=\"amountToRefundTotal < refundTotal || refundTotal < amountToRefundTotal\"\r\n [clrAlertType]=\"'danger'\"\r\n [clrAlertClosable]=\"false\"\r\n >\r\n <clr-alert-item>\r\n {{ 'order.refund-total-warning' | translate }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n <clr-alert\r\n *ngIf=\"amountToRefundTotal && !reason\"\r\n [clrAlertType]=\"'danger'\"\r\n [clrAlertClosable]=\"false\"\r\n >\r\n <clr-alert-item>\r\n {{ 'order.refund-cancellation-reason-required' | translate }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div class=\"modal-buttons\">\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"select()\" [disabled]=\"!canSubmit()\" class=\"btn btn-primary\">\r\n {{\r\n 'order.refund-with-amount'\r\n | translate : { amount: amountToRefundTotal | localeCurrency : order.currencyCode }\r\n }}\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{height:100%;display:flex;flex-direction:column;min-height:64vh}.refund-wrapper{flex:1;flex-direction:column}.refund-wrapper .order-table{flex:1;overflow-y:auto}.refund-wrapper .order-table table{margin-top:0}.refund-wrapper tr.ignore{color:var(--color-grey-300)}::ng-deep .refund-wrapper .table-wrapper{max-width:initial!important}.quantity-col{background-color:var(--color-warning-100)}.cancel-checkbox-wrapper{display:flex;align-items:center;justify-content:center}clr-checkbox-wrapper{margin-top:12px;margin-bottom:12px;display:block}.refund-details{display:flex;flex-direction:column;padding-bottom:var(--space-unit);gap:calc(var(--space-unit) * 2);justify-content:space-between}@media screen and (min-width: 992px){.refund-details{flex-direction:row}}.refund-details vdr-card.unselected{opacity:.8}.refund-details>*{flex:1}.errors{display:flex;justify-content:flex-end;gap:calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) 0}.prorated-wrapper{display:flex;justify-content:center}.line-promotion{display:flex;justify-content:space-between;font-size:12px;padding:3px 6px}.line-promotion .promotion-amount{margin-inline-start:12px}vdr-card.faded{opacity:.8}.modal-buttons{display:flex;justify-content:flex-end;gap:.6rem;gap:var(--clr-modal-footer-gap, .6rem)}\n"], dependencies: [{ kind: "component", type: i3.ClrAlert, selector: "clr-alert", inputs: ["clrAlertSizeSmall", "clrAlertClosable", "clrAlertAppLevel", "clrCloseButtonAriaLabel", "clrAlertType", "clrAlertIcon", "clrAlertClosed"], outputs: ["clrAlertClosedChange"] }, { kind: "component", type: i3.ClrAlertItem, selector: "clr-alert-item" }, { kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i3.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"], outputs: ["readOnlyToggleChange"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "component", type: i1.DataTable2Component, selector: "vdr-data-table-2", inputs: ["id", "items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "filters", "activeIndex"], outputs: ["pageChange", "itemsPerPageChange"] }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "component", type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { kind: "component", type: PaymentForRefundSelectorComponent, selector: "vdr-payment-for-refund-selector", inputs: ["refundablePayments", "order"], outputs: ["paymentSelected"] }, { kind: "pipe", type: i2$1.DecimalPipe, name: "number" }, { kind: "pipe", type: i2$1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1510
1601
  }
1511
1602
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: RefundOrderDialogComponent, decorators: [{
1512
1603
  type: Component,
1513
- args: [{ selector: 'vdr-refund-order-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.refund-and-cancel-order' | translate }}</ng-template>\r\n\r\n<div class=\"refund-wrapper\">\r\n <div class=\"order-table\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th>{{ 'order.unit-price' | translate }}</th>\r\n <th>{{ 'order.prorated-unit-price' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th>{{ 'order.refund' | translate }}</th>\r\n <th>{{ 'order.cancel' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tr *ngFor=\"let line of order.lines\" class=\"order-line\">\r\n <td class=\"align-middle thumb\">\r\n <img [src]=\"line.featuredAsset | assetPreview: 'tiny'\" />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle quantity\">\r\n {{ line.quantity }}\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n {{ line.unitPriceWithTax | localeCurrency: order.currencyCode }}\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n <div class=\"prorated-wrapper\">\r\n {{ line.proratedUnitPriceWithTax | localeCurrency: order.currencyCode }}\r\n <ng-container *ngIf=\"line.discounts as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n <button class=\"icon-button\"><clr-icon shape=\"info\"></clr-icon></button>\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n {{ discount.description }}\r\n <div class=\"promotion-amount\">\r\n {{\r\n discount.amount / 100 / line.quantity\r\n | number: '1.0-2'\r\n | currency: order.currencyCode\r\n }}\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td class=\"align-middle quantity-col\">\r\n <input\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n [(ngModel)]=\"lineQuantities[line.id].quantity\"\r\n type=\"number\"\r\n [max]=\"line.quantity\"\r\n min=\"0\"\r\n (input)=\"handleZeroQuantity(lineQuantities[line.id])\"\r\n />\r\n </td>\r\n <td class=\"align-middle\">\r\n <div class=\"cancel-checkbox-wrapper\">\r\n <input\r\n type=\"checkbox\"\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n clrCheckbox\r\n [disabled]=\"0 === lineQuantities[line.id].quantity\"\r\n [(ngModel)]=\"lineQuantities[line.id].refund\"\r\n />\r\n </div>\r\n </td>\r\n <td class=\"align-middle\">\r\n <div class=\"cancel-checkbox-wrapper\">\r\n <input\r\n type=\"checkbox\"\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n clrCheckbox\r\n [disabled]=\"0 === lineQuantities[line.id].quantity\"\r\n [(ngModel)]=\"lineQuantities[line.id].cancel\"\r\n />\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class=\"refund-details mt-4\" [class.faded]=\"!isRefunding() && !isCancelling()\">\r\n <div>\r\n <label class=\"clr-control-label\">{{ 'order.refund-cancellation-reason' | translate }}</label>\r\n <ng-select\r\n [disabled]=\"!isRefunding() && !isCancelling()\"\r\n [items]=\"reasons\"\r\n bindLabel=\"name\"\r\n autofocus\r\n [placeholder]=\"'order.refund-cancellation-reason-required' | translate\"\r\n bindValue=\"id\"\r\n [addTag]=\"true\"\r\n [(ngModel)]=\"reason\"\r\n ></ng-select>\r\n </div>\r\n\r\n <div>\r\n <clr-select-container>\r\n <label>{{ 'order.payment-to-refund' | translate }}</label>\r\n <select clrSelect name=\"options\" [(ngModel)]=\"selectedPayment\" [disabled]=\"!isRefunding()\">\r\n <option\r\n *ngFor=\"let payment of settledPayments\"\r\n [ngValue]=\"payment\"\r\n [disabled]=\"payment.state !== 'Settled'\"\r\n >\r\n #{{ payment.id }} {{ payment.method }}:\r\n {{ payment.amount | localeCurrency: order.currencyCode }}\r\n </option>\r\n </select>\r\n </clr-select-container>\r\n\r\n <clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"refundShipping\" [disabled]=\"!isRefunding()\" />\r\n <label>\r\n {{ 'order.refund-shipping' | translate }} ({{\r\n order.shippingWithTax | localeCurrency: order.currencyCode\r\n }})\r\n </label>\r\n </clr-checkbox-wrapper>\r\n <clr-input-container>\r\n <label>{{ 'order.refund-adjustment' | translate }}</label>\r\n <vdr-currency-input\r\n clrInput\r\n [disabled]=\"!isRefunding()\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [(ngModel)]=\"adjustment\"\r\n ></vdr-currency-input>\r\n </clr-input-container>\r\n <div class=\"totals\" [class.disabled]=\"!isRefunding()\">\r\n <div class=\"order-total\">\r\n {{ 'order.payment-amount' | translate }}:\r\n {{ selectedPayment.amount | localeCurrency: order.currencyCode }}\r\n </div>\r\n <div class=\"refund-total\">\r\n {{ 'order.refund-total' | translate }}:\r\n {{ refundTotal | localeCurrency: order.currencyCode }}\r\n </div>\r\n <div class=\"refund-total-error\" *ngIf=\"refundTotal < 0 || settledPaymentsTotal < refundTotal\">\r\n {{\r\n 'order.refund-total-error'\r\n | translate\r\n : {\r\n min: 0 | currency: order.currencyCode,\r\n max: settledPaymentsTotal | localeCurrency: order.currencyCode\r\n }\r\n }}\r\n </div>\r\n <div class=\"refund-total-warning\" *ngIf=\"selectedPayment.amount < refundTotal\">\r\n {{ 'order.refund-total-warning' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"select()\" [disabled]=\"!canSubmit()\" class=\"btn btn-primary\">\r\n <ng-container *ngIf=\"isRefunding(); else cancelling\">\r\n {{\r\n 'order.refund-with-amount'\r\n | translate: { amount: refundTotal | localeCurrency: order.currencyCode }\r\n }}\r\n </ng-container>\r\n <ng-template #cancelling>\r\n {{ 'order.cancel-selected-items' | translate }}\r\n </ng-template>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{height:100%;display:flex;min-height:64vh}.refund-wrapper{flex:1;flex-direction:column}.refund-wrapper .order-table{flex:1;overflow-y:auto}.refund-wrapper .order-table table{margin-top:0}.refund-wrapper tr.ignore{color:var(--color-grey-300)}.quantity-col{background-color:var(--color-warning-100)}.cancel-checkbox-wrapper{display:flex;align-items:center;justify-content:center}clr-checkbox-wrapper{margin-top:12px;margin-bottom:12px;display:block}.refund-details{display:flex;justify-content:space-between}.refund-details.faded{opacity:.5}.totals{margin-top:48px}.totals .refund-total{font-size:18px}.totals .refund-total-error{color:var(--color-error-500)}.totals .refund-total-warning{color:var(--color-warning-600);max-width:250px}.totals.disabled{color:var(--color-grey-300)}.prorated-wrapper{display:flex;justify-content:center}.line-promotion{display:flex;justify-content:space-between;font-size:12px;padding:3px 6px}.line-promotion .promotion-amount{margin-inline-start:12px}\n"] }]
1604
+ args: [{ selector: 'vdr-refund-order-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.refund-and-cancel-order' | translate }}</ng-template>\r\n\r\n<div class=\"refund-wrapper\">\r\n <vdr-data-table-2 id=\"refund-order\" [items]=\"order.lines\">\r\n <!-- Here we define all the available columns -->\r\n <vdr-dt2-column id=\"id\" [heading]=\"'common.id' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"created-at\" [heading]=\"'common.created-at' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"updated-at\" [heading]=\"'common.updated-at' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"line.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"product-name\" [heading]=\"'order.product-name' | translate\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.name }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"product-sku\" [heading]=\"'order.product-sku' | translate\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"unit-price\" [heading]=\"'order.unit-price' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"prorated-unit-price\" [heading]=\"'order.prorated-unit-price' | translate\">\r\n <ng-template let-line=\"item\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n <ng-container *ngIf=\"line.discounts as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n <button class=\"icon-button\"><clr-icon shape=\"info\"></clr-icon></button>\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n {{ discount.description }}\r\n <div class=\"promotion-amount\">\r\n {{\r\n discount.amount / 100 / line.quantity\r\n | number : '1.0-2'\r\n | currency : order.currencyCode\r\n }}\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"quantity\" [heading]=\"'order.quantity' | translate\">\r\n <ng-template let-line=\"item\">\r\n {{ line.quantity }}\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"refund-quantity\" [heading]=\"'order.refund' | translate\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <input\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n [ngModel]=\"lineQuantities[line.id].quantity\"\r\n type=\"number\"\r\n [max]=\"line.quantity\"\r\n min=\"0\"\r\n (ngModelChange)=\"onRefundQuantityChange(line.id, $event)\"\r\n />\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"cancel\" [heading]=\"'order.return-to-stock' | translate\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"cancel-checkbox-wrapper\">\r\n <label class=\"flex center\">\r\n <input\r\n type=\"checkbox\"\r\n *ngIf=\"lineCanBeRefundedOrCancelled(line)\"\r\n clrCheckbox\r\n [disabled]=\"0 === lineQuantities[line.id].quantity\"\r\n [(ngModel)]=\"lineQuantities[line.id].cancel\"\r\n />\r\n <span class=\"ml-1\">{{ 'order.return-to-stock' | translate }}</span></label\r\n >\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n </vdr-data-table-2>\r\n\r\n <div class=\"refund-details mt-4\">\r\n <div>\r\n <vdr-card>\r\n <label class=\"flex mb-2\" *ngFor=\"let shippingLine of order.shippingLines\">\r\n <input type=\"checkbox\" clrCheckbox (change)=\"toggleShippingRefund(shippingLine.id)\" />\r\n <div class=\"ml-1\">\r\n {{ 'order.refund-shipping' | translate }}\r\n <span>{{ shippingLine.shippingMethod.name }}:</span>\r\n <span class=\"ml-1\"\r\n >{{ shippingLine.discountedPriceWithTax | localeCurrency : order.currencyCode }}\r\n </span>\r\n </div></label\r\n >\r\n <vdr-form-field [label]=\"'order.refund-cancellation-reason' | translate\" class=\"mb-2\">\r\n <ng-select\r\n [items]=\"reasons\"\r\n bindLabel=\"name\"\r\n autofocus\r\n [placeholder]=\"'order.refund-cancellation-reason-required' | translate\"\r\n bindValue=\"id\"\r\n [addTag]=\"true\"\r\n [(ngModel)]=\"reason\"\r\n ></ng-select>\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"'order.refund-total' | translate\"\r\n [readOnlyToggle]=\"true\"\r\n (readOnlyToggleChange)=\"manuallySetRefundTotal = !$event\"\r\n >\r\n <vdr-currency-input\r\n [readonly]=\"!manuallySetRefundTotal\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [(ngModel)]=\"refundTotal\"\r\n (ngModelChange)=\"updateRefundTotal()\"\r\n ></vdr-currency-input>\r\n </vdr-form-field>\r\n </vdr-card>\r\n </div>\r\n <div class=\"\">\r\n <vdr-payment-for-refund-selector\r\n [refundablePayments]=\"refundablePayments\"\r\n (paymentSelected)=\"onPaymentSelected($event.payment, $event.selected)\"\r\n [order]=\"order\"\r\n ></vdr-payment-for-refund-selector>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <div>\r\n <div class=\"errors\">\r\n <clr-alert\r\n *ngIf=\"refundTotal < 0 || totalRefundableAmount < refundTotal\"\r\n [clrAlertType]=\"'danger'\"\r\n [clrAlertClosable]=\"false\"\r\n >\r\n <clr-alert-item>\r\n {{\r\n 'order.refund-total-error'\r\n | translate\r\n : {\r\n min: 0 | currency : order.currencyCode,\r\n max: totalRefundableAmount | localeCurrency : order.currencyCode\r\n }\r\n }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n <clr-alert\r\n *ngIf=\"amountToRefundTotal < refundTotal || refundTotal < amountToRefundTotal\"\r\n [clrAlertType]=\"'danger'\"\r\n [clrAlertClosable]=\"false\"\r\n >\r\n <clr-alert-item>\r\n {{ 'order.refund-total-warning' | translate }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n <clr-alert\r\n *ngIf=\"amountToRefundTotal && !reason\"\r\n [clrAlertType]=\"'danger'\"\r\n [clrAlertClosable]=\"false\"\r\n >\r\n <clr-alert-item>\r\n {{ 'order.refund-cancellation-reason-required' | translate }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div class=\"modal-buttons\">\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"select()\" [disabled]=\"!canSubmit()\" class=\"btn btn-primary\">\r\n {{\r\n 'order.refund-with-amount'\r\n | translate : { amount: amountToRefundTotal | localeCurrency : order.currencyCode }\r\n }}\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{height:100%;display:flex;flex-direction:column;min-height:64vh}.refund-wrapper{flex:1;flex-direction:column}.refund-wrapper .order-table{flex:1;overflow-y:auto}.refund-wrapper .order-table table{margin-top:0}.refund-wrapper tr.ignore{color:var(--color-grey-300)}::ng-deep .refund-wrapper .table-wrapper{max-width:initial!important}.quantity-col{background-color:var(--color-warning-100)}.cancel-checkbox-wrapper{display:flex;align-items:center;justify-content:center}clr-checkbox-wrapper{margin-top:12px;margin-bottom:12px;display:block}.refund-details{display:flex;flex-direction:column;padding-bottom:var(--space-unit);gap:calc(var(--space-unit) * 2);justify-content:space-between}@media screen and (min-width: 992px){.refund-details{flex-direction:row}}.refund-details vdr-card.unselected{opacity:.8}.refund-details>*{flex:1}.errors{display:flex;justify-content:flex-end;gap:calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) 0}.prorated-wrapper{display:flex;justify-content:center}.line-promotion{display:flex;justify-content:space-between;font-size:12px;padding:3px 6px}.line-promotion .promotion-amount{margin-inline-start:12px}vdr-card.faded{opacity:.8}.modal-buttons{display:flex;justify-content:flex-end;gap:.6rem;gap:var(--clr-modal-footer-gap, .6rem)}\n"] }]
1514
1605
  }], ctorParameters: function () { return [{ type: i1.I18nService }]; } });
1515
1606
 
1516
1607
  class SettleRefundDialogComponent {
@@ -1524,7 +1615,7 @@ class SettleRefundDialogComponent {
1524
1615
  this.resolveWith();
1525
1616
  }
1526
1617
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SettleRefundDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1527
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SettleRefundDialogComponent, selector: "vdr-settle-refund-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.settle-refund' | translate }}</ng-template>\r\n<p class=\"instruction\">\r\n {{ 'order.settle-refund-manual-instructions' | translate: { method: refund.method } }}\r\n</p>\r\n<clr-input-container>\r\n <label>{{ 'order.transaction-id' | translate }}</label>\r\n <input clrInput name=\"transactionId\" [(ngModel)]=\"transactionId\" />\r\n</clr-input-container>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"submit()\" [disabled]=\"!transactionId\" class=\"btn btn-primary\">\r\n {{ 'order.settle-refund' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [":host{padding-bottom:32px}.instruction{margin-top:0;margin-bottom:24px}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i1$1.ClrInput, selector: "[clrInput]" }, { kind: "component", type: i1$1.ClrInputContainer, selector: "clr-input-container" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1618
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SettleRefundDialogComponent, selector: "vdr-settle-refund-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.settle-refund' | translate }}</ng-template>\r\n<p class=\"instruction\">\r\n {{ 'order.settle-refund-manual-instructions' | translate: { method: refund.method } }}\r\n</p>\r\n<clr-input-container>\r\n <label>{{ 'order.transaction-id' | translate }}</label>\r\n <input clrInput name=\"transactionId\" [(ngModel)]=\"transactionId\" />\r\n</clr-input-container>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"submit()\" [disabled]=\"!transactionId\" class=\"btn btn-primary\">\r\n {{ 'order.settle-refund' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [":host{padding-bottom:32px}.instruction{margin-top:0;margin-bottom:24px}\n"], dependencies: [{ kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i3.ClrInput, selector: "[clrInput]" }, { kind: "component", type: i3.ClrInputContainer, selector: "clr-input-container" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1528
1619
  }
1529
1620
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SettleRefundDialogComponent, decorators: [{
1530
1621
  type: Component,
@@ -1544,11 +1635,11 @@ class PaymentStateLabelComponent {
1544
1635
  }
1545
1636
  }
1546
1637
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: PaymentStateLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1547
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: PaymentStateLabelComponent, selector: "vdr-payment-state-label", inputs: { state: "state" }, ngImport: i0, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Settled'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{font-size:14px}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1638
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: PaymentStateLabelComponent, selector: "vdr-payment-state-label", inputs: { state: "state" }, ngImport: i0, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Settled'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{display:flex;font-size:14px}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1548
1639
  }
1549
1640
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: PaymentStateLabelComponent, decorators: [{
1550
1641
  type: Component,
1551
- args: [{ selector: 'vdr-payment-state-label', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Settled'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{font-size:14px}\n"] }]
1642
+ args: [{ selector: 'vdr-payment-state-label', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Settled'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{display:flex;font-size:14px}\n"] }]
1552
1643
  }], propDecorators: { state: [{
1553
1644
  type: Input
1554
1645
  }] } });
@@ -1565,11 +1656,11 @@ class RefundStateLabelComponent {
1565
1656
  }
1566
1657
  }
1567
1658
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: RefundStateLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1568
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: RefundStateLabelComponent, selector: "vdr-refund-state-label", inputs: { state: "state" }, ngImport: i0, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Settled'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{font-size:14px}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1659
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: RefundStateLabelComponent, selector: "vdr-refund-state-label", inputs: { state: "state" }, ngImport: i0, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Settled'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{display:flex;font-size:14px}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1569
1660
  }
1570
1661
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: RefundStateLabelComponent, decorators: [{
1571
1662
  type: Component,
1572
- args: [{ selector: 'vdr-refund-state-label', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Settled'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{font-size:14px}\n"] }]
1663
+ args: [{ selector: 'vdr-refund-state-label', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-chip [title]=\"'order.payment-state' | translate\" [colorType]=\"chipColorType\">\r\n <clr-icon shape=\"check-circle\" *ngIf=\"state === 'Settled'\"></clr-icon>\r\n {{ state | stateI18nToken | translate }}\r\n</vdr-chip>\r\n", styles: [":host{display:flex;font-size:14px}\n"] }]
1573
1664
  }], propDecorators: { state: [{
1574
1665
  type: Input
1575
1666
  }] } });
@@ -1603,11 +1694,11 @@ class OrderPaymentCardComponent {
1603
1694
  return this.payment.nextStates.filter(s => s !== 'Settled' && s !== 'Error');
1604
1695
  }
1605
1696
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderPaymentCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1606
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderPaymentCardComponent, selector: "vdr-order-payment-card", inputs: { payment: "payment", currencyCode: "currencyCode" }, outputs: { settlePayment: "settlePayment", transitionPaymentState: "transitionPaymentState", settleRefund: "settleRefund" }, ngImport: i0, template: "<div class=\"card\">\r\n <div class=\"card-header payment-header\">\r\n <div>\r\n {{ 'order.payment' | translate }}\r\n <ng-container *ngIf=\"payment.transactionId\">#{{ payment.transactionId }}</ng-container>\r\n </div>\r\n <div class=\"payment-state\">\r\n <vdr-payment-state-label [state]=\"payment.state\"></vdr-payment-state-label>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-payment-detail [payment]=\"payment\" [currencyCode]=\"currencyCode\"></vdr-payment-detail>\r\n </div>\r\n <ng-container *ngFor=\"let refund of payment.refunds\">\r\n <div class=\"card-header payment-header\">\r\n <clr-icon shape=\"redo\" class=\"refund-icon\" dir=\"down\"></clr-icon>\r\n {{ 'order.refund' | translate }} #{{ refund.id }}\r\n <div class=\"clr-flex-fill\"></div>\r\n <vdr-refund-state-label [state]=\"refund.state\"></vdr-refund-state-label>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-labeled-data [label]=\"'common.created-at' | translate\">\r\n {{ refund.createdAt | localeDate: 'medium' }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-total' | translate\">\r\n {{ refund.total | localeCurrency: currencyCode }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.transaction-id' | translate\" *ngIf=\"refund.transactionId\">\r\n {{ refund.transactionId }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-reason' | translate\" *ngIf=\"refund.reason\">\r\n {{ refund.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-metadata' | translate\" *ngIf=\"refundHasMetadata(refund)\">\r\n <vdr-object-tree [value]=\"refund.metadata\"></vdr-object-tree>\r\n </vdr-labeled-data>\r\n </div>\r\n <div class=\"card-footer\" *ngIf=\"refund.state === 'Pending'\">\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"settleRefund.emit(refund)\">\r\n {{ 'order.settle-refund' | translate }}\r\n </button>\r\n </div>\r\n </ng-container>\r\n <div class=\"card-footer\" *ngIf=\"payment.nextStates.length\">\r\n <button\r\n class=\"btn btn-sm btn-primary\"\r\n *ngIf=\"payment.nextStates.includes('Settled')\"\r\n (click)=\"settlePayment.emit(payment)\"\r\n >\r\n {{ 'order.settle-payment' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container *ngFor=\"let nextState of nextOtherStates()\">\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionPaymentState.emit({ payment: payment, state: nextState })\"\r\n >\r\n <ng-container *ngIf=\"nextState !== 'Cancelled'; else cancel\">\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{\r\n 'order.transition-to-state'\r\n | translate: { state: (nextState | stateI18nToken | translate) }\r\n }}\r\n </ng-container>\r\n <ng-template #cancel>\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n {{ 'order.cancel-payment' | translate }}\r\n </ng-template>\r\n </button>\r\n </ng-container>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n</div>\r\n", styles: [".payment-header{display:flex;justify-content:space-between;align-items:center}.refund-icon{margin-inline-end:6px;color:var(--color-grey-400)}.card-footer{display:flex;align-items:center;justify-content:flex-end}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }, { kind: "component", type: PaymentStateLabelComponent, selector: "vdr-payment-state-label", inputs: ["state"] }, { kind: "component", type: RefundStateLabelComponent, selector: "vdr-refund-state-label", inputs: ["state"] }, { kind: "component", type: PaymentDetailComponent, selector: "vdr-payment-detail", inputs: ["payment", "currencyCode"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1697
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderPaymentCardComponent, selector: "vdr-order-payment-card", inputs: { payment: "payment", currencyCode: "currencyCode" }, outputs: { settlePayment: "settlePayment", transitionPaymentState: "transitionPaymentState", settleRefund: "settleRefund" }, ngImport: i0, template: "<div class=\"card\">\r\n <div class=\"card-header payment-header\">\r\n <div>\r\n {{ 'order.payment' | translate }}\r\n <ng-container *ngIf=\"payment.amount\">{{ payment.amount | localeCurrency : currencyCode }}</ng-container>\r\n </div>\r\n <div class=\"payment-state\">\r\n <vdr-payment-state-label [state]=\"payment.state\"></vdr-payment-state-label>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-payment-detail [payment]=\"payment\" [currencyCode]=\"currencyCode\"></vdr-payment-detail>\r\n </div>\r\n <ng-container *ngFor=\"let refund of payment.refunds\">\r\n <div class=\"refund-wrapper card-block\">\r\n <div class=\"card-header payment-header refund-header\">\r\n <clr-icon shape=\"redo\" class=\"refund-icon\" dir=\"down\"></clr-icon>\r\n {{ 'order.refund' | translate }} #{{ refund.id }}\r\n <div class=\"clr-flex-fill\"></div>\r\n <vdr-refund-state-label [state]=\"refund.state\"></vdr-refund-state-label>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-labeled-data [label]=\"'common.created-at' | translate\">\r\n {{ refund.createdAt | localeDate : 'medium' }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-total' | translate\">\r\n {{ refund.total | localeCurrency : currencyCode }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.transaction-id' | translate\" *ngIf=\"refund.transactionId\">\r\n {{ refund.transactionId }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-reason' | translate\" *ngIf=\"refund.reason\">\r\n {{ refund.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data\r\n [label]=\"'order.refund-metadata' | translate\"\r\n *ngIf=\"refundHasMetadata(refund)\"\r\n >\r\n <vdr-object-tree [value]=\"refund.metadata\"></vdr-object-tree>\r\n </vdr-labeled-data>\r\n </div>\r\n <div class=\"card-footer\" *ngIf=\"refund.state === 'Pending'\">\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"settleRefund.emit(refund)\">\r\n {{ 'order.settle-refund' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"card-footer\" *ngIf=\"payment.nextStates.length\">\r\n <button\r\n class=\"btn btn-sm btn-primary\"\r\n *ngIf=\"payment.nextStates.includes('Settled')\"\r\n (click)=\"settlePayment.emit(payment)\"\r\n >\r\n {{ 'order.settle-payment' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container *ngFor=\"let nextState of nextOtherStates()\">\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionPaymentState.emit({ payment: payment, state: nextState })\"\r\n >\r\n <ng-container *ngIf=\"nextState !== 'Cancelled'; else cancel\">\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{\r\n 'order.transition-to-state'\r\n | translate : { state: (nextState | stateI18nToken | translate) }\r\n }}\r\n </ng-container>\r\n <ng-template #cancel>\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n {{ 'order.cancel-payment' | translate }}\r\n </ng-template>\r\n </button>\r\n </ng-container>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}.payment-header{display:flex;justify-content:space-between;align-items:center;line-break:anywhere}.refund-icon{margin-inline-end:6px;color:var(--color-grey-400)}.card-footer{display:flex;align-items:center;justify-content:flex-end}.refund-wrapper{font-size:var(--font-size-xs)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }, { kind: "component", type: PaymentStateLabelComponent, selector: "vdr-payment-state-label", inputs: ["state"] }, { kind: "component", type: RefundStateLabelComponent, selector: "vdr-refund-state-label", inputs: ["state"] }, { kind: "component", type: PaymentDetailComponent, selector: "vdr-payment-detail", inputs: ["payment", "currencyCode"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1607
1698
  }
1608
1699
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderPaymentCardComponent, decorators: [{
1609
1700
  type: Component,
1610
- args: [{ selector: 'vdr-order-payment-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"card\">\r\n <div class=\"card-header payment-header\">\r\n <div>\r\n {{ 'order.payment' | translate }}\r\n <ng-container *ngIf=\"payment.transactionId\">#{{ payment.transactionId }}</ng-container>\r\n </div>\r\n <div class=\"payment-state\">\r\n <vdr-payment-state-label [state]=\"payment.state\"></vdr-payment-state-label>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-payment-detail [payment]=\"payment\" [currencyCode]=\"currencyCode\"></vdr-payment-detail>\r\n </div>\r\n <ng-container *ngFor=\"let refund of payment.refunds\">\r\n <div class=\"card-header payment-header\">\r\n <clr-icon shape=\"redo\" class=\"refund-icon\" dir=\"down\"></clr-icon>\r\n {{ 'order.refund' | translate }} #{{ refund.id }}\r\n <div class=\"clr-flex-fill\"></div>\r\n <vdr-refund-state-label [state]=\"refund.state\"></vdr-refund-state-label>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-labeled-data [label]=\"'common.created-at' | translate\">\r\n {{ refund.createdAt | localeDate: 'medium' }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-total' | translate\">\r\n {{ refund.total | localeCurrency: currencyCode }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.transaction-id' | translate\" *ngIf=\"refund.transactionId\">\r\n {{ refund.transactionId }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-reason' | translate\" *ngIf=\"refund.reason\">\r\n {{ refund.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-metadata' | translate\" *ngIf=\"refundHasMetadata(refund)\">\r\n <vdr-object-tree [value]=\"refund.metadata\"></vdr-object-tree>\r\n </vdr-labeled-data>\r\n </div>\r\n <div class=\"card-footer\" *ngIf=\"refund.state === 'Pending'\">\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"settleRefund.emit(refund)\">\r\n {{ 'order.settle-refund' | translate }}\r\n </button>\r\n </div>\r\n </ng-container>\r\n <div class=\"card-footer\" *ngIf=\"payment.nextStates.length\">\r\n <button\r\n class=\"btn btn-sm btn-primary\"\r\n *ngIf=\"payment.nextStates.includes('Settled')\"\r\n (click)=\"settlePayment.emit(payment)\"\r\n >\r\n {{ 'order.settle-payment' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container *ngFor=\"let nextState of nextOtherStates()\">\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionPaymentState.emit({ payment: payment, state: nextState })\"\r\n >\r\n <ng-container *ngIf=\"nextState !== 'Cancelled'; else cancel\">\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{\r\n 'order.transition-to-state'\r\n | translate: { state: (nextState | stateI18nToken | translate) }\r\n }}\r\n </ng-container>\r\n <ng-template #cancel>\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n {{ 'order.cancel-payment' | translate }}\r\n </ng-template>\r\n </button>\r\n </ng-container>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n</div>\r\n", styles: [".payment-header{display:flex;justify-content:space-between;align-items:center}.refund-icon{margin-inline-end:6px;color:var(--color-grey-400)}.card-footer{display:flex;align-items:center;justify-content:flex-end}\n"] }]
1701
+ args: [{ selector: 'vdr-order-payment-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"card\">\r\n <div class=\"card-header payment-header\">\r\n <div>\r\n {{ 'order.payment' | translate }}\r\n <ng-container *ngIf=\"payment.amount\">{{ payment.amount | localeCurrency : currencyCode }}</ng-container>\r\n </div>\r\n <div class=\"payment-state\">\r\n <vdr-payment-state-label [state]=\"payment.state\"></vdr-payment-state-label>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-payment-detail [payment]=\"payment\" [currencyCode]=\"currencyCode\"></vdr-payment-detail>\r\n </div>\r\n <ng-container *ngFor=\"let refund of payment.refunds\">\r\n <div class=\"refund-wrapper card-block\">\r\n <div class=\"card-header payment-header refund-header\">\r\n <clr-icon shape=\"redo\" class=\"refund-icon\" dir=\"down\"></clr-icon>\r\n {{ 'order.refund' | translate }} #{{ refund.id }}\r\n <div class=\"clr-flex-fill\"></div>\r\n <vdr-refund-state-label [state]=\"refund.state\"></vdr-refund-state-label>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-labeled-data [label]=\"'common.created-at' | translate\">\r\n {{ refund.createdAt | localeDate : 'medium' }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-total' | translate\">\r\n {{ refund.total | localeCurrency : currencyCode }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.transaction-id' | translate\" *ngIf=\"refund.transactionId\">\r\n {{ refund.transactionId }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.refund-reason' | translate\" *ngIf=\"refund.reason\">\r\n {{ refund.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data\r\n [label]=\"'order.refund-metadata' | translate\"\r\n *ngIf=\"refundHasMetadata(refund)\"\r\n >\r\n <vdr-object-tree [value]=\"refund.metadata\"></vdr-object-tree>\r\n </vdr-labeled-data>\r\n </div>\r\n <div class=\"card-footer\" *ngIf=\"refund.state === 'Pending'\">\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"settleRefund.emit(refund)\">\r\n {{ 'order.settle-refund' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"card-footer\" *ngIf=\"payment.nextStates.length\">\r\n <button\r\n class=\"btn btn-sm btn-primary\"\r\n *ngIf=\"payment.nextStates.includes('Settled')\"\r\n (click)=\"settlePayment.emit(payment)\"\r\n >\r\n {{ 'order.settle-payment' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container *ngFor=\"let nextState of nextOtherStates()\">\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionPaymentState.emit({ payment: payment, state: nextState })\"\r\n >\r\n <ng-container *ngIf=\"nextState !== 'Cancelled'; else cancel\">\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{\r\n 'order.transition-to-state'\r\n | translate : { state: (nextState | stateI18nToken | translate) }\r\n }}\r\n </ng-container>\r\n <ng-template #cancel>\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n {{ 'order.cancel-payment' | translate }}\r\n </ng-template>\r\n </button>\r\n </ng-container>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}.payment-header{display:flex;justify-content:space-between;align-items:center;line-break:anywhere}.refund-icon{margin-inline-end:6px;color:var(--color-grey-400)}.card-footer{display:flex;align-items:center;justify-content:flex-end}.refund-wrapper{font-size:var(--font-size-xs)}\n"] }]
1611
1702
  }], propDecorators: { payment: [{
1612
1703
  type: Input
1613
1704
  }], currencyCode: [{
@@ -1713,7 +1804,7 @@ class OrderHistoryComponent {
1713
1804
  }
1714
1805
  }
1715
1806
  if (entry.type === HistoryEntryType.ORDER_CANCELLATION) {
1716
- return 'error';
1807
+ return 'warning';
1717
1808
  }
1718
1809
  if (entry.type === HistoryEntryType.ORDER_REFUND_TRANSITION) {
1719
1810
  return 'warning';
@@ -1734,12 +1825,20 @@ class OrderHistoryComponent {
1734
1825
  return 'credit-card';
1735
1826
  }
1736
1827
  }
1828
+ if (entry.type === HistoryEntryType.ORDER_REFUND_TRANSITION) {
1829
+ if (entry.data.to === 'Settled') {
1830
+ return 'credit-card';
1831
+ }
1832
+ }
1737
1833
  if (entry.type === HistoryEntryType.ORDER_NOTE) {
1738
1834
  return 'note';
1739
1835
  }
1740
1836
  if (entry.type === HistoryEntryType.ORDER_MODIFIED) {
1741
1837
  return 'pencil';
1742
1838
  }
1839
+ if (entry.type === HistoryEntryType.ORDER_CUSTOMER_UPDATED) {
1840
+ return 'switch';
1841
+ }
1743
1842
  if (entry.type === HistoryEntryType.ORDER_FULFILLMENT_TRANSITION) {
1744
1843
  if (entry.data.to === 'Shipped') {
1745
1844
  return 'truck';
@@ -1756,12 +1855,15 @@ class OrderHistoryComponent {
1756
1855
  entry.data.to === 'Cancelled' ||
1757
1856
  entry.data.to === 'Settled');
1758
1857
  }
1858
+ case HistoryEntryType.ORDER_REFUND_TRANSITION:
1859
+ return entry.data.to === 'Settled';
1759
1860
  case HistoryEntryType.ORDER_PAYMENT_TRANSITION:
1760
1861
  return entry.data.to === 'Settled' || entry.data.to === 'Cancelled';
1761
1862
  case HistoryEntryType.ORDER_FULFILLMENT_TRANSITION:
1762
1863
  return entry.data.to === 'Delivered' || entry.data.to === 'Shipped';
1763
1864
  case HistoryEntryType.ORDER_NOTE:
1764
1865
  case HistoryEntryType.ORDER_MODIFIED:
1866
+ case HistoryEntryType.ORDER_CUSTOMER_UPDATED:
1765
1867
  return true;
1766
1868
  default:
1767
1869
  return false;
@@ -1779,12 +1881,17 @@ class OrderHistoryComponent {
1779
1881
  return this.order.payments.find(p => p.id === entry.data.paymentId);
1780
1882
  }
1781
1883
  }
1884
+ getRefund(entry) {
1885
+ if (entry.type === HistoryEntryType.ORDER_REFUND_TRANSITION && this.order.payments) {
1886
+ const allRefunds = this.order.payments.reduce((refunds, payment) => refunds.concat(payment.refunds), []);
1887
+ return allRefunds.find(r => r.id === entry.data.refundId);
1888
+ }
1889
+ }
1782
1890
  getCancelledQuantity(entry) {
1783
1891
  return entry.data.lines.reduce((total, line) => total + line.quantity, 0);
1784
1892
  }
1785
- getCancelledItems(entry) {
1893
+ getCancelledItems(cancellationLines) {
1786
1894
  const itemMap = new Map();
1787
- const cancellationLines = entry.data.lines;
1788
1895
  for (const line of this.order.lines) {
1789
1896
  const cancellationLine = cancellationLines.find(l => l.orderLineId === line.id);
1790
1897
  if (cancellationLine) {
@@ -1816,11 +1923,11 @@ class OrderHistoryComponent {
1816
1923
  this.noteIsPrivate = true;
1817
1924
  }
1818
1925
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderHistoryComponent, deps: [{ token: i1.HistoryEntryComponentService }], target: i0.ɵɵFactoryTarget.Component }); }
1819
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderHistoryComponent, selector: "vdr-order-history", inputs: { order: "order", history: "history" }, outputs: { addNote: "addNote", updateNote: "updateNote", deleteNote: "deleteNote" }, ngImport: i0, template: "<div class=\"entry-list\" [class.expanded]=\"expanded\">\r\n <vdr-timeline-entry iconShape=\"note\" displayType=\"muted\" [featured]=\"true\">\r\n <div class=\"note-entry\">\r\n <textarea [(ngModel)]=\"note\" name=\"note\" class=\"note\"></textarea>\r\n <button class=\"btn btn-secondary\" [disabled]=\"!note\" (click)=\"addNoteToOrder()\">\r\n {{ 'common.add-note' | translate }}\r\n </button>\r\n </div>\r\n <div class=\"visibility-select\">\r\n <clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"noteIsPrivate\" />\r\n <label>{{ 'order.note-is-private' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <span *ngIf=\"noteIsPrivate\" class=\"private\">\r\n {{ 'order.note-only-visible-to-administrators' | translate }}\r\n </span>\r\n <span *ngIf=\"!noteIsPrivate\" class=\"public\">\r\n {{ 'order.note-visible-to-customer' | translate }}\r\n </span>\r\n </div>\r\n </vdr-timeline-entry>\r\n <ng-container *ngFor=\"let entry of history\">\r\n <vdr-order-history-entry-host\r\n *ngIf=\"hasCustomComponent(entry.type); else defaultComponents\"\r\n [order]=\"order\"\r\n [entry]=\"entry\"\r\n [expanded]=\"expanded\"\r\n (expandClick)=\"expanded = !expanded\"\r\n ></vdr-order-history-entry-host>\r\n <ng-template #defaultComponents>\r\n <vdr-timeline-entry\r\n [displayType]=\"getDisplayType(entry)\"\r\n [iconShape]=\"getTimelineIcon(entry)\"\r\n [createdAt]=\"entry.createdAt\"\r\n [name]=\"getName(entry)\"\r\n [featured]=\"isFeatured(entry)\"\r\n [collapsed]=\"!expanded && !isFeatured(entry)\"\r\n (expandClick)=\"expanded = !expanded\"\r\n >\r\n <ng-container [ngSwitch]=\"entry.type\">\r\n <ng-container *ngSwitchCase=\"type.ORDER_STATE_TRANSITION\">\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Delivered'\">\r\n {{ 'order.history-order-fulfilled' | translate }}\r\n </div>\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Cancelled'\">\r\n {{ 'order.history-order-cancelled' | translate }}\r\n </div>\r\n <ng-template [ngIf]=\"entry.data.to !== 'Cancelled' && entry.data.to !== 'Delivered'\">\r\n {{\r\n 'order.history-order-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_MODIFIED\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-modified' | translate }}\r\n </div>\r\n <ng-container *ngIf=\"getModification(entry.data.modificationId) as modification\">\r\n {{ 'order.modify-order-price-difference' | translate }}:\r\n <strong>{{\r\n modification.priceChange | localeCurrency: order.currencyCode\r\n }}</strong>\r\n <vdr-chip colorType=\"success\" *ngIf=\"modification.isSettled\">{{\r\n 'order.modification-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip colorType=\"error\" *ngIf=\"!modification.isSettled\">{{\r\n 'order.modification-not-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail>\r\n <vdr-modification-detail\r\n [order]=\"order\"\r\n [modification]=\"modification\"\r\n ></vdr-modification-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_PAYMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Settled'; else regularPaymentTransition\">\r\n <div class=\"title\">\r\n {{ 'order.history-payment-settled' | translate }}\r\n </div>\r\n {{ 'order.transaction-id' | translate }}: {{ getPayment(entry)?.transactionId }}\r\n <vdr-history-entry-detail *ngIf=\"getPayment(entry) as payment\">\r\n <vdr-payment-detail\r\n [payment]=\"payment\"\r\n [currencyCode]=\"order.currencyCode\"\r\n ></vdr-payment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-template #regularPaymentTransition>\r\n {{\r\n 'order.history-payment-transition'\r\n | translate\r\n : {\r\n from: entry.data.from,\r\n to: entry.data.to,\r\n id: getPayment(entry)?.transactionId\r\n }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_REFUND_TRANSITION\">\r\n {{\r\n 'order.history-refund-transition'\r\n | translate\r\n : { from: entry.data.from, to: entry.data.to, id: entry.data.refundId }\r\n }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_CANCELLATION\">\r\n {{\r\n 'order.history-items-cancelled'\r\n | translate: { count: getCancelledQuantity(entry) }\r\n }}\r\n <vdr-history-entry-detail *ngIf=\"getCancelledItems(entry) as items\">\r\n <vdr-labeled-data [label]=\"'order.cancellation-reason' | translate\">\r\n {{ entry.data.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.contents' | translate\">\r\n <vdr-simple-item-list [items]=\"items\"></vdr-simple-item-list>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.shipping-cancelled' | translate\">\r\n {{ entry.data.shippingCancelled }}\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT\">\r\n {{ 'order.history-fulfillment-created' | translate }}\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Delivered'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-delivered' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to === 'Shipped'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-shipped' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to !== 'Delivered' && entry.data.to !== 'Shipped'\">\r\n {{\r\n 'order.history-fulfillment-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-container>\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_NOTE\">\r\n <div class=\"flex\">\r\n <div class=\"note-text\">\r\n <span *ngIf=\"entry.isPublic\" class=\"note-visibility public\">{{\r\n 'common.public' | translate\r\n }}</span>\r\n <span *ngIf=\"!entry.isPublic\" class=\"note-visibility private\">{{\r\n 'common.private' | translate\r\n }}</span>\r\n {{ entry.data.note }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n vdrDropdownItem\r\n (click)=\"updateNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n vdrDropdownItem\r\n (click)=\"deleteNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_APPLIED\">\r\n {{ 'order.history-coupon-code-applied' | translate }}:\r\n <vdr-chip>\r\n <a [routerLink]=\"['/marketing', 'promotions', entry.data.promotionId]\">{{\r\n entry.data.couponCode\r\n }}</a>\r\n </vdr-chip>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_REMOVED\">\r\n {{ 'order.history-coupon-code-removed' | translate }}:\r\n <vdr-chip\r\n ><span class=\"cancelled-coupon-code\">{{ entry.data.couponCode }}</span></vdr-chip\r\n >\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <div class=\"title\">\r\n {{ entry.type | translate }}\r\n </div>\r\n <vdr-history-entry-detail *ngIf=\"entry.data\">\r\n <vdr-object-tree [value]=\"entry.data\"></vdr-object-tree>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n </vdr-timeline-entry>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <vdr-timeline-entry [isLast]=\"true\" [createdAt]=\"order.createdAt\" [featured]=\"true\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-created' | translate }}\r\n </div>\r\n </vdr-timeline-entry>\r\n</div>\r\n", styles: [":host{display:block}.entry-list{margin-inline-start:calc(var(--space-unit) * 2)}.note-entry{display:flex;align-items:center}.note-entry .note{flex:1}.note-entry button{margin:0}.visibility-select{display:flex;justify-content:space-between;align-items:baseline}.visibility-select .public{color:var(--color-warning-700)}.visibility-select .private{color:var(--color-success-700)}textarea.note{flex:1;height:36px;border-radius:3px;margin-inline-end:6px}.note-text{color:var(--color-grey-800);white-space:pre-wrap}.cancelled-coupon-code{text-decoration:line-through}.note-visibility{text-transform:lowercase}.note-visibility.public{color:var(--color-warning-700)}.note-visibility.private{color:var(--color-success-700)}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i1$1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i1$1.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i1$1.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }, { kind: "component", type: i1.TimelineEntryComponent, selector: "vdr-timeline-entry", inputs: ["displayType", "createdAt", "name", "featured", "iconShape", "isLast", "collapsed"], outputs: ["expandClick"] }, { kind: "component", type: i1.HistoryEntryDetailComponent, selector: "vdr-history-entry-detail" }, { kind: "component", type: FulfillmentDetailComponent, selector: "vdr-fulfillment-detail", inputs: ["fulfillmentId", "order"] }, { kind: "component", type: PaymentDetailComponent, selector: "vdr-payment-detail", inputs: ["payment", "currencyCode"] }, { kind: "component", type: SimpleItemListComponent, selector: "vdr-simple-item-list", inputs: ["items"] }, { kind: "component", type: ModificationDetailComponent, selector: "vdr-modification-detail", inputs: ["order", "modification"] }, { kind: "component", type: OrderHistoryEntryHostComponent, selector: "vdr-order-history-entry-host", inputs: ["entry", "order", "expanded"], outputs: ["expandClick"], exportAs: ["historyEntry"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.HasPermissionPipe, name: "hasPermission" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1926
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderHistoryComponent, selector: "vdr-order-history", inputs: { order: "order", history: "history" }, outputs: { addNote: "addNote", updateNote: "updateNote", deleteNote: "deleteNote" }, ngImport: i0, template: "<div class=\"entry-list\" [class.expanded]=\"expanded\">\r\n <vdr-timeline-entry iconShape=\"note\" displayType=\"muted\" [featured]=\"true\">\r\n <div class=\"note-entry\">\r\n <textarea [(ngModel)]=\"note\" name=\"note\" class=\"note\"></textarea>\r\n <button class=\"btn btn-secondary\" [disabled]=\"!note\" (click)=\"addNoteToOrder()\">\r\n {{ 'common.add-note' | translate }}\r\n </button>\r\n </div>\r\n <div class=\"visibility-select\">\r\n <clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"noteIsPrivate\" />\r\n <label>{{ 'order.note-is-private' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <span *ngIf=\"noteIsPrivate\" class=\"private\">\r\n {{ 'order.note-only-visible-to-administrators' | translate }}\r\n </span>\r\n <span *ngIf=\"!noteIsPrivate\" class=\"public\">\r\n {{ 'order.note-visible-to-customer' | translate }}\r\n </span>\r\n </div>\r\n </vdr-timeline-entry>\r\n <ng-container *ngFor=\"let entry of history\">\r\n <vdr-order-history-entry-host\r\n *ngIf=\"hasCustomComponent(entry.type); else defaultComponents\"\r\n [order]=\"order\"\r\n [entry]=\"entry\"\r\n [expanded]=\"expanded\"\r\n (expandClick)=\"expanded = !expanded\"\r\n ></vdr-order-history-entry-host>\r\n <ng-template #defaultComponents>\r\n <vdr-timeline-entry\r\n [displayType]=\"getDisplayType(entry)\"\r\n [iconShape]=\"getTimelineIcon(entry)\"\r\n [createdAt]=\"entry.createdAt\"\r\n [name]=\"getName(entry)\"\r\n [featured]=\"isFeatured(entry)\"\r\n [collapsed]=\"!expanded && !isFeatured(entry)\"\r\n (expandClick)=\"expanded = !expanded\"\r\n >\r\n <ng-container [ngSwitch]=\"entry.type\">\r\n <ng-container *ngSwitchCase=\"type.ORDER_STATE_TRANSITION\">\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Delivered'\">\r\n {{ 'order.history-order-fulfilled' | translate }}\r\n </div>\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Cancelled'\">\r\n {{ 'order.history-order-cancelled' | translate }}\r\n </div>\r\n <ng-template [ngIf]=\"entry.data.to !== 'Cancelled' && entry.data.to !== 'Delivered'\">\r\n {{\r\n 'order.history-order-transition'\r\n | translate : { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_MODIFIED\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-modified' | translate }}\r\n </div>\r\n <div\r\n class=\"flex items-center\"\r\n *ngIf=\"getModification(entry.data.modificationId) as modification\"\r\n >\r\n {{ 'order.modify-order-price-difference' | translate }}:\r\n <strong>{{\r\n modification.priceChange | localeCurrency : order.currencyCode\r\n }}</strong>\r\n <vdr-chip colorType=\"success\" class=\"mx-1\" *ngIf=\"modification.isSettled\">{{\r\n 'order.modification-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip colorType=\"error\" class=\"mx-1\" *ngIf=\"!modification.isSettled\">{{\r\n 'order.modification-not-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail>\r\n <vdr-modification-detail\r\n [order]=\"order\"\r\n [modification]=\"modification\"\r\n ></vdr-modification-detail>\r\n </vdr-history-entry-detail>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_PAYMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Settled'; else regularPaymentTransition\">\r\n <div class=\"title\">\r\n {{ 'order.history-payment-settled' | translate }}\r\n </div>\r\n <div class=\"flex items-center\">\r\n <vdr-chip *ngIf=\"getPayment(entry) as payment\" class=\"mr-1\">{{\r\n payment.amount | localeCurrency : order.currencyCode\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail *ngIf=\"getPayment(entry) as payment\">\r\n <vdr-payment-detail\r\n [payment]=\"payment\"\r\n [currencyCode]=\"order.currencyCode\"\r\n ></vdr-payment-detail>\r\n </vdr-history-entry-detail>\r\n </div>\r\n </ng-container>\r\n <ng-template #regularPaymentTransition>\r\n {{\r\n 'order.history-payment-transition'\r\n | translate\r\n : {\r\n from: entry.data.from,\r\n to: entry.data.to,\r\n id: getPayment(entry)?.transactionId\r\n }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_REFUND_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Settled'; else regularRefundTransition\">\r\n <ng-container *ngIf=\"getRefund(entry) as refund\">\r\n <div class=\"title\">{{ 'order.refund' | translate }} #{{ refund.id }}</div>\r\n <div class=\"flex items-center\">\r\n <vdr-chip colorType=\"warning\" class=\"mr-1\">{{\r\n refund.total | localeCurrency : order.currencyCode\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail>\r\n <vdr-labeled-data [label]=\"'order.cancellation-reason' | translate\">\r\n {{ entry.data.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.contents' | translate\">\r\n <vdr-simple-item-list\r\n [items]=\"getCancelledItems(refund.lines)\"\r\n ></vdr-simple-item-list>\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #regularRefundTransition>\r\n {{\r\n 'order.history-refund-transition'\r\n | translate\r\n : {\r\n from: entry.data.from,\r\n to: entry.data.to,\r\n id: entry.data.refundId\r\n }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_CANCELLATION\">\r\n {{\r\n 'order.history-items-cancelled'\r\n | translate : { count: getCancelledQuantity(entry) }\r\n }}\r\n <vdr-history-entry-detail *ngIf=\"getCancelledItems(entry.data.lines) as items\">\r\n <vdr-labeled-data [label]=\"'order.cancellation-reason' | translate\">\r\n {{ entry.data.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.contents' | translate\">\r\n <vdr-simple-item-list [items]=\"items\"></vdr-simple-item-list>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.shipping-cancelled' | translate\">\r\n {{ entry.data.shippingCancelled }}\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT\">\r\n {{ 'order.history-fulfillment-created' | translate }}\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Delivered'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-delivered' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to === 'Shipped'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-shipped' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to !== 'Delivered' && entry.data.to !== 'Shipped'\">\r\n {{\r\n 'order.history-fulfillment-transition'\r\n | translate : { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-container>\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_NOTE\">\r\n <div class=\"flex\">\r\n <div class=\"note-text\">\r\n <span *ngIf=\"entry.isPublic\" class=\"note-visibility public\">{{\r\n 'common.public' | translate\r\n }}</span>\r\n <span *ngIf=\"!entry.isPublic\" class=\"note-visibility private\">{{\r\n 'common.private' | translate\r\n }}</span>\r\n {{ entry.data.note }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-dropdown>\r\n <button class=\"button-small ml-1\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\" size=\"12\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n vdrDropdownItem\r\n (click)=\"updateNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n vdrDropdownItem\r\n (click)=\"deleteNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_APPLIED\">\r\n {{ 'order.history-coupon-code-applied' | translate }}:\r\n <vdr-chip>\r\n <a [routerLink]=\"['/marketing', 'promotions', entry.data.promotionId]\">{{\r\n entry.data.couponCode\r\n }}</a>\r\n </vdr-chip>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_REMOVED\">\r\n {{ 'order.history-coupon-code-removed' | translate }}:\r\n <vdr-chip\r\n ><span class=\"cancelled-coupon-code\">{{ entry.data.couponCode }}</span></vdr-chip\r\n >\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_CUSTOMER_UPDATED\">\r\n <div class=\"title\">\r\n {{\r\n 'order.history-customer-updated'\r\n | translate : { newCustomerName: entry.data.newCustomerName }\r\n }}\r\n </div>\r\n <div class=\"flex\">\r\n <div class=\"note-text\">\r\n {{ entry.data.note }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-history-entry-detail>\r\n <vdr-labeled-data [label]=\"'order.previous-customer' | translate\">\r\n <a\r\n *ngIf=\"entry.data.previousCustomerId\"\r\n class=\"button-ghost\"\r\n [routerLink]=\"[\r\n '/customer',\r\n 'customers',\r\n entry.data.previousCustomerId\r\n ]\"\r\n >\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon>\r\n <span>{{ entry.data.previousCustomerName }}</span>\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.new-customer' | translate\">\r\n <a\r\n *ngIf=\"entry.data.newCustomerId\"\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/customer', 'customers', entry.data.newCustomerId]\"\r\n >\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon>\r\n <span>{{ entry.data.newCustomerName }}</span>\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <div class=\"title\">\r\n {{ entry.type | translate }}\r\n </div>\r\n <vdr-history-entry-detail *ngIf=\"entry.data\">\r\n <vdr-object-tree [value]=\"entry.data\"></vdr-object-tree>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n </vdr-timeline-entry>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <vdr-timeline-entry [isLast]=\"true\" [createdAt]=\"order.createdAt\" [featured]=\"true\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-created' | translate }}\r\n </div>\r\n </vdr-timeline-entry>\r\n</div>\r\n", styles: [":host{display:block}.entry-list{margin-inline-start:calc(var(--space-unit) * 2)}.note-entry{display:flex;align-items:center}.note-entry .note{flex:1}.note-entry button{margin:0}.visibility-select{display:flex;justify-content:space-between;align-items:baseline}.visibility-select .public{color:var(--color-warning-700)}.visibility-select .private{color:var(--color-success-700)}textarea.note{flex:1;height:36px;border-radius:3px;margin-inline-end:6px}.note-text{color:var(--color-grey-800);white-space:pre-wrap;max-width:580px}.cancelled-coupon-code{text-decoration:line-through}.note-visibility{text-transform:lowercase}.note-visibility.public{color:var(--color-warning-700)}.note-visibility.private{color:var(--color-success-700)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i3.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i3.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }, { kind: "component", type: i1.TimelineEntryComponent, selector: "vdr-timeline-entry", inputs: ["displayType", "createdAt", "name", "featured", "iconShape", "isLast", "collapsed"], outputs: ["expandClick"] }, { kind: "component", type: i1.HistoryEntryDetailComponent, selector: "vdr-history-entry-detail" }, { kind: "component", type: FulfillmentDetailComponent, selector: "vdr-fulfillment-detail", inputs: ["fulfillmentId", "order"] }, { kind: "component", type: PaymentDetailComponent, selector: "vdr-payment-detail", inputs: ["payment", "currencyCode"] }, { kind: "component", type: SimpleItemListComponent, selector: "vdr-simple-item-list", inputs: ["items"] }, { kind: "component", type: ModificationDetailComponent, selector: "vdr-modification-detail", inputs: ["order", "modification"] }, { kind: "component", type: OrderHistoryEntryHostComponent, selector: "vdr-order-history-entry-host", inputs: ["entry", "order", "expanded"], outputs: ["expandClick"], exportAs: ["historyEntry"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.HasPermissionPipe, name: "hasPermission" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1820
1927
  }
1821
1928
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderHistoryComponent, decorators: [{
1822
1929
  type: Component,
1823
- args: [{ selector: 'vdr-order-history', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"entry-list\" [class.expanded]=\"expanded\">\r\n <vdr-timeline-entry iconShape=\"note\" displayType=\"muted\" [featured]=\"true\">\r\n <div class=\"note-entry\">\r\n <textarea [(ngModel)]=\"note\" name=\"note\" class=\"note\"></textarea>\r\n <button class=\"btn btn-secondary\" [disabled]=\"!note\" (click)=\"addNoteToOrder()\">\r\n {{ 'common.add-note' | translate }}\r\n </button>\r\n </div>\r\n <div class=\"visibility-select\">\r\n <clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"noteIsPrivate\" />\r\n <label>{{ 'order.note-is-private' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <span *ngIf=\"noteIsPrivate\" class=\"private\">\r\n {{ 'order.note-only-visible-to-administrators' | translate }}\r\n </span>\r\n <span *ngIf=\"!noteIsPrivate\" class=\"public\">\r\n {{ 'order.note-visible-to-customer' | translate }}\r\n </span>\r\n </div>\r\n </vdr-timeline-entry>\r\n <ng-container *ngFor=\"let entry of history\">\r\n <vdr-order-history-entry-host\r\n *ngIf=\"hasCustomComponent(entry.type); else defaultComponents\"\r\n [order]=\"order\"\r\n [entry]=\"entry\"\r\n [expanded]=\"expanded\"\r\n (expandClick)=\"expanded = !expanded\"\r\n ></vdr-order-history-entry-host>\r\n <ng-template #defaultComponents>\r\n <vdr-timeline-entry\r\n [displayType]=\"getDisplayType(entry)\"\r\n [iconShape]=\"getTimelineIcon(entry)\"\r\n [createdAt]=\"entry.createdAt\"\r\n [name]=\"getName(entry)\"\r\n [featured]=\"isFeatured(entry)\"\r\n [collapsed]=\"!expanded && !isFeatured(entry)\"\r\n (expandClick)=\"expanded = !expanded\"\r\n >\r\n <ng-container [ngSwitch]=\"entry.type\">\r\n <ng-container *ngSwitchCase=\"type.ORDER_STATE_TRANSITION\">\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Delivered'\">\r\n {{ 'order.history-order-fulfilled' | translate }}\r\n </div>\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Cancelled'\">\r\n {{ 'order.history-order-cancelled' | translate }}\r\n </div>\r\n <ng-template [ngIf]=\"entry.data.to !== 'Cancelled' && entry.data.to !== 'Delivered'\">\r\n {{\r\n 'order.history-order-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_MODIFIED\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-modified' | translate }}\r\n </div>\r\n <ng-container *ngIf=\"getModification(entry.data.modificationId) as modification\">\r\n {{ 'order.modify-order-price-difference' | translate }}:\r\n <strong>{{\r\n modification.priceChange | localeCurrency: order.currencyCode\r\n }}</strong>\r\n <vdr-chip colorType=\"success\" *ngIf=\"modification.isSettled\">{{\r\n 'order.modification-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip colorType=\"error\" *ngIf=\"!modification.isSettled\">{{\r\n 'order.modification-not-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail>\r\n <vdr-modification-detail\r\n [order]=\"order\"\r\n [modification]=\"modification\"\r\n ></vdr-modification-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_PAYMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Settled'; else regularPaymentTransition\">\r\n <div class=\"title\">\r\n {{ 'order.history-payment-settled' | translate }}\r\n </div>\r\n {{ 'order.transaction-id' | translate }}: {{ getPayment(entry)?.transactionId }}\r\n <vdr-history-entry-detail *ngIf=\"getPayment(entry) as payment\">\r\n <vdr-payment-detail\r\n [payment]=\"payment\"\r\n [currencyCode]=\"order.currencyCode\"\r\n ></vdr-payment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-template #regularPaymentTransition>\r\n {{\r\n 'order.history-payment-transition'\r\n | translate\r\n : {\r\n from: entry.data.from,\r\n to: entry.data.to,\r\n id: getPayment(entry)?.transactionId\r\n }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_REFUND_TRANSITION\">\r\n {{\r\n 'order.history-refund-transition'\r\n | translate\r\n : { from: entry.data.from, to: entry.data.to, id: entry.data.refundId }\r\n }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_CANCELLATION\">\r\n {{\r\n 'order.history-items-cancelled'\r\n | translate: { count: getCancelledQuantity(entry) }\r\n }}\r\n <vdr-history-entry-detail *ngIf=\"getCancelledItems(entry) as items\">\r\n <vdr-labeled-data [label]=\"'order.cancellation-reason' | translate\">\r\n {{ entry.data.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.contents' | translate\">\r\n <vdr-simple-item-list [items]=\"items\"></vdr-simple-item-list>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.shipping-cancelled' | translate\">\r\n {{ entry.data.shippingCancelled }}\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT\">\r\n {{ 'order.history-fulfillment-created' | translate }}\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Delivered'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-delivered' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to === 'Shipped'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-shipped' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to !== 'Delivered' && entry.data.to !== 'Shipped'\">\r\n {{\r\n 'order.history-fulfillment-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-container>\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_NOTE\">\r\n <div class=\"flex\">\r\n <div class=\"note-text\">\r\n <span *ngIf=\"entry.isPublic\" class=\"note-visibility public\">{{\r\n 'common.public' | translate\r\n }}</span>\r\n <span *ngIf=\"!entry.isPublic\" class=\"note-visibility private\">{{\r\n 'common.private' | translate\r\n }}</span>\r\n {{ entry.data.note }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n vdrDropdownItem\r\n (click)=\"updateNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n vdrDropdownItem\r\n (click)=\"deleteNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_APPLIED\">\r\n {{ 'order.history-coupon-code-applied' | translate }}:\r\n <vdr-chip>\r\n <a [routerLink]=\"['/marketing', 'promotions', entry.data.promotionId]\">{{\r\n entry.data.couponCode\r\n }}</a>\r\n </vdr-chip>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_REMOVED\">\r\n {{ 'order.history-coupon-code-removed' | translate }}:\r\n <vdr-chip\r\n ><span class=\"cancelled-coupon-code\">{{ entry.data.couponCode }}</span></vdr-chip\r\n >\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <div class=\"title\">\r\n {{ entry.type | translate }}\r\n </div>\r\n <vdr-history-entry-detail *ngIf=\"entry.data\">\r\n <vdr-object-tree [value]=\"entry.data\"></vdr-object-tree>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n </vdr-timeline-entry>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <vdr-timeline-entry [isLast]=\"true\" [createdAt]=\"order.createdAt\" [featured]=\"true\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-created' | translate }}\r\n </div>\r\n </vdr-timeline-entry>\r\n</div>\r\n", styles: [":host{display:block}.entry-list{margin-inline-start:calc(var(--space-unit) * 2)}.note-entry{display:flex;align-items:center}.note-entry .note{flex:1}.note-entry button{margin:0}.visibility-select{display:flex;justify-content:space-between;align-items:baseline}.visibility-select .public{color:var(--color-warning-700)}.visibility-select .private{color:var(--color-success-700)}textarea.note{flex:1;height:36px;border-radius:3px;margin-inline-end:6px}.note-text{color:var(--color-grey-800);white-space:pre-wrap}.cancelled-coupon-code{text-decoration:line-through}.note-visibility{text-transform:lowercase}.note-visibility.public{color:var(--color-warning-700)}.note-visibility.private{color:var(--color-success-700)}\n"] }]
1930
+ args: [{ selector: 'vdr-order-history', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"entry-list\" [class.expanded]=\"expanded\">\r\n <vdr-timeline-entry iconShape=\"note\" displayType=\"muted\" [featured]=\"true\">\r\n <div class=\"note-entry\">\r\n <textarea [(ngModel)]=\"note\" name=\"note\" class=\"note\"></textarea>\r\n <button class=\"btn btn-secondary\" [disabled]=\"!note\" (click)=\"addNoteToOrder()\">\r\n {{ 'common.add-note' | translate }}\r\n </button>\r\n </div>\r\n <div class=\"visibility-select\">\r\n <clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"noteIsPrivate\" />\r\n <label>{{ 'order.note-is-private' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <span *ngIf=\"noteIsPrivate\" class=\"private\">\r\n {{ 'order.note-only-visible-to-administrators' | translate }}\r\n </span>\r\n <span *ngIf=\"!noteIsPrivate\" class=\"public\">\r\n {{ 'order.note-visible-to-customer' | translate }}\r\n </span>\r\n </div>\r\n </vdr-timeline-entry>\r\n <ng-container *ngFor=\"let entry of history\">\r\n <vdr-order-history-entry-host\r\n *ngIf=\"hasCustomComponent(entry.type); else defaultComponents\"\r\n [order]=\"order\"\r\n [entry]=\"entry\"\r\n [expanded]=\"expanded\"\r\n (expandClick)=\"expanded = !expanded\"\r\n ></vdr-order-history-entry-host>\r\n <ng-template #defaultComponents>\r\n <vdr-timeline-entry\r\n [displayType]=\"getDisplayType(entry)\"\r\n [iconShape]=\"getTimelineIcon(entry)\"\r\n [createdAt]=\"entry.createdAt\"\r\n [name]=\"getName(entry)\"\r\n [featured]=\"isFeatured(entry)\"\r\n [collapsed]=\"!expanded && !isFeatured(entry)\"\r\n (expandClick)=\"expanded = !expanded\"\r\n >\r\n <ng-container [ngSwitch]=\"entry.type\">\r\n <ng-container *ngSwitchCase=\"type.ORDER_STATE_TRANSITION\">\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Delivered'\">\r\n {{ 'order.history-order-fulfilled' | translate }}\r\n </div>\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Cancelled'\">\r\n {{ 'order.history-order-cancelled' | translate }}\r\n </div>\r\n <ng-template [ngIf]=\"entry.data.to !== 'Cancelled' && entry.data.to !== 'Delivered'\">\r\n {{\r\n 'order.history-order-transition'\r\n | translate : { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_MODIFIED\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-modified' | translate }}\r\n </div>\r\n <div\r\n class=\"flex items-center\"\r\n *ngIf=\"getModification(entry.data.modificationId) as modification\"\r\n >\r\n {{ 'order.modify-order-price-difference' | translate }}:\r\n <strong>{{\r\n modification.priceChange | localeCurrency : order.currencyCode\r\n }}</strong>\r\n <vdr-chip colorType=\"success\" class=\"mx-1\" *ngIf=\"modification.isSettled\">{{\r\n 'order.modification-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip colorType=\"error\" class=\"mx-1\" *ngIf=\"!modification.isSettled\">{{\r\n 'order.modification-not-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail>\r\n <vdr-modification-detail\r\n [order]=\"order\"\r\n [modification]=\"modification\"\r\n ></vdr-modification-detail>\r\n </vdr-history-entry-detail>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_PAYMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Settled'; else regularPaymentTransition\">\r\n <div class=\"title\">\r\n {{ 'order.history-payment-settled' | translate }}\r\n </div>\r\n <div class=\"flex items-center\">\r\n <vdr-chip *ngIf=\"getPayment(entry) as payment\" class=\"mr-1\">{{\r\n payment.amount | localeCurrency : order.currencyCode\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail *ngIf=\"getPayment(entry) as payment\">\r\n <vdr-payment-detail\r\n [payment]=\"payment\"\r\n [currencyCode]=\"order.currencyCode\"\r\n ></vdr-payment-detail>\r\n </vdr-history-entry-detail>\r\n </div>\r\n </ng-container>\r\n <ng-template #regularPaymentTransition>\r\n {{\r\n 'order.history-payment-transition'\r\n | translate\r\n : {\r\n from: entry.data.from,\r\n to: entry.data.to,\r\n id: getPayment(entry)?.transactionId\r\n }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_REFUND_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Settled'; else regularRefundTransition\">\r\n <ng-container *ngIf=\"getRefund(entry) as refund\">\r\n <div class=\"title\">{{ 'order.refund' | translate }} #{{ refund.id }}</div>\r\n <div class=\"flex items-center\">\r\n <vdr-chip colorType=\"warning\" class=\"mr-1\">{{\r\n refund.total | localeCurrency : order.currencyCode\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail>\r\n <vdr-labeled-data [label]=\"'order.cancellation-reason' | translate\">\r\n {{ entry.data.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.contents' | translate\">\r\n <vdr-simple-item-list\r\n [items]=\"getCancelledItems(refund.lines)\"\r\n ></vdr-simple-item-list>\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #regularRefundTransition>\r\n {{\r\n 'order.history-refund-transition'\r\n | translate\r\n : {\r\n from: entry.data.from,\r\n to: entry.data.to,\r\n id: entry.data.refundId\r\n }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_CANCELLATION\">\r\n {{\r\n 'order.history-items-cancelled'\r\n | translate : { count: getCancelledQuantity(entry) }\r\n }}\r\n <vdr-history-entry-detail *ngIf=\"getCancelledItems(entry.data.lines) as items\">\r\n <vdr-labeled-data [label]=\"'order.cancellation-reason' | translate\">\r\n {{ entry.data.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.contents' | translate\">\r\n <vdr-simple-item-list [items]=\"items\"></vdr-simple-item-list>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.shipping-cancelled' | translate\">\r\n {{ entry.data.shippingCancelled }}\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT\">\r\n {{ 'order.history-fulfillment-created' | translate }}\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Delivered'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-delivered' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to === 'Shipped'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-shipped' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to !== 'Delivered' && entry.data.to !== 'Shipped'\">\r\n {{\r\n 'order.history-fulfillment-transition'\r\n | translate : { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-container>\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_NOTE\">\r\n <div class=\"flex\">\r\n <div class=\"note-text\">\r\n <span *ngIf=\"entry.isPublic\" class=\"note-visibility public\">{{\r\n 'common.public' | translate\r\n }}</span>\r\n <span *ngIf=\"!entry.isPublic\" class=\"note-visibility private\">{{\r\n 'common.private' | translate\r\n }}</span>\r\n {{ entry.data.note }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-dropdown>\r\n <button class=\"button-small ml-1\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\" size=\"12\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n vdrDropdownItem\r\n (click)=\"updateNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n vdrDropdownItem\r\n (click)=\"deleteNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_APPLIED\">\r\n {{ 'order.history-coupon-code-applied' | translate }}:\r\n <vdr-chip>\r\n <a [routerLink]=\"['/marketing', 'promotions', entry.data.promotionId]\">{{\r\n entry.data.couponCode\r\n }}</a>\r\n </vdr-chip>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_REMOVED\">\r\n {{ 'order.history-coupon-code-removed' | translate }}:\r\n <vdr-chip\r\n ><span class=\"cancelled-coupon-code\">{{ entry.data.couponCode }}</span></vdr-chip\r\n >\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_CUSTOMER_UPDATED\">\r\n <div class=\"title\">\r\n {{\r\n 'order.history-customer-updated'\r\n | translate : { newCustomerName: entry.data.newCustomerName }\r\n }}\r\n </div>\r\n <div class=\"flex\">\r\n <div class=\"note-text\">\r\n {{ entry.data.note }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-history-entry-detail>\r\n <vdr-labeled-data [label]=\"'order.previous-customer' | translate\">\r\n <a\r\n *ngIf=\"entry.data.previousCustomerId\"\r\n class=\"button-ghost\"\r\n [routerLink]=\"[\r\n '/customer',\r\n 'customers',\r\n entry.data.previousCustomerId\r\n ]\"\r\n >\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon>\r\n <span>{{ entry.data.previousCustomerName }}</span>\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.new-customer' | translate\">\r\n <a\r\n *ngIf=\"entry.data.newCustomerId\"\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/customer', 'customers', entry.data.newCustomerId]\"\r\n >\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon>\r\n <span>{{ entry.data.newCustomerName }}</span>\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <div class=\"title\">\r\n {{ entry.type | translate }}\r\n </div>\r\n <vdr-history-entry-detail *ngIf=\"entry.data\">\r\n <vdr-object-tree [value]=\"entry.data\"></vdr-object-tree>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n </vdr-timeline-entry>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <vdr-timeline-entry [isLast]=\"true\" [createdAt]=\"order.createdAt\" [featured]=\"true\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-created' | translate }}\r\n </div>\r\n </vdr-timeline-entry>\r\n</div>\r\n", styles: [":host{display:block}.entry-list{margin-inline-start:calc(var(--space-unit) * 2)}.note-entry{display:flex;align-items:center}.note-entry .note{flex:1}.note-entry button{margin:0}.visibility-select{display:flex;justify-content:space-between;align-items:baseline}.visibility-select .public{color:var(--color-warning-700)}.visibility-select .private{color:var(--color-success-700)}textarea.note{flex:1;height:36px;border-radius:3px;margin-inline-end:6px}.note-text{color:var(--color-grey-800);white-space:pre-wrap;max-width:580px}.cancelled-coupon-code{text-decoration:line-through}.note-visibility{text-transform:lowercase}.note-visibility.public{color:var(--color-warning-700)}.note-visibility.private{color:var(--color-success-700)}\n"] }]
1824
1931
  }], ctorParameters: function () { return [{ type: i1.HistoryEntryComponentService }]; }, propDecorators: { order: [{
1825
1932
  type: Input
1826
1933
  }], history: [{
@@ -1877,13 +1984,13 @@ class SellerOrdersCardComponent {
1877
1984
  navigateToSellerOrder(order) {
1878
1985
  this.router.navigate(['/orders', order.id]);
1879
1986
  }
1880
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SellerOrdersCardComponent, deps: [{ token: i1$2.Router }, { token: i1.DataService }, { token: i1.ChannelService }], target: i0.ɵɵFactoryTarget.Component }); }
1881
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SellerOrdersCardComponent, selector: "vdr-seller-orders-card", inputs: { orderId: "orderId" }, ngImport: i0, template: "<vdr-card [title]=\"'order.seller-orders' | translate\">\r\n <div class=\"form-grid\">\r\n <div *ngFor=\"let order of sellerOrders$ | async\">\r\n <a [routerLink]=\"['seller-orders', order.id]\" class=\"button-ghost mb-1\"\r\n >{{ order.code }} <clr-icon shape=\"arrow right\"></clr-icon\r\n ></a>\r\n <vdr-labeled-data [label]=\"'order.state' | translate\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data *ngIf=\"getSeller(order) as seller\" [label]=\"'common.seller' | translate\">\r\n {{ seller.name }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data *ngIf=\"getSeller(order) as seller\" [label]=\"'order.total' | translate\">\r\n {{ order.totalWithTax | localeCurrency : order.currencyCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n </div>\r\n</vdr-card>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1987
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SellerOrdersCardComponent, deps: [{ token: i1$1.Router }, { token: i1.DataService }, { token: i1.ChannelService }], target: i0.ɵɵFactoryTarget.Component }); }
1988
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: SellerOrdersCardComponent, selector: "vdr-seller-orders-card", inputs: { orderId: "orderId" }, ngImport: i0, template: "<vdr-card [title]=\"'order.seller-orders' | translate\">\r\n <div class=\"form-grid\">\r\n <div *ngFor=\"let order of sellerOrders$ | async\">\r\n <a [routerLink]=\"['seller-orders', order.id]\" class=\"button-ghost mb-1\"\r\n >{{ order.code }} <clr-icon shape=\"arrow right\"></clr-icon\r\n ></a>\r\n <vdr-labeled-data [label]=\"'order.state' | translate\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data *ngIf=\"getSeller(order) as seller\" [label]=\"'common.seller' | translate\">\r\n {{ seller.name }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data *ngIf=\"getSeller(order) as seller\" [label]=\"'order.total' | translate\">\r\n {{ order.totalWithTax | localeCurrency : order.currencyCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n </div>\r\n</vdr-card>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1882
1989
  }
1883
1990
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: SellerOrdersCardComponent, decorators: [{
1884
1991
  type: Component,
1885
1992
  args: [{ selector: 'vdr-seller-orders-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-card [title]=\"'order.seller-orders' | translate\">\r\n <div class=\"form-grid\">\r\n <div *ngFor=\"let order of sellerOrders$ | async\">\r\n <a [routerLink]=\"['seller-orders', order.id]\" class=\"button-ghost mb-1\"\r\n >{{ order.code }} <clr-icon shape=\"arrow right\"></clr-icon\r\n ></a>\r\n <vdr-labeled-data [label]=\"'order.state' | translate\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data *ngIf=\"getSeller(order) as seller\" [label]=\"'common.seller' | translate\">\r\n {{ seller.name }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data *ngIf=\"getSeller(order) as seller\" [label]=\"'order.total' | translate\">\r\n {{ order.totalWithTax | localeCurrency : order.currencyCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n </div>\r\n</vdr-card>\r\n", styles: [":host{display:block}\n"] }]
1886
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1.DataService }, { type: i1.ChannelService }]; }, propDecorators: { orderId: [{
1993
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1.DataService }, { type: i1.ChannelService }]; }, propDecorators: { orderId: [{
1887
1994
  type: Input
1888
1995
  }] } });
1889
1996
 
@@ -1895,6 +2002,19 @@ const ORDER_DETAIL_QUERY = gql `
1895
2002
  }
1896
2003
  ${ORDER_DETAIL_FRAGMENT}
1897
2004
  `;
2005
+ const SET_ORDER_CUSTOMER_MUTATION = gql `
2006
+ mutation SetOrderCustomer($input: SetOrderCustomerInput!) {
2007
+ setOrderCustomer(input: $input) {
2008
+ id
2009
+ customer {
2010
+ id
2011
+ firstName
2012
+ lastName
2013
+ emailAddress
2014
+ }
2015
+ }
2016
+ }
2017
+ `;
1898
2018
  class OrderDetailComponent extends TypedBaseDetailComponent {
1899
2019
  constructor(changeDetector, dataService, notificationService, modalService, orderTransitionService, formBuilder) {
1900
2020
  super();
@@ -1958,6 +2078,38 @@ class OrderDetailComponent extends TypedBaseDetailComponent {
1958
2078
  })))
1959
2079
  .subscribe();
1960
2080
  }
2081
+ setOrderCustomer() {
2082
+ this.modalService
2083
+ .fromComponent(SelectCustomerDialogComponent, {
2084
+ locals: {
2085
+ canCreateNew: false,
2086
+ includeNoteInput: true,
2087
+ title: marker('order.assign-order-to-another-customer'),
2088
+ },
2089
+ })
2090
+ .pipe(switchMap(result => {
2091
+ function isExisting(input) {
2092
+ return typeof input === 'object' && !!input.id;
2093
+ }
2094
+ if (isExisting(result)) {
2095
+ return this.dataService.mutate(SetOrderCustomerDocument, {
2096
+ input: {
2097
+ customerId: result.id,
2098
+ orderId: this.id,
2099
+ note: result.note,
2100
+ },
2101
+ });
2102
+ }
2103
+ else {
2104
+ return EMPTY;
2105
+ }
2106
+ }), switchMap(result => this.refetchOrder(result)))
2107
+ .subscribe(result => {
2108
+ if (result) {
2109
+ this.notificationService.success(marker('order.set-customer-success'));
2110
+ }
2111
+ });
2112
+ }
1961
2113
  transitionToState(state) {
1962
2114
  this.dataService.order.transitionToState(this.id, state).subscribe(({ transitionOrderToState }) => {
1963
2115
  switch (transitionOrderToState?.__typename) {
@@ -2342,7 +2494,9 @@ class OrderDetailComponent extends TypedBaseDetailComponent {
2342
2494
  switch (result.__typename) {
2343
2495
  case 'Order':
2344
2496
  this.refetchOrder(result).subscribe();
2345
- this.notificationService.success(marker('order.cancelled-order-success'));
2497
+ this.notificationService.success(marker('order.cancelled-order-items-success'), {
2498
+ count: summate(input.cancel.lines, 'quantity'),
2499
+ });
2346
2500
  return input;
2347
2501
  case 'CancelActiveOrderError':
2348
2502
  case 'QuantityTooGreatError':
@@ -2361,36 +2515,36 @@ class OrderDetailComponent extends TypedBaseDetailComponent {
2361
2515
  if (!input) {
2362
2516
  return of(undefined);
2363
2517
  }
2364
- if (input.refund.lines.length) {
2365
- return this.dataService.order
2366
- .refundOrder(input.refund)
2367
- .pipe(map(res => res.refundOrder));
2518
+ if (input.refunds.length) {
2519
+ return forkJoin(input.refunds.map(refund => this.dataService.order.refundOrder(refund).pipe(map(res => res.refundOrder))));
2368
2520
  }
2369
2521
  else {
2370
2522
  return [undefined];
2371
2523
  }
2372
2524
  }))
2373
- .subscribe(result => {
2374
- if (result) {
2375
- switch (result.__typename) {
2376
- case 'Refund':
2377
- this.refetchOrder(result).subscribe();
2378
- if (result.state === 'Failed') {
2379
- this.notificationService.error(marker('order.refund-order-failed'));
2380
- }
2381
- else {
2382
- this.notificationService.success(marker('order.refund-order-success'));
2383
- }
2384
- break;
2385
- case 'AlreadyRefundedError':
2386
- case 'NothingToRefundError':
2387
- case 'PaymentOrderMismatchError':
2388
- case 'RefundOrderStateError':
2389
- case 'RefundStateTransitionError':
2390
- this.notificationService.error(result.message);
2391
- break;
2525
+ .subscribe(results => {
2526
+ for (const result of results ?? []) {
2527
+ if (result) {
2528
+ switch (result.__typename) {
2529
+ case 'Refund':
2530
+ if (result.state === 'Failed') {
2531
+ this.notificationService.error(marker('order.refund-order-failed'));
2532
+ }
2533
+ else {
2534
+ this.notificationService.success(marker('order.refund-order-success'));
2535
+ }
2536
+ break;
2537
+ case 'AlreadyRefundedError':
2538
+ case 'NothingToRefundError':
2539
+ case 'PaymentOrderMismatchError':
2540
+ case 'RefundOrderStateError':
2541
+ case 'RefundStateTransitionError':
2542
+ this.notificationService.error(result.message);
2543
+ break;
2544
+ }
2392
2545
  }
2393
2546
  }
2547
+ this.refetchOrder(results?.[0]).subscribe();
2394
2548
  });
2395
2549
  }
2396
2550
  refetchOrder(result) {
@@ -2408,13 +2562,83 @@ class OrderDetailComponent extends TypedBaseDetailComponent {
2408
2562
  }
2409
2563
  }
2410
2564
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderDetailComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.DataService }, { token: i1.NotificationService }, { token: i1.ModalService }, { token: OrderTransitionService }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
2411
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderDetailComponent, selector: "vdr-order-detail", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left> </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"button primary mr-1\"\r\n *ngIf=\"\r\n order.type !== 'Aggregate' &&\r\n (order.state === 'ArrangingPayment' || order.state === 'ArrangingAdditionalPayment') &&\r\n (hasUnsettledModifications(order) || 0 < outstandingPaymentAmount(order))\r\n \"\r\n (click)=\"addManualPayment(order)\"\r\n >\r\n {{ 'order.add-payment-to-order' | translate }}\r\n ({{ outstandingPaymentAmount(order) | localeCurrency : order.currencyCode }})\r\n </button>\r\n <button\r\n class=\"button primary mr-1\"\r\n *ngIf=\"\r\n order.type !== 'Aggregate' &&\r\n order.active === false &&\r\n order.state !== 'ArrangingAdditionalPayment' &&\r\n order.state !== 'ArrangingPayment' &&\r\n 0 < outstandingPaymentAmount(order)\r\n \"\r\n (click)=\"transitionToState('ArrangingAdditionalPayment')\"\r\n >\r\n {{ 'order.arrange-additional-payment' | translate }}\r\n </button>\r\n <button\r\n *ngIf=\"order.type !== 'Aggregate'\"\r\n class=\"button primary mr-1\"\r\n (click)=\"fulfillOrder()\"\r\n [disabled]=\"!canAddFulfillment(order)\"\r\n >\r\n {{ 'order.fulfill-order' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container\r\n *ngIf=\"order.type !== 'Aggregate' && order.nextStates.includes('Modifying')\"\r\n >\r\n <button type=\"button\" vdrDropdownItem (click)=\"transitionToModifying()\">\r\n <clr-icon shape=\"pencil\"></clr-icon>\r\n {{ 'order.modify-order' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n </ng-container>\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n *ngIf=\"order.type !== 'Aggregate' && order.nextStates.includes('Cancelled')\"\r\n (click)=\"cancelOrRefund(order)\"\r\n >\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n <ng-container *ngIf=\"orderHasSettledPayments(order); else cancelOnly\">\r\n {{ 'order.refund-and-cancel-order' | translate }}\r\n </ng-container>\r\n <ng-template #cancelOnly>\r\n {{ 'order.cancel-order' | translate }}\r\n </ng-template>\r\n </button>\r\n\r\n <ng-container *ngIf=\"(nextStates$ | async)?.length\">\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n *ngFor=\"let nextState of nextStates$ | async\"\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionToState(nextState)\"\r\n >\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{\r\n 'order.transition-to-state'\r\n | translate : { state: (nextState | stateI18nToken | translate) }\r\n }}\r\n </button>\r\n </ng-container>\r\n <div class=\"dropdown-divider\"></div>\r\n <button type=\"button\" vdrDropdownItem (click)=\"manuallyTransitionToState(order)\">\r\n <clr-icon shape=\"step-forward-2\" class=\"is-warning\"></clr-icon>\r\n {{ 'order.manually-transition-to-state' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-detail-layout *ngIf=\"entity$ | async as order\">\r\n <vdr-page-detail-sidebar>\r\n <vdr-card>\r\n <vdr-order-state-label [state]=\"order.state\">\r\n <button\r\n class=\"icon-button\"\r\n (click)=\"openStateDiagram()\"\r\n [title]=\"'order.order-state-diagram' | translate\"\r\n >\r\n <clr-icon shape=\"list\"></clr-icon>\r\n </button>\r\n </vdr-order-state-label>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.customer' | translate\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n <vdr-labeled-data\r\n class=\"mt-2\"\r\n [label]=\"'order.shipping-address' | translate\"\r\n *ngIf=\"getOrderAddressLines(order.shippingAddress).length\"\r\n >\r\n <vdr-formatted-address [address]=\"order.shippingAddress\" class=\"mt-1\"></vdr-formatted-address>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data\r\n [label]=\"'order.billing-address' | translate\"\r\n *ngIf=\"getOrderAddressLines(order.billingAddress).length\"\r\n >\r\n <vdr-formatted-address [address]=\"order.billingAddress\" class=\"mt-1\"></vdr-formatted-address>\r\n </vdr-labeled-data>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.payments' | translate\" *ngIf=\"order.payments?.length\">\r\n <vdr-order-payment-card\r\n *ngFor=\"let payment of order.payments\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [payment]=\"payment\"\r\n (settlePayment)=\"settlePayment($event)\"\r\n (transitionPaymentState)=\"transitionPaymentState($event)\"\r\n (settleRefund)=\"settleRefund($event)\"\r\n ></vdr-order-payment-card>\r\n </vdr-card>\r\n <vdr-card *ngIf=\"order.fulfillments?.length\">\r\n <vdr-fulfillment-card\r\n *ngFor=\"let fulfillment of order.fulfillments\"\r\n [fulfillment]=\"fulfillment\"\r\n [order]=\"order\"\r\n (transitionState)=\"transitionFulfillment(fulfillment.id, $event)\"\r\n ></vdr-fulfillment-card>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n\r\n <vdr-page-block>\r\n <vdr-seller-orders-card\r\n class=\"mb-2\"\r\n *ngIf=\"order.sellerOrders.length\"\r\n [orderId]=\"order.id\"\r\n ></vdr-seller-orders-card>\r\n <vdr-card [paddingX]=\"false\">\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n ></vdr-order-table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.tax-summary' | translate\" [paddingX]=\"false\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'common.description' | translate }}</th>\r\n <th>{{ 'order.tax-rate' | translate }}</th>\r\n <th>{{ 'order.tax-base' | translate }}</th>\r\n <th>{{ 'order.tax-total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let row of order.taxSummary\">\r\n <td>{{ row.description }}</td>\r\n <td>{{ row.taxRate / 100 | percent:'0.0-2' }}</td>\r\n <td>{{ row.taxBase | localeCurrency : order.currencyCode }}</td>\r\n <td>{{ row.taxTotal | localeCurrency : order.currencyCode }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'common.custom-fields' | translate\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Order\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get('customFields')\"\r\n [readonly]=\"!('UpdateOrder' | hasPermission)\"\r\n />\r\n <button\r\n class=\"button primary\"\r\n (click)=\"updateCustomFields()\"\r\n [disabled]=\"\r\n detailForm.get('customFields')?.pristine || detailForm.get('customFields')?.invalid\r\n \"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-custom-detail-component-host\r\n locationId=\"order-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-card [title]=\"'order.order-history' | translate\">\r\n <vdr-order-history\r\n [order]=\"order\"\r\n [history]=\"history$ | async\"\r\n (addNote)=\"addNote($event)\"\r\n (updateNote)=\"updateNote($event)\"\r\n (deleteNote)=\"deleteNote($event)\"\r\n ></vdr-order-history>\r\n </vdr-card>\r\n </vdr-page-block>\r\n</vdr-page-detail-layout>\r\n", styles: [".shipping-address{list-style-type:none;line-height:1.3em}.order-cards h6{margin-top:6px;color:var(--color-text-200)}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "component", type: i1.CustomDetailComponentHostComponent, selector: "vdr-custom-detail-component-host", inputs: ["locationId", "entity$", "detailForm"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "component", type: i1.PageEntityInfoComponent, selector: "vdr-page-entity-info", inputs: ["entity"] }, { kind: "component", type: i1.PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: i1.PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "component", type: OrderPaymentCardComponent, selector: "vdr-order-payment-card", inputs: ["payment", "currencyCode"], outputs: ["settlePayment", "transitionPaymentState", "settleRefund"] }, { kind: "component", type: OrderHistoryComponent, selector: "vdr-order-history", inputs: ["order", "history"], outputs: ["addNote", "updateNote", "deleteNote"] }, { kind: "component", type: FulfillmentCardComponent, selector: "vdr-fulfillment-card", inputs: ["fulfillment", "order"], outputs: ["transitionState"] }, { kind: "component", type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { kind: "component", type: SellerOrdersCardComponent, selector: "vdr-seller-orders-card", inputs: ["orderId"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.PercentPipe, name: "percent" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.HasPermissionPipe, name: "hasPermission" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2565
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderDetailComponent, selector: "vdr-order-detail", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left> </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"button primary mr-1\"\r\n *ngIf=\"\r\n order.type !== 'Aggregate' &&\r\n (order.state === 'ArrangingPayment' || order.state === 'ArrangingAdditionalPayment') &&\r\n (hasUnsettledModifications(order) || 0 < outstandingPaymentAmount(order))\r\n \"\r\n (click)=\"addManualPayment(order)\"\r\n >\r\n {{ 'order.add-payment-to-order' | translate }}\r\n ({{ outstandingPaymentAmount(order) | localeCurrency : order.currencyCode }})\r\n </button>\r\n <button\r\n class=\"button primary mr-1\"\r\n *ngIf=\"\r\n order.type !== 'Aggregate' &&\r\n order.active === false &&\r\n order.state !== 'ArrangingAdditionalPayment' &&\r\n order.state !== 'ArrangingPayment' &&\r\n 0 < outstandingPaymentAmount(order)\r\n \"\r\n (click)=\"transitionToState('ArrangingAdditionalPayment')\"\r\n >\r\n {{ 'order.arrange-additional-payment' | translate }}\r\n </button>\r\n <button\r\n *ngIf=\"order.type !== 'Aggregate'\"\r\n class=\"button primary mr-1\"\r\n (click)=\"fulfillOrder()\"\r\n [disabled]=\"!canAddFulfillment(order)\"\r\n >\r\n {{ 'order.fulfill-order' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container\r\n *ngIf=\"order.type !== 'Aggregate' && order.nextStates.includes('Modifying')\"\r\n >\r\n <button type=\"button\" vdrDropdownItem (click)=\"transitionToModifying()\">\r\n <clr-icon shape=\"pencil\"></clr-icon>\r\n {{ 'order.modify-order' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n </ng-container>\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n *ngIf=\"order.type !== 'Aggregate' && order.nextStates.includes('Cancelled')\"\r\n (click)=\"cancelOrRefund(order)\"\r\n >\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n <ng-container *ngIf=\"orderHasSettledPayments(order); else cancelOnly\">\r\n {{ 'order.refund-and-cancel-order' | translate }}\r\n </ng-container>\r\n <ng-template #cancelOnly>\r\n {{ 'order.cancel-order' | translate }}\r\n </ng-template>\r\n </button>\r\n\r\n <ng-container *ngIf=\"(nextStates$ | async)?.length\">\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n *ngFor=\"let nextState of nextStates$ | async\"\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionToState(nextState)\"\r\n >\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{\r\n 'order.transition-to-state'\r\n | translate : { state: (nextState | stateI18nToken | translate) }\r\n }}\r\n </button>\r\n </ng-container>\r\n <div class=\"dropdown-divider\"></div>\r\n <button type=\"button\" vdrDropdownItem (click)=\"manuallyTransitionToState(order)\">\r\n <clr-icon shape=\"step-forward-2\" class=\"is-warning\"></clr-icon>\r\n {{ 'order.manually-transition-to-state' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-detail-layout *ngIf=\"entity$ | async as order\">\r\n <vdr-page-detail-sidebar>\r\n <vdr-card [title]=\"'order.state' | translate\">\r\n <ng-template vdrCardControls>\r\n <button\r\n class=\"button-small\"\r\n (click)=\"openStateDiagram()\"\r\n [title]=\"'order.order-state-diagram' | translate\"\r\n >\r\n <clr-icon shape=\"list\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.customer' | translate\">\r\n <ng-template vdrCardControls>\r\n <button\r\n *vdrIfPermissions=\"['UpdateOrder', 'ReadCustomer']\"\r\n class=\"button-small\"\r\n (click)=\"setOrderCustomer()\"\r\n [title]=\"'order.assign-order-to-another-customer' | translate\"\r\n >\r\n <clr-icon shape=\"switch\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n <vdr-labeled-data\r\n class=\"mt-2\"\r\n [label]=\"'order.shipping-address' | translate\"\r\n *ngIf=\"getOrderAddressLines(order.shippingAddress).length\"\r\n >\r\n <vdr-formatted-address [address]=\"order.shippingAddress\" class=\"mt-1\"></vdr-formatted-address>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data\r\n [label]=\"'order.billing-address' | translate\"\r\n *ngIf=\"getOrderAddressLines(order.billingAddress).length\"\r\n >\r\n <vdr-formatted-address [address]=\"order.billingAddress\" class=\"mt-1\"></vdr-formatted-address>\r\n </vdr-labeled-data>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.payments' | translate\" *ngIf=\"order.payments?.length\">\r\n <vdr-order-payment-card\r\n *ngFor=\"let payment of order.payments\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [payment]=\"payment\"\r\n (settlePayment)=\"settlePayment($event)\"\r\n (transitionPaymentState)=\"transitionPaymentState($event)\"\r\n (settleRefund)=\"settleRefund($event)\"\r\n ></vdr-order-payment-card>\r\n </vdr-card>\r\n <vdr-card *ngIf=\"order.fulfillments?.length\">\r\n <vdr-fulfillment-card\r\n *ngFor=\"let fulfillment of order.fulfillments\"\r\n [fulfillment]=\"fulfillment\"\r\n [order]=\"order\"\r\n (transitionState)=\"transitionFulfillment(fulfillment.id, $event)\"\r\n ></vdr-fulfillment-card>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n\r\n <vdr-page-block>\r\n <vdr-seller-orders-card\r\n class=\"mb-2\"\r\n *ngIf=\"order.sellerOrders.length\"\r\n [orderId]=\"order.id\"\r\n ></vdr-seller-orders-card>\r\n <vdr-card [paddingX]=\"false\">\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n ></vdr-order-table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.tax-summary' | translate\" [paddingX]=\"false\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'common.description' | translate }}</th>\r\n <th>{{ 'order.tax-rate' | translate }}</th>\r\n <th>{{ 'order.tax-base' | translate }}</th>\r\n <th>{{ 'order.tax-total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let row of order.taxSummary\">\r\n <td>{{ row.description }}</td>\r\n <td>{{ row.taxRate / 100 | percent : '0.0-2' }}</td>\r\n <td>{{ row.taxBase | localeCurrency : order.currencyCode }}</td>\r\n <td>{{ row.taxTotal | localeCurrency : order.currencyCode }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'common.custom-fields' | translate\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Order\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get('customFields')\"\r\n [readonly]=\"!('UpdateOrder' | hasPermission)\"\r\n />\r\n <button\r\n class=\"button primary\"\r\n (click)=\"updateCustomFields()\"\r\n [disabled]=\"\r\n detailForm.get('customFields')?.pristine || detailForm.get('customFields')?.invalid\r\n \"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-custom-detail-component-host\r\n locationId=\"order-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-card [title]=\"'order.order-history' | translate\">\r\n <vdr-order-history\r\n [order]=\"order\"\r\n [history]=\"history$ | async\"\r\n (addNote)=\"addNote($event)\"\r\n (updateNote)=\"updateNote($event)\"\r\n (deleteNote)=\"deleteNote($event)\"\r\n ></vdr-order-history>\r\n </vdr-card>\r\n </vdr-page-block>\r\n</vdr-page-detail-layout>\r\n", styles: [".shipping-address{list-style-type:none;line-height:1.3em}.order-cards h6{margin-top:6px;color:var(--color-text-200)}vdr-order-payment-card+vdr-order-payment-card{margin-top:calc(var(--space-unit) * 2)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "directive", type: i1.IfPermissionsDirective, selector: "[vdrIfPermissions]", inputs: ["vdrIfPermissions", "vdrIfPermissionsElse"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "component", type: i1.CustomDetailComponentHostComponent, selector: "vdr-custom-detail-component-host", inputs: ["locationId", "entity$", "detailForm"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "component", type: i1.PageEntityInfoComponent, selector: "vdr-page-entity-info", inputs: ["entity"] }, { kind: "component", type: i1.PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: i1.PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "directive", type: i1.CardControlsDirective, selector: "[vdrCardControls]" }, { kind: "component", type: OrderPaymentCardComponent, selector: "vdr-order-payment-card", inputs: ["payment", "currencyCode"], outputs: ["settlePayment", "transitionPaymentState", "settleRefund"] }, { kind: "component", type: OrderHistoryComponent, selector: "vdr-order-history", inputs: ["order", "history"], outputs: ["addNote", "updateNote", "deleteNote"] }, { kind: "component", type: FulfillmentCardComponent, selector: "vdr-fulfillment-card", inputs: ["fulfillment", "order"], outputs: ["transitionState"] }, { kind: "component", type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { kind: "component", type: SellerOrdersCardComponent, selector: "vdr-seller-orders-card", inputs: ["orderId"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.PercentPipe, name: "percent" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.HasPermissionPipe, name: "hasPermission" }, { kind: "pipe", type: i1.StateI18nTokenPipe, name: "stateI18nToken" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2412
2566
  }
2413
2567
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderDetailComponent, decorators: [{
2414
2568
  type: Component,
2415
- args: [{ selector: 'vdr-order-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left> </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"button primary mr-1\"\r\n *ngIf=\"\r\n order.type !== 'Aggregate' &&\r\n (order.state === 'ArrangingPayment' || order.state === 'ArrangingAdditionalPayment') &&\r\n (hasUnsettledModifications(order) || 0 < outstandingPaymentAmount(order))\r\n \"\r\n (click)=\"addManualPayment(order)\"\r\n >\r\n {{ 'order.add-payment-to-order' | translate }}\r\n ({{ outstandingPaymentAmount(order) | localeCurrency : order.currencyCode }})\r\n </button>\r\n <button\r\n class=\"button primary mr-1\"\r\n *ngIf=\"\r\n order.type !== 'Aggregate' &&\r\n order.active === false &&\r\n order.state !== 'ArrangingAdditionalPayment' &&\r\n order.state !== 'ArrangingPayment' &&\r\n 0 < outstandingPaymentAmount(order)\r\n \"\r\n (click)=\"transitionToState('ArrangingAdditionalPayment')\"\r\n >\r\n {{ 'order.arrange-additional-payment' | translate }}\r\n </button>\r\n <button\r\n *ngIf=\"order.type !== 'Aggregate'\"\r\n class=\"button primary mr-1\"\r\n (click)=\"fulfillOrder()\"\r\n [disabled]=\"!canAddFulfillment(order)\"\r\n >\r\n {{ 'order.fulfill-order' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container\r\n *ngIf=\"order.type !== 'Aggregate' && order.nextStates.includes('Modifying')\"\r\n >\r\n <button type=\"button\" vdrDropdownItem (click)=\"transitionToModifying()\">\r\n <clr-icon shape=\"pencil\"></clr-icon>\r\n {{ 'order.modify-order' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n </ng-container>\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n *ngIf=\"order.type !== 'Aggregate' && order.nextStates.includes('Cancelled')\"\r\n (click)=\"cancelOrRefund(order)\"\r\n >\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n <ng-container *ngIf=\"orderHasSettledPayments(order); else cancelOnly\">\r\n {{ 'order.refund-and-cancel-order' | translate }}\r\n </ng-container>\r\n <ng-template #cancelOnly>\r\n {{ 'order.cancel-order' | translate }}\r\n </ng-template>\r\n </button>\r\n\r\n <ng-container *ngIf=\"(nextStates$ | async)?.length\">\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n *ngFor=\"let nextState of nextStates$ | async\"\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionToState(nextState)\"\r\n >\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{\r\n 'order.transition-to-state'\r\n | translate : { state: (nextState | stateI18nToken | translate) }\r\n }}\r\n </button>\r\n </ng-container>\r\n <div class=\"dropdown-divider\"></div>\r\n <button type=\"button\" vdrDropdownItem (click)=\"manuallyTransitionToState(order)\">\r\n <clr-icon shape=\"step-forward-2\" class=\"is-warning\"></clr-icon>\r\n {{ 'order.manually-transition-to-state' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-detail-layout *ngIf=\"entity$ | async as order\">\r\n <vdr-page-detail-sidebar>\r\n <vdr-card>\r\n <vdr-order-state-label [state]=\"order.state\">\r\n <button\r\n class=\"icon-button\"\r\n (click)=\"openStateDiagram()\"\r\n [title]=\"'order.order-state-diagram' | translate\"\r\n >\r\n <clr-icon shape=\"list\"></clr-icon>\r\n </button>\r\n </vdr-order-state-label>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.customer' | translate\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n <vdr-labeled-data\r\n class=\"mt-2\"\r\n [label]=\"'order.shipping-address' | translate\"\r\n *ngIf=\"getOrderAddressLines(order.shippingAddress).length\"\r\n >\r\n <vdr-formatted-address [address]=\"order.shippingAddress\" class=\"mt-1\"></vdr-formatted-address>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data\r\n [label]=\"'order.billing-address' | translate\"\r\n *ngIf=\"getOrderAddressLines(order.billingAddress).length\"\r\n >\r\n <vdr-formatted-address [address]=\"order.billingAddress\" class=\"mt-1\"></vdr-formatted-address>\r\n </vdr-labeled-data>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.payments' | translate\" *ngIf=\"order.payments?.length\">\r\n <vdr-order-payment-card\r\n *ngFor=\"let payment of order.payments\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [payment]=\"payment\"\r\n (settlePayment)=\"settlePayment($event)\"\r\n (transitionPaymentState)=\"transitionPaymentState($event)\"\r\n (settleRefund)=\"settleRefund($event)\"\r\n ></vdr-order-payment-card>\r\n </vdr-card>\r\n <vdr-card *ngIf=\"order.fulfillments?.length\">\r\n <vdr-fulfillment-card\r\n *ngFor=\"let fulfillment of order.fulfillments\"\r\n [fulfillment]=\"fulfillment\"\r\n [order]=\"order\"\r\n (transitionState)=\"transitionFulfillment(fulfillment.id, $event)\"\r\n ></vdr-fulfillment-card>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n\r\n <vdr-page-block>\r\n <vdr-seller-orders-card\r\n class=\"mb-2\"\r\n *ngIf=\"order.sellerOrders.length\"\r\n [orderId]=\"order.id\"\r\n ></vdr-seller-orders-card>\r\n <vdr-card [paddingX]=\"false\">\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n ></vdr-order-table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.tax-summary' | translate\" [paddingX]=\"false\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'common.description' | translate }}</th>\r\n <th>{{ 'order.tax-rate' | translate }}</th>\r\n <th>{{ 'order.tax-base' | translate }}</th>\r\n <th>{{ 'order.tax-total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let row of order.taxSummary\">\r\n <td>{{ row.description }}</td>\r\n <td>{{ row.taxRate / 100 | percent:'0.0-2' }}</td>\r\n <td>{{ row.taxBase | localeCurrency : order.currencyCode }}</td>\r\n <td>{{ row.taxTotal | localeCurrency : order.currencyCode }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'common.custom-fields' | translate\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Order\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get('customFields')\"\r\n [readonly]=\"!('UpdateOrder' | hasPermission)\"\r\n />\r\n <button\r\n class=\"button primary\"\r\n (click)=\"updateCustomFields()\"\r\n [disabled]=\"\r\n detailForm.get('customFields')?.pristine || detailForm.get('customFields')?.invalid\r\n \"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-custom-detail-component-host\r\n locationId=\"order-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-card [title]=\"'order.order-history' | translate\">\r\n <vdr-order-history\r\n [order]=\"order\"\r\n [history]=\"history$ | async\"\r\n (addNote)=\"addNote($event)\"\r\n (updateNote)=\"updateNote($event)\"\r\n (deleteNote)=\"deleteNote($event)\"\r\n ></vdr-order-history>\r\n </vdr-card>\r\n </vdr-page-block>\r\n</vdr-page-detail-layout>\r\n", styles: [".shipping-address{list-style-type:none;line-height:1.3em}.order-cards h6{margin-top:6px;color:var(--color-text-200)}\n"] }]
2569
+ args: [{ selector: 'vdr-order-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left> </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"button primary mr-1\"\r\n *ngIf=\"\r\n order.type !== 'Aggregate' &&\r\n (order.state === 'ArrangingPayment' || order.state === 'ArrangingAdditionalPayment') &&\r\n (hasUnsettledModifications(order) || 0 < outstandingPaymentAmount(order))\r\n \"\r\n (click)=\"addManualPayment(order)\"\r\n >\r\n {{ 'order.add-payment-to-order' | translate }}\r\n ({{ outstandingPaymentAmount(order) | localeCurrency : order.currencyCode }})\r\n </button>\r\n <button\r\n class=\"button primary mr-1\"\r\n *ngIf=\"\r\n order.type !== 'Aggregate' &&\r\n order.active === false &&\r\n order.state !== 'ArrangingAdditionalPayment' &&\r\n order.state !== 'ArrangingPayment' &&\r\n 0 < outstandingPaymentAmount(order)\r\n \"\r\n (click)=\"transitionToState('ArrangingAdditionalPayment')\"\r\n >\r\n {{ 'order.arrange-additional-payment' | translate }}\r\n </button>\r\n <button\r\n *ngIf=\"order.type !== 'Aggregate'\"\r\n class=\"button primary mr-1\"\r\n (click)=\"fulfillOrder()\"\r\n [disabled]=\"!canAddFulfillment(order)\"\r\n >\r\n {{ 'order.fulfill-order' | translate }}\r\n </button>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <ng-container\r\n *ngIf=\"order.type !== 'Aggregate' && order.nextStates.includes('Modifying')\"\r\n >\r\n <button type=\"button\" vdrDropdownItem (click)=\"transitionToModifying()\">\r\n <clr-icon shape=\"pencil\"></clr-icon>\r\n {{ 'order.modify-order' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n </ng-container>\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n *ngIf=\"order.type !== 'Aggregate' && order.nextStates.includes('Cancelled')\"\r\n (click)=\"cancelOrRefund(order)\"\r\n >\r\n <clr-icon shape=\"error-standard\" class=\"is-error\"></clr-icon>\r\n <ng-container *ngIf=\"orderHasSettledPayments(order); else cancelOnly\">\r\n {{ 'order.refund-and-cancel-order' | translate }}\r\n </ng-container>\r\n <ng-template #cancelOnly>\r\n {{ 'order.cancel-order' | translate }}\r\n </ng-template>\r\n </button>\r\n\r\n <ng-container *ngIf=\"(nextStates$ | async)?.length\">\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n *ngFor=\"let nextState of nextStates$ | async\"\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"transitionToState(nextState)\"\r\n >\r\n <clr-icon shape=\"step-forward-2\"></clr-icon>\r\n {{\r\n 'order.transition-to-state'\r\n | translate : { state: (nextState | stateI18nToken | translate) }\r\n }}\r\n </button>\r\n </ng-container>\r\n <div class=\"dropdown-divider\"></div>\r\n <button type=\"button\" vdrDropdownItem (click)=\"manuallyTransitionToState(order)\">\r\n <clr-icon shape=\"step-forward-2\" class=\"is-warning\"></clr-icon>\r\n {{ 'order.manually-transition-to-state' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-detail-layout *ngIf=\"entity$ | async as order\">\r\n <vdr-page-detail-sidebar>\r\n <vdr-card [title]=\"'order.state' | translate\">\r\n <ng-template vdrCardControls>\r\n <button\r\n class=\"button-small\"\r\n (click)=\"openStateDiagram()\"\r\n [title]=\"'order.order-state-diagram' | translate\"\r\n >\r\n <clr-icon shape=\"list\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.customer' | translate\">\r\n <ng-template vdrCardControls>\r\n <button\r\n *vdrIfPermissions=\"['UpdateOrder', 'ReadCustomer']\"\r\n class=\"button-small\"\r\n (click)=\"setOrderCustomer()\"\r\n [title]=\"'order.assign-order-to-another-customer' | translate\"\r\n >\r\n <clr-icon shape=\"switch\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n <vdr-labeled-data\r\n class=\"mt-2\"\r\n [label]=\"'order.shipping-address' | translate\"\r\n *ngIf=\"getOrderAddressLines(order.shippingAddress).length\"\r\n >\r\n <vdr-formatted-address [address]=\"order.shippingAddress\" class=\"mt-1\"></vdr-formatted-address>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data\r\n [label]=\"'order.billing-address' | translate\"\r\n *ngIf=\"getOrderAddressLines(order.billingAddress).length\"\r\n >\r\n <vdr-formatted-address [address]=\"order.billingAddress\" class=\"mt-1\"></vdr-formatted-address>\r\n </vdr-labeled-data>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.payments' | translate\" *ngIf=\"order.payments?.length\">\r\n <vdr-order-payment-card\r\n *ngFor=\"let payment of order.payments\"\r\n [currencyCode]=\"order.currencyCode\"\r\n [payment]=\"payment\"\r\n (settlePayment)=\"settlePayment($event)\"\r\n (transitionPaymentState)=\"transitionPaymentState($event)\"\r\n (settleRefund)=\"settleRefund($event)\"\r\n ></vdr-order-payment-card>\r\n </vdr-card>\r\n <vdr-card *ngIf=\"order.fulfillments?.length\">\r\n <vdr-fulfillment-card\r\n *ngFor=\"let fulfillment of order.fulfillments\"\r\n [fulfillment]=\"fulfillment\"\r\n [order]=\"order\"\r\n (transitionState)=\"transitionFulfillment(fulfillment.id, $event)\"\r\n ></vdr-fulfillment-card>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n\r\n <vdr-page-block>\r\n <vdr-seller-orders-card\r\n class=\"mb-2\"\r\n *ngIf=\"order.sellerOrders.length\"\r\n [orderId]=\"order.id\"\r\n ></vdr-seller-orders-card>\r\n <vdr-card [paddingX]=\"false\">\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n ></vdr-order-table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.tax-summary' | translate\" [paddingX]=\"false\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'common.description' | translate }}</th>\r\n <th>{{ 'order.tax-rate' | translate }}</th>\r\n <th>{{ 'order.tax-base' | translate }}</th>\r\n <th>{{ 'order.tax-total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let row of order.taxSummary\">\r\n <td>{{ row.description }}</td>\r\n <td>{{ row.taxRate / 100 | percent : '0.0-2' }}</td>\r\n <td>{{ row.taxBase | localeCurrency : order.currencyCode }}</td>\r\n <td>{{ row.taxTotal | localeCurrency : order.currencyCode }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </vdr-card>\r\n <vdr-card [title]=\"'common.custom-fields' | translate\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Order\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get('customFields')\"\r\n [readonly]=\"!('UpdateOrder' | hasPermission)\"\r\n />\r\n <button\r\n class=\"button primary\"\r\n (click)=\"updateCustomFields()\"\r\n [disabled]=\"\r\n detailForm.get('customFields')?.pristine || detailForm.get('customFields')?.invalid\r\n \"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </vdr-card>\r\n <vdr-custom-detail-component-host\r\n locationId=\"order-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-card [title]=\"'order.order-history' | translate\">\r\n <vdr-order-history\r\n [order]=\"order\"\r\n [history]=\"history$ | async\"\r\n (addNote)=\"addNote($event)\"\r\n (updateNote)=\"updateNote($event)\"\r\n (deleteNote)=\"deleteNote($event)\"\r\n ></vdr-order-history>\r\n </vdr-card>\r\n </vdr-page-block>\r\n</vdr-page-detail-layout>\r\n", styles: [".shipping-address{list-style-type:none;line-height:1.3em}.order-cards h6{margin-top:6px;color:var(--color-text-200)}vdr-order-payment-card+vdr-order-payment-card{margin-top:calc(var(--space-unit) * 2)}\n"] }]
2416
2570
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.DataService }, { type: i1.NotificationService }, { type: i1.ModalService }, { type: OrderTransitionService }, { type: i2.FormBuilder }]; } });
2417
2571
 
2572
+ class OrderModificationSummaryComponent {
2573
+ get adjustedLines() {
2574
+ return (this.modifyOrderInput.adjustOrderLines || [])
2575
+ .map(l => {
2576
+ const line = this.orderSnapshot.lines.find(line => line.id === l.orderLineId);
2577
+ if (line) {
2578
+ const delta = l.quantity - line.quantity;
2579
+ const sign = delta === 0 ? '' : delta > 0 ? '+' : '-';
2580
+ return delta
2581
+ ? `${sign}${Math.abs(delta)} ${line.productVariant.name}`
2582
+ : line.productVariant.name;
2583
+ }
2584
+ })
2585
+ .filter(notNullOrUndefined);
2586
+ }
2587
+ getModifiedFields(formGroup) {
2588
+ if (!formGroup.dirty) {
2589
+ return '';
2590
+ }
2591
+ return Object.entries(formGroup.controls)
2592
+ .map(([key, control]) => {
2593
+ if (control.dirty) {
2594
+ return key;
2595
+ }
2596
+ })
2597
+ .filter(notNullOrUndefined)
2598
+ .join(', ');
2599
+ }
2600
+ getUpdatedShippingMethodLines() {
2601
+ return Object.entries(this.updatedShippingMethods || {})
2602
+ .map(([lineId, shippingMethod]) => {
2603
+ const previousMethod = this.orderSnapshot.shippingLines.find(l => l.id === lineId);
2604
+ if (!previousMethod) {
2605
+ return;
2606
+ }
2607
+ const previousName = previousMethod.shippingMethod.name || previousMethod.shippingMethod.code;
2608
+ const newName = shippingMethod.name || shippingMethod.code;
2609
+ return `${previousName} -> ${newName}`;
2610
+ })
2611
+ .filter(notNullOrUndefined);
2612
+ }
2613
+ get couponCodeChanges() {
2614
+ const originalCodes = this.orderSnapshot.couponCodes || [];
2615
+ const newCodes = this.couponCodesControl.value || [];
2616
+ const addedCodes = newCodes.filter(c => !originalCodes.includes(c)).map(c => `+ ${c}`);
2617
+ const removedCodes = originalCodes.filter(c => !newCodes.includes(c)).map(c => `- ${c}`);
2618
+ return [...addedCodes, ...removedCodes];
2619
+ }
2620
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderModificationSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2621
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderModificationSummaryComponent, selector: "vdr-order-modification-summary", inputs: { orderSnapshot: "orderSnapshot", modifyOrderInput: "modifyOrderInput", addedLines: "addedLines", shippingAddressForm: "shippingAddressForm", billingAddressForm: "billingAddressForm", updatedShippingMethods: "updatedShippingMethods", couponCodesControl: "couponCodesControl" }, ngImport: i0, template: "<vdr-labeled-data\r\n *ngIf=\"modifyOrderInput.adjustOrderLines?.length\"\r\n [label]=\"\r\n 'order.modification-adjusting-lines'\r\n | translate : { count: modifyOrderInput.adjustOrderLines?.length }\r\n \"\r\n>\r\n <div *ngFor=\"let line of adjustedLines\" class=\"mb-1\">\r\n {{ line }}\r\n </div>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data\r\n *ngIf=\"modifyOrderInput.addItems?.length\"\r\n [label]=\"\r\n 'order.modification-adding-items'\r\n | translate : { count: modifyOrderInput.addItems?.length }\r\n \"\r\n>\r\n <div *ngFor=\"let item of addedLines\">\r\n {{ item.productVariant.name }} x {{ item.quantity }}\r\n </div>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data\r\n *ngIf=\"modifyOrderInput.surcharges?.length\"\r\n [label]=\"\r\n 'order.modification-adding-surcharges'\r\n | translate : { count: modifyOrderInput.surcharges?.length }\r\n \"\r\n>\r\n <div *ngFor=\"let surcharge of modifyOrderInput.surcharges\" class=\"mb-1\">\r\n {{ surcharge.description }}: {{ surcharge.price | localeCurrency : orderSnapshot.currencyCode }}\r\n </div>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data\r\n *ngIf=\"getModifiedFields(shippingAddressForm) as updatedShippingFields\"\r\n [label]=\"'order.modification-updating-shipping-address' | translate\"\r\n>\r\n {{ updatedShippingFields }}\r\n</vdr-labeled-data>\r\n<vdr-labeled-data\r\n *ngIf=\"getModifiedFields(billingAddressForm) as updatedBillingFields\"\r\n [label]=\"'order.modification-updating-billing-address' | translate\"\r\n>\r\n {{ updatedBillingFields }}\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"couponCodeChanges.length\" [label]=\"'order.set-coupon-codes' | translate\">\r\n <div *ngFor=\"let change of couponCodeChanges\" class=\"mb-1\">{{ change }}</div>\r\n</vdr-labeled-data>\r\n<ng-container *ngIf=\"getUpdatedShippingMethodLines() as updatedShippingMethods\">\r\n <vdr-labeled-data *ngIf=\"updatedShippingMethods.length\" [label]=\"'order.shipping-method' | translate\">\r\n <div *ngFor=\"let change of updatedShippingMethods\" class=\"mb-1\">{{ change }}</div>\r\n </vdr-labeled-data>\r\n</ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2622
+ }
2623
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderModificationSummaryComponent, decorators: [{
2624
+ type: Component,
2625
+ args: [{ selector: 'vdr-order-modification-summary', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-labeled-data\r\n *ngIf=\"modifyOrderInput.adjustOrderLines?.length\"\r\n [label]=\"\r\n 'order.modification-adjusting-lines'\r\n | translate : { count: modifyOrderInput.adjustOrderLines?.length }\r\n \"\r\n>\r\n <div *ngFor=\"let line of adjustedLines\" class=\"mb-1\">\r\n {{ line }}\r\n </div>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data\r\n *ngIf=\"modifyOrderInput.addItems?.length\"\r\n [label]=\"\r\n 'order.modification-adding-items'\r\n | translate : { count: modifyOrderInput.addItems?.length }\r\n \"\r\n>\r\n <div *ngFor=\"let item of addedLines\">\r\n {{ item.productVariant.name }} x {{ item.quantity }}\r\n </div>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data\r\n *ngIf=\"modifyOrderInput.surcharges?.length\"\r\n [label]=\"\r\n 'order.modification-adding-surcharges'\r\n | translate : { count: modifyOrderInput.surcharges?.length }\r\n \"\r\n>\r\n <div *ngFor=\"let surcharge of modifyOrderInput.surcharges\" class=\"mb-1\">\r\n {{ surcharge.description }}: {{ surcharge.price | localeCurrency : orderSnapshot.currencyCode }}\r\n </div>\r\n</vdr-labeled-data>\r\n<vdr-labeled-data\r\n *ngIf=\"getModifiedFields(shippingAddressForm) as updatedShippingFields\"\r\n [label]=\"'order.modification-updating-shipping-address' | translate\"\r\n>\r\n {{ updatedShippingFields }}\r\n</vdr-labeled-data>\r\n<vdr-labeled-data\r\n *ngIf=\"getModifiedFields(billingAddressForm) as updatedBillingFields\"\r\n [label]=\"'order.modification-updating-billing-address' | translate\"\r\n>\r\n {{ updatedBillingFields }}\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"couponCodeChanges.length\" [label]=\"'order.set-coupon-codes' | translate\">\r\n <div *ngFor=\"let change of couponCodeChanges\" class=\"mb-1\">{{ change }}</div>\r\n</vdr-labeled-data>\r\n<ng-container *ngIf=\"getUpdatedShippingMethodLines() as updatedShippingMethods\">\r\n <vdr-labeled-data *ngIf=\"updatedShippingMethods.length\" [label]=\"'order.shipping-method' | translate\">\r\n <div *ngFor=\"let change of updatedShippingMethods\" class=\"mb-1\">{{ change }}</div>\r\n </vdr-labeled-data>\r\n</ng-container>" }]
2626
+ }], propDecorators: { orderSnapshot: [{
2627
+ type: Input
2628
+ }], modifyOrderInput: [{
2629
+ type: Input
2630
+ }], addedLines: [{
2631
+ type: Input
2632
+ }], shippingAddressForm: [{
2633
+ type: Input
2634
+ }], billingAddressForm: [{
2635
+ type: Input
2636
+ }], updatedShippingMethods: [{
2637
+ type: Input
2638
+ }], couponCodesControl: [{
2639
+ type: Input
2640
+ }] } });
2641
+
2418
2642
  var OrderEditResultType;
2419
2643
  (function (OrderEditResultType) {
2420
2644
  OrderEditResultType[OrderEditResultType["Refund"] = 0] = "Refund";
@@ -2424,10 +2648,37 @@ var OrderEditResultType;
2424
2648
  })(OrderEditResultType || (OrderEditResultType = {}));
2425
2649
  class OrderEditsPreviewDialogComponent {
2426
2650
  get priceDifference() {
2427
- return this.order.totalWithTax - this.originalTotalWithTax;
2651
+ return this.order.totalWithTax - this.orderSnapshot.totalWithTax;
2652
+ }
2653
+ get amountToRefundTotal() {
2654
+ return this.refundablePayments.reduce((total, payment) => total + payment.amountToRefundControl.value, 0);
2428
2655
  }
2429
2656
  ngOnInit() {
2430
2657
  this.refundNote = this.modifyOrderInput.note || '';
2658
+ this.refundablePayments = getRefundablePayments(this.order.payments || []);
2659
+ this.refundablePayments.forEach(rp => {
2660
+ rp.amountToRefundControl.addValidators(Validators.max(this.priceDifference * -1));
2661
+ });
2662
+ if (this.priceDifference < 0 && this.refundablePayments.length) {
2663
+ this.onPaymentSelected(this.refundablePayments[0], true);
2664
+ }
2665
+ }
2666
+ onPaymentSelected(payment, selected) {
2667
+ if (selected) {
2668
+ const outstandingRefundAmount = this.priceDifference * -1 -
2669
+ this.refundablePayments
2670
+ .filter(p => p.id !== payment.id)
2671
+ .reduce((total, p) => total + p.amountToRefundControl.value, 0);
2672
+ if (0 < outstandingRefundAmount) {
2673
+ payment.amountToRefundControl.setValue(Math.min(outstandingRefundAmount, payment.refundableAmount));
2674
+ }
2675
+ }
2676
+ else {
2677
+ payment.amountToRefundControl.setValue(0);
2678
+ }
2679
+ }
2680
+ refundsCoverDifference() {
2681
+ return this.priceDifference * -1 === this.amountToRefundTotal;
2431
2682
  }
2432
2683
  cancel() {
2433
2684
  this.resolveWith({
@@ -2444,8 +2695,15 @@ class OrderEditsPreviewDialogComponent {
2444
2695
  this.resolveWith({
2445
2696
  result: OrderEditResultType.Refund,
2446
2697
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2447
- refundPaymentId: this.selectedPayment.id,
2448
- refundNote: this.refundNote,
2698
+ refunds: this.refundablePayments
2699
+ .filter(rp => rp.selected && 0 < rp.amountToRefundControl.value)
2700
+ .map(payment => {
2701
+ return {
2702
+ reason: this.refundNote || this.modifyOrderInput.note,
2703
+ paymentId: payment.id,
2704
+ amount: payment.amountToRefundControl.value,
2705
+ };
2706
+ }),
2449
2707
  });
2450
2708
  }
2451
2709
  else {
@@ -2455,23 +2713,23 @@ class OrderEditsPreviewDialogComponent {
2455
2713
  }
2456
2714
  }
2457
2715
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderEditsPreviewDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2458
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderEditsPreviewDialogComponent, selector: "vdr-order-edits-preview-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.confirm-modifications' | translate }}</ng-template>\r\n<vdr-order-table [order]=\"order\" [orderLineCustomFields]=\"orderLineCustomFields\"></vdr-order-table>\r\n\r\n<h4 class=\"h4\">\r\n {{ 'order.modify-order-price-difference' | translate }}:\r\n <strong>{{ priceDifference | localeCurrency: order.currencyCode }}</strong>\r\n</h4>\r\n<div *ngIf=\"priceDifference < 0\">\r\n<clr-select-container>\r\n <label>{{ 'order.payment-to-refund' | translate }}</label>\r\n <select clrSelect name=\"options\" [(ngModel)]=\"selectedPayment\">\r\n <option\r\n *ngFor=\"let payment of order.payments\"\r\n [ngValue]=\"payment\"\r\n >\r\n #{{ payment.id }} {{ payment.method }}:\r\n {{ payment.amount | localeCurrency: order.currencyCode }}\r\n </option>\r\n </select>\r\n</clr-select-container>\r\n <label class=\"clr-control-label\">{{ 'order.refund-cancellation-reason' | translate }}</label>\r\n <textarea [(ngModel)]=\"refundNote\" name=\"refundNote\" clrTextarea required></textarea>\r\n</div>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"submit()\" [disabled]=\"priceDifference < 0 && !selectedPayment\" class=\"btn btn-primary\">\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i1$1.ClrSelect, selector: "[clrSelect]" }, { kind: "component", type: i1$1.ClrSelectContainer, selector: "clr-select-container" }, { kind: "directive", type: i1$1.ClrTextarea, selector: "[clrTextarea]" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2716
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderEditsPreviewDialogComponent, selector: "vdr-order-edits-preview-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.confirm-modifications' | translate }}</ng-template>\r\n<vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n class=\"order-edits-preview-table\"\r\n></vdr-order-table>\r\n<div class=\"payments-wrapper mb-2\">\r\n <div class=\"flex-spacer\">\r\n <vdr-payment-for-refund-selector\r\n *ngIf=\"priceDifference < 0\"\r\n class=\"\"\r\n [refundablePayments]=\"refundablePayments\"\r\n (paymentSelected)=\"onPaymentSelected($event.payment, $event.selected)\"\r\n [order]=\"order\"\r\n ></vdr-payment-for-refund-selector>\r\n </div>\r\n <div class=\"flex-spacer\">\r\n <vdr-card [title]=\"'order.modify-order' | translate\">\r\n <vdr-order-modification-summary\r\n [orderSnapshot]=\"orderSnapshot\"\r\n [modifyOrderInput]=\"modifyOrderInput\"\r\n [addedLines]=\"addedLines\"\r\n [shippingAddressForm]=\"shippingAddressForm\"\r\n [billingAddressForm]=\"billingAddressForm\"\r\n [couponCodesControl]=\"couponCodesControl\"\r\n [updatedShippingMethods]=\"updatedShippingMethods\"\r\n ></vdr-order-modification-summary>\r\n <vdr-labeled-data [label]=\"'order.note' | translate\">\r\n {{ modifyOrderInput.note || '-' }}\r\n </vdr-labeled-data>\r\n <vdr-form-field\r\n [label]=\"'order.refund-cancellation-reason' | translate\"\r\n *ngIf=\"priceDifference < 0\"\r\n >\r\n <textarea [(ngModel)]=\"refundNote\" name=\"refundNote\" required></textarea>\r\n </vdr-form-field>\r\n </vdr-card>\r\n </div>\r\n</div>\r\n<ng-template vdrDialogButtons>\r\n <div>\r\n <div class=\"errors\">\r\n <clr-alert\r\n class=\"mb-1\"\r\n *ngIf=\"priceDifference < 0 && !refundsCoverDifference()\"\r\n [clrAlertType]=\"'danger'\"\r\n [clrAlertClosable]=\"false\"\r\n >\r\n <clr-alert-item>\r\n {{ 'order.refund-total-warning' | translate }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div class=\"modal-buttons\">\r\n <clr-alert class=\"\" [clrAlertType]=\"'primary'\" [clrAlertClosable]=\"false\">\r\n <clr-alert-item>\r\n {{ 'order.modify-order-price-difference' | translate }}\r\n {{ 0 < priceDifference ? '+' : ''\r\n }}{{ priceDifference | localeCurrency : order.currencyCode }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">\r\n {{ 'common.cancel' | translate }}\r\n </button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"submit()\"\r\n [disabled]=\"priceDifference < 0 ? !refundsCoverDifference() : false\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: ["::ng-deep .order-edits-preview-table .table-wrapper{max-width:initial!important}.payments-wrapper{display:flex;gap:calc(var(--space-unit) * 2)}.modal-buttons{display:flex;justify-content:flex-end;gap:.6rem;gap:var(--clr-modal-footer-gap, .6rem)}\n"], dependencies: [{ kind: "component", type: i3.ClrAlert, selector: "clr-alert", inputs: ["clrAlertSizeSmall", "clrAlertClosable", "clrAlertAppLevel", "clrCloseButtonAriaLabel", "clrAlertType", "clrAlertIcon", "clrAlertClosed"], outputs: ["clrAlertClosedChange"] }, { kind: "component", type: i3.ClrAlertItem, selector: "clr-alert-item" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"], outputs: ["readOnlyToggleChange"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "component", type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { kind: "component", type: PaymentForRefundSelectorComponent, selector: "vdr-payment-for-refund-selector", inputs: ["refundablePayments", "order"], outputs: ["paymentSelected"] }, { kind: "component", type: OrderModificationSummaryComponent, selector: "vdr-order-modification-summary", inputs: ["orderSnapshot", "modifyOrderInput", "addedLines", "shippingAddressForm", "billingAddressForm", "updatedShippingMethods", "couponCodesControl"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2459
2717
  }
2460
2718
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderEditsPreviewDialogComponent, decorators: [{
2461
2719
  type: Component,
2462
- args: [{ selector: 'vdr-order-edits-preview-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.confirm-modifications' | translate }}</ng-template>\r\n<vdr-order-table [order]=\"order\" [orderLineCustomFields]=\"orderLineCustomFields\"></vdr-order-table>\r\n\r\n<h4 class=\"h4\">\r\n {{ 'order.modify-order-price-difference' | translate }}:\r\n <strong>{{ priceDifference | localeCurrency: order.currencyCode }}</strong>\r\n</h4>\r\n<div *ngIf=\"priceDifference < 0\">\r\n<clr-select-container>\r\n <label>{{ 'order.payment-to-refund' | translate }}</label>\r\n <select clrSelect name=\"options\" [(ngModel)]=\"selectedPayment\">\r\n <option\r\n *ngFor=\"let payment of order.payments\"\r\n [ngValue]=\"payment\"\r\n >\r\n #{{ payment.id }} {{ payment.method }}:\r\n {{ payment.amount | localeCurrency: order.currencyCode }}\r\n </option>\r\n </select>\r\n</clr-select-container>\r\n <label class=\"clr-control-label\">{{ 'order.refund-cancellation-reason' | translate }}</label>\r\n <textarea [(ngModel)]=\"refundNote\" name=\"refundNote\" clrTextarea required></textarea>\r\n</div>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"submit()\" [disabled]=\"priceDifference < 0 && !selectedPayment\" class=\"btn btn-primary\">\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>\r\n" }]
2720
+ args: [{ selector: 'vdr-order-edits-preview-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.confirm-modifications' | translate }}</ng-template>\r\n<vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n class=\"order-edits-preview-table\"\r\n></vdr-order-table>\r\n<div class=\"payments-wrapper mb-2\">\r\n <div class=\"flex-spacer\">\r\n <vdr-payment-for-refund-selector\r\n *ngIf=\"priceDifference < 0\"\r\n class=\"\"\r\n [refundablePayments]=\"refundablePayments\"\r\n (paymentSelected)=\"onPaymentSelected($event.payment, $event.selected)\"\r\n [order]=\"order\"\r\n ></vdr-payment-for-refund-selector>\r\n </div>\r\n <div class=\"flex-spacer\">\r\n <vdr-card [title]=\"'order.modify-order' | translate\">\r\n <vdr-order-modification-summary\r\n [orderSnapshot]=\"orderSnapshot\"\r\n [modifyOrderInput]=\"modifyOrderInput\"\r\n [addedLines]=\"addedLines\"\r\n [shippingAddressForm]=\"shippingAddressForm\"\r\n [billingAddressForm]=\"billingAddressForm\"\r\n [couponCodesControl]=\"couponCodesControl\"\r\n [updatedShippingMethods]=\"updatedShippingMethods\"\r\n ></vdr-order-modification-summary>\r\n <vdr-labeled-data [label]=\"'order.note' | translate\">\r\n {{ modifyOrderInput.note || '-' }}\r\n </vdr-labeled-data>\r\n <vdr-form-field\r\n [label]=\"'order.refund-cancellation-reason' | translate\"\r\n *ngIf=\"priceDifference < 0\"\r\n >\r\n <textarea [(ngModel)]=\"refundNote\" name=\"refundNote\" required></textarea>\r\n </vdr-form-field>\r\n </vdr-card>\r\n </div>\r\n</div>\r\n<ng-template vdrDialogButtons>\r\n <div>\r\n <div class=\"errors\">\r\n <clr-alert\r\n class=\"mb-1\"\r\n *ngIf=\"priceDifference < 0 && !refundsCoverDifference()\"\r\n [clrAlertType]=\"'danger'\"\r\n [clrAlertClosable]=\"false\"\r\n >\r\n <clr-alert-item>\r\n {{ 'order.refund-total-warning' | translate }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div class=\"modal-buttons\">\r\n <clr-alert class=\"\" [clrAlertType]=\"'primary'\" [clrAlertClosable]=\"false\">\r\n <clr-alert-item>\r\n {{ 'order.modify-order-price-difference' | translate }}\r\n {{ 0 < priceDifference ? '+' : ''\r\n }}{{ priceDifference | localeCurrency : order.currencyCode }}\r\n </clr-alert-item>\r\n </clr-alert>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">\r\n {{ 'common.cancel' | translate }}\r\n </button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"submit()\"\r\n [disabled]=\"priceDifference < 0 ? !refundsCoverDifference() : false\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: ["::ng-deep .order-edits-preview-table .table-wrapper{max-width:initial!important}.payments-wrapper{display:flex;gap:calc(var(--space-unit) * 2)}.modal-buttons{display:flex;justify-content:flex-end;gap:.6rem;gap:var(--clr-modal-footer-gap, .6rem)}\n"] }]
2463
2721
  }] });
2464
2722
 
2465
- class OrderEditorComponent extends BaseDetailComponent {
2466
- constructor(router, route, serverConfigService, changeDetector, dataService, notificationService, modalService, orderTransitionService) {
2467
- super(route, router, serverConfigService, dataService);
2468
- this.changeDetector = changeDetector;
2723
+ class OrderEditorComponent extends TypedBaseDetailComponent {
2724
+ constructor(dataService, notificationService, modalService, orderTransitionService, changeDetectorRef) {
2725
+ super();
2469
2726
  this.dataService = dataService;
2470
2727
  this.notificationService = notificationService;
2471
2728
  this.modalService = modalService;
2472
2729
  this.orderTransitionService = orderTransitionService;
2730
+ this.changeDetectorRef = changeDetectorRef;
2473
2731
  this.detailForm = new UntypedFormGroup({});
2474
- this.couponCodesControl = new UntypedFormControl();
2732
+ this.couponCodesControl = new FormControl([]);
2475
2733
  this.modifyOrderInput = {
2476
2734
  dryRun: true,
2477
2735
  orderId: '',
@@ -2479,74 +2737,66 @@ class OrderEditorComponent extends BaseDetailComponent {
2479
2737
  adjustOrderLines: [],
2480
2738
  surcharges: [],
2481
2739
  note: '',
2740
+ refunds: [],
2482
2741
  updateShippingAddress: {},
2483
2742
  updateBillingAddress: {},
2484
2743
  };
2744
+ this.surchargeForm = new FormGroup({
2745
+ description: new FormControl('', Validators.minLength(1)),
2746
+ sku: new FormControl(''),
2747
+ price: new FormControl(0),
2748
+ priceIncludesTax: new FormControl(true),
2749
+ taxRate: new FormControl(0),
2750
+ taxDescription: new FormControl(''),
2751
+ });
2752
+ this.shippingAddressForm = new FormGroup({
2753
+ fullName: new FormControl(''),
2754
+ company: new FormControl(''),
2755
+ streetLine1: new FormControl(''),
2756
+ streetLine2: new FormControl(''),
2757
+ city: new FormControl(''),
2758
+ province: new FormControl(''),
2759
+ postalCode: new FormControl(''),
2760
+ countryCode: new FormControl(''),
2761
+ phoneNumber: new FormControl(''),
2762
+ });
2763
+ this.billingAddressForm = new FormGroup({
2764
+ fullName: new FormControl(''),
2765
+ company: new FormControl(''),
2766
+ streetLine1: new FormControl(''),
2767
+ streetLine2: new FormControl(''),
2768
+ city: new FormControl(''),
2769
+ province: new FormControl(''),
2770
+ postalCode: new FormControl(''),
2771
+ countryCode: new FormControl(''),
2772
+ phoneNumber: new FormControl(''),
2773
+ });
2485
2774
  this.note = '';
2486
2775
  this.recalculateShipping = true;
2776
+ this.editingShippingAddress = false;
2777
+ this.editingBillingAddress = false;
2778
+ this.updatedShippingMethods = {};
2487
2779
  this.addedVariants = new Map();
2488
2780
  }
2489
- get addedLines() {
2490
- const getSinglePriceValue = (price) => price.__typename === 'SinglePrice' ? price.value : 0;
2491
- return (this.modifyOrderInput.addItems || [])
2492
- .map(row => {
2493
- const variantInfo = this.addedVariants.get(row.productVariantId);
2494
- if (variantInfo) {
2495
- return {
2496
- ...variantInfo,
2497
- price: getSinglePriceValue(variantInfo.price),
2498
- priceWithTax: getSinglePriceValue(variantInfo.priceWithTax),
2499
- quantity: row.quantity,
2500
- };
2501
- }
2502
- })
2503
- .filter(notNullOrUndefined);
2504
- }
2505
2781
  ngOnInit() {
2506
2782
  this.init();
2507
2783
  this.addressCustomFields = this.getCustomFieldConfig('Address');
2508
2784
  this.modifyOrderInput.orderId = this.route.snapshot.paramMap.get('id');
2509
2785
  this.orderLineCustomFields = this.getCustomFieldConfig('OrderLine');
2510
- this.entity$.pipe(takeUntil(this.destroy$)).subscribe(order => {
2786
+ this.entity$.pipe(take(1)).subscribe(order => {
2787
+ this.orderSnapshot = this.createOrderSnapshot(order);
2511
2788
  if (order.couponCodes.length) {
2512
2789
  this.couponCodesControl.setValue(order.couponCodes);
2513
2790
  }
2514
- this.surchargeForm = new UntypedFormGroup({
2515
- description: new UntypedFormControl('', Validators.required),
2516
- sku: new UntypedFormControl(''),
2517
- price: new UntypedFormControl(0, Validators.required),
2518
- priceIncludesTax: new UntypedFormControl(true),
2519
- taxRate: new UntypedFormControl(0),
2520
- taxDescription: new UntypedFormControl(''),
2521
- });
2522
- if (!this.shippingAddressForm) {
2523
- this.shippingAddressForm = new UntypedFormGroup({
2524
- fullName: new UntypedFormControl(order.shippingAddress?.fullName),
2525
- company: new UntypedFormControl(order.shippingAddress?.company),
2526
- streetLine1: new UntypedFormControl(order.shippingAddress?.streetLine1),
2527
- streetLine2: new UntypedFormControl(order.shippingAddress?.streetLine2),
2528
- city: new UntypedFormControl(order.shippingAddress?.city),
2529
- province: new UntypedFormControl(order.shippingAddress?.province),
2530
- postalCode: new UntypedFormControl(order.shippingAddress?.postalCode),
2531
- countryCode: new UntypedFormControl(order.shippingAddress?.countryCode),
2532
- phoneNumber: new UntypedFormControl(order.shippingAddress?.phoneNumber),
2533
- });
2534
- this.addAddressCustomFieldsFormGroup(this.shippingAddressForm, order.shippingAddress);
2535
- }
2536
- if (!this.billingAddressForm) {
2537
- this.billingAddressForm = new UntypedFormGroup({
2538
- fullName: new UntypedFormControl(order.billingAddress?.fullName),
2539
- company: new UntypedFormControl(order.billingAddress?.company),
2540
- streetLine1: new UntypedFormControl(order.billingAddress?.streetLine1),
2541
- streetLine2: new UntypedFormControl(order.billingAddress?.streetLine2),
2542
- city: new UntypedFormControl(order.billingAddress?.city),
2543
- province: new UntypedFormControl(order.billingAddress?.province),
2544
- postalCode: new UntypedFormControl(order.billingAddress?.postalCode),
2545
- countryCode: new UntypedFormControl(order.billingAddress?.countryCode),
2546
- phoneNumber: new UntypedFormControl(order.billingAddress?.phoneNumber),
2547
- });
2548
- this.addAddressCustomFieldsFormGroup(this.billingAddressForm, order.billingAddress);
2791
+ this.surchargeForm.reset();
2792
+ for (const [name, control] of Object.entries(this.shippingAddressForm.controls)) {
2793
+ control.setValue(order.shippingAddress?.[name]);
2549
2794
  }
2795
+ this.addAddressCustomFieldsFormGroup(this.shippingAddressForm, order.shippingAddress);
2796
+ for (const [name, control] of Object.entries(this.billingAddressForm.controls)) {
2797
+ control.setValue(order.billingAddress?.[name]);
2798
+ }
2799
+ this.addAddressCustomFieldsFormGroup(this.billingAddressForm, order.billingAddress);
2550
2800
  this.orderLineCustomFieldsFormArray = new UntypedFormArray([]);
2551
2801
  for (const line of order.lines) {
2552
2802
  const formGroup = new UntypedFormGroup({});
@@ -2589,10 +2839,38 @@ class OrderEditorComponent extends BaseDetailComponent {
2589
2839
  .single$.subscribe(({ order }) => {
2590
2840
  this.previousState = order?.history.items[0].data.from;
2591
2841
  });
2842
+ this.uiLanguage$ = this.dataService.client
2843
+ .uiState()
2844
+ .stream$.pipe(map(({ uiState }) => uiState.language));
2592
2845
  }
2593
2846
  ngOnDestroy() {
2594
2847
  this.destroy();
2595
2848
  }
2849
+ get addedLines() {
2850
+ const getSinglePriceValue = (price) => price.__typename === 'SinglePrice' ? price.value : 0;
2851
+ return (this.modifyOrderInput.addItems || [])
2852
+ .map(row => {
2853
+ const variantInfo = this.addedVariants.get(row.productVariantId);
2854
+ if (variantInfo) {
2855
+ return {
2856
+ id: this.getIdForAddedItem(row),
2857
+ featuredAsset: variantInfo.productAsset,
2858
+ productVariant: {
2859
+ id: variantInfo.productVariantId,
2860
+ name: variantInfo.productVariantName,
2861
+ sku: variantInfo.sku,
2862
+ },
2863
+ unitPrice: getSinglePriceValue(variantInfo.price),
2864
+ unitPriceWithTax: getSinglePriceValue(variantInfo.priceWithTax),
2865
+ quantity: row.quantity,
2866
+ };
2867
+ }
2868
+ })
2869
+ .filter(notNullOrUndefined);
2870
+ }
2871
+ getIdForAddedItem(row) {
2872
+ return `added-${row.productVariantId}-${JSON.stringify(row.customFields || {})}`;
2873
+ }
2596
2874
  transitionToPriorState(order) {
2597
2875
  this.orderTransitionService
2598
2876
  .transitionToPreModifyingState(order.id, order.nextStates)
@@ -2600,40 +2878,62 @@ class OrderEditorComponent extends BaseDetailComponent {
2600
2878
  this.router.navigate(['..'], { relativeTo: this.route });
2601
2879
  });
2602
2880
  }
2603
- canPreviewChanges() {
2881
+ hasModifications() {
2604
2882
  const { addItems, adjustOrderLines, surcharges } = this.modifyOrderInput;
2605
2883
  return (!!addItems?.length ||
2606
2884
  !!surcharges?.length ||
2607
2885
  !!adjustOrderLines?.length ||
2608
2886
  (this.shippingAddressForm.dirty && this.shippingAddressForm.valid) ||
2609
2887
  (this.billingAddressForm.dirty && this.billingAddressForm.valid) ||
2610
- this.couponCodesControl.dirty);
2888
+ this.couponCodesControl.dirty ||
2889
+ Object.entries(this.updatedShippingMethods).length > 0);
2611
2890
  }
2612
2891
  isLineModified(line) {
2613
2892
  return !!this.modifyOrderInput.adjustOrderLines?.find(l => l.orderLineId === line.id && l.quantity !== line.quantity);
2614
2893
  }
2894
+ getInitialLineQuantity(lineId) {
2895
+ const adjustedLine = this.modifyOrderInput.adjustOrderLines?.find(l => l.orderLineId === lineId);
2896
+ if (adjustedLine) {
2897
+ return adjustedLine.quantity;
2898
+ }
2899
+ else {
2900
+ const line = this.orderSnapshot.lines.find(l => l.id === lineId);
2901
+ return line ? line.quantity : 0;
2902
+ }
2903
+ }
2615
2904
  updateLineQuantity(line, quantity) {
2616
2905
  const { adjustOrderLines } = this.modifyOrderInput;
2617
- let row = adjustOrderLines?.find(l => l.orderLineId === line.id);
2618
- if (row && +quantity === line.quantity) {
2619
- // Remove the modification if the quantity is the same as
2620
- // the original order
2621
- adjustOrderLines?.splice(adjustOrderLines?.indexOf(row), 1);
2906
+ if (this.isAddedLine(line)) {
2907
+ const row = this.modifyOrderInput.addItems?.find(l => l.productVariantId === line.productVariant.id);
2908
+ if (row) {
2909
+ row.quantity = +quantity;
2910
+ }
2622
2911
  }
2623
- if (!row) {
2624
- row = { orderLineId: line.id, quantity: +quantity };
2625
- adjustOrderLines?.push(row);
2912
+ else {
2913
+ let row = adjustOrderLines?.find(l => l.orderLineId === line.id);
2914
+ if (row && +quantity === line.quantity) {
2915
+ // Remove the modification if the quantity is the same as
2916
+ // the original order
2917
+ adjustOrderLines?.splice(adjustOrderLines?.indexOf(row), 1);
2918
+ }
2919
+ if (!row) {
2920
+ row = { orderLineId: line.id, quantity: +quantity };
2921
+ adjustOrderLines?.push(row);
2922
+ }
2923
+ row.quantity = +quantity;
2626
2924
  }
2627
- row.quantity = +quantity;
2925
+ }
2926
+ isAddedLine(line) {
2927
+ return line.id.startsWith('added-');
2628
2928
  }
2629
2929
  updateAddedItemQuantity(item, quantity) {
2630
- const row = this.modifyOrderInput.addItems?.find(l => l.productVariantId === item.productVariantId);
2930
+ const row = this.modifyOrderInput.addItems?.find(l => l.productVariantId === item.productVariant.id);
2631
2931
  if (row) {
2632
2932
  row.quantity = +quantity;
2633
2933
  }
2634
2934
  }
2635
2935
  trackByProductVariantId(index, item) {
2636
- return item.productVariantId;
2936
+ return item.productVariant.id;
2637
2937
  }
2638
2938
  getSelectedItemPrice(result) {
2639
2939
  switch (result?.priceWithTax.__typename) {
@@ -2677,15 +2977,59 @@ class OrderEditorComponent extends BaseDetailComponent {
2677
2977
  this.addItemSelectedVariant = undefined;
2678
2978
  this.addedVariants.set(result.productVariantId, result);
2679
2979
  }
2980
+ getShippingLineDetails(shippingLine) {
2981
+ const updatedMethod = this.updatedShippingMethods[shippingLine.id];
2982
+ if (updatedMethod) {
2983
+ return {
2984
+ name: updatedMethod.name || updatedMethod.code,
2985
+ price: updatedMethod.priceWithTax,
2986
+ };
2987
+ }
2988
+ else {
2989
+ return {
2990
+ name: shippingLine.shippingMethod.name || shippingLine.shippingMethod.code,
2991
+ price: shippingLine.discountedPriceWithTax,
2992
+ };
2993
+ }
2994
+ }
2995
+ setShippingMethod(shippingLineId) {
2996
+ const currentShippingMethod = this.updatedShippingMethods[shippingLineId] ??
2997
+ this.entity?.shippingLines.find(l => l.id === shippingLineId)?.shippingMethod;
2998
+ if (!currentShippingMethod) {
2999
+ return;
3000
+ }
3001
+ this.dataService.order
3002
+ .getDraftOrderEligibleShippingMethods(this.id)
3003
+ .mapSingle(({ eligibleShippingMethodsForDraftOrder }) => eligibleShippingMethodsForDraftOrder)
3004
+ .pipe(switchMap(methods => this.modalService
3005
+ .fromComponent(SelectShippingMethodDialogComponent, {
3006
+ locals: {
3007
+ eligibleShippingMethods: methods,
3008
+ currencyCode: this.entity?.currencyCode,
3009
+ currentSelectionId: currentShippingMethod.id,
3010
+ },
3011
+ })
3012
+ .pipe(map(result => {
3013
+ if (result) {
3014
+ return methods.find(method => method.id === result);
3015
+ }
3016
+ }))))
3017
+ .subscribe(result => {
3018
+ if (result) {
3019
+ this.updatedShippingMethods[shippingLineId] = result;
3020
+ this.changeDetectorRef.markForCheck();
3021
+ }
3022
+ });
3023
+ }
2680
3024
  isMatchingAddItemRow(row, result, customFields) {
2681
3025
  return (row.productVariantId === result.productVariantId &&
2682
3026
  JSON.stringify(row.customFields) === JSON.stringify(customFields));
2683
3027
  }
2684
- removeAddedItem(index) {
2685
- this.modifyOrderInput.addItems.splice(index, 1);
2686
- if (-1 < index) {
2687
- this.addItemCustomFieldsFormArray.removeAt(index);
2688
- }
3028
+ removeAddedItem(id) {
3029
+ this.modifyOrderInput.addItems = this.modifyOrderInput.addItems?.filter(l => {
3030
+ const itemId = this.getIdForAddedItem(l);
3031
+ return itemId !== id;
3032
+ });
2689
3033
  }
2690
3034
  getSurchargePrices(surcharge) {
2691
3035
  const priceWithTax = surcharge.priceIncludesTax
@@ -2728,7 +3072,11 @@ class OrderEditorComponent extends BaseDetailComponent {
2728
3072
  recalculateShipping: this.recalculateShipping,
2729
3073
  },
2730
3074
  };
2731
- const originalTotalWithTax = order.totalWithTax;
3075
+ if (Object.entries(this.updatedShippingMethods).length) {
3076
+ input.shippingMethodIds = order.shippingLines.map(l => this.updatedShippingMethods[l.id]
3077
+ ? this.updatedShippingMethods[l.id].id
3078
+ : l.shippingMethod.id);
3079
+ }
2732
3080
  this.dataService.order
2733
3081
  .modifyOrder(input)
2734
3082
  .pipe(switchMap(({ modifyOrder }) => {
@@ -2738,10 +3086,15 @@ class OrderEditorComponent extends BaseDetailComponent {
2738
3086
  size: 'xl',
2739
3087
  closable: false,
2740
3088
  locals: {
2741
- originalTotalWithTax,
2742
3089
  order: modifyOrder,
3090
+ orderSnapshot: this.orderSnapshot,
2743
3091
  orderLineCustomFields: this.orderLineCustomFields,
2744
3092
  modifyOrderInput: input,
3093
+ addedLines: this.addedLines,
3094
+ shippingAddressForm: this.shippingAddressForm,
3095
+ billingAddressForm: this.billingAddressForm,
3096
+ couponCodesControl: this.couponCodesControl,
3097
+ updatedShippingMethods: this.updatedShippingMethods,
2745
3098
  },
2746
3099
  });
2747
3100
  case 'InsufficientStockError':
@@ -2753,6 +3106,7 @@ class OrderEditorComponent extends BaseDetailComponent {
2753
3106
  case 'RefundPaymentIdMissingError':
2754
3107
  case 'CouponCodeLimitError':
2755
3108
  case 'CouponCodeExpiredError':
3109
+ case 'IneligibleShippingMethodError':
2756
3110
  case 'CouponCodeInvalidError': {
2757
3111
  this.notificationService.error(modifyOrder.message);
2758
3112
  return of(false);
@@ -2775,14 +3129,11 @@ class OrderEditorComponent extends BaseDetailComponent {
2775
3129
  dryRun: false,
2776
3130
  };
2777
3131
  if (result.result === OrderEditResultType.Refund) {
2778
- wetRunInput.refund = {
2779
- paymentId: result.refundPaymentId,
2780
- reason: result.refundNote,
2781
- };
3132
+ wetRunInput.refunds = result.refunds;
2782
3133
  }
2783
3134
  return this.dataService.order.modifyOrder(wetRunInput).pipe(switchMap(({ modifyOrder }) => {
2784
3135
  if (modifyOrder.__typename === 'Order') {
2785
- const priceDelta = modifyOrder.totalWithTax - originalTotalWithTax;
3136
+ const priceDelta = modifyOrder.totalWithTax - this.orderSnapshot.totalWithTax;
2786
3137
  const nextState = 0 < priceDelta ? 'ArrangingAdditionalPayment' : this.previousState;
2787
3138
  return this.dataService.order
2788
3139
  .transitionToState(order.id, nextState)
@@ -2812,16 +3163,25 @@ class OrderEditorComponent extends BaseDetailComponent {
2812
3163
  parentFormGroup.addControl('customFields', addressCustomFieldsFormGroup);
2813
3164
  }
2814
3165
  }
3166
+ createOrderSnapshot(order) {
3167
+ return {
3168
+ totalWithTax: order.totalWithTax,
3169
+ currencyCode: order.currencyCode,
3170
+ couponCodes: order.couponCodes,
3171
+ lines: [...order.lines].map(line => ({ ...line })),
3172
+ shippingLines: [...order.shippingLines].map(line => ({ ...line })),
3173
+ };
3174
+ }
2815
3175
  setFormValues(entity, languageCode) {
2816
3176
  /* not used */
2817
3177
  }
2818
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderEditorComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i1.ServerConfigService }, { token: i0.ChangeDetectorRef }, { token: i1.DataService }, { token: i1.NotificationService }, { token: i1.ModalService }, { token: OrderTransitionService }], target: i0.ɵɵFactoryTarget.Component }); }
2819
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderEditorComponent, selector: "vdr-order-editor", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left>\r\n <div class=\"flex clr-align-items-center\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </div>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <button class=\"btn btn-secondary\" (click)=\"transitionToPriorState(order)\">\r\n {{ 'order.cancel-modification' | translate }}\r\n </button>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-block>\r\n <div *ngIf=\"entity$ | async as order\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-lg-8\">\r\n <table class=\"order-table table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.unit-price' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th *ngIf=\"orderLineCustomFields.length\">\r\n {{ 'common.custom-fields' | translate }}\r\n </th>\r\n <th>{{ 'order.total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n *ngFor=\"let line of order.lines; let i = index\"\r\n class=\"order-line\"\r\n [class.is-cancelled]=\"line.quantity === 0\"\r\n [class.modified]=\"isLineModified(line)\"\r\n >\r\n <td class=\"align-middle thumb\">\r\n <img\r\n *ngIf=\"line.featuredAsset\"\r\n [src]=\"line.featuredAsset | assetPreview : 'tiny'\"\r\n />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle unit-price\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n <input\r\n type=\"number\"\r\n min=\"0\"\r\n [value]=\"line.quantity\"\r\n (input)=\"updateLineQuantity(line, $event.target.value)\"\r\n />\r\n <vdr-line-refunds\r\n [line]=\"line\"\r\n [payments]=\"order.payments\"\r\n ></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [allOrderFulfillments]=\"order.fulfillments\"\r\n [orderState]=\"order.state\"\r\n ></vdr-line-fulfillment>\r\n </td>\r\n <td\r\n *ngIf=\"orderLineCustomFields.length\"\r\n class=\"order-line-custom-field align-middle\"\r\n >\r\n <vdr-tabbed-custom-fields\r\n entityName=\"OrderLine\"\r\n [customFields]=\"orderLineCustomFields\"\r\n [customFieldsFormGroup]=\"orderLineCustomFieldsFormArray.get([i])\"\r\n [compact]=\"true\"\r\n ></vdr-tabbed-custom-fields>\r\n </td>\r\n <td class=\"align-middle total\">\r\n {{ line.linePriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.linePrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr\r\n *ngFor=\"\r\n let addedLine of addedLines;\r\n trackBy: trackByProductVariantId;\r\n let i = index\r\n \"\r\n class=\"modified\"\r\n >\r\n <td class=\"align-middle thumb\">\r\n <img\r\n *ngIf=\"addedLine.productAsset\"\r\n [src]=\"addedLine.productAsset | assetPreview : 'tiny'\"\r\n />\r\n </td>\r\n <td class=\"align-middle name\">{{ addedLine.productVariantName }}</td>\r\n <td class=\"align-middle sku\">{{ addedLine.sku }}</td>\r\n <td class=\"align-middle unit-price\">\r\n {{ addedLine.priceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ addedLine.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n <input\r\n type=\"number\"\r\n min=\"0\"\r\n [value]=\"addedLine.quantity\"\r\n (input)=\"updateAddedItemQuantity(addedLine, $event.target.value)\"\r\n />\r\n <button class=\"icon-button\" (click)=\"removeAddedItem(i)\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </td>\r\n <td\r\n *ngIf=\"orderLineCustomFields.length\"\r\n class=\"order-line-custom-field align-middle\"\r\n >\r\n <ng-container *ngFor=\"let customField of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"addItemCustomFieldsFormArray.get([i])\"\r\n entityName=\"OrderLine\"\r\n [compact]=\"true\"\r\n ></vdr-custom-field-control>\r\n </ng-container>\r\n </td>\r\n <td class=\"align-middle total\">\r\n {{\r\n (addedLine.priceWithTax * addedLine.quantity) / 100\r\n | currency : order.currencyCode\r\n }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{\r\n (addedLine.price * addedLine.quantity) / 100\r\n | currency : order.currencyCode\r\n }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr class=\"surcharge\" *ngFor=\"let surcharge of order.surcharges\">\r\n <td class=\"align-middle name left\" colspan=\"2\">{{ surcharge.description }}</td>\r\n <td class=\"align-middle sku\">{{ surcharge.sku }}</td>\r\n <td class=\"align-middle\"></td>\r\n <td></td>\r\n <td *ngIf=\"orderLineCustomFields.length\"></td>\r\n <td class=\"align-middle total\">\r\n {{ surcharge.priceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ surcharge.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr\r\n class=\"surcharge modified\"\r\n *ngFor=\"let surcharge of modifyOrderInput.surcharges; let i = index\"\r\n >\r\n <td class=\"align-middle name left\" colspan=\"2\">\r\n {{ surcharge.description }}\r\n <button class=\"icon-button\" (click)=\"removeSurcharge(i)\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </td>\r\n <td class=\"align-middle sku\">{{ surcharge.sku }}</td>\r\n <td class=\"align-middle\"></td>\r\n <td></td>\r\n <td *ngIf=\"orderLineCustomFields.length\"></td>\r\n <td class=\"align-middle total\">\r\n <ng-container *ngIf=\"getSurchargePrices(surcharge) as surchargePrice\">\r\n {{ surchargePrice.priceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ surchargePrice.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n <tr class=\"shipping\">\r\n <td class=\"left clr-align-middle\">{{ 'order.shipping' | translate }}</td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.shippingLines[0]?.shippingMethod?.name }}\r\n </td>\r\n <td colspan=\"3\"></td>\r\n <td *ngIf=\"orderLineCustomFields.length\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.shippingWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.shipping | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <h4 class=\"mb-2\">{{ 'order.modifications' | translate }}</h4>\r\n <clr-accordion>\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{ 'order.add-item-to-order' | translate }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <vdr-product-variant-selector\r\n class=\"mb-4\"\r\n (productSelected)=\"addItemSelectedVariant = $event\"\r\n >\r\n </vdr-product-variant-selector>\r\n <div *ngIf=\"addItemSelectedVariant\" class=\"flex mb-4\">\r\n <img\r\n *ngIf=\"addItemSelectedVariant.productAsset as asset\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n class=\"mr-4 add-item-thumb\"\r\n />\r\n <div>\r\n <strong class=\"mr-4\">{{\r\n addItemSelectedVariant.productVariantName\r\n }}</strong>\r\n <small>{{ addItemSelectedVariant.sku }}</small>\r\n <div>\r\n {{\r\n getSelectedItemPrice(addItemSelectedVariant)\r\n | localeCurrency : order.currencyCode\r\n }}\r\n </div>\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let customField of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [readonly]=\"!addItemSelectedVariant\"\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"addItemCustomFieldsForm\"\r\n entityName=\"OrderLine\"\r\n [compact]=\"true\"\r\n ></vdr-custom-field-control>\r\n </ng-container>\r\n <button\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"!addItemSelectedVariant || addItemCustomFieldsForm.invalid\"\r\n (click)=\"addItemToOrder(addItemSelectedVariant)\"\r\n >\r\n {{ 'order.add-item-to-order' | translate }}\r\n </button>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{ 'order.set-coupon-codes' | translate }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <vdr-coupon-code-selector\r\n [control]=\"couponCodesControl\"\r\n ></vdr-coupon-code-selector>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{ 'order.add-surcharge' | translate }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <form [formGroup]=\"surchargeForm\" (submit)=\"addSurcharge(surchargeForm.value)\">\r\n <vdr-form-field [label]=\"'common.description' | translate\" for=\"description\"\r\n ><input id=\"description\" type=\"text\" formControlName=\"description\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'order.product-sku' | translate\" for=\"sku\"\r\n ><input id=\"sku\" type=\"text\" formControlName=\"sku\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'common.price' | translate\" for=\"price\">\r\n <vdr-currency-input\r\n [currencyCode]=\"order.currencyCode\"\r\n id=\"price\"\r\n formControlName=\"price\"\r\n ></vdr-currency-input>\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"\r\n 'catalog.price-includes-tax-at'\r\n | translate : { rate: surchargeForm.get('taxRate')?.value }\r\n \"\r\n for=\"priceIncludesTax\"\r\n ><input\r\n id=\"priceIncludesTax\"\r\n type=\"checkbox\"\r\n clrCheckbox\r\n formControlName=\"priceIncludesTax\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'order.tax-rate' | translate\" for=\"taxRate\">\r\n <vdr-affixed-input suffix=\"%\"\r\n ><input\r\n id=\"taxRate\"\r\n type=\"number\"\r\n min=\"0\"\r\n max=\"100\"\r\n formControlName=\"taxRate\"\r\n /></vdr-affixed-input>\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"'order.tax-description' | translate\"\r\n for=\"taxDescription\"\r\n ><input id=\"taxDescription\" type=\"text\" formControlName=\"taxDescription\"\r\n /></vdr-form-field>\r\n <button\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"\r\n surchargeForm.invalid ||\r\n surchargeForm.pristine ||\r\n surchargeForm.get('price')?.value === 0\r\n \"\r\n >\r\n {{ 'order.add-surcharge' | translate }}\r\n </button>\r\n </form>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{\r\n 'order.edit-shipping-address' | translate\r\n }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <vdr-address-form\r\n [formGroup]=\"shippingAddressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n [customFields]=\"addressCustomFields\"\r\n ></vdr-address-form>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{\r\n 'order.edit-billing-address' | translate\r\n }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <vdr-address-form\r\n [formGroup]=\"billingAddressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n [customFields]=\"addressCustomFields\"\r\n ></vdr-address-form>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n </clr-accordion>\r\n </div>\r\n <div class=\"clr-col-lg-4 order-cards\">\r\n <div class=\"card\">\r\n <div class=\"card-header\">\r\n {{ 'order.modification-summary' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <ul>\r\n <li *ngIf=\"modifyOrderInput.addItems?.length\">\r\n {{\r\n 'order.modification-adding-items'\r\n | translate : { count: modifyOrderInput.addItems?.length }\r\n }}\r\n </li>\r\n <li *ngIf=\"modifyOrderInput.adjustOrderLines?.length\">\r\n {{\r\n 'order.modification-adjusting-lines'\r\n | translate : { count: modifyOrderInput.adjustOrderLines?.length }\r\n }}\r\n </li>\r\n <li *ngIf=\"modifyOrderInput.surcharges?.length\">\r\n {{\r\n 'order.modification-adding-surcharges'\r\n | translate : { count: modifyOrderInput.surcharges?.length }\r\n }}\r\n </li>\r\n <li *ngIf=\"shippingAddressForm.dirty\">\r\n {{ 'order.modification-updating-shipping-address' | translate }}\r\n </li>\r\n <li *ngIf=\"billingAddressForm.dirty\">\r\n {{ 'order.modification-updating-billing-address' | translate }}\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"card-block\">\r\n <label class=\"clr-control-label\">{{ 'order.note' | translate }}</label>\r\n <textarea [(ngModel)]=\"note\" name=\"note\" clrTextarea required></textarea>\r\n <clr-checkbox-wrapper class=\"\">\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"recalculateShipping\" />\r\n <label>{{ 'order.modification-recalculate-shipping' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n </div>\r\n <div class=\"card-footer\">\r\n <button\r\n class=\"btn btn-primary\"\r\n [disabled]=\"!canPreviewChanges()\"\r\n (click)=\"previewAndModify(order)\"\r\n >\r\n {{ 'order.preview-changes' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <vdr-page-block> </vdr-page-block\r\n></vdr-page-block>\r\n", styles: [".order-table .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}.order-table .sub-total td{border-top:1px dashed var(--color-component-border-200)}.order-table .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}.order-table td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}.order-table img{border-radius:var(--border-radius-img)}.order-table .order-line-custom-fields{display:flex;flex-wrap:wrap}.order-table .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}.order-table .draft-qty{max-width:48px}.order-table .order-line-custom-field{background-color:var(--color-component-bg-100)}.order-table .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}.order-table .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}.order-table .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}.order-table .thumb img{width:50px;height:50px}.order-table .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}.order-table .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}.order-table tr.modified td{background-color:var(--color-warning-100)}.order-table .order-line-custom-field{text-align:start}.add-item-thumb{max-width:50px}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrDatagridItemsTrackBy, selector: "[ngForTrackBy]", inputs: ["ngForTrackBy"] }, { kind: "directive", type: i1$1.ÇlrDatagridDetailRegisterer, selector: "[clrIfExpanded]" }, { kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i1$1.ClrIfExpanded, selector: "[clrIfExpanded]", inputs: ["clrIfExpanded"], outputs: ["clrIfExpandedChange"] }, { kind: "directive", type: i1$1.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i1$1.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i1$1.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "directive", type: i1$1.ClrTextarea, selector: "[clrTextarea]" }, { kind: "component", type: i1$1.ClrAccordion, selector: "clr-accordion", inputs: ["clrAccordionMultiPanel"] }, { kind: "component", type: i1$1.ClrAccordionPanel, selector: "clr-accordion-panel", inputs: ["clrAccordionPanelDisabled", "clrAccordionPanelOpen"], outputs: ["clrAccordionPanelOpenChange"] }, { kind: "component", type: i1$1.ClrAccordionTitle, selector: "clr-accordion-title, clr-step-title" }, { kind: "component", type: i1$1.ClrAccordionContent, selector: "clr-accordion-content, clr-step-content" }, { kind: "directive", type: i1$1.ÇlrAccordionOompaLoompa, selector: "clr-accordion-panel" }, { kind: "directive", type: i1$1.ÇlrAccordionWillyWonka, selector: "clr-accordion" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.AffixedInputComponent, selector: "vdr-affixed-input", inputs: ["prefix", "suffix"] }, { kind: "component", type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }, { kind: "component", type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "component", type: i1.ProductVariantSelectorComponent, selector: "vdr-product-variant-selector", outputs: ["productSelected"] }, { kind: "component", type: i1.AddressFormComponent, selector: "vdr-address-form", inputs: ["customFields", "formGroup", "availableCountries"] }, { kind: "component", type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "component", type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: ["line", "allOrderFulfillments", "orderState"] }, { kind: "component", type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { kind: "component", type: CouponCodeSelectorComponent, selector: "vdr-coupon-code-selector", inputs: ["couponCodes", "control"], outputs: ["addCouponCode", "removeCouponCode"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3178
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderEditorComponent, deps: [{ token: i1.DataService }, { token: i1.NotificationService }, { token: i1.ModalService }, { token: OrderTransitionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
3179
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderEditorComponent, selector: "vdr-order-editor", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left>\r\n <div class=\"flex clr-align-items-center\"></div>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <button class=\"btn btn-secondary\" (click)=\"transitionToPriorState(order)\">\r\n {{ 'order.cancel-modification' | translate }}\r\n </button>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-detail-layout *ngIf=\"entity as order\">\r\n <vdr-page-detail-sidebar>\r\n <vdr-card [title]=\"'order.modification-summary' | translate\">\r\n <vdr-order-modification-summary\r\n [orderSnapshot]=\"orderSnapshot\"\r\n [modifyOrderInput]=\"modifyOrderInput\"\r\n [addedLines]=\"addedLines\"\r\n [shippingAddressForm]=\"shippingAddressForm\"\r\n [billingAddressForm]=\"billingAddressForm\"\r\n [couponCodesControl]=\"couponCodesControl\"\r\n [updatedShippingMethods]=\"updatedShippingMethods\"\r\n ></vdr-order-modification-summary>\r\n\r\n <div *ngIf=\"!hasModifications()\" class=\"no-modifications\">\r\n {{ 'order.no-modifications-made' | translate }}\r\n </div>\r\n\r\n <div class=\"summary-controls\">\r\n <vdr-form-field [label]=\"'order.note' | translate\">\r\n <textarea\r\n [(ngModel)]=\"note\"\r\n name=\"note\"\r\n required\r\n [disabled]=\"!hasModifications()\"\r\n ></textarea>\r\n </vdr-form-field>\r\n <label class=\"flex items-center\">\r\n <input\r\n type=\"checkbox\"\r\n [(ngModel)]=\"recalculateShipping\"\r\n [disabled]=\"!hasModifications()\"\r\n />\r\n <div class=\"ml-1\">{{ 'order.modification-recalculate-shipping' | translate }}</div>\r\n </label>\r\n <button\r\n class=\"btn btn-primary mt-2\"\r\n [disabled]=\"!hasModifications()\"\r\n (click)=\"previewAndModify(order)\"\r\n >\r\n {{ 'order.preview-changes' | translate }}\r\n </button>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.set-coupon-codes' | translate\">\r\n <vdr-coupon-code-selector [control]=\"couponCodesControl\"></vdr-coupon-code-selector>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.shipping-address' | translate\">\r\n <ng-template vdrCardControls>\r\n <button\r\n class=\"button-small\"\r\n [title]=\"'order.edit-shipping-address' | translate\"\r\n (click)=\"editingShippingAddress = !editingShippingAddress\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n <vdr-formatted-address\r\n *ngIf=\"!editingShippingAddress\"\r\n [address]=\"shippingAddressForm.value\"\r\n ></vdr-formatted-address>\r\n <vdr-address-form\r\n *ngIf=\"editingShippingAddress\"\r\n [formGroup]=\"shippingAddressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n [customFields]=\"addressCustomFields\"\r\n ></vdr-address-form>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.billing-address' | translate\">\r\n <ng-template vdrCardControls>\r\n <button\r\n class=\"button-small\"\r\n [title]=\"'order.edit-billing-address' | translate\"\r\n (click)=\"editingBillingAddress = !editingBillingAddress\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n <vdr-formatted-address\r\n *ngIf=\"!editingBillingAddress\"\r\n [address]=\"billingAddressForm.value\"\r\n ></vdr-formatted-address>\r\n <vdr-address-form\r\n *ngIf=\"editingBillingAddress\"\r\n [formGroup]=\"billingAddressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n [customFields]=\"addressCustomFields\"\r\n ></vdr-address-form>\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n\r\n <vdr-page-block>\r\n <vdr-card [paddingX]=\"false\">\r\n <vdr-data-table-2 id=\"modify-order\" class=\"order-table\" [items]=\"order.lines.concat(addedLines)\">\r\n <!-- Here we define all the available columns -->\r\n <vdr-dt2-column id=\"id\" [heading]=\"'common.id' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"created-at\"\r\n [heading]=\"'common.created-at' | translate\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"updated-at\"\r\n [heading]=\"'common.updated-at' | translate\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"line.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"product-name\"\r\n [heading]=\"'order.product-name' | translate\"\r\n [optional]=\"false\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.name }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"product-sku\" [heading]=\"'order.product-sku' | translate\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"unit-price\" [heading]=\"'order.unit-price' | translate\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"text-center\">\r\n <div>{{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}</div>\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"quantity\" [heading]=\"'order.quantity' | translate\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <input\r\n type=\"number\"\r\n class=\"draft-qty mr-1\"\r\n min=\"0\"\r\n [value]=\"getInitialLineQuantity(line.id)\"\r\n (input)=\"updateLineQuantity(line, $event.target.value)\"\r\n />\r\n <button\r\n class=\"button-small\"\r\n *ngIf=\"isAddedLine(line)\"\r\n (click)=\"removeAddedItem(line.id)\"\r\n >\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [allOrderFulfillments]=\"order.fulfillments\"\r\n [orderState]=\"order.state\"\r\n ></vdr-line-fulfillment>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n *ngFor=\"let customField of orderLineCustomFields\"\r\n [id]=\"customField.name\"\r\n [heading]=\"customField | customFieldLabel : (uiLanguage$ | async)\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\" let-index=\"index\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [entityName]=\"'OrderLine'\"\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"orderLineCustomFieldsFormArray.at(index)\"\r\n />\r\n </ng-template>\r\n </vdr-dt2-column>\r\n </vdr-data-table-2>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.add-item-to-order' | translate\">\r\n <vdr-product-variant-selector class=\"mb-4\" (productSelected)=\"addItemSelectedVariant = $event\">\r\n </vdr-product-variant-selector>\r\n <div class=\"flex\">\r\n <div>\r\n <div *ngIf=\"addItemSelectedVariant\" class=\"flex mb-4\">\r\n <img\r\n *ngIf=\"addItemSelectedVariant.productAsset as asset\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n class=\"mr-4 add-item-thumb\"\r\n />\r\n <div>\r\n <strong class=\"mr-4\">{{ addItemSelectedVariant.productVariantName }}</strong>\r\n <small>{{ addItemSelectedVariant.sku }}</small>\r\n <div>\r\n {{\r\n getSelectedItemPrice(addItemSelectedVariant)\r\n | localeCurrency : order.currencyCode\r\n }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"form-grid\" *ngIf=\"addItemSelectedVariant\">\r\n <ng-container *ngFor=\"let customField of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [readonly]=\"!addItemSelectedVariant\"\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"addItemCustomFieldsForm\"\r\n entityName=\"OrderLine\"\r\n [compact]=\"true\"\r\n ></vdr-custom-field-control>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <div>\r\n <button\r\n *ngIf=\"addItemSelectedVariant\"\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"!addItemSelectedVariant || addItemCustomFieldsForm.invalid\"\r\n (click)=\"addItemToOrder(addItemSelectedVariant)\"\r\n >\r\n {{ 'order.add-item-to-order' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.shipping' | translate\">\r\n <div *ngFor=\"let shippingLine of order.shippingLines\" class=\"flex items-center\">\r\n <ng-container *ngIf=\"getShippingLineDetails(shippingLine) as details\">\r\n <div>{{ details.name }}:</div>\r\n <div class=\"mx-1\">\r\n {{ details.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n <button class=\"button-small\" (click)=\"setShippingMethod(shippingLine.id)\">\r\n {{ 'order.set-shipping-method' | translate }}\r\n </button>\r\n </ng-container>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.add-surcharge' | translate\">\r\n <form [formGroup]=\"surchargeForm\" (submit)=\"addSurcharge(surchargeForm.value)\">\r\n <div class=\"form-grid\">\r\n <vdr-form-field [label]=\"'common.description' | translate\" for=\"description\"\r\n ><input id=\"description\" type=\"text\" formControlName=\"description\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'order.product-sku' | translate\" for=\"sku\"\r\n ><input id=\"sku\" type=\"text\" formControlName=\"sku\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'common.price' | translate\" for=\"price\">\r\n <vdr-currency-input\r\n [currencyCode]=\"order.currencyCode\"\r\n id=\"price\"\r\n formControlName=\"price\"\r\n ></vdr-currency-input>\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"\r\n 'catalog.price-includes-tax-at'\r\n | translate : { rate: surchargeForm.get('taxRate')?.value ?? 0 }\r\n \"\r\n for=\"priceIncludesTax\"\r\n ><input\r\n id=\"priceIncludesTax\"\r\n type=\"checkbox\"\r\n clrCheckbox\r\n formControlName=\"priceIncludesTax\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'order.tax-rate' | translate\" for=\"taxRate\">\r\n <vdr-affixed-input suffix=\"%\"\r\n ><input id=\"taxRate\" type=\"number\" min=\"0\" max=\"100\" formControlName=\"taxRate\"\r\n /></vdr-affixed-input>\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'order.tax-description' | translate\" for=\"taxDescription\"\r\n ><input id=\"taxDescription\" type=\"text\" formControlName=\"taxDescription\"\r\n /></vdr-form-field>\r\n </div>\r\n <button\r\n class=\"btn btn-secondary mt-2\"\r\n [disabled]=\"\r\n surchargeForm.invalid ||\r\n surchargeForm.pristine ||\r\n surchargeForm.get('price')?.value === 0 ||\r\n !surchargeForm.get('description')?.value\r\n \"\r\n >\r\n {{ 'order.add-surcharge' | translate }}\r\n </button>\r\n </form>\r\n </vdr-card>\r\n </vdr-page-block>\r\n</vdr-page-detail-layout>\r\n", styles: [".order-table .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}.order-table .sub-total td{border-top:1px dashed var(--color-component-border-200)}.order-table .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}.order-table td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}.order-table img{border-radius:var(--border-radius-img)}.order-table .order-line-custom-fields{display:flex;flex-wrap:wrap}.order-table .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}.order-table .draft-qty{max-width:48px}.order-table .order-line-custom-field{background-color:var(--color-component-bg-100)}.order-table .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}.order-table .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}.order-table .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}.order-table .thumb img{width:50px;height:50px}.order-table .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}.order-table .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}.order-table tr.modified td{background-color:var(--color-warning-100)}.order-table .order-line-custom-field{text-align:start}.add-item-thumb{max-width:50px}.no-modifications{color:var(--color-grey-400)}.summary-controls{border-top:1px solid var(--color-weight-200);margin-top:calc(var(--space-unit) * 2);padding-top:calc(var(--space-unit) * 1)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i3.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.AffixedInputComponent, selector: "vdr-affixed-input", inputs: ["prefix", "suffix"] }, { kind: "component", type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }, { kind: "component", type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"], outputs: ["readOnlyToggleChange"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select, vdr-currency-input" }, { kind: "component", type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { kind: "component", type: i1.ProductVariantSelectorComponent, selector: "vdr-product-variant-selector", outputs: ["productSelected"] }, { kind: "component", type: i1.AddressFormComponent, selector: "vdr-address-form", inputs: ["customFields", "formGroup", "availableCountries"] }, { kind: "component", type: i1.DataTable2Component, selector: "vdr-data-table-2", inputs: ["id", "items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "filters", "activeIndex"], outputs: ["pageChange", "itemsPerPageChange"] }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "component", type: i1.PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: i1.PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "directive", type: i1.CardControlsDirective, selector: "[vdrCardControls]" }, { kind: "component", type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: ["line", "allOrderFulfillments", "orderState"] }, { kind: "component", type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { kind: "component", type: CouponCodeSelectorComponent, selector: "vdr-coupon-code-selector", inputs: ["couponCodes", "control"], outputs: ["addCouponCode", "removeCouponCode"] }, { kind: "component", type: OrderModificationSummaryComponent, selector: "vdr-order-modification-summary", inputs: ["orderSnapshot", "modifyOrderInput", "addedLines", "shippingAddressForm", "billingAddressForm", "updatedShippingMethods", "couponCodesControl"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.CustomFieldLabelPipe, name: "customFieldLabel" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2820
3180
  }
2821
3181
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderEditorComponent, decorators: [{
2822
3182
  type: Component,
2823
- args: [{ selector: 'vdr-order-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left>\r\n <div class=\"flex clr-align-items-center\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </div>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <button class=\"btn btn-secondary\" (click)=\"transitionToPriorState(order)\">\r\n {{ 'order.cancel-modification' | translate }}\r\n </button>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-block>\r\n <div *ngIf=\"entity$ | async as order\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-lg-8\">\r\n <table class=\"order-table table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.unit-price' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th *ngIf=\"orderLineCustomFields.length\">\r\n {{ 'common.custom-fields' | translate }}\r\n </th>\r\n <th>{{ 'order.total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n *ngFor=\"let line of order.lines; let i = index\"\r\n class=\"order-line\"\r\n [class.is-cancelled]=\"line.quantity === 0\"\r\n [class.modified]=\"isLineModified(line)\"\r\n >\r\n <td class=\"align-middle thumb\">\r\n <img\r\n *ngIf=\"line.featuredAsset\"\r\n [src]=\"line.featuredAsset | assetPreview : 'tiny'\"\r\n />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle unit-price\">\r\n {{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n <input\r\n type=\"number\"\r\n min=\"0\"\r\n [value]=\"line.quantity\"\r\n (input)=\"updateLineQuantity(line, $event.target.value)\"\r\n />\r\n <vdr-line-refunds\r\n [line]=\"line\"\r\n [payments]=\"order.payments\"\r\n ></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [allOrderFulfillments]=\"order.fulfillments\"\r\n [orderState]=\"order.state\"\r\n ></vdr-line-fulfillment>\r\n </td>\r\n <td\r\n *ngIf=\"orderLineCustomFields.length\"\r\n class=\"order-line-custom-field align-middle\"\r\n >\r\n <vdr-tabbed-custom-fields\r\n entityName=\"OrderLine\"\r\n [customFields]=\"orderLineCustomFields\"\r\n [customFieldsFormGroup]=\"orderLineCustomFieldsFormArray.get([i])\"\r\n [compact]=\"true\"\r\n ></vdr-tabbed-custom-fields>\r\n </td>\r\n <td class=\"align-middle total\">\r\n {{ line.linePriceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.linePrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr\r\n *ngFor=\"\r\n let addedLine of addedLines;\r\n trackBy: trackByProductVariantId;\r\n let i = index\r\n \"\r\n class=\"modified\"\r\n >\r\n <td class=\"align-middle thumb\">\r\n <img\r\n *ngIf=\"addedLine.productAsset\"\r\n [src]=\"addedLine.productAsset | assetPreview : 'tiny'\"\r\n />\r\n </td>\r\n <td class=\"align-middle name\">{{ addedLine.productVariantName }}</td>\r\n <td class=\"align-middle sku\">{{ addedLine.sku }}</td>\r\n <td class=\"align-middle unit-price\">\r\n {{ addedLine.priceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ addedLine.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n <input\r\n type=\"number\"\r\n min=\"0\"\r\n [value]=\"addedLine.quantity\"\r\n (input)=\"updateAddedItemQuantity(addedLine, $event.target.value)\"\r\n />\r\n <button class=\"icon-button\" (click)=\"removeAddedItem(i)\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </td>\r\n <td\r\n *ngIf=\"orderLineCustomFields.length\"\r\n class=\"order-line-custom-field align-middle\"\r\n >\r\n <ng-container *ngFor=\"let customField of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"addItemCustomFieldsFormArray.get([i])\"\r\n entityName=\"OrderLine\"\r\n [compact]=\"true\"\r\n ></vdr-custom-field-control>\r\n </ng-container>\r\n </td>\r\n <td class=\"align-middle total\">\r\n {{\r\n (addedLine.priceWithTax * addedLine.quantity) / 100\r\n | currency : order.currencyCode\r\n }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{\r\n (addedLine.price * addedLine.quantity) / 100\r\n | currency : order.currencyCode\r\n }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr class=\"surcharge\" *ngFor=\"let surcharge of order.surcharges\">\r\n <td class=\"align-middle name left\" colspan=\"2\">{{ surcharge.description }}</td>\r\n <td class=\"align-middle sku\">{{ surcharge.sku }}</td>\r\n <td class=\"align-middle\"></td>\r\n <td></td>\r\n <td *ngIf=\"orderLineCustomFields.length\"></td>\r\n <td class=\"align-middle total\">\r\n {{ surcharge.priceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ surcharge.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr\r\n class=\"surcharge modified\"\r\n *ngFor=\"let surcharge of modifyOrderInput.surcharges; let i = index\"\r\n >\r\n <td class=\"align-middle name left\" colspan=\"2\">\r\n {{ surcharge.description }}\r\n <button class=\"icon-button\" (click)=\"removeSurcharge(i)\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </td>\r\n <td class=\"align-middle sku\">{{ surcharge.sku }}</td>\r\n <td class=\"align-middle\"></td>\r\n <td></td>\r\n <td *ngIf=\"orderLineCustomFields.length\"></td>\r\n <td class=\"align-middle total\">\r\n <ng-container *ngIf=\"getSurchargePrices(surcharge) as surchargePrice\">\r\n {{ surchargePrice.priceWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ surchargePrice.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n <tr class=\"shipping\">\r\n <td class=\"left clr-align-middle\">{{ 'order.shipping' | translate }}</td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.shippingLines[0]?.shippingMethod?.name }}\r\n </td>\r\n <td colspan=\"3\"></td>\r\n <td *ngIf=\"orderLineCustomFields.length\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.shippingWithTax | localeCurrency : order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.shipping | localeCurrency : order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <h4 class=\"mb-2\">{{ 'order.modifications' | translate }}</h4>\r\n <clr-accordion>\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{ 'order.add-item-to-order' | translate }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <vdr-product-variant-selector\r\n class=\"mb-4\"\r\n (productSelected)=\"addItemSelectedVariant = $event\"\r\n >\r\n </vdr-product-variant-selector>\r\n <div *ngIf=\"addItemSelectedVariant\" class=\"flex mb-4\">\r\n <img\r\n *ngIf=\"addItemSelectedVariant.productAsset as asset\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n class=\"mr-4 add-item-thumb\"\r\n />\r\n <div>\r\n <strong class=\"mr-4\">{{\r\n addItemSelectedVariant.productVariantName\r\n }}</strong>\r\n <small>{{ addItemSelectedVariant.sku }}</small>\r\n <div>\r\n {{\r\n getSelectedItemPrice(addItemSelectedVariant)\r\n | localeCurrency : order.currencyCode\r\n }}\r\n </div>\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let customField of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [readonly]=\"!addItemSelectedVariant\"\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"addItemCustomFieldsForm\"\r\n entityName=\"OrderLine\"\r\n [compact]=\"true\"\r\n ></vdr-custom-field-control>\r\n </ng-container>\r\n <button\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"!addItemSelectedVariant || addItemCustomFieldsForm.invalid\"\r\n (click)=\"addItemToOrder(addItemSelectedVariant)\"\r\n >\r\n {{ 'order.add-item-to-order' | translate }}\r\n </button>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{ 'order.set-coupon-codes' | translate }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <vdr-coupon-code-selector\r\n [control]=\"couponCodesControl\"\r\n ></vdr-coupon-code-selector>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{ 'order.add-surcharge' | translate }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <form [formGroup]=\"surchargeForm\" (submit)=\"addSurcharge(surchargeForm.value)\">\r\n <vdr-form-field [label]=\"'common.description' | translate\" for=\"description\"\r\n ><input id=\"description\" type=\"text\" formControlName=\"description\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'order.product-sku' | translate\" for=\"sku\"\r\n ><input id=\"sku\" type=\"text\" formControlName=\"sku\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'common.price' | translate\" for=\"price\">\r\n <vdr-currency-input\r\n [currencyCode]=\"order.currencyCode\"\r\n id=\"price\"\r\n formControlName=\"price\"\r\n ></vdr-currency-input>\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"\r\n 'catalog.price-includes-tax-at'\r\n | translate : { rate: surchargeForm.get('taxRate')?.value }\r\n \"\r\n for=\"priceIncludesTax\"\r\n ><input\r\n id=\"priceIncludesTax\"\r\n type=\"checkbox\"\r\n clrCheckbox\r\n formControlName=\"priceIncludesTax\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'order.tax-rate' | translate\" for=\"taxRate\">\r\n <vdr-affixed-input suffix=\"%\"\r\n ><input\r\n id=\"taxRate\"\r\n type=\"number\"\r\n min=\"0\"\r\n max=\"100\"\r\n formControlName=\"taxRate\"\r\n /></vdr-affixed-input>\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"'order.tax-description' | translate\"\r\n for=\"taxDescription\"\r\n ><input id=\"taxDescription\" type=\"text\" formControlName=\"taxDescription\"\r\n /></vdr-form-field>\r\n <button\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"\r\n surchargeForm.invalid ||\r\n surchargeForm.pristine ||\r\n surchargeForm.get('price')?.value === 0\r\n \"\r\n >\r\n {{ 'order.add-surcharge' | translate }}\r\n </button>\r\n </form>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{\r\n 'order.edit-shipping-address' | translate\r\n }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <vdr-address-form\r\n [formGroup]=\"shippingAddressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n [customFields]=\"addressCustomFields\"\r\n ></vdr-address-form>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n <clr-accordion-panel>\r\n <clr-accordion-title>{{\r\n 'order.edit-billing-address' | translate\r\n }}</clr-accordion-title>\r\n <clr-accordion-content *clrIfExpanded>\r\n <vdr-address-form\r\n [formGroup]=\"billingAddressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n [customFields]=\"addressCustomFields\"\r\n ></vdr-address-form>\r\n </clr-accordion-content>\r\n </clr-accordion-panel>\r\n </clr-accordion>\r\n </div>\r\n <div class=\"clr-col-lg-4 order-cards\">\r\n <div class=\"card\">\r\n <div class=\"card-header\">\r\n {{ 'order.modification-summary' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <ul>\r\n <li *ngIf=\"modifyOrderInput.addItems?.length\">\r\n {{\r\n 'order.modification-adding-items'\r\n | translate : { count: modifyOrderInput.addItems?.length }\r\n }}\r\n </li>\r\n <li *ngIf=\"modifyOrderInput.adjustOrderLines?.length\">\r\n {{\r\n 'order.modification-adjusting-lines'\r\n | translate : { count: modifyOrderInput.adjustOrderLines?.length }\r\n }}\r\n </li>\r\n <li *ngIf=\"modifyOrderInput.surcharges?.length\">\r\n {{\r\n 'order.modification-adding-surcharges'\r\n | translate : { count: modifyOrderInput.surcharges?.length }\r\n }}\r\n </li>\r\n <li *ngIf=\"shippingAddressForm.dirty\">\r\n {{ 'order.modification-updating-shipping-address' | translate }}\r\n </li>\r\n <li *ngIf=\"billingAddressForm.dirty\">\r\n {{ 'order.modification-updating-billing-address' | translate }}\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"card-block\">\r\n <label class=\"clr-control-label\">{{ 'order.note' | translate }}</label>\r\n <textarea [(ngModel)]=\"note\" name=\"note\" clrTextarea required></textarea>\r\n <clr-checkbox-wrapper class=\"\">\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"recalculateShipping\" />\r\n <label>{{ 'order.modification-recalculate-shipping' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n </div>\r\n <div class=\"card-footer\">\r\n <button\r\n class=\"btn btn-primary\"\r\n [disabled]=\"!canPreviewChanges()\"\r\n (click)=\"previewAndModify(order)\"\r\n >\r\n {{ 'order.preview-changes' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <vdr-page-block> </vdr-page-block\r\n></vdr-page-block>\r\n", styles: [".order-table .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}.order-table .sub-total td{border-top:1px dashed var(--color-component-border-200)}.order-table .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}.order-table td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}.order-table img{border-radius:var(--border-radius-img)}.order-table .order-line-custom-fields{display:flex;flex-wrap:wrap}.order-table .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}.order-table .draft-qty{max-width:48px}.order-table .order-line-custom-field{background-color:var(--color-component-bg-100)}.order-table .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}.order-table .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}.order-table .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}.order-table .thumb img{width:50px;height:50px}.order-table .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}.order-table .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}.order-table tr.modified td{background-color:var(--color-warning-100)}.order-table .order-line-custom-field{text-align:start}.add-item-thumb{max-width:50px}\n"] }]
2824
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i1.ServerConfigService }, { type: i0.ChangeDetectorRef }, { type: i1.DataService }, { type: i1.NotificationService }, { type: i1.ModalService }, { type: OrderTransitionService }]; } });
3183
+ args: [{ selector: 'vdr-order-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-block>\r\n <vdr-action-bar *ngIf=\"entity$ | async as order\">\r\n <vdr-ab-left>\r\n <div class=\"flex clr-align-items-center\"></div>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <button class=\"btn btn-secondary\" (click)=\"transitionToPriorState(order)\">\r\n {{ 'order.cancel-modification' | translate }}\r\n </button>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n\r\n<vdr-page-detail-layout *ngIf=\"entity as order\">\r\n <vdr-page-detail-sidebar>\r\n <vdr-card [title]=\"'order.modification-summary' | translate\">\r\n <vdr-order-modification-summary\r\n [orderSnapshot]=\"orderSnapshot\"\r\n [modifyOrderInput]=\"modifyOrderInput\"\r\n [addedLines]=\"addedLines\"\r\n [shippingAddressForm]=\"shippingAddressForm\"\r\n [billingAddressForm]=\"billingAddressForm\"\r\n [couponCodesControl]=\"couponCodesControl\"\r\n [updatedShippingMethods]=\"updatedShippingMethods\"\r\n ></vdr-order-modification-summary>\r\n\r\n <div *ngIf=\"!hasModifications()\" class=\"no-modifications\">\r\n {{ 'order.no-modifications-made' | translate }}\r\n </div>\r\n\r\n <div class=\"summary-controls\">\r\n <vdr-form-field [label]=\"'order.note' | translate\">\r\n <textarea\r\n [(ngModel)]=\"note\"\r\n name=\"note\"\r\n required\r\n [disabled]=\"!hasModifications()\"\r\n ></textarea>\r\n </vdr-form-field>\r\n <label class=\"flex items-center\">\r\n <input\r\n type=\"checkbox\"\r\n [(ngModel)]=\"recalculateShipping\"\r\n [disabled]=\"!hasModifications()\"\r\n />\r\n <div class=\"ml-1\">{{ 'order.modification-recalculate-shipping' | translate }}</div>\r\n </label>\r\n <button\r\n class=\"btn btn-primary mt-2\"\r\n [disabled]=\"!hasModifications()\"\r\n (click)=\"previewAndModify(order)\"\r\n >\r\n {{ 'order.preview-changes' | translate }}\r\n </button>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.set-coupon-codes' | translate\">\r\n <vdr-coupon-code-selector [control]=\"couponCodesControl\"></vdr-coupon-code-selector>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.shipping-address' | translate\">\r\n <ng-template vdrCardControls>\r\n <button\r\n class=\"button-small\"\r\n [title]=\"'order.edit-shipping-address' | translate\"\r\n (click)=\"editingShippingAddress = !editingShippingAddress\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n <vdr-formatted-address\r\n *ngIf=\"!editingShippingAddress\"\r\n [address]=\"shippingAddressForm.value\"\r\n ></vdr-formatted-address>\r\n <vdr-address-form\r\n *ngIf=\"editingShippingAddress\"\r\n [formGroup]=\"shippingAddressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n [customFields]=\"addressCustomFields\"\r\n ></vdr-address-form>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.billing-address' | translate\">\r\n <ng-template vdrCardControls>\r\n <button\r\n class=\"button-small\"\r\n [title]=\"'order.edit-billing-address' | translate\"\r\n (click)=\"editingBillingAddress = !editingBillingAddress\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n <vdr-formatted-address\r\n *ngIf=\"!editingBillingAddress\"\r\n [address]=\"billingAddressForm.value\"\r\n ></vdr-formatted-address>\r\n <vdr-address-form\r\n *ngIf=\"editingBillingAddress\"\r\n [formGroup]=\"billingAddressForm\"\r\n [availableCountries]=\"availableCountries$ | async\"\r\n [customFields]=\"addressCustomFields\"\r\n ></vdr-address-form>\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n\r\n <vdr-page-block>\r\n <vdr-card [paddingX]=\"false\">\r\n <vdr-data-table-2 id=\"modify-order\" class=\"order-table\" [items]=\"order.lines.concat(addedLines)\">\r\n <!-- Here we define all the available columns -->\r\n <vdr-dt2-column id=\"id\" [heading]=\"'common.id' | translate\" [hiddenByDefault]=\"true\">\r\n <ng-template let-line=\"item\">\r\n {{ line.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"created-at\"\r\n [heading]=\"'common.created-at' | translate\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"updated-at\"\r\n [heading]=\"'common.updated-at' | translate\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"line.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n id=\"product-name\"\r\n [heading]=\"'order.product-name' | translate\"\r\n [optional]=\"false\"\r\n >\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.name }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"product-sku\" [heading]=\"'order.product-sku' | translate\">\r\n <ng-template let-line=\"item\">\r\n {{ line.productVariant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"unit-price\" [heading]=\"'order.unit-price' | translate\">\r\n <ng-template let-line=\"item\">\r\n <div class=\"text-center\">\r\n <div>{{ line.unitPriceWithTax | localeCurrency : order.currencyCode }}</div>\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency : order.currencyCode }}\r\n </div>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column id=\"quantity\" [heading]=\"'order.quantity' | translate\" [optional]=\"false\">\r\n <ng-template let-line=\"item\">\r\n <input\r\n type=\"number\"\r\n class=\"draft-qty mr-1\"\r\n min=\"0\"\r\n [value]=\"getInitialLineQuantity(line.id)\"\r\n (input)=\"updateLineQuantity(line, $event.target.value)\"\r\n />\r\n <button\r\n class=\"button-small\"\r\n *ngIf=\"isAddedLine(line)\"\r\n (click)=\"removeAddedItem(line.id)\"\r\n >\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [allOrderFulfillments]=\"order.fulfillments\"\r\n [orderState]=\"order.state\"\r\n ></vdr-line-fulfillment>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n *ngFor=\"let customField of orderLineCustomFields\"\r\n [id]=\"customField.name\"\r\n [heading]=\"customField | customFieldLabel : (uiLanguage$ | async)\"\r\n [hiddenByDefault]=\"true\"\r\n >\r\n <ng-template let-line=\"item\" let-index=\"index\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [entityName]=\"'OrderLine'\"\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"orderLineCustomFieldsFormArray.at(index)\"\r\n />\r\n </ng-template>\r\n </vdr-dt2-column>\r\n </vdr-data-table-2>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.add-item-to-order' | translate\">\r\n <vdr-product-variant-selector class=\"mb-4\" (productSelected)=\"addItemSelectedVariant = $event\">\r\n </vdr-product-variant-selector>\r\n <div class=\"flex\">\r\n <div>\r\n <div *ngIf=\"addItemSelectedVariant\" class=\"flex mb-4\">\r\n <img\r\n *ngIf=\"addItemSelectedVariant.productAsset as asset\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n class=\"mr-4 add-item-thumb\"\r\n />\r\n <div>\r\n <strong class=\"mr-4\">{{ addItemSelectedVariant.productVariantName }}</strong>\r\n <small>{{ addItemSelectedVariant.sku }}</small>\r\n <div>\r\n {{\r\n getSelectedItemPrice(addItemSelectedVariant)\r\n | localeCurrency : order.currencyCode\r\n }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"form-grid\" *ngIf=\"addItemSelectedVariant\">\r\n <ng-container *ngFor=\"let customField of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [readonly]=\"!addItemSelectedVariant\"\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"addItemCustomFieldsForm\"\r\n entityName=\"OrderLine\"\r\n [compact]=\"true\"\r\n ></vdr-custom-field-control>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <div>\r\n <button\r\n *ngIf=\"addItemSelectedVariant\"\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"!addItemSelectedVariant || addItemCustomFieldsForm.invalid\"\r\n (click)=\"addItemToOrder(addItemSelectedVariant)\"\r\n >\r\n {{ 'order.add-item-to-order' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.shipping' | translate\">\r\n <div *ngFor=\"let shippingLine of order.shippingLines\" class=\"flex items-center\">\r\n <ng-container *ngIf=\"getShippingLineDetails(shippingLine) as details\">\r\n <div>{{ details.name }}:</div>\r\n <div class=\"mx-1\">\r\n {{ details.price | localeCurrency : order.currencyCode }}\r\n </div>\r\n <button class=\"button-small\" (click)=\"setShippingMethod(shippingLine.id)\">\r\n {{ 'order.set-shipping-method' | translate }}\r\n </button>\r\n </ng-container>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'order.add-surcharge' | translate\">\r\n <form [formGroup]=\"surchargeForm\" (submit)=\"addSurcharge(surchargeForm.value)\">\r\n <div class=\"form-grid\">\r\n <vdr-form-field [label]=\"'common.description' | translate\" for=\"description\"\r\n ><input id=\"description\" type=\"text\" formControlName=\"description\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'order.product-sku' | translate\" for=\"sku\"\r\n ><input id=\"sku\" type=\"text\" formControlName=\"sku\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'common.price' | translate\" for=\"price\">\r\n <vdr-currency-input\r\n [currencyCode]=\"order.currencyCode\"\r\n id=\"price\"\r\n formControlName=\"price\"\r\n ></vdr-currency-input>\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"\r\n 'catalog.price-includes-tax-at'\r\n | translate : { rate: surchargeForm.get('taxRate')?.value ?? 0 }\r\n \"\r\n for=\"priceIncludesTax\"\r\n ><input\r\n id=\"priceIncludesTax\"\r\n type=\"checkbox\"\r\n clrCheckbox\r\n formControlName=\"priceIncludesTax\"\r\n /></vdr-form-field>\r\n <vdr-form-field [label]=\"'order.tax-rate' | translate\" for=\"taxRate\">\r\n <vdr-affixed-input suffix=\"%\"\r\n ><input id=\"taxRate\" type=\"number\" min=\"0\" max=\"100\" formControlName=\"taxRate\"\r\n /></vdr-affixed-input>\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'order.tax-description' | translate\" for=\"taxDescription\"\r\n ><input id=\"taxDescription\" type=\"text\" formControlName=\"taxDescription\"\r\n /></vdr-form-field>\r\n </div>\r\n <button\r\n class=\"btn btn-secondary mt-2\"\r\n [disabled]=\"\r\n surchargeForm.invalid ||\r\n surchargeForm.pristine ||\r\n surchargeForm.get('price')?.value === 0 ||\r\n !surchargeForm.get('description')?.value\r\n \"\r\n >\r\n {{ 'order.add-surcharge' | translate }}\r\n </button>\r\n </form>\r\n </vdr-card>\r\n </vdr-page-block>\r\n</vdr-page-detail-layout>\r\n", styles: [".order-table .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}.order-table .sub-total td{border-top:1px dashed var(--color-component-border-200)}.order-table .total td{font-weight:700;border-top:1px dashed var(--color-component-border-200)}.order-table td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}.order-table img{border-radius:var(--border-radius-img)}.order-table .order-line-custom-fields{display:flex;flex-wrap:wrap}.order-table .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-inline-end:18px}.order-table .draft-qty{max-width:48px}.order-table .order-line-custom-field{background-color:var(--color-component-bg-100)}.order-table .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}.order-table .net-price{font-size:11px;color:var(--color-text-300);line-height:14px}.order-table .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}.order-table .thumb img{width:50px;height:50px}.order-table .shipping-method-name{font-size:var(--font-size-xs);margin-inline-end:2px}.order-table .order-placed-quantity{text-decoration:line-through;color:var(--color-text-300);margin-inline-end:2px}.order-table tr.modified td{background-color:var(--color-warning-100)}.order-table .order-line-custom-field{text-align:start}.add-item-thumb{max-width:50px}.no-modifications{color:var(--color-grey-400)}.summary-controls{border-top:1px solid var(--color-weight-200);margin-top:calc(var(--space-unit) * 2);padding-top:calc(var(--space-unit) * 1)}\n"] }]
3184
+ }], ctorParameters: function () { return [{ type: i1.DataService }, { type: i1.NotificationService }, { type: i1.ModalService }, { type: OrderTransitionService }, { type: i0.ChangeDetectorRef }]; } });
2825
3185
 
2826
3186
  class OrderListComponent extends TypedBaseListComponent {
2827
3187
  constructor(serverConfigService, channelService) {
@@ -2960,13 +3320,26 @@ class OrderListComponent extends TypedBaseListComponent {
2960
3320
  }
2961
3321
  }
2962
3322
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderListComponent, deps: [{ token: i1.ServerConfigService }, { token: i1.ChannelService }], target: i0.ɵɵFactoryTarget.Component }); }
2963
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderListComponent, selector: "vdr-order-list", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-list\"></vdr-action-bar-items>\r\n <ng-container *ngIf=\"canCreateDraftOrder\">\r\n <a class=\"btn\" *vdrIfPermissions=\"['CreateOrder']\" [routerLink]=\"['./draft/create']\">\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-draft-order' | translate }}\r\n </a>\r\n </ng-container>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n id=\"order-list\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"order-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n ></vdr-bulk-action-menu>\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'order.search-by-order-filters' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.created-at' | translate\" id=\"created-at\" [hiddenByDefault]=\"true\">\r\n <ng-template let-order=\"item\">\r\n {{ order.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.code' | translate\" id=\"code\" [optional]=\"false\">\r\n <ng-template let-order=\"item\">\r\n <a class=\"button-ghost\" [routerLink]=\"order.state === 'Draft' ? ['./draft', order.id] : ['./', order.id]\"\r\n ><span>{{ order.code }}</span>\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.customer' | translate\" id=\"customer\" [sort]=\"sorts.get('customerLastName')\">\r\n <ng-template let-order=\"item\">\r\n <vdr-customer-label\r\n [customer]=\"order.customer\"\r\n (click)=\"$event.stopPropagation()\"\r\n ></vdr-customer-label>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.order-type' | translate\" id=\"order-type\" [hiddenByDefault]=\"true\">\r\n <ng-template let-order=\"item\">\r\n <vdr-chip *ngIf=\"order.type === OrderType.Regular\">{{ 'order.order-type-regular' | translate }}</vdr-chip>\r\n <vdr-chip *ngIf=\"order.type === OrderType.Aggregate\">{{ 'order.order-type-aggregate' | translate }}</vdr-chip>\r\n <vdr-chip *ngIf=\"order.type === OrderType.Seller\">{{ 'order.order-type-seller' | translate }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.state' | translate\" id=\"state\" [sort]=\"sorts.get('state')\">\r\n <ng-template let-order=\"item\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.total' | translate\" id=\"total\" [sort]=\"sorts.get('totalWithTax')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.totalWithTax | localeCurrency : order.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.updated-at' | translate\" id=\"updated-at\">\r\n <ng-template let-order=\"item\">\r\n {{ order.updatedAt | timeAgo }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.placed-at' | translate\" id=\"placed-at\" [sort]=\"sorts.get('orderPlacedAt')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.orderPlacedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.shipping' | translate\" id=\"shipping\">\r\n <ng-template let-order=\"item\">\r\n {{ getShippingNames(order) }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of customFields\"\r\n [customField]=\"customField\"\r\n [sorts]=\"sorts\"\r\n />\r\n</vdr-data-table-2>\r\n", styles: [".search-form{display:flex;flex-direction:column;align-items:baseline;width:100%;max-width:100vw;margin-bottom:6px}.filter-presets{max-width:90vw;overflow-x:auto}.search-input{margin-top:6px;min-width:300px}.custom-filters{overflow:hidden;max-height:0;padding-bottom:6px}.custom-filters.expanded{max-height:initial}.custom-filters>form{display:flex;flex-direction:column;align-items:center}.custom-filters>form>div{width:100%}ng-select{flex:1;min-width:200px;height:36px}ng-select ::ng-deep .ng-select-container{height:36px}\n"], dependencies: [{ kind: "directive", type: i1$1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "directive", type: i1.IfPermissionsDirective, selector: "[vdrIfPermissions]", inputs: ["vdrIfPermissions", "vdrIfPermissionsElse"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.BulkActionMenuComponent, selector: "vdr-bulk-action-menu", inputs: ["locationId", "selectionManager", "hostComponent"] }, { kind: "component", type: i1.DataTable2Component, selector: "vdr-data-table-2", inputs: ["id", "items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "filters", "activeIndex"], outputs: ["pageChange", "itemsPerPageChange"] }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.DataTable2SearchComponent, selector: "vdr-dt2-search", inputs: ["searchTermControl", "searchTermPlaceholder"] }, { kind: "component", type: i1.DataTableCustomFieldColumnComponent, selector: "vdr-dt2-custom-field-column", inputs: ["customField", "sorts"], exportAs: ["row"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.TimeAgoPipe, name: "timeAgo" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3323
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: OrderListComponent, selector: "vdr-order-list", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-list\"></vdr-action-bar-items>\r\n <ng-container *ngIf=\"canCreateDraftOrder\">\r\n <a class=\"btn\" *vdrIfPermissions=\"['CreateOrder']\" [routerLink]=\"['./draft/create']\">\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-draft-order' | translate }}\r\n </a>\r\n </ng-container>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n id=\"order-list\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"order-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n ></vdr-bulk-action-menu>\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'order.search-by-order-filters' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.created-at' | translate\" id=\"created-at\" [hiddenByDefault]=\"true\">\r\n <ng-template let-order=\"item\">\r\n {{ order.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.code' | translate\" id=\"code\" [optional]=\"false\">\r\n <ng-template let-order=\"item\">\r\n <a class=\"button-ghost\" [routerLink]=\"order.state === 'Draft' ? ['./draft', order.id] : ['./', order.id]\"\r\n ><span>{{ order.code }}</span>\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.customer' | translate\" id=\"customer\" [sort]=\"sorts.get('customerLastName')\">\r\n <ng-template let-order=\"item\">\r\n <vdr-customer-label\r\n [customer]=\"order.customer\"\r\n (click)=\"$event.stopPropagation()\"\r\n ></vdr-customer-label>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.order-type' | translate\" id=\"order-type\" [hiddenByDefault]=\"true\">\r\n <ng-template let-order=\"item\">\r\n <vdr-chip *ngIf=\"order.type === OrderType.Regular\">{{ 'order.order-type-regular' | translate }}</vdr-chip>\r\n <vdr-chip *ngIf=\"order.type === OrderType.Aggregate\">{{ 'order.order-type-aggregate' | translate }}</vdr-chip>\r\n <vdr-chip *ngIf=\"order.type === OrderType.Seller\">{{ 'order.order-type-seller' | translate }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.state' | translate\" id=\"state\" [sort]=\"sorts.get('state')\">\r\n <ng-template let-order=\"item\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.total' | translate\" id=\"total\" [sort]=\"sorts.get('totalWithTax')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.totalWithTax | localeCurrency : order.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.updated-at' | translate\" id=\"updated-at\">\r\n <ng-template let-order=\"item\">\r\n {{ order.updatedAt | timeAgo }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.placed-at' | translate\" id=\"placed-at\" [sort]=\"sorts.get('orderPlacedAt')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.orderPlacedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.shipping' | translate\" id=\"shipping\">\r\n <ng-template let-order=\"item\">\r\n {{ getShippingNames(order) }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of customFields\"\r\n [customField]=\"customField\"\r\n [sorts]=\"sorts\"\r\n />\r\n</vdr-data-table-2>\r\n", styles: [".search-form{display:flex;flex-direction:column;align-items:baseline;width:100%;max-width:100vw;margin-bottom:6px}.filter-presets{max-width:90vw;overflow-x:auto}.search-input{margin-top:6px;min-width:300px}.custom-filters{overflow:hidden;max-height:0;padding-bottom:6px}.custom-filters.expanded{max-height:initial}.custom-filters>form{display:flex;flex-direction:column;align-items:center}.custom-filters>form>div{width:100%}ng-select{flex:1;min-width:200px;height:36px}ng-select ::ng-deep .ng-select-container{height:36px}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { kind: "component", type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { kind: "directive", type: i1.IfPermissionsDirective, selector: "[vdrIfPermissions]", inputs: ["vdrIfPermissions", "vdrIfPermissionsElse"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.BulkActionMenuComponent, selector: "vdr-bulk-action-menu", inputs: ["locationId", "selectionManager", "hostComponent"] }, { kind: "component", type: i1.DataTable2Component, selector: "vdr-data-table-2", inputs: ["id", "items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "filters", "activeIndex"], outputs: ["pageChange", "itemsPerPageChange"] }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.DataTable2SearchComponent, selector: "vdr-dt2-search", inputs: ["searchTermControl", "searchTermPlaceholder"] }, { kind: "component", type: i1.DataTableCustomFieldColumnComponent, selector: "vdr-dt2-custom-field-column", inputs: ["customField", "sorts"], exportAs: ["row"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.TimeAgoPipe, name: "timeAgo" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2964
3324
  }
2965
3325
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderListComponent, decorators: [{
2966
3326
  type: Component,
2967
3327
  args: [{ selector: 'vdr-order-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-list\"></vdr-action-bar-items>\r\n <ng-container *ngIf=\"canCreateDraftOrder\">\r\n <a class=\"btn\" *vdrIfPermissions=\"['CreateOrder']\" [routerLink]=\"['./draft/create']\">\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-draft-order' | translate }}\r\n </a>\r\n </ng-container>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n id=\"order-list\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"order-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n ></vdr-bulk-action-menu>\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'order.search-by-order-filters' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.created-at' | translate\" id=\"created-at\" [hiddenByDefault]=\"true\">\r\n <ng-template let-order=\"item\">\r\n {{ order.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.code' | translate\" id=\"code\" [optional]=\"false\">\r\n <ng-template let-order=\"item\">\r\n <a class=\"button-ghost\" [routerLink]=\"order.state === 'Draft' ? ['./draft', order.id] : ['./', order.id]\"\r\n ><span>{{ order.code }}</span>\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.customer' | translate\" id=\"customer\" [sort]=\"sorts.get('customerLastName')\">\r\n <ng-template let-order=\"item\">\r\n <vdr-customer-label\r\n [customer]=\"order.customer\"\r\n (click)=\"$event.stopPropagation()\"\r\n ></vdr-customer-label>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.order-type' | translate\" id=\"order-type\" [hiddenByDefault]=\"true\">\r\n <ng-template let-order=\"item\">\r\n <vdr-chip *ngIf=\"order.type === OrderType.Regular\">{{ 'order.order-type-regular' | translate }}</vdr-chip>\r\n <vdr-chip *ngIf=\"order.type === OrderType.Aggregate\">{{ 'order.order-type-aggregate' | translate }}</vdr-chip>\r\n <vdr-chip *ngIf=\"order.type === OrderType.Seller\">{{ 'order.order-type-seller' | translate }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.state' | translate\" id=\"state\" [sort]=\"sorts.get('state')\">\r\n <ng-template let-order=\"item\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.total' | translate\" id=\"total\" [sort]=\"sorts.get('totalWithTax')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.totalWithTax | localeCurrency : order.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.updated-at' | translate\" id=\"updated-at\">\r\n <ng-template let-order=\"item\">\r\n {{ order.updatedAt | timeAgo }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.placed-at' | translate\" id=\"placed-at\" [sort]=\"sorts.get('orderPlacedAt')\">\r\n <ng-template let-order=\"item\">\r\n {{ order.orderPlacedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'order.shipping' | translate\" id=\"shipping\">\r\n <ng-template let-order=\"item\">\r\n {{ getShippingNames(order) }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of customFields\"\r\n [customField]=\"customField\"\r\n [sorts]=\"sorts\"\r\n />\r\n</vdr-data-table-2>\r\n", styles: [".search-form{display:flex;flex-direction:column;align-items:baseline;width:100%;max-width:100vw;margin-bottom:6px}.filter-presets{max-width:90vw;overflow-x:auto}.search-input{margin-top:6px;min-width:300px}.custom-filters{overflow:hidden;max-height:0;padding-bottom:6px}.custom-filters.expanded{max-height:initial}.custom-filters>form{display:flex;flex-direction:column;align-items:center}.custom-filters>form>div{width:100%}ng-select{flex:1;min-width:200px;height:36px}ng-select ::ng-deep .ng-select-container{height:36px}\n"] }]
2968
3328
  }], ctorParameters: function () { return [{ type: i1.ServerConfigService }, { type: i1.ChannelService }]; } });
2969
3329
 
3330
+ class RefundDetailComponent {
3331
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: RefundDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3332
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: RefundDetailComponent, selector: "vdr-refund-detail", inputs: { refund: "refund", currencyCode: "currencyCode" }, ngImport: i0, template: "<vdr-labeled-data [label]=\"'order.amount' | translate\">\r\n {{ refund.total | localeCurrency: currencyCode }}\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"refund.transactionId\" [label]=\"'order.transaction-id' | translate\">\r\n {{ refund.transactionId }}\r\n</vdr-labeled-data>\r\n<vdr-labeled-data [label]=\"'order.payment-metadata' | translate\">\r\n <vdr-object-tree [value]=\"refund.metadata\"></vdr-object-tree>\r\n</vdr-labeled-data>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i1.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3333
+ }
3334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: RefundDetailComponent, decorators: [{
3335
+ type: Component,
3336
+ args: [{ selector: 'vdr-refund-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-labeled-data [label]=\"'order.amount' | translate\">\r\n {{ refund.total | localeCurrency: currencyCode }}\r\n</vdr-labeled-data>\r\n<vdr-labeled-data *ngIf=\"refund.transactionId\" [label]=\"'order.transaction-id' | translate\">\r\n {{ refund.transactionId }}\r\n</vdr-labeled-data>\r\n<vdr-labeled-data [label]=\"'order.payment-metadata' | translate\">\r\n <vdr-object-tree [value]=\"refund.metadata\"></vdr-object-tree>\r\n</vdr-labeled-data>\r\n" }]
3337
+ }], propDecorators: { refund: [{
3338
+ type: Input
3339
+ }], currencyCode: [{
3340
+ type: Input
3341
+ }] } });
3342
+
2970
3343
  const GET_CUSTOMER_ADDRESSES = gql `
2971
3344
  query GetCustomerAddresses($customerId: ID!) {
2972
3345
  customer(id: $customerId) {
@@ -2979,45 +3352,14 @@ const GET_CUSTOMER_ADDRESSES = gql `
2979
3352
  ${ADDRESS_FRAGMENT}
2980
3353
  `;
2981
3354
 
2982
- /**
2983
- * Resolves the id from the path into a Customer entity.
2984
- */
2985
- class OrderResolver {
2986
- constructor(router, dataService) {
2987
- this.router = router;
2988
- this.dataService = dataService;
2989
- }
2990
- /** @internal */
2991
- resolve(route, state) {
2992
- const id = route.paramMap.get('id');
2993
- // Complete the entity stream upon navigating away
2994
- const navigateAway$ = this.router.events.pipe(filter(event => event instanceof ActivationStart));
2995
- const stream = this.dataService.order
2996
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2997
- .getOrder(id)
2998
- .mapStream(data => data.order)
2999
- .pipe(switchMap(order => {
3000
- if (order?.state === 'Draft' && route.component !== DraftOrderDetailComponent) {
3001
- // Make sure Draft orders only get displayed with the DraftOrderDetailComponent
3002
- this.router.navigate(['/orders/draft', id]);
3003
- return EMPTY;
3004
- }
3005
- else {
3006
- return [order];
3007
- }
3008
- }), takeUntil(navigateAway$), filter(notNullOrUndefined), shareReplay(1));
3009
- return stream.pipe(take(1), map(() => stream));
3355
+ const GET_ORDER_STATE = gql `
3356
+ query GetOrderState($id: ID!) {
3357
+ order(id: $id) {
3358
+ id
3359
+ state
3360
+ }
3010
3361
  }
3011
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderResolver, deps: [{ token: i1$2.Router }, { token: i1.DataService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3012
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderResolver, providedIn: 'root' }); }
3013
- }
3014
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderResolver, decorators: [{
3015
- type: Injectable,
3016
- args: [{
3017
- providedIn: 'root',
3018
- }]
3019
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1.DataService }]; } });
3020
-
3362
+ `;
3021
3363
  class OrderGuard {
3022
3364
  constructor(dataService, router) {
3023
3365
  this.dataService = dataService;
@@ -3025,6 +3367,7 @@ class OrderGuard {
3025
3367
  }
3026
3368
  canActivate(route, state) {
3027
3369
  const isDraft = state.url.includes('orders/draft');
3370
+ const isModifying = state.url.includes('/modify');
3028
3371
  const id = route.paramMap.get('id');
3029
3372
  if (isDraft) {
3030
3373
  if (id === 'create') {
@@ -3037,10 +3380,20 @@ class OrderGuard {
3037
3380
  }
3038
3381
  }
3039
3382
  else {
3040
- return true;
3383
+ return (this.dataService
3384
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3385
+ .query(GET_ORDER_STATE, { id: id })
3386
+ .single$.pipe(map(({ order }) => {
3387
+ if (order?.state === 'Modifying' && !isModifying) {
3388
+ return this.router.parseUrl(`/orders/${id}/modify`);
3389
+ }
3390
+ else {
3391
+ return true;
3392
+ }
3393
+ })));
3041
3394
  }
3042
3395
  }
3043
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderGuard, deps: [{ token: i1.DataService }, { token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
3396
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderGuard, deps: [{ token: i1.DataService }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
3044
3397
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderGuard, providedIn: 'root' }); }
3045
3398
  }
3046
3399
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderGuard, decorators: [{
@@ -3048,7 +3401,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImpor
3048
3401
  args: [{
3049
3402
  providedIn: 'root',
3050
3403
  }]
3051
- }], ctorParameters: function () { return [{ type: i1.DataService }, { type: i1$2.Router }]; } });
3404
+ }], ctorParameters: function () { return [{ type: i1.DataService }, { type: i1$1.Router }]; } });
3052
3405
 
3053
3406
  const createRoutes = (pageService) => [
3054
3407
  {
@@ -3093,58 +3446,15 @@ const createRoutes = (pageService) => [
3093
3446
  },
3094
3447
  {
3095
3448
  path: ':id/modify',
3096
- component: OrderEditorComponent,
3097
- resolve: {
3098
- entity: OrderResolver,
3099
- },
3449
+ component: PageComponent,
3450
+ canActivate: [OrderGuard],
3100
3451
  data: {
3101
- breadcrumb: modifyingOrderBreadcrumb,
3452
+ locationId: 'modify-order',
3453
+ breadcrumb: { label: marker('breadcrumb.orders'), link: ['../'] },
3102
3454
  },
3455
+ children: pageService.getPageTabRoutes('modify-order'),
3103
3456
  },
3104
- ];
3105
- function orderBreadcrumb(data, params) {
3106
- return data.entity.pipe(map((entity) => {
3107
- if (entity.aggregateOrder) {
3108
- return [
3109
- {
3110
- label: 'breadcrumb.orders',
3111
- link: ['../'],
3112
- },
3113
- {
3114
- label: entity.aggregateOrder.code,
3115
- link: ['../', entity.aggregateOrder.id],
3116
- },
3117
- {
3118
- label: marker('breadcrumb.seller-orders'),
3119
- link: ['../', entity.aggregateOrder.id],
3120
- },
3121
- {
3122
- label: entity.code,
3123
- link: [entity.id],
3124
- },
3125
- ];
3126
- }
3127
- else {
3128
- return [
3129
- {
3130
- label: 'breadcrumb.orders',
3131
- link: ['../'],
3132
- },
3133
- {
3134
- label: entity.code,
3135
- link: [entity.id],
3136
- },
3137
- ];
3138
- }
3139
- }));
3140
- }
3141
- function modifyingOrderBreadcrumb(data, params) {
3142
- return orderBreadcrumb(data, params).pipe(map((breadcrumbs) => {
3143
- const modifiedBreadcrumbs = breadcrumbs.slice();
3144
- modifiedBreadcrumbs[1].link = ['../', breadcrumbs[1].link[0]];
3145
- return modifiedBreadcrumbs.concat({ label: marker('breadcrumb.modifying'), link: [''] });
3146
- }));
3147
- }
3457
+ ];
3148
3458
 
3149
3459
  class OrderModule {
3150
3460
  static { this.hasRegisteredTabsAndBulkActions = false; }
@@ -3208,6 +3518,27 @@ class OrderModule {
3208
3518
  ],
3209
3519
  }),
3210
3520
  });
3521
+ pageService.registerPageTab({
3522
+ priority: 0,
3523
+ location: 'modify-order',
3524
+ tab: marker('order.order'),
3525
+ route: '',
3526
+ component: detailComponentWithResolver({
3527
+ component: OrderEditorComponent,
3528
+ query: OrderDetailQueryDocument,
3529
+ entityKey: 'order',
3530
+ getBreadcrumbs: entity => [
3531
+ {
3532
+ label: entity?.code || 'order',
3533
+ link: ['/orders/', entity?.id],
3534
+ },
3535
+ {
3536
+ label: marker('breadcrumb.modifying-order'),
3537
+ link: [entity?.id],
3538
+ },
3539
+ ],
3540
+ }),
3541
+ });
3211
3542
  OrderModule.hasRegisteredTabsAndBulkActions = true;
3212
3543
  }
3213
3544
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderModule, deps: [{ token: i1.PageService }], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -3248,7 +3579,10 @@ class OrderModule {
3248
3579
  OrderHistoryEntryHostComponent,
3249
3580
  SellerOrdersCardComponent,
3250
3581
  OrderDataTableComponent,
3251
- OrderTotalColumnComponent], imports: [SharedModule, i1$2.RouterModule], exports: [OrderCustomFieldsCardComponent] }); }
3582
+ OrderTotalColumnComponent,
3583
+ PaymentForRefundSelectorComponent,
3584
+ OrderModificationSummaryComponent,
3585
+ RefundDetailComponent], imports: [SharedModule, i1$1.RouterModule], exports: [OrderCustomFieldsCardComponent] }); }
3252
3586
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: OrderModule, providers: [
3253
3587
  {
3254
3588
  provide: ROUTES,
@@ -3309,6 +3643,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImpor
3309
3643
  SellerOrdersCardComponent,
3310
3644
  OrderDataTableComponent,
3311
3645
  OrderTotalColumnComponent,
3646
+ PaymentForRefundSelectorComponent,
3647
+ OrderModificationSummaryComponent,
3648
+ RefundDetailComponent,
3312
3649
  ],
3313
3650
  exports: [OrderCustomFieldsCardComponent],
3314
3651
  }]
@@ -3320,5 +3657,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImpor
3320
3657
  * Generated bundle index. Do not edit.
3321
3658
  */
3322
3659
 
3323
- export { AddManualPaymentDialogComponent, CancelOrderDialogComponent, CouponCodeSelectorComponent, DraftOrderDetailComponent, DraftOrderVariantSelectorComponent, FulfillOrderDialogComponent, FulfillmentCardComponent, FulfillmentDetailComponent, FulfillmentStateLabelComponent, GET_COUPON_CODE_SELECTOR_PROMOTION_LIST, GET_CUSTOMER_ADDRESSES, GET_SELLER_ORDERS, LineFulfillmentComponent, LineRefundsComponent, ModificationDetailComponent, NODE_HEIGHT, ORDER_DETAIL_QUERY, OrderCustomFieldsCardComponent, OrderDataTableComponent, OrderDetailComponent, OrderEditResultType, OrderEditorComponent, OrderEditsPreviewDialogComponent, OrderGuard, OrderHistoryComponent, OrderHistoryEntryHostComponent, OrderListComponent, OrderModule, OrderPaymentCardComponent, OrderProcessEdgeComponent, OrderProcessGraphComponent, OrderProcessGraphDialogComponent, OrderProcessNodeComponent, OrderResolver, OrderStateSelectDialogComponent, OrderTableComponent, OrderTotalColumnComponent, OrderTransitionService, PaymentDetailComponent, PaymentStateLabelComponent, RefundOrderDialogComponent, RefundStateLabelComponent, SelectAddressDialogComponent, SelectCustomerDialogComponent, SelectShippingMethodDialogComponent, SellerOrdersCardComponent, SettleRefundDialogComponent, SimpleItemListComponent, createRoutes, modifyingOrderBreadcrumb, orderBreadcrumb };
3660
+ export { AddManualPaymentDialogComponent, CancelOrderDialogComponent, CouponCodeSelectorComponent, DraftOrderDetailComponent, DraftOrderVariantSelectorComponent, FulfillOrderDialogComponent, FulfillmentCardComponent, FulfillmentDetailComponent, FulfillmentStateLabelComponent, GET_COUPON_CODE_SELECTOR_PROMOTION_LIST, GET_CUSTOMER_ADDRESSES, GET_ORDER_STATE, GET_SELLER_ORDERS, LineFulfillmentComponent, LineRefundsComponent, ModificationDetailComponent, NODE_HEIGHT, ORDER_DETAIL_QUERY, OrderCustomFieldsCardComponent, OrderDataTableComponent, OrderDetailComponent, OrderEditResultType, OrderEditorComponent, OrderEditsPreviewDialogComponent, OrderGuard, OrderHistoryComponent, OrderHistoryEntryHostComponent, OrderListComponent, OrderModificationSummaryComponent, OrderModule, OrderPaymentCardComponent, OrderProcessEdgeComponent, OrderProcessGraphComponent, OrderProcessGraphDialogComponent, OrderProcessNodeComponent, OrderStateSelectDialogComponent, OrderTableComponent, OrderTotalColumnComponent, OrderTransitionService, PaymentDetailComponent, PaymentForRefundSelectorComponent, PaymentStateLabelComponent, RefundDetailComponent, RefundOrderDialogComponent, RefundStateLabelComponent, SET_ORDER_CUSTOMER_MUTATION, SelectAddressDialogComponent, SelectCustomerDialogComponent, SelectShippingMethodDialogComponent, SellerOrdersCardComponent, SettleRefundDialogComponent, SimpleItemListComponent, createRoutes, getRefundablePayments };
3324
3661
  //# sourceMappingURL=vendure-admin-ui-order.mjs.map