@vendure/admin-ui 2.0.0-next.2 → 2.0.0-next.21
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.
- package/catalog/catalog.module.d.ts +15 -11
- package/catalog/components/assign-to-channel-dialog/assign-to-channel-dialog.component.d.ts +22 -0
- package/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component.d.ts +41 -0
- package/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.graphql.d.ts +4 -0
- package/catalog/components/collection-contents/collection-contents.component.d.ts +10 -2
- package/catalog/components/collection-detail/collection-detail.component.d.ts +13 -4
- package/catalog/components/collection-list/collection-list-bulk-actions.d.ts +6 -0
- package/catalog/components/collection-list/collection-list.component.d.ts +9 -5
- package/catalog/components/collection-tree/array-to-tree.d.ts +1 -1
- package/catalog/components/collection-tree/collection-tree-node.component.d.ts +14 -6
- package/catalog/components/collection-tree/collection-tree.component.d.ts +4 -1
- package/catalog/components/facet-list/facet-list-bulk-actions.d.ts +5 -0
- package/catalog/components/facet-list/facet-list.component.d.ts +2 -1
- package/catalog/components/generate-product-variants/generate-product-variants.component.d.ts +3 -3
- package/catalog/components/option-value-input/option-value-input.component.d.ts +21 -9
- package/catalog/components/product-detail/product-detail.component.d.ts +1 -1
- package/catalog/components/product-list/product-list-bulk-actions.d.ts +6 -0
- package/catalog/components/product-list/product-list.component.d.ts +4 -2
- package/catalog/components/product-variants-editor/product-variants-editor.component.d.ts +22 -12
- package/catalog/components/product-variants-list/product-variants-list.component.d.ts +1 -0
- package/catalog/public_api.d.ts +6 -1
- package/core/common/component-registry-types.d.ts +1 -1
- package/core/common/generated-types.d.ts +3184 -195
- package/core/common/utilities/bulk-action-utils.d.ts +19 -0
- package/core/common/utilities/configurable-operation-utils.d.ts +7 -2
- package/core/common/utilities/selection-manager.d.ts +30 -0
- package/core/common/version.d.ts +1 -1
- package/core/components/app-shell/app-shell.component.d.ts +1 -0
- package/core/data/definitions/collection-definitions.d.ts +4 -0
- package/core/data/definitions/facet-definitions.d.ts +3 -0
- package/core/data/definitions/order-definitions.d.ts +14 -0
- package/core/data/definitions/product-definitions.d.ts +2 -0
- package/core/data/providers/collection-data.service.d.ts +7 -0
- package/core/data/providers/facet-data.service.d.ts +3 -0
- package/core/data/providers/order-data.service.d.ts +18 -0
- package/core/data/providers/product-data.service.d.ts +2 -0
- package/core/providers/bulk-action-registry/bulk-action-registry.service.d.ts +9 -0
- package/core/providers/bulk-action-registry/bulk-action-types.d.ts +149 -0
- package/core/providers/bulk-action-registry/register-bulk-action.d.ts +53 -0
- package/core/providers/local-storage/local-storage.service.d.ts +1 -0
- package/core/providers/modal/modal.types.d.ts +2 -0
- package/core/providers/nav-builder/nav-builder-types.d.ts +1 -0
- package/core/public_api.d.ts +24 -1
- package/core/shared/components/asset-gallery/asset-gallery.component.d.ts +27 -3
- package/core/shared/components/bulk-action-menu/bulk-action-menu.component.d.ts +32 -0
- package/core/shared/components/configurable-input/configurable-input.component.d.ts +8 -3
- package/core/shared/components/custom-field-control/custom-field-control.component.d.ts +6 -2
- package/core/shared/components/data-table/data-table.component.d.ts +29 -7
- package/core/shared/components/dropdown/dropdown-menu.component.d.ts +2 -1
- package/core/shared/components/facet-value-selector/facet-value-selector.component.d.ts +3 -2
- package/core/shared/components/product-multi-selector-dialog/product-multi-selector-dialog.component.d.ts +38 -0
- package/{catalog → core/shared}/components/product-search-input/product-search-input.component.d.ts +1 -1
- package/core/shared/components/radio-card/radio-card-fieldset.component.d.ts +24 -0
- package/core/shared/components/radio-card/radio-card.component.d.ts +22 -0
- package/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.component.d.ts +31 -0
- package/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.service.d.ts +34 -0
- package/core/shared/components/rich-text-editor/prosemirror/custom-nodes.d.ts +4 -0
- package/core/shared/components/rich-text-editor/prosemirror/inputrules.d.ts +5 -5
- package/core/shared/components/rich-text-editor/prosemirror/menu/links.d.ts +1 -1
- package/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.d.ts +12 -0
- package/core/shared/components/rich-text-editor/prosemirror/menu/menu-plugin.d.ts +9 -0
- package/core/shared/components/rich-text-editor/prosemirror/menu/sub-menu-with-icon.d.ts +14 -0
- package/core/shared/components/rich-text-editor/prosemirror/plugins/image-plugin.d.ts +7 -0
- package/core/shared/components/rich-text-editor/prosemirror/plugins/link-select-plugin.d.ts +1 -1
- package/core/shared/components/rich-text-editor/prosemirror/plugins/raw-editor-plugin.d.ts +7 -0
- package/core/shared/components/rich-text-editor/prosemirror/plugins/tables-plugin.d.ts +13 -0
- package/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.d.ts +7 -3
- package/core/shared/components/rich-text-editor/prosemirror/types.d.ts +0 -2
- package/core/shared/components/rich-text-editor/raw-html-dialog/raw-html-dialog.component.d.ts +21 -0
- package/core/shared/components/rich-text-editor/rich-text-editor.component.d.ts +6 -2
- package/core/shared/components/select-toggle/select-toggle.component.d.ts +2 -1
- package/core/shared/dynamic-form-inputs/code-editor-form-input/base-code-editor-form-input.component.d.ts +30 -0
- package/core/shared/dynamic-form-inputs/code-editor-form-input/html-editor-form-input.component.d.ts +22 -0
- package/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.d.ts +5 -17
- package/core/shared/dynamic-form-inputs/combination-mode-form-input/combination-mode-form-input.component.d.ts +28 -0
- package/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.d.ts +2 -0
- package/core/shared/dynamic-form-inputs/product-multi-selector-form-input/product-multi-selector-form-input.component.d.ts +23 -0
- package/core/shared/dynamic-form-inputs/register-dynamic-input-components.d.ts +5 -1
- package/core/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.d.ts +6 -3
- package/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.d.ts +10 -2
- package/core/shared/pipes/custom-field-description.pipe.d.ts +11 -0
- package/core/shared/pipes/custom-field-label.pipe.d.ts +4 -10
- package/core/shared/shared.module.d.ts +68 -57
- package/customer/components/customer-group-list/customer-group-list.component.d.ts +6 -4
- package/customer/components/customer-group-member-list/customer-group-member-list.component.d.ts +11 -4
- package/esm2020/catalog/catalog.module.mjs +31 -10
- package/esm2020/catalog/components/apply-facet-dialog/apply-facet-dialog.component.mjs +1 -1
- package/esm2020/catalog/components/assets/assets.component.mjs +2 -2
- package/esm2020/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.mjs +4 -1
- package/esm2020/catalog/components/assign-to-channel-dialog/assign-to-channel-dialog.component.mjs +50 -0
- package/esm2020/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component.mjs +84 -0
- package/esm2020/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.graphql.mjs +69 -0
- package/esm2020/catalog/components/collection-contents/collection-contents.component.mjs +61 -13
- package/esm2020/catalog/components/collection-detail/collection-detail.component.mjs +70 -32
- package/esm2020/catalog/components/collection-list/collection-list-bulk-actions.mjs +143 -0
- package/esm2020/catalog/components/collection-list/collection-list.component.mjs +46 -12
- package/esm2020/catalog/components/collection-tree/array-to-tree.mjs +3 -3
- package/esm2020/catalog/components/collection-tree/collection-tree-node.component.mjs +36 -10
- package/esm2020/catalog/components/collection-tree/collection-tree.component.mjs +9 -4
- package/esm2020/catalog/components/facet-detail/facet-detail.component.mjs +3 -3
- package/esm2020/catalog/components/facet-list/facet-list-bulk-actions.mjs +202 -0
- package/esm2020/catalog/components/facet-list/facet-list.component.mjs +14 -5
- package/esm2020/catalog/components/generate-product-variants/generate-product-variants.component.mjs +12 -4
- package/esm2020/catalog/components/option-value-input/option-value-input.component.mjs +70 -11
- package/esm2020/catalog/components/product-detail/product-detail.component.mjs +36 -24
- package/esm2020/catalog/components/product-list/product-list-bulk-actions.mjs +168 -0
- package/esm2020/catalog/components/product-list/product-list.component.mjs +13 -9
- package/esm2020/catalog/components/product-variants-editor/product-variants-editor.component.mjs +130 -19
- package/esm2020/catalog/components/product-variants-list/product-variants-list.component.mjs +9 -3
- package/esm2020/catalog/providers/routing/collection-resolver.mjs +2 -1
- package/esm2020/catalog/public_api.mjs +7 -2
- package/esm2020/core/app.component.module.mjs +1 -1
- package/esm2020/core/common/base-detail.component.mjs +1 -1
- package/esm2020/core/common/component-registry-types.mjs +1 -1
- package/esm2020/core/common/deactivate-aware.mjs +1 -1
- package/esm2020/core/common/generated-types.mjs +31 -1
- package/esm2020/core/common/introspection-result.mjs +296 -189
- package/esm2020/core/common/utilities/bulk-action-utils.mjs +35 -0
- package/esm2020/core/common/utilities/configurable-operation-utils.mjs +37 -10
- package/esm2020/core/common/utilities/selection-manager.mjs +96 -0
- package/esm2020/core/common/version.mjs +2 -2
- package/esm2020/core/components/app-shell/app-shell.component.mjs +6 -5
- package/esm2020/core/components/breadcrumb/breadcrumb.component.mjs +2 -2
- package/esm2020/core/components/channel-switcher/channel-switcher.component.mjs +1 -1
- package/esm2020/core/components/main-nav/main-nav.component.mjs +3 -3
- package/esm2020/core/components/user-menu/user-menu.component.mjs +1 -1
- package/esm2020/core/core.module.mjs +1 -1
- package/esm2020/core/data/definitions/collection-definitions.mjs +47 -1
- package/esm2020/core/data/definitions/facet-definitions.mjs +31 -1
- package/esm2020/core/data/definitions/order-definitions.mjs +583 -455
- package/esm2020/core/data/definitions/product-definitions.mjs +23 -1
- package/esm2020/core/data/definitions/shared-definitions.mjs +29 -28
- package/esm2020/core/data/providers/collection-data.service.mjs +20 -2
- package/esm2020/core/data/providers/customer-data.service.mjs +6 -1
- package/esm2020/core/data/providers/facet-data.service.mjs +18 -2
- package/esm2020/core/data/providers/order-data.service.mjs +43 -2
- package/esm2020/core/data/providers/product-data.service.mjs +10 -2
- package/esm2020/core/data/providers/promotion-data.service.mjs +1 -1
- package/esm2020/core/data/utils/remove-readonly-custom-fields.mjs +8 -1
- package/esm2020/core/providers/bulk-action-registry/bulk-action-registry.service.mjs +28 -0
- package/esm2020/core/providers/bulk-action-registry/bulk-action-types.mjs +2 -0
- package/esm2020/core/providers/bulk-action-registry/register-bulk-action.mjs +63 -0
- package/esm2020/core/providers/dashboard-widget/dashboard-widget.service.mjs +1 -4
- package/esm2020/core/providers/local-storage/local-storage.service.mjs +1 -1
- package/esm2020/core/providers/modal/modal.service.mjs +2 -1
- package/esm2020/core/providers/modal/modal.types.mjs +1 -1
- package/esm2020/core/providers/nav-builder/nav-builder-types.mjs +1 -1
- package/esm2020/core/public_api.mjs +25 -2
- package/esm2020/core/shared/components/action-bar/action-bar.component.mjs +7 -15
- package/esm2020/core/shared/components/address-form/address-form.component.mjs +3 -3
- package/esm2020/core/shared/components/asset-gallery/asset-gallery.component.mjs +34 -51
- package/esm2020/core/shared/components/asset-preview/asset-preview.component.mjs +4 -4
- package/esm2020/core/shared/components/asset-preview-links/asset-preview-links.component.mjs +1 -1
- package/esm2020/core/shared/components/bulk-action-menu/bulk-action-menu.component.mjs +97 -0
- package/esm2020/core/shared/components/configurable-input/configurable-input.component.mjs +22 -10
- package/esm2020/core/shared/components/custom-field-control/custom-field-control.component.mjs +18 -10
- package/esm2020/core/shared/components/data-table/data-table.component.mjs +64 -14
- package/esm2020/core/shared/components/datetime-picker/datetime-picker.component.mjs +1 -1
- package/esm2020/core/shared/components/dropdown/dropdown-menu.component.mjs +26 -23
- package/esm2020/core/shared/components/dropdown/dropdown-trigger.directive.mjs +1 -1
- package/esm2020/core/shared/components/entity-info/entity-info.component.mjs +1 -1
- package/esm2020/core/shared/components/facet-value-selector/facet-value-selector.component.mjs +13 -6
- package/esm2020/core/shared/components/formatted-address/formatted-address.component.mjs +3 -3
- package/esm2020/core/shared/components/help-tooltip/help-tooltip.component.mjs +2 -2
- package/esm2020/core/shared/components/history-entry-detail/history-entry-detail.component.mjs +1 -1
- package/esm2020/core/shared/components/language-selector/language-selector.component.mjs +3 -3
- package/esm2020/core/shared/components/object-tree/object-tree.component.mjs +1 -1
- package/esm2020/core/shared/components/order-state-label/order-state-label.component.mjs +2 -1
- package/esm2020/core/shared/components/product-multi-selector-dialog/product-multi-selector-dialog.component.mjs +135 -0
- package/esm2020/core/shared/components/product-search-input/product-search-input.component.mjs +108 -0
- package/esm2020/core/shared/components/product-variant-selector/product-variant-selector.component.mjs +2 -2
- package/esm2020/core/shared/components/radio-card/radio-card-fieldset.component.mjs +54 -0
- package/esm2020/core/shared/components/radio-card/radio-card.component.mjs +53 -0
- package/esm2020/core/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.mjs +3 -3
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.component.mjs +136 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.service.mjs +46 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/custom-nodes.mjs +57 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/menu/links.mjs +4 -4
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.mjs +22 -1
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/menu/menu-plugin.mjs +12 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/menu/menu.mjs +73 -18
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/menu/sub-menu-with-icon.mjs +16 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/plugins/image-plugin.mjs +100 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/plugins/raw-editor-plugin.mjs +96 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/plugins/tables-plugin.mjs +166 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.mjs +47 -18
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/types.mjs +1 -1
- package/esm2020/core/shared/components/rich-text-editor/raw-html-dialog/raw-html-dialog.component.mjs +59 -0
- package/esm2020/core/shared/components/rich-text-editor/rich-text-editor.component.mjs +22 -10
- package/esm2020/core/shared/components/select-toggle/select-toggle.component.mjs +6 -3
- package/esm2020/core/shared/components/simple-dialog/simple-dialog.component.mjs +3 -3
- package/esm2020/core/shared/components/ui-extension-point/ui-extension-point.component.mjs +1 -1
- package/esm2020/core/shared/dynamic-form-inputs/code-editor-form-input/base-code-editor-form-input.component.mjs +57 -0
- package/esm2020/core/shared/dynamic-form-inputs/code-editor-form-input/html-editor-form-input.component.mjs +63 -0
- package/esm2020/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.mjs +48 -83
- package/esm2020/core/shared/dynamic-form-inputs/combination-mode-form-input/combination-mode-form-input.component.mjs +45 -0
- package/esm2020/core/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.mjs +3 -3
- package/esm2020/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.mjs +12 -3
- package/esm2020/core/shared/dynamic-form-inputs/product-multi-selector-form-input/product-multi-selector-form-input.component.mjs +48 -0
- package/esm2020/core/shared/dynamic-form-inputs/register-dynamic-input-components.mjs +7 -1
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.mjs +11 -9
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/generic/relation-generic-input.component.mjs +1 -1
- package/esm2020/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.mjs +21 -11
- package/esm2020/core/shared/pipes/custom-field-description.pipe.mjs +30 -0
- package/esm2020/core/shared/pipes/custom-field-label.pipe.mjs +7 -19
- package/esm2020/core/shared/pipes/locale-currency.pipe.mjs +10 -2
- package/esm2020/core/shared/pipes/state-i18n-token.pipe.mjs +2 -1
- package/esm2020/core/shared/shared.module.mjs +49 -5
- package/esm2020/customer/components/address-card/address-card.component.mjs +1 -1
- package/esm2020/customer/components/customer-detail/customer-detail.component.mjs +1 -1
- package/esm2020/customer/components/customer-group-list/customer-group-list.component.mjs +33 -18
- package/esm2020/customer/components/customer-group-member-list/customer-group-member-list.component.mjs +3 -3
- package/esm2020/customer/components/customer-history/customer-history.component.mjs +1 -1
- package/esm2020/customer/components/customer-list/customer-list.component.mjs +3 -3
- package/esm2020/dashboard/components/dashboard/dashboard.component.mjs +2 -2
- package/esm2020/dashboard/components/dashboard-widget/dashboard-widget.component.mjs +2 -2
- package/esm2020/dashboard/dashboard.module.mjs +6 -2
- package/esm2020/dashboard/widgets/latest-orders-widget/latest-orders-widget.component.mjs +1 -1
- package/esm2020/dashboard/widgets/order-summary-widget/order-summary-widget.component.mjs +2 -2
- package/esm2020/login/components/login/login.component.mjs +3 -3
- package/esm2020/marketing/components/promotion-detail/promotion-detail.component.mjs +3 -3
- package/esm2020/marketing/components/promotion-list/promotion-list.component.mjs +1 -1
- package/esm2020/order/components/cancel-order-dialog/cancel-order-dialog.component.mjs +1 -1
- package/esm2020/order/components/coupon-code-selector/coupon-code-selector.component.mjs +42 -0
- package/esm2020/order/components/draft-order-detail/draft-order-detail.component.mjs +187 -0
- package/esm2020/order/components/draft-order-variant-selector/draft-order-variant-selector.component.mjs +59 -0
- package/esm2020/order/components/fulfill-order-dialog/fulfill-order-dialog.component.mjs +7 -3
- package/esm2020/order/components/fulfillment-card/fulfillment-card.component.mjs +1 -1
- package/esm2020/order/components/fulfillment-detail/fulfillment-detail.component.mjs +8 -17
- package/esm2020/order/components/line-fulfillment/line-fulfillment.component.mjs +8 -22
- package/esm2020/order/components/order-custom-fields-card/order-custom-fields-card.component.mjs +30 -6
- package/esm2020/order/components/order-detail/order-detail.component.mjs +80 -40
- package/esm2020/order/components/order-editor/order-editor.component.mjs +15 -14
- package/esm2020/order/components/order-edits-preview-dialog/order-edits-preview-dialog.component.mjs +1 -1
- package/esm2020/order/components/order-history/order-history.component.mjs +1 -1
- package/esm2020/order/components/order-list/order-list.component.mjs +40 -17
- package/esm2020/order/components/order-payment-card/order-payment-card.component.mjs +3 -3
- package/esm2020/order/components/order-table/order-table.component.mjs +29 -6
- package/esm2020/order/components/refund-order-dialog/refund-order-dialog.component.mjs +2 -2
- package/esm2020/order/components/select-address-dialog/select-address-dialog.component.mjs +89 -0
- package/esm2020/order/components/select-address-dialog/select-address-dialog.graphql.mjs +14 -0
- package/esm2020/order/components/select-customer-dialog/select-customer-dialog.component.mjs +59 -0
- package/esm2020/order/components/select-shipping-method-dialog/select-shipping-method-dialog.component.mjs +31 -0
- package/esm2020/order/order.module.mjs +20 -2
- package/esm2020/order/order.routes.mjs +23 -4
- package/esm2020/order/providers/routing/order-resolver.mjs +29 -11
- package/esm2020/order/providers/routing/order.guard.mjs +37 -0
- package/esm2020/order/public_api.mjs +9 -1
- package/esm2020/settings/components/administrator-list/administrator-list.component.mjs +1 -1
- package/esm2020/settings/components/channel-list/channel-list.component.mjs +1 -1
- package/esm2020/settings/components/country-list/country-list.component.mjs +3 -3
- package/esm2020/settings/components/payment-method-detail/payment-method-detail.component.mjs +1 -1
- package/esm2020/settings/components/payment-method-list/payment-method-list.component.mjs +1 -1
- package/esm2020/settings/components/permission-grid/permission-grid.component.mjs +1 -1
- package/esm2020/settings/components/profile/profile.component.mjs +3 -3
- package/esm2020/settings/components/role-list/role-list.component.mjs +1 -1
- package/esm2020/settings/components/shipping-method-detail/shipping-method-detail.component.mjs +4 -2
- package/esm2020/settings/components/shipping-method-list/shipping-method-list.component.mjs +1 -1
- package/esm2020/settings/components/tax-category-list/tax-category-list.component.mjs +1 -1
- package/esm2020/settings/components/tax-rate-list/tax-rate-list.component.mjs +1 -1
- package/esm2020/settings/components/zone-detail-dialog/zone-detail-dialog.component.mjs +2 -2
- package/esm2020/settings/components/zone-list/zone-list.component.mjs +3 -3
- package/esm2020/settings/components/zone-member-list/zone-member-list.component.mjs +3 -3
- package/esm2020/system/components/health-check/health-check.component.mjs +2 -2
- package/esm2020/system/components/job-list/job-list.component.mjs +1 -1
- package/fesm2015/vendure-admin-ui-catalog.mjs +1206 -228
- package/fesm2015/vendure-admin-ui-catalog.mjs.map +1 -1
- package/fesm2015/vendure-admin-ui-core.mjs +9451 -7332
- package/fesm2015/vendure-admin-ui-core.mjs.map +1 -1
- package/fesm2015/vendure-admin-ui-customer.mjs +36 -23
- package/fesm2015/vendure-admin-ui-customer.mjs.map +1 -1
- package/fesm2015/vendure-admin-ui-dashboard.mjs +11 -7
- package/fesm2015/vendure-admin-ui-dashboard.mjs.map +1 -1
- package/fesm2015/vendure-admin-ui-login.mjs +2 -2
- package/fesm2015/vendure-admin-ui-login.mjs.map +1 -1
- package/fesm2015/vendure-admin-ui-marketing.mjs +3 -3
- package/fesm2015/vendure-admin-ui-marketing.mjs.map +1 -1
- package/fesm2015/vendure-admin-ui-order.mjs +1184 -599
- package/fesm2015/vendure-admin-ui-order.mjs.map +1 -1
- package/fesm2015/vendure-admin-ui-settings.mjs +21 -19
- package/fesm2015/vendure-admin-ui-settings.mjs.map +1 -1
- package/fesm2015/vendure-admin-ui-system.mjs +3 -3
- package/fesm2020/vendure-admin-ui-catalog.mjs +1190 -230
- package/fesm2020/vendure-admin-ui-catalog.mjs.map +1 -1
- package/fesm2020/vendure-admin-ui-core.mjs +9539 -7437
- package/fesm2020/vendure-admin-ui-core.mjs.map +1 -1
- package/fesm2020/vendure-admin-ui-customer.mjs +36 -23
- package/fesm2020/vendure-admin-ui-customer.mjs.map +1 -1
- package/fesm2020/vendure-admin-ui-dashboard.mjs +11 -7
- package/fesm2020/vendure-admin-ui-dashboard.mjs.map +1 -1
- package/fesm2020/vendure-admin-ui-login.mjs +2 -2
- package/fesm2020/vendure-admin-ui-login.mjs.map +1 -1
- package/fesm2020/vendure-admin-ui-marketing.mjs +3 -3
- package/fesm2020/vendure-admin-ui-marketing.mjs.map +1 -1
- package/fesm2020/vendure-admin-ui-order.mjs +1194 -614
- package/fesm2020/vendure-admin-ui-order.mjs.map +1 -1
- package/fesm2020/vendure-admin-ui-settings.mjs +21 -19
- package/fesm2020/vendure-admin-ui-settings.mjs.map +1 -1
- package/fesm2020/vendure-admin-ui-system.mjs +3 -3
- package/order/components/coupon-code-selector/coupon-code-selector.component.d.ts +21 -0
- package/order/components/draft-order-detail/draft-order-detail.component.d.ts +52 -0
- package/order/components/draft-order-variant-selector/draft-order-variant-selector.component.d.ts +24 -0
- package/order/components/order-custom-fields-card/order-custom-fields-card.component.d.ts +4 -2
- package/order/components/order-editor/order-editor.component.d.ts +1 -6
- package/order/components/order-list/order-list.component.d.ts +2 -0
- package/order/components/order-table/order-table.component.d.ts +12 -2
- package/order/components/select-address-dialog/select-address-dialog.component.d.ts +27 -0
- package/order/components/select-address-dialog/select-address-dialog.graphql.d.ts +1 -0
- package/order/components/select-customer-dialog/select-customer-dialog.component.d.ts +25 -0
- package/order/components/select-shipping-method-dialog/select-shipping-method-dialog.component.d.ts +19 -0
- package/order/order.module.d.ts +9 -3
- package/order/providers/routing/order-resolver.d.ts +8 -3
- package/order/providers/routing/order.guard.d.ts +12 -0
- package/order/public_api.d.ts +8 -0
- package/package.json +13 -12
- package/settings/components/zone-member-list/zone-member-list.component.d.ts +3 -1
- package/static/i18n-messages/cs.json +50 -3
- package/static/i18n-messages/de.json +53 -3
- package/static/i18n-messages/en.json +55 -8
- package/static/i18n-messages/es.json +50 -3
- package/static/i18n-messages/fr.json +50 -3
- package/static/i18n-messages/it.json +50 -3
- package/static/i18n-messages/pl.json +50 -3
- package/static/i18n-messages/pt_BR.json +50 -3
- package/static/i18n-messages/pt_PT.json +50 -3
- package/static/i18n-messages/ru.json +50 -3
- package/static/i18n-messages/uk.json +50 -3
- package/static/i18n-messages/zh_Hans.json +50 -3
- package/static/i18n-messages/zh_Hant.json +50 -3
- package/static/styles/_variables.scss +4 -0
- package/static/styles/global/_forms.scss +8 -7
- package/static/styles/global/_overrides.scss +11 -1
- package/static/styles/global/_sass-overrides.scss +3 -0
- package/static/styles/global/_utilities.scss +14 -0
- package/static/styles/styles.scss +1 -0
- package/static/styles/theme/default.scss +13 -1
- package/static/styles/ui-extension-theme.scss +1 -0
- package/static/theme.min.css +1 -1
- package/core/shared/components/rich-text-editor/prosemirror/menu/images.d.ts +0 -4
- package/esm2020/catalog/components/product-search-input/product-search-input.component.mjs +0 -107
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/menu/images.mjs +0 -36
|
@@ -1,123 +1,885 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy,
|
|
2
|
+
import { Component, ChangeDetectionStrategy, EventEmitter, Input, Output, Injectable, ViewChildren, HostBinding, NgModule } from '@angular/core';
|
|
3
3
|
import * as i3$1 from '@angular/forms';
|
|
4
4
|
import { FormGroup, FormControl, Validators, FormArray } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@vendure/admin-ui/core';
|
|
6
|
-
import { getAppConfig,
|
|
6
|
+
import { getAppConfig, ADDRESS_FRAGMENT, HistoryEntryType, SortOrder, AdjustmentType, BaseDetailComponent, DeletionResult, configurableDefinitionToInstance, GlobalFlag, configurableOperationValueIsValid, toConfigurableOperationInput, EditNoteDialogComponent, transformRelationCustomFieldInputs, BaseListComponent, LogicalOperator, CanDeactivateDetailGuard, detailBreadcrumb, SharedModule } from '@vendure/admin-ui/core';
|
|
7
7
|
import * as i3 from '@ng-select/ng-select';
|
|
8
8
|
import * as i4 from '@ngx-translate/core';
|
|
9
9
|
import * as i4$1 from '@angular/common';
|
|
10
10
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker';
|
|
11
|
-
import * as
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
11
|
+
import * as i3$2 from '@clr/angular';
|
|
12
|
+
import { Subject, concat, of, EMPTY, combineLatest, BehaviorSubject, merge } from 'rxjs';
|
|
13
|
+
import { distinctUntilChanged, switchMap, map, startWith, tap, debounceTime, catchError, retryWhen, delay, take, mapTo, takeUntil, shareReplay, filter } from 'rxjs/operators';
|
|
14
|
+
import { pick } from '@vendure/common/lib/pick';
|
|
15
|
+
import { gql } from 'apollo-angular';
|
|
16
16
|
import * as i1$1 from '@angular/router';
|
|
17
|
-
import { RouterModule } from '@angular/router';
|
|
17
|
+
import { ActivationStart, RouterModule } from '@angular/router';
|
|
18
|
+
import * as i3$3 from '@angular/cdk/bidi';
|
|
19
|
+
import { isObject, summate, assertNever, notNullOrUndefined } from '@vendure/common/lib/shared-utils';
|
|
20
|
+
import { simpleDeepClone } from '@vendure/common/lib/simple-deep-clone';
|
|
18
21
|
|
|
19
22
|
class AddManualPaymentDialogComponent {
|
|
20
23
|
constructor(dataService) {
|
|
21
24
|
this.dataService = dataService;
|
|
22
|
-
this.form = new FormGroup({
|
|
23
|
-
method: new FormControl('', Validators.required),
|
|
24
|
-
transactionId: new FormControl('', Validators.required),
|
|
25
|
-
});
|
|
25
|
+
this.form = new FormGroup({
|
|
26
|
+
method: new FormControl('', Validators.required),
|
|
27
|
+
transactionId: new FormControl('', Validators.required),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
ngOnInit() {
|
|
31
|
+
this.paymentMethods$ = this.dataService.settings
|
|
32
|
+
.getPaymentMethods(999)
|
|
33
|
+
.mapSingle(data => data.paymentMethods.items);
|
|
34
|
+
}
|
|
35
|
+
submit() {
|
|
36
|
+
const formValue = this.form.value;
|
|
37
|
+
this.resolveWith({
|
|
38
|
+
method: formValue.method,
|
|
39
|
+
transactionId: formValue.transactionId,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
cancel() {
|
|
43
|
+
this.resolveWith();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
AddManualPaymentDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AddManualPaymentDialogComponent, deps: [{ token: i1.DataService }], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
AddManualPaymentDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 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"], components: [{ type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "async": i4$1.AsyncPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AddManualPaymentDialogComponent, decorators: [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{ selector: 'vdr-add-manual-payment-dialog', changeDetection: ChangeDetectionStrategy.OnPush, 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 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"] }]
|
|
51
|
+
}], ctorParameters: function () { return [{ type: i1.DataService }]; } });
|
|
52
|
+
|
|
53
|
+
class CancelOrderDialogComponent {
|
|
54
|
+
constructor(i18nService) {
|
|
55
|
+
this.i18nService = i18nService;
|
|
56
|
+
this.cancelAll = true;
|
|
57
|
+
this.lineQuantities = {};
|
|
58
|
+
this.reasons = getAppConfig().cancellationReasons ?? [
|
|
59
|
+
marker('order.cancel-reason-customer-request'),
|
|
60
|
+
marker('order.cancel-reason-not-available'),
|
|
61
|
+
];
|
|
62
|
+
this.reasons = this.reasons.map(r => this.i18nService.translate(r));
|
|
63
|
+
}
|
|
64
|
+
get selectionCount() {
|
|
65
|
+
return Object.values(this.lineQuantities).reduce((sum, n) => sum + n, 0);
|
|
66
|
+
}
|
|
67
|
+
ngOnInit() {
|
|
68
|
+
this.lineQuantities = this.order.lines.reduce((result, line) => {
|
|
69
|
+
return { ...result, [line.id]: line.quantity };
|
|
70
|
+
}, {});
|
|
71
|
+
}
|
|
72
|
+
radioChanged() {
|
|
73
|
+
if (this.cancelAll) {
|
|
74
|
+
for (const line of this.order.lines) {
|
|
75
|
+
this.lineQuantities[line.id] = line.quantity;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
for (const line of this.order.lines) {
|
|
80
|
+
this.lineQuantities[line.id] = 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
checkIfAllSelected() {
|
|
85
|
+
for (const [lineId, quantity] of Object.entries(this.lineQuantities)) {
|
|
86
|
+
const quantityInOrder = this.order.lines.find(line => line.id === lineId)?.quantity;
|
|
87
|
+
if (quantityInOrder && quantity < quantityInOrder) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// If we got here, all of the selected quantities are equal to the order
|
|
92
|
+
// line quantities, i.e. everything is selected.
|
|
93
|
+
this.cancelAll = true;
|
|
94
|
+
}
|
|
95
|
+
select() {
|
|
96
|
+
this.resolveWith({
|
|
97
|
+
orderId: this.order.id,
|
|
98
|
+
lines: this.getLineInputs(),
|
|
99
|
+
reason: this.reason,
|
|
100
|
+
cancelShipping: this.cancelAll,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
cancel() {
|
|
104
|
+
this.resolveWith();
|
|
105
|
+
}
|
|
106
|
+
getLineInputs() {
|
|
107
|
+
if (this.order.active) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
return Object.entries(this.lineQuantities)
|
|
111
|
+
.map(([orderLineId, quantity]) => ({
|
|
112
|
+
orderLineId,
|
|
113
|
+
quantity,
|
|
114
|
+
}))
|
|
115
|
+
.filter(l => 0 < l.quantity);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
CancelOrderDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CancelOrderDialogComponent, deps: [{ token: i1.I18nService }], target: i0.ɵɵFactoryTarget.Component });
|
|
119
|
+
CancelOrderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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-left: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"], components: [{ type: i3$2.ClrRadioWrapper, selector: "clr-radio-wrapper" }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { type: i3$2.ClrRadio, selector: "[clrRadio]" }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CancelOrderDialogComponent, decorators: [{
|
|
121
|
+
type: Component,
|
|
122
|
+
args: [{ selector: 'vdr-cancel-order-dialog', changeDetection: ChangeDetectionStrategy.OnPush, 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-left: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"] }]
|
|
123
|
+
}], ctorParameters: function () { return [{ type: i1.I18nService }]; } });
|
|
124
|
+
|
|
125
|
+
class CouponCodeSelectorComponent {
|
|
126
|
+
constructor(dataService) {
|
|
127
|
+
this.dataService = dataService;
|
|
128
|
+
this.addCouponCode = new EventEmitter();
|
|
129
|
+
this.removeCouponCode = new EventEmitter();
|
|
130
|
+
this.couponCodeInput$ = new Subject();
|
|
131
|
+
}
|
|
132
|
+
ngOnInit() {
|
|
133
|
+
this.availableCouponCodes$ = concat(this.couponCodeInput$.pipe(distinctUntilChanged(), switchMap(term => this.dataService.promotion.getPromotions(10, 0, {
|
|
134
|
+
couponCode: { contains: term },
|
|
135
|
+
}).single$), map(({ promotions }) =>
|
|
136
|
+
// tslint:disable-next-line:no-non-null-assertion
|
|
137
|
+
promotions.items.map(p => ({ code: p.couponCode, promotionName: p.name }))), startWith([])));
|
|
138
|
+
if (!this.control) {
|
|
139
|
+
this.control = new FormControl(this.couponCodes ?? []);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
CouponCodeSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CouponCodeSelectorComponent, deps: [{ token: i1.DataService }], target: i0.ɵɵFactoryTarget.Component });
|
|
144
|
+
CouponCodeSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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: [""], components: [{ 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CouponCodeSelectorComponent, decorators: [{
|
|
146
|
+
type: Component,
|
|
147
|
+
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", styles: [""] }]
|
|
148
|
+
}], ctorParameters: function () { return [{ type: i1.DataService }]; }, propDecorators: { couponCodes: [{
|
|
149
|
+
type: Input
|
|
150
|
+
}], control: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], addCouponCode: [{
|
|
153
|
+
type: Output
|
|
154
|
+
}], removeCouponCode: [{
|
|
155
|
+
type: Output
|
|
156
|
+
}] } });
|
|
157
|
+
|
|
158
|
+
const GET_CUSTOMER_ADDRESSES = gql `
|
|
159
|
+
query GetCustomerAddresses($customerId: ID!) {
|
|
160
|
+
customer(id: $customerId) {
|
|
161
|
+
id
|
|
162
|
+
addresses {
|
|
163
|
+
...Address
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
${ADDRESS_FRAGMENT}
|
|
168
|
+
`;
|
|
169
|
+
|
|
170
|
+
class SelectAddressDialogComponent {
|
|
171
|
+
constructor(dataService, formBuilder) {
|
|
172
|
+
this.dataService = dataService;
|
|
173
|
+
this.formBuilder = formBuilder;
|
|
174
|
+
this.useExisting = true;
|
|
175
|
+
this.createNew = false;
|
|
176
|
+
}
|
|
177
|
+
ngOnInit() {
|
|
178
|
+
this.addressForm = this.formBuilder.group({
|
|
179
|
+
fullName: [this.currentAddress?.fullName ?? ''],
|
|
180
|
+
company: [this.currentAddress?.company ?? ''],
|
|
181
|
+
streetLine1: [this.currentAddress?.streetLine1 ?? '', Validators.required],
|
|
182
|
+
streetLine2: [this.currentAddress?.streetLine2 ?? ''],
|
|
183
|
+
city: [this.currentAddress?.city ?? '', Validators.required],
|
|
184
|
+
province: [this.currentAddress?.province ?? ''],
|
|
185
|
+
postalCode: [this.currentAddress?.postalCode ?? '', Validators.required],
|
|
186
|
+
countryCode: [this.currentAddress?.countryCode ?? '', Validators.required],
|
|
187
|
+
phoneNumber: [this.currentAddress?.phoneNumber ?? ''],
|
|
188
|
+
});
|
|
189
|
+
this.useExisting = !!this.customerId;
|
|
190
|
+
this.addresses$ = this.customerId
|
|
191
|
+
? this.dataService
|
|
192
|
+
.query(GET_CUSTOMER_ADDRESSES, { customerId: this.customerId })
|
|
193
|
+
.mapSingle(({ customer }) => customer?.addresses ?? [])
|
|
194
|
+
.pipe(tap(addresses => {
|
|
195
|
+
if (this.currentAddress) {
|
|
196
|
+
this.selectedAddress = addresses.find(a => a.streetLine1 === this.currentAddress?.streetLine1 &&
|
|
197
|
+
a.postalCode === this.currentAddress?.postalCode);
|
|
198
|
+
}
|
|
199
|
+
if (addresses.length === 0) {
|
|
200
|
+
this.createNew = true;
|
|
201
|
+
this.useExisting = false;
|
|
202
|
+
}
|
|
203
|
+
}))
|
|
204
|
+
: of([]);
|
|
205
|
+
this.availableCountries$ = this.dataService.settings
|
|
206
|
+
.getAvailableCountries()
|
|
207
|
+
.mapSingle(({ countries }) => countries.items);
|
|
208
|
+
}
|
|
209
|
+
trackByFn(item) {
|
|
210
|
+
return item.id;
|
|
211
|
+
}
|
|
212
|
+
addressIdFn(item) {
|
|
213
|
+
return item.streetLine1 + item.postalCode;
|
|
214
|
+
}
|
|
215
|
+
cancel() {
|
|
216
|
+
this.resolveWith();
|
|
217
|
+
}
|
|
218
|
+
select() {
|
|
219
|
+
if (this.useExisting && this.selectedAddress) {
|
|
220
|
+
this.resolveWith({
|
|
221
|
+
...pick(this.selectedAddress, [
|
|
222
|
+
'fullName',
|
|
223
|
+
'company',
|
|
224
|
+
'streetLine1',
|
|
225
|
+
'streetLine2',
|
|
226
|
+
'city',
|
|
227
|
+
'province',
|
|
228
|
+
'phoneNumber',
|
|
229
|
+
'postalCode',
|
|
230
|
+
]),
|
|
231
|
+
countryCode: this.selectedAddress.country.code,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
if (this.createNew && this.addressForm.valid) {
|
|
235
|
+
const formValue = this.addressForm.value;
|
|
236
|
+
this.resolveWith(formValue);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
SelectAddressDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectAddressDialogComponent, deps: [{ token: i1.DataService }, { token: i3$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
241
|
+
SelectAddressDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 mt4\"\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: [""], components: [{ type: i3$2.ClrTabs, selector: "clr-tabs", inputs: ["clrLayout"] }, { type: i3$2.ClrTab, selector: "clr-tab" }, { type: i3$2.ClrTabContent, selector: "clr-tab-content", inputs: ["id"] }, { type: i1.RadioCardFieldsetComponent, selector: "vdr-radio-card-fieldset", inputs: ["selectedItemId", "idFn"], outputs: ["selectItem"] }, { type: i1.RadioCardComponent, selector: "vdr-radio-card", inputs: ["item"], exportAs: ["VdrRadioCard"] }, { type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { type: i1.AddressFormComponent, selector: "vdr-address-form", inputs: ["customFields", "formGroup", "availableCountries"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ÇlrTabsWillyWonka, selector: "clr-tabs" }, { type: i3$2.ClrTabLink, selector: "[clrTabLink]", inputs: ["clrTabLinkInOverflow", "id"] }, { type: i3$2.ÇlrActiveOompaLoompa, selector: "[clrTabLink], clr-tab-content" }, { type: i3$2.ClrIfActive, selector: "[clrIfActive]", inputs: ["clrIfActive"], outputs: ["clrIfActiveChange"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectAddressDialogComponent, decorators: [{
|
|
243
|
+
type: Component,
|
|
244
|
+
args: [{ selector: 'vdr-select-address-dialog', changeDetection: ChangeDetectionStrategy.OnPush, 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 mt4\"\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: [""] }]
|
|
245
|
+
}], ctorParameters: function () { return [{ type: i1.DataService }, { type: i3$1.FormBuilder }]; } });
|
|
246
|
+
|
|
247
|
+
class SelectCustomerDialogComponent {
|
|
248
|
+
constructor(dataService, formBuilder) {
|
|
249
|
+
this.dataService = dataService;
|
|
250
|
+
this.formBuilder = formBuilder;
|
|
251
|
+
this.isLoading = false;
|
|
252
|
+
this.input$ = new Subject();
|
|
253
|
+
this.selectedCustomer = [];
|
|
254
|
+
this.useExisting = true;
|
|
255
|
+
this.createNew = false;
|
|
256
|
+
this.customerForm = this.formBuilder.group({
|
|
257
|
+
title: '',
|
|
258
|
+
firstName: ['', Validators.required],
|
|
259
|
+
lastName: ['', Validators.required],
|
|
260
|
+
phoneNumber: '',
|
|
261
|
+
emailAddress: ['', [Validators.required, Validators.email]],
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
ngOnInit() {
|
|
265
|
+
this.customers$ = concat(of([]), // default items
|
|
266
|
+
this.input$.pipe(debounceTime(200), distinctUntilChanged(), tap(() => (this.isLoading = true)), switchMap(term => this.dataService.customer
|
|
267
|
+
.getCustomerList(10, 0, term)
|
|
268
|
+
.mapStream(({ customers }) => customers.items)
|
|
269
|
+
.pipe(catchError(() => of([])), // empty list on error
|
|
270
|
+
tap(() => (this.isLoading = false))))));
|
|
271
|
+
}
|
|
272
|
+
trackByFn(item) {
|
|
273
|
+
return item.id;
|
|
274
|
+
}
|
|
275
|
+
cancel() {
|
|
276
|
+
this.resolveWith();
|
|
277
|
+
}
|
|
278
|
+
select() {
|
|
279
|
+
if (this.useExisting && this.selectedCustomer.length === 1) {
|
|
280
|
+
this.resolveWith(this.selectedCustomer[0]);
|
|
281
|
+
}
|
|
282
|
+
if (this.createNew && this.customerForm.valid) {
|
|
283
|
+
const formValue = this.customerForm.value;
|
|
284
|
+
this.resolveWith(formValue);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
SelectCustomerDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectCustomerDialogComponent, deps: [{ token: i1.DataService }, { token: i3$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
289
|
+
SelectCustomerDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 <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 class=\"mt4\"\r\n >\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"ml2 mr2\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </ng-template>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"ml2 mr2\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </ng-template>\r\n </ng-select>\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: [""], components: [{ type: i3$2.ClrTabs, selector: "clr-tabs", inputs: ["clrLayout"] }, { type: i3$2.ClrTab, selector: "clr-tab" }, { type: i3$2.ClrTabContent, selector: "clr-tab-content", inputs: ["id"] }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i3$2.ÇlrTabsWillyWonka, selector: "clr-tabs" }, { type: i3$2.ClrTabLink, selector: "[clrTabLink]", inputs: ["clrTabLinkInOverflow", "id"] }, { type: i3$2.ÇlrActiveOompaLoompa, selector: "[clrTabLink], clr-tab-content" }, { type: i3$2.ClrIfActive, selector: "[clrIfActive]", inputs: ["clrIfActive"], outputs: ["clrIfActiveChange"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectCustomerDialogComponent, decorators: [{
|
|
291
|
+
type: Component,
|
|
292
|
+
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 <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 class=\"mt4\"\r\n >\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"ml2 mr2\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </ng-template>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <clr-icon shape=\"user\" class=\"is-solid\"></clr-icon\r\n ><span class=\"ml2 mr2\">{{ item.firstName }} {{ item.lastName }}</span>\r\n <vdr-chip>{{ item.emailAddress }}</vdr-chip>\r\n </ng-template>\r\n </ng-select>\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: [""] }]
|
|
293
|
+
}], ctorParameters: function () { return [{ type: i1.DataService }, { type: i3$1.FormBuilder }]; } });
|
|
294
|
+
|
|
295
|
+
class SelectShippingMethodDialogComponent {
|
|
296
|
+
constructor() { }
|
|
297
|
+
ngOnInit() {
|
|
298
|
+
if (this.currentSelectionId) {
|
|
299
|
+
this.selectedMethod = this.eligibleShippingMethods.find(m => m.id === this.currentSelectionId);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
methodIdFn(item) {
|
|
303
|
+
return item.id;
|
|
304
|
+
}
|
|
305
|
+
cancel() {
|
|
306
|
+
this.resolveWith();
|
|
307
|
+
}
|
|
308
|
+
select() {
|
|
309
|
+
if (this.selectedMethod) {
|
|
310
|
+
this.resolveWith(this.selectedMethod.id);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
SelectShippingMethodDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectShippingMethodDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
315
|
+
SelectShippingMethodDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SelectShippingMethodDialogComponent, selector: "vdr-select-shipping-method-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'order.select-shipping-method' | translate }}</ng-template>\r\n<vdr-radio-card-fieldset\r\n [idFn]=\"methodIdFn\"\r\n [selectedItemId]=\"selectedMethod?.id\"\r\n (selectItem)=\"selectedMethod = $event\"\r\n>\r\n <vdr-radio-card *ngFor=\"let quote of eligibleShippingMethods\" [item]=\"quote\">\r\n <div class=\"result-details\">\r\n <vdr-labeled-data [label]=\"'settings.shipping-method' | translate\">\r\n {{ quote.name }}\r\n </vdr-labeled-data>\r\n <div class=\"price-row\">\r\n <vdr-labeled-data [label]=\"'common.price' | translate\">\r\n {{ quote.price | localeCurrency: currencyCode }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'common.price-with-tax' | translate\">\r\n {{ quote.priceWithTax | localeCurrency: currencyCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n <vdr-object-tree *ngIf=\"quote.metadata\" [value]=\"quote.metadata\"></vdr-object-tree>\r\n </div>\r\n </vdr-radio-card>\r\n</vdr-radio-card-fieldset>\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]=\"!selectedMethod\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.okay' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [""], components: [{ type: i1.RadioCardFieldsetComponent, selector: "vdr-radio-card-fieldset", inputs: ["selectedItemId", "idFn"], outputs: ["selectItem"] }, { type: i1.RadioCardComponent, selector: "vdr-radio-card", inputs: ["item"], exportAs: ["VdrRadioCard"] }, { type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { type: i1.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectShippingMethodDialogComponent, decorators: [{
|
|
317
|
+
type: Component,
|
|
318
|
+
args: [{ selector: 'vdr-select-shipping-method-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.select-shipping-method' | translate }}</ng-template>\r\n<vdr-radio-card-fieldset\r\n [idFn]=\"methodIdFn\"\r\n [selectedItemId]=\"selectedMethod?.id\"\r\n (selectItem)=\"selectedMethod = $event\"\r\n>\r\n <vdr-radio-card *ngFor=\"let quote of eligibleShippingMethods\" [item]=\"quote\">\r\n <div class=\"result-details\">\r\n <vdr-labeled-data [label]=\"'settings.shipping-method' | translate\">\r\n {{ quote.name }}\r\n </vdr-labeled-data>\r\n <div class=\"price-row\">\r\n <vdr-labeled-data [label]=\"'common.price' | translate\">\r\n {{ quote.price | localeCurrency: currencyCode }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'common.price-with-tax' | translate\">\r\n {{ quote.priceWithTax | localeCurrency: currencyCode }}\r\n </vdr-labeled-data>\r\n </div>\r\n <vdr-object-tree *ngIf=\"quote.metadata\" [value]=\"quote.metadata\"></vdr-object-tree>\r\n </div>\r\n </vdr-radio-card>\r\n</vdr-radio-card-fieldset>\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]=\"!selectedMethod\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'common.okay' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [""] }]
|
|
319
|
+
}], ctorParameters: function () { return []; } });
|
|
320
|
+
|
|
321
|
+
class OrderStateSelectDialogComponent {
|
|
322
|
+
constructor() {
|
|
323
|
+
this.nextStates = [];
|
|
324
|
+
this.message = '';
|
|
325
|
+
this.selectedState = '';
|
|
326
|
+
}
|
|
327
|
+
select() {
|
|
328
|
+
if (this.selectedState) {
|
|
329
|
+
this.resolveWith(this.selectedState);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
cancel() {
|
|
333
|
+
this.resolveWith();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
OrderStateSelectDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderStateSelectDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
337
|
+
OrderStateSelectDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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<clr-select-container>\r\n <select clrSelect 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</clr-select-container>\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: [""], components: [{ type: i3$2.ClrSelectContainer, selector: "clr-select-container" }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i3$2.ClrSelect, selector: "[clrSelect]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
338
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderStateSelectDialogComponent, decorators: [{
|
|
339
|
+
type: Component,
|
|
340
|
+
args: [{ selector: 'vdr-order-state-select-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.select-state' | translate }}</ng-template>\r\n<p>{{ message | translate }}</p>\r\n<clr-select-container>\r\n <select clrSelect 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</clr-select-container>\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: [""] }]
|
|
341
|
+
}] });
|
|
342
|
+
|
|
343
|
+
class OrderTransitionService {
|
|
344
|
+
constructor(dataService, modalService, notificationService, i18nService) {
|
|
345
|
+
this.dataService = dataService;
|
|
346
|
+
this.modalService = modalService;
|
|
347
|
+
this.notificationService = notificationService;
|
|
348
|
+
this.i18nService = i18nService;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Attempts to transition the Order to the last state it was in before it was transitioned
|
|
352
|
+
* to the "Modifying" state. If this fails, a manual prompt is used.
|
|
353
|
+
*/
|
|
354
|
+
transitionToPreModifyingState(orderId, nextStates) {
|
|
355
|
+
return this.getPreModifyingState(orderId).pipe(switchMap(state => {
|
|
356
|
+
const manualTransitionOptions = {
|
|
357
|
+
orderId,
|
|
358
|
+
nextStates,
|
|
359
|
+
message: this.i18nService.translate(marker('order.unable-to-transition-to-state-try-another'), { state }),
|
|
360
|
+
cancellable: false,
|
|
361
|
+
retry: 10,
|
|
362
|
+
};
|
|
363
|
+
if (state) {
|
|
364
|
+
return this.transitionToStateOrThrow(orderId, state).pipe(catchError(err => this.manuallyTransitionToState(manualTransitionOptions)));
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
return this.manuallyTransitionToState(manualTransitionOptions);
|
|
368
|
+
}
|
|
369
|
+
}));
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Displays a modal for manually selecting the next state.
|
|
373
|
+
*/
|
|
374
|
+
manuallyTransitionToState(options) {
|
|
375
|
+
return this.modalService
|
|
376
|
+
.fromComponent(OrderStateSelectDialogComponent, {
|
|
377
|
+
locals: {
|
|
378
|
+
nextStates: options.nextStates,
|
|
379
|
+
cancellable: options.cancellable,
|
|
380
|
+
message: options.message,
|
|
381
|
+
},
|
|
382
|
+
closable: false,
|
|
383
|
+
size: 'md',
|
|
384
|
+
})
|
|
385
|
+
.pipe(switchMap(result => {
|
|
386
|
+
if (result) {
|
|
387
|
+
return this.transitionToStateOrThrow(options.orderId, result);
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
if (!options.cancellable) {
|
|
391
|
+
throw new Error(`An order state must be selected`);
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
return EMPTY;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}), retryWhen(errors => errors.pipe(delay(2000), take(options.retry))));
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Attempts to get the last state the Order was in before it was transitioned
|
|
401
|
+
* to the "Modifying" state.
|
|
402
|
+
*/
|
|
403
|
+
getPreModifyingState(orderId) {
|
|
404
|
+
return this.dataService.order
|
|
405
|
+
.getOrderHistory(orderId, {
|
|
406
|
+
filter: {
|
|
407
|
+
type: {
|
|
408
|
+
eq: HistoryEntryType.ORDER_STATE_TRANSITION,
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
sort: {
|
|
412
|
+
createdAt: SortOrder.DESC,
|
|
413
|
+
},
|
|
414
|
+
})
|
|
415
|
+
.mapSingle(result => result.order)
|
|
416
|
+
.pipe(map(result => {
|
|
417
|
+
const item = result?.history.items.find(i => i.data.to === 'Modifying');
|
|
418
|
+
if (item) {
|
|
419
|
+
return item.data.from;
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
}));
|
|
425
|
+
}
|
|
426
|
+
transitionToStateOrThrow(orderId, state) {
|
|
427
|
+
return this.dataService.order.transitionToState(orderId, state).pipe(map(({ transitionOrderToState }) => {
|
|
428
|
+
switch (transitionOrderToState?.__typename) {
|
|
429
|
+
case 'Order':
|
|
430
|
+
return transitionOrderToState?.state;
|
|
431
|
+
case 'OrderStateTransitionError':
|
|
432
|
+
this.notificationService.error(transitionOrderToState?.transitionError);
|
|
433
|
+
throw new Error(transitionOrderToState?.transitionError);
|
|
434
|
+
}
|
|
435
|
+
}));
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
OrderTransitionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderTransitionService, deps: [{ token: i1.DataService }, { token: i1.ModalService }, { token: i1.NotificationService }, { token: i1.I18nService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
439
|
+
OrderTransitionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderTransitionService, providedIn: 'root' });
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderTransitionService, decorators: [{
|
|
441
|
+
type: Injectable,
|
|
442
|
+
args: [{
|
|
443
|
+
providedIn: 'root',
|
|
444
|
+
}]
|
|
445
|
+
}], ctorParameters: function () { return [{ type: i1.DataService }, { type: i1.ModalService }, { type: i1.NotificationService }, { type: i1.I18nService }]; } });
|
|
446
|
+
|
|
447
|
+
class DraftOrderVariantSelectorComponent {
|
|
448
|
+
constructor(dataService) {
|
|
449
|
+
this.dataService = dataService;
|
|
450
|
+
this.addItem = new EventEmitter();
|
|
451
|
+
this.customFieldsFormGroup = new FormGroup({});
|
|
452
|
+
this.selectedVariantId$ = new Subject();
|
|
453
|
+
this.quantity = 1;
|
|
454
|
+
}
|
|
455
|
+
ngOnInit() {
|
|
456
|
+
this.selectedVariant$ = this.selectedVariantId$.pipe(switchMap(id => {
|
|
457
|
+
if (id) {
|
|
458
|
+
return this.dataService.product
|
|
459
|
+
.getProductVariant(id)
|
|
460
|
+
.mapSingle(({ productVariant }) => productVariant);
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
return [undefined];
|
|
464
|
+
}
|
|
465
|
+
}));
|
|
466
|
+
for (const customField of this.orderLineCustomFields) {
|
|
467
|
+
this.customFieldsFormGroup.addControl(customField.name, new FormControl(''));
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
addItemClick(selectedVariant) {
|
|
471
|
+
if (selectedVariant) {
|
|
472
|
+
this.addItem.emit({
|
|
473
|
+
productVariantId: selectedVariant.id,
|
|
474
|
+
quantity: this.quantity,
|
|
475
|
+
customFields: this.orderLineCustomFields.length
|
|
476
|
+
? this.customFieldsFormGroup.value
|
|
477
|
+
: undefined,
|
|
478
|
+
});
|
|
479
|
+
this.selectedVariantId$.next(undefined);
|
|
480
|
+
this.customFieldsFormGroup.reset();
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
DraftOrderVariantSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DraftOrderVariantSelectorComponent, deps: [{ token: i1.DataService }], target: i0.ɵɵFactoryTarget.Component });
|
|
485
|
+
DraftOrderVariantSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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=\"mr2\" [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 ml4\">\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"], components: [{ type: i1.ProductVariantSelectorComponent, selector: "vdr-product-variant-selector", outputs: ["productSelected"] }, { type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i4.TranslatePipe, "async": i4$1.AsyncPipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
486
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DraftOrderVariantSelectorComponent, decorators: [{
|
|
487
|
+
type: Component,
|
|
488
|
+
args: [{ selector: 'vdr-draft-order-variant-selector', changeDetection: ChangeDetectionStrategy.OnPush, 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=\"mr2\" [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 ml4\">\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"] }]
|
|
489
|
+
}], ctorParameters: function () { return [{ type: i1.DataService }]; }, propDecorators: { currencyCode: [{
|
|
490
|
+
type: Input
|
|
491
|
+
}], orderLineCustomFields: [{
|
|
492
|
+
type: Input
|
|
493
|
+
}], addItem: [{
|
|
494
|
+
type: Output
|
|
495
|
+
}] } });
|
|
496
|
+
|
|
497
|
+
class LineRefundsComponent {
|
|
498
|
+
getRefundedCount() {
|
|
499
|
+
const refunds = this.payments?.reduce((all, payment) => [...all, ...payment.refunds], []) ?? [];
|
|
500
|
+
return this.line.items.filter(i => {
|
|
501
|
+
if (i.refundId === null && !i.cancelled) {
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
if (i.refundId) {
|
|
505
|
+
const refund = refunds.find(r => r.id === i.refundId);
|
|
506
|
+
if (refund?.state === 'Failed') {
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
return true;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
return false;
|
|
514
|
+
}).length;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
LineRefundsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LineRefundsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
518
|
+
LineRefundsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i3$3.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }], pipes: { "translate": i4.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LineRefundsComponent, decorators: [{
|
|
520
|
+
type: Component,
|
|
521
|
+
args: [{ selector: 'vdr-line-refunds', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
522
|
+
}], propDecorators: { line: [{
|
|
523
|
+
type: Input
|
|
524
|
+
}], payments: [{
|
|
525
|
+
type: Input
|
|
526
|
+
}] } });
|
|
527
|
+
|
|
528
|
+
class LineFulfillmentComponent {
|
|
529
|
+
constructor() {
|
|
530
|
+
this.fulfilledCount = 0;
|
|
531
|
+
this.fulfillments = [];
|
|
532
|
+
}
|
|
533
|
+
ngOnChanges(changes) {
|
|
534
|
+
if (this.line) {
|
|
535
|
+
this.fulfilledCount = this.getDeliveredCount(this.line);
|
|
536
|
+
this.fulfillmentStatus = this.getFulfillmentStatus(this.fulfilledCount, this.line.items.length);
|
|
537
|
+
this.fulfillments = this.getFulfillments(this.line);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Returns the number of items in an OrderLine which are fulfilled.
|
|
542
|
+
*/
|
|
543
|
+
getDeliveredCount(line) {
|
|
544
|
+
return (line.fulfillments?.reduce((sum, fulfillment) => sum + (fulfillment.summary.find(s => s.orderLine.id === line.id)?.quantity ?? 0), 0) ?? 0);
|
|
545
|
+
}
|
|
546
|
+
getFulfillmentStatus(fulfilledCount, lineQuantity) {
|
|
547
|
+
if (fulfilledCount === lineQuantity) {
|
|
548
|
+
return 'full';
|
|
549
|
+
}
|
|
550
|
+
if (0 < fulfilledCount && fulfilledCount < lineQuantity) {
|
|
551
|
+
return 'partial';
|
|
552
|
+
}
|
|
553
|
+
return 'none';
|
|
554
|
+
}
|
|
555
|
+
getFulfillments(line) {
|
|
556
|
+
return (line.fulfillments?.map(fulfillment => {
|
|
557
|
+
const summaryLine = fulfillment.summary.find(s => s.orderLine.id === line.id);
|
|
558
|
+
return {
|
|
559
|
+
count: summaryLine?.quantity ?? 0,
|
|
560
|
+
fulfillment,
|
|
561
|
+
};
|
|
562
|
+
}) ?? []);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
LineFulfillmentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LineFulfillmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
566
|
+
LineFulfillmentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: { line: "line", 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-500)}.item-partially-fulfilled{color:var(--color-warning-500)}.item-not-fulfilled{color:var(--color-error-500)}.fulfillment-detail{margin:6px 12px}.fulfillment-detail:not(:last-of-type){border-bottom:1px dashed var(--color-component-border-200)}\n"], components: [{ type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i4.TranslatePipe, "localeDate": i1.LocaleDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
567
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LineFulfillmentComponent, decorators: [{
|
|
568
|
+
type: Component,
|
|
569
|
+
args: [{ selector: 'vdr-line-fulfillment', changeDetection: ChangeDetectionStrategy.OnPush, 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-500)}.item-partially-fulfilled{color:var(--color-warning-500)}.item-not-fulfilled{color:var(--color-error-500)}.fulfillment-detail{margin:6px 12px}.fulfillment-detail:not(:last-of-type){border-bottom:1px dashed var(--color-component-border-200)}\n"] }]
|
|
570
|
+
}], propDecorators: { line: [{
|
|
571
|
+
type: Input
|
|
572
|
+
}], orderState: [{
|
|
573
|
+
type: Input
|
|
574
|
+
}] } });
|
|
575
|
+
|
|
576
|
+
class OrderTableComponent {
|
|
577
|
+
constructor() {
|
|
578
|
+
this.isDraft = false;
|
|
579
|
+
this.adjust = new EventEmitter();
|
|
580
|
+
this.remove = new EventEmitter();
|
|
581
|
+
this.orderLineCustomFieldsVisible = false;
|
|
582
|
+
this.customFieldsForLine = {};
|
|
583
|
+
}
|
|
584
|
+
get visibleOrderLineCustomFields() {
|
|
585
|
+
return this.orderLineCustomFieldsVisible ? this.orderLineCustomFields : [];
|
|
586
|
+
}
|
|
587
|
+
get showElided() {
|
|
588
|
+
return !this.orderLineCustomFieldsVisible && 0 < this.orderLineCustomFields.length;
|
|
589
|
+
}
|
|
590
|
+
ngOnInit() {
|
|
591
|
+
this.orderLineCustomFieldsVisible = this.orderLineCustomFields.length < 2;
|
|
592
|
+
this.getLineCustomFields();
|
|
593
|
+
}
|
|
594
|
+
draftInputBlur(line, quantity) {
|
|
595
|
+
if (line.quantity !== quantity) {
|
|
596
|
+
this.adjust.emit({ lineId: line.id, quantity });
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
toggleOrderLineCustomFields() {
|
|
600
|
+
this.orderLineCustomFieldsVisible = !this.orderLineCustomFieldsVisible;
|
|
601
|
+
}
|
|
602
|
+
getLineDiscounts(line) {
|
|
603
|
+
return line.discounts.filter(a => a.type === AdjustmentType.PROMOTION);
|
|
604
|
+
}
|
|
605
|
+
getLineCustomFields() {
|
|
606
|
+
for (const line of this.order.lines) {
|
|
607
|
+
const formGroup = new FormGroup({});
|
|
608
|
+
const result = this.orderLineCustomFields
|
|
609
|
+
.map(config => {
|
|
610
|
+
const value = line.customFields[config.name];
|
|
611
|
+
formGroup.addControl(config.name, new FormControl(value));
|
|
612
|
+
return {
|
|
613
|
+
config,
|
|
614
|
+
formGroup,
|
|
615
|
+
value,
|
|
616
|
+
};
|
|
617
|
+
})
|
|
618
|
+
.filter(field => {
|
|
619
|
+
return this.orderLineCustomFieldsVisible ? true : field.value != null;
|
|
620
|
+
});
|
|
621
|
+
this.customFieldsForLine[line.id] = result;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
getPromotionLink(promotion) {
|
|
625
|
+
const id = promotion.adjustmentSource.split(':')[1];
|
|
626
|
+
return ['/marketing', 'promotions', id];
|
|
627
|
+
}
|
|
628
|
+
getCouponCodeForAdjustment(order, promotionAdjustment) {
|
|
629
|
+
const id = promotionAdjustment.adjustmentSource.split(':')[1];
|
|
630
|
+
const promotion = order.promotions.find(p => p.id === id);
|
|
631
|
+
if (promotion) {
|
|
632
|
+
return promotion.couponCode || undefined;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
getShippingNames(order) {
|
|
636
|
+
if (order.shippingLines.length) {
|
|
637
|
+
return order.shippingLines.map(shippingLine => shippingLine.shippingMethod.name).join(', ');
|
|
638
|
+
}
|
|
639
|
+
else {
|
|
640
|
+
return '';
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
OrderTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
645
|
+
OrderTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderTableComponent, selector: "vdr-order-table", inputs: { order: "order", orderLineCustomFields: "orderLineCustomFields", isDraft: "isDraft" }, outputs: { adjust: "adjust", remove: "remove" }, ngImport: i0, template: "<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>{{ 'order.total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let line of order.lines\">\r\n <tr class=\"order-line\" [class.is-cancelled]=\"line.quantity === 0\">\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 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 <ng-container *ngIf=\"!isDraft; else draft\">\r\n {{ line.quantity }}\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 [line]=\"line\" [orderState]=\"order.state\"></vdr-line-fulfillment>\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\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 </td>\r\n </tr>\r\n <ng-container *ngIf=\"customFieldsForLine[line.id] as customFields\">\r\n <tr *ngIf=\"customFields.length\">\r\n <td colspan=\"6\" class=\"custom-fields-row\">\r\n <div class=\"order-line-custom-fields\">\r\n <div class=\"custom-field\" *ngFor=\"let field of customFields\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [readonly]=\"true\"\r\n [customField]=\"field.config\"\r\n [customFieldsFormGroup]=\"field.formGroup\"\r\n ></vdr-custom-field-control>\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\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\" colspan=\"2\"></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 <ng-container *ngFor=\"let discount of order.discounts\">\r\n <tr class=\"order-adjustment\" *ngIf=\"discount.type !== 'OTHER'\">\r\n <td colspan=\"5\" class=\"left clr-align-middle\">\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=\"clr-align-middle\">\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 </tr>\r\n </ng-container>\r\n <tr class=\"sub-total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.sub-total' | translate }}</td>\r\n <td colspan=\"4\"></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 </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\">{{ getShippingNames(order) }}</td>\r\n <td colspan=\"3\"></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 <tr class=\"total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.total' | translate }}</td>\r\n <td colspan=\"4\"></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 </tr>\r\n </tbody>\r\n</table>\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-right: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)}.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}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-left:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"], components: [{ type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: ["line", "orderState"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }, { type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
646
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderTableComponent, decorators: [{
|
|
647
|
+
type: Component,
|
|
648
|
+
args: [{ selector: 'vdr-order-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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>{{ 'order.total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let line of order.lines\">\r\n <tr class=\"order-line\" [class.is-cancelled]=\"line.quantity === 0\">\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 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 <ng-container *ngIf=\"!isDraft; else draft\">\r\n {{ line.quantity }}\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 [line]=\"line\" [orderState]=\"order.state\"></vdr-line-fulfillment>\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\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 </td>\r\n </tr>\r\n <ng-container *ngIf=\"customFieldsForLine[line.id] as customFields\">\r\n <tr *ngIf=\"customFields.length\">\r\n <td colspan=\"6\" class=\"custom-fields-row\">\r\n <div class=\"order-line-custom-fields\">\r\n <div class=\"custom-field\" *ngFor=\"let field of customFields\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [readonly]=\"true\"\r\n [customField]=\"field.config\"\r\n [customFieldsFormGroup]=\"field.formGroup\"\r\n ></vdr-custom-field-control>\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\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\" colspan=\"2\"></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 <ng-container *ngFor=\"let discount of order.discounts\">\r\n <tr class=\"order-adjustment\" *ngIf=\"discount.type !== 'OTHER'\">\r\n <td colspan=\"5\" class=\"left clr-align-middle\">\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=\"clr-align-middle\">\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 </tr>\r\n </ng-container>\r\n <tr class=\"sub-total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.sub-total' | translate }}</td>\r\n <td colspan=\"4\"></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 </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\">{{ getShippingNames(order) }}</td>\r\n <td colspan=\"3\"></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 <tr class=\"total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.total' | translate }}</td>\r\n <td colspan=\"4\"></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 </tr>\r\n </tbody>\r\n</table>\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-right: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)}.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}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-left:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"] }]
|
|
649
|
+
}], propDecorators: { order: [{
|
|
650
|
+
type: Input
|
|
651
|
+
}], orderLineCustomFields: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], isDraft: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}], adjust: [{
|
|
656
|
+
type: Output
|
|
657
|
+
}], remove: [{
|
|
658
|
+
type: Output
|
|
659
|
+
}] } });
|
|
660
|
+
|
|
661
|
+
class OrderCustomFieldsCardComponent {
|
|
662
|
+
constructor(formBuilder, modalService) {
|
|
663
|
+
this.formBuilder = formBuilder;
|
|
664
|
+
this.modalService = modalService;
|
|
665
|
+
this.customFieldsConfig = [];
|
|
666
|
+
this.customFieldValues = {};
|
|
667
|
+
this.updateClick = new EventEmitter();
|
|
668
|
+
this.editable = false;
|
|
669
|
+
}
|
|
670
|
+
ngOnInit() {
|
|
671
|
+
this.customFieldForm = this.formBuilder.group({});
|
|
672
|
+
for (const field of this.customFieldsConfig) {
|
|
673
|
+
this.customFieldForm.addControl(field.name, this.formBuilder.control(this.customFieldValues[field.name]));
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
onUpdateClick() {
|
|
677
|
+
this.updateClick.emit(this.customFieldForm.value);
|
|
678
|
+
this.customFieldForm.markAsPristine();
|
|
679
|
+
this.editable = false;
|
|
680
|
+
}
|
|
681
|
+
onCancelClick() {
|
|
682
|
+
if (this.customFieldForm.dirty) {
|
|
683
|
+
this.modalService
|
|
684
|
+
.dialog({
|
|
685
|
+
title: marker('catalog.confirm-cancel'),
|
|
686
|
+
buttons: [
|
|
687
|
+
{ type: 'secondary', label: marker('common.keep-editing') },
|
|
688
|
+
{ type: 'danger', label: marker('common.discard-changes'), returnValue: true },
|
|
689
|
+
],
|
|
690
|
+
})
|
|
691
|
+
.subscribe(result => {
|
|
692
|
+
if (result) {
|
|
693
|
+
this.customFieldForm.reset();
|
|
694
|
+
this.customFieldForm.markAsPristine();
|
|
695
|
+
this.editable = false;
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
this.editable = false;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
OrderCustomFieldsCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderCustomFieldsCardComponent, deps: [{ token: i3$1.FormBuilder }, { token: i1.ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
705
|
+
OrderCustomFieldsCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }], pipes: { "translate": i4.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderCustomFieldsCardComponent, decorators: [{
|
|
707
|
+
type: Component,
|
|
708
|
+
args: [{ selector: 'vdr-order-custom-fields-card', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
709
|
+
}], ctorParameters: function () { return [{ type: i3$1.FormBuilder }, { type: i1.ModalService }]; }, propDecorators: { customFieldsConfig: [{
|
|
710
|
+
type: Input
|
|
711
|
+
}], customFieldValues: [{
|
|
712
|
+
type: Input
|
|
713
|
+
}], updateClick: [{
|
|
714
|
+
type: Output
|
|
715
|
+
}] } });
|
|
716
|
+
|
|
717
|
+
class DraftOrderDetailComponent extends BaseDetailComponent {
|
|
718
|
+
constructor(router, route, serverConfigService, changeDetector, dataService, notificationService, modalService, orderTransitionService) {
|
|
719
|
+
super(route, router, serverConfigService, dataService);
|
|
720
|
+
this.changeDetector = changeDetector;
|
|
721
|
+
this.dataService = dataService;
|
|
722
|
+
this.notificationService = notificationService;
|
|
723
|
+
this.modalService = modalService;
|
|
724
|
+
this.orderTransitionService = orderTransitionService;
|
|
725
|
+
this.detailForm = new FormGroup({});
|
|
726
|
+
this.fetchHistory = new Subject();
|
|
727
|
+
this.displayCouponCodeInput = false;
|
|
26
728
|
}
|
|
27
729
|
ngOnInit() {
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
|
|
730
|
+
this.init();
|
|
731
|
+
this.orderLineCustomFields = this.getCustomFieldConfig('OrderLine');
|
|
732
|
+
this.eligibleShippingMethods$ = this.entity$.pipe(switchMap(order => this.dataService.order
|
|
733
|
+
.getDraftOrderEligibleShippingMethods(order.id)
|
|
734
|
+
.mapSingle(({ eligibleShippingMethodsForDraftOrder }) => eligibleShippingMethodsForDraftOrder)));
|
|
735
|
+
this.customFields = this.getCustomFieldConfig('Order');
|
|
736
|
+
this.orderLineCustomFields = this.getCustomFieldConfig('OrderLine');
|
|
31
737
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
738
|
+
ngOnDestroy() {
|
|
739
|
+
this.destroy();
|
|
740
|
+
}
|
|
741
|
+
addItemToOrder(event) {
|
|
742
|
+
this.dataService.order.addItemToDraftOrder(this.id, event).subscribe(result => {
|
|
743
|
+
if (result.addItemToDraftOrder.__typename !== 'Order') {
|
|
744
|
+
this.notificationService.error(result.addItemToDraftOrder.message);
|
|
745
|
+
}
|
|
37
746
|
});
|
|
38
747
|
}
|
|
39
|
-
|
|
40
|
-
this.
|
|
748
|
+
adjustOrderLine(event) {
|
|
749
|
+
this.dataService.order
|
|
750
|
+
.adjustDraftOrderLine(this.id, { orderLineId: event.lineId, quantity: event.quantity })
|
|
751
|
+
.subscribe(result => {
|
|
752
|
+
if (result.adjustDraftOrderLine.__typename !== 'Order') {
|
|
753
|
+
this.notificationService.error(result.adjustDraftOrderLine.message);
|
|
754
|
+
}
|
|
755
|
+
});
|
|
41
756
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}], ctorParameters: function () { return [{ type: i1.DataService }]; } });
|
|
49
|
-
|
|
50
|
-
class CancelOrderDialogComponent {
|
|
51
|
-
constructor(i18nService) {
|
|
52
|
-
this.i18nService = i18nService;
|
|
53
|
-
this.cancelAll = true;
|
|
54
|
-
this.lineQuantities = {};
|
|
55
|
-
this.reasons = getAppConfig().cancellationReasons ?? [
|
|
56
|
-
marker('order.cancel-reason-customer-request'),
|
|
57
|
-
marker('order.cancel-reason-not-available'),
|
|
58
|
-
];
|
|
59
|
-
this.reasons = this.reasons.map(r => this.i18nService.translate(r));
|
|
757
|
+
removeOrderLine(event) {
|
|
758
|
+
this.dataService.order.removeDraftOrderLine(this.id, event.lineId).subscribe(result => {
|
|
759
|
+
if (result.removeDraftOrderLine.__typename !== 'Order') {
|
|
760
|
+
this.notificationService.error(result.removeDraftOrderLine.message);
|
|
761
|
+
}
|
|
762
|
+
});
|
|
60
763
|
}
|
|
61
|
-
|
|
62
|
-
|
|
764
|
+
getOrderAddressLines(orderAddress) {
|
|
765
|
+
if (!orderAddress) {
|
|
766
|
+
return [];
|
|
767
|
+
}
|
|
768
|
+
return Object.values(orderAddress)
|
|
769
|
+
.filter(val => val !== 'OrderAddress')
|
|
770
|
+
.filter(line => !!line);
|
|
63
771
|
}
|
|
64
|
-
|
|
65
|
-
this.
|
|
66
|
-
|
|
67
|
-
|
|
772
|
+
setCustomer() {
|
|
773
|
+
this.modalService.fromComponent(SelectCustomerDialogComponent).subscribe(result => {
|
|
774
|
+
if (this.hasId(result)) {
|
|
775
|
+
this.dataService.order
|
|
776
|
+
.setCustomerForDraftOrder(this.id, { customerId: result.id })
|
|
777
|
+
.subscribe();
|
|
778
|
+
}
|
|
779
|
+
else if (result) {
|
|
780
|
+
this.dataService.order.setCustomerForDraftOrder(this.id, { input: result }).subscribe();
|
|
781
|
+
}
|
|
782
|
+
});
|
|
68
783
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
784
|
+
setShippingAddress() {
|
|
785
|
+
this.entity$
|
|
786
|
+
.pipe(take(1), switchMap(order => {
|
|
787
|
+
return this.modalService.fromComponent(SelectAddressDialogComponent, {
|
|
788
|
+
locals: {
|
|
789
|
+
customerId: order.customer?.id,
|
|
790
|
+
currentAddress: order.shippingAddress ?? undefined,
|
|
791
|
+
},
|
|
792
|
+
});
|
|
793
|
+
}))
|
|
794
|
+
.subscribe(result => {
|
|
795
|
+
if (result) {
|
|
796
|
+
this.dataService.order.setDraftOrderShippingAddress(this.id, result).subscribe();
|
|
73
797
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
setBillingAddress() {
|
|
801
|
+
this.entity$
|
|
802
|
+
.pipe(take(1), switchMap(order => {
|
|
803
|
+
return this.modalService.fromComponent(SelectAddressDialogComponent, {
|
|
804
|
+
locals: {
|
|
805
|
+
customerId: order.customer?.id,
|
|
806
|
+
currentAddress: order.billingAddress ?? undefined,
|
|
807
|
+
},
|
|
808
|
+
});
|
|
809
|
+
}))
|
|
810
|
+
.subscribe(result => {
|
|
811
|
+
if (result) {
|
|
812
|
+
this.dataService.order.setDraftOrderBillingAddress(this.id, result).subscribe();
|
|
78
813
|
}
|
|
79
|
-
}
|
|
814
|
+
});
|
|
80
815
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
816
|
+
applyCouponCode(couponCode) {
|
|
817
|
+
this.dataService.order.applyCouponCodeToDraftOrder(this.id, couponCode).subscribe();
|
|
818
|
+
}
|
|
819
|
+
removeCouponCode(couponCode) {
|
|
820
|
+
this.dataService.order.removeCouponCodeFromDraftOrder(this.id, couponCode).subscribe();
|
|
821
|
+
}
|
|
822
|
+
setShippingMethod() {
|
|
823
|
+
combineLatest(this.entity$, this.eligibleShippingMethods$)
|
|
824
|
+
.pipe(take(1), switchMap(([order, methods]) => this.modalService.fromComponent(SelectShippingMethodDialogComponent, {
|
|
825
|
+
locals: {
|
|
826
|
+
eligibleShippingMethods: methods,
|
|
827
|
+
currencyCode: order.currencyCode,
|
|
828
|
+
currentSelectionId: order.shippingLines?.[0]?.shippingMethod.id,
|
|
829
|
+
},
|
|
830
|
+
})))
|
|
831
|
+
.subscribe(result => {
|
|
832
|
+
if (result) {
|
|
833
|
+
this.dataService.order.setDraftOrderShippingMethod(this.id, result).subscribe();
|
|
86
834
|
}
|
|
87
|
-
}
|
|
88
|
-
// If we got here, all of the selected quantities are equal to the order
|
|
89
|
-
// line quantities, i.e. everything is selected.
|
|
90
|
-
this.cancelAll = true;
|
|
835
|
+
});
|
|
91
836
|
}
|
|
92
|
-
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
837
|
+
updateCustomFields(customFieldsValue) {
|
|
838
|
+
this.dataService.order
|
|
839
|
+
.updateOrderCustomFields({
|
|
840
|
+
id: this.id,
|
|
841
|
+
customFields: customFieldsValue,
|
|
842
|
+
})
|
|
843
|
+
.subscribe();
|
|
844
|
+
}
|
|
845
|
+
deleteOrder() {
|
|
846
|
+
this.dataService.order.deleteDraftOrder(this.id).subscribe(({ deleteDraftOrder }) => {
|
|
847
|
+
if (deleteDraftOrder.result === DeletionResult.DELETED) {
|
|
848
|
+
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
849
|
+
entity: 'Order',
|
|
850
|
+
});
|
|
851
|
+
this.router.navigate(['/orders']);
|
|
852
|
+
}
|
|
853
|
+
else if (deleteDraftOrder.message) {
|
|
854
|
+
this.notificationService.error(deleteDraftOrder.message);
|
|
855
|
+
}
|
|
98
856
|
});
|
|
99
857
|
}
|
|
100
|
-
|
|
101
|
-
this.
|
|
858
|
+
completeOrder() {
|
|
859
|
+
this.dataService.order
|
|
860
|
+
.transitionToState(this.id, 'ArrangingPayment')
|
|
861
|
+
.subscribe(({ transitionOrderToState }) => {
|
|
862
|
+
if (transitionOrderToState?.__typename === 'Order') {
|
|
863
|
+
this.router.navigate(['/orders', this.id]);
|
|
864
|
+
}
|
|
865
|
+
else if (transitionOrderToState?.__typename === 'OrderStateTransitionError') {
|
|
866
|
+
this.notificationService.error(transitionOrderToState.transitionError);
|
|
867
|
+
}
|
|
868
|
+
});
|
|
102
869
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.map(([orderLineId, quantity]) => ({
|
|
109
|
-
orderLineId,
|
|
110
|
-
quantity,
|
|
111
|
-
}))
|
|
112
|
-
.filter(l => 0 < l.quantity);
|
|
870
|
+
hasId(input) {
|
|
871
|
+
return typeof input === 'object' && !!input.id;
|
|
872
|
+
}
|
|
873
|
+
setFormValues(entity) {
|
|
874
|
+
// empty
|
|
113
875
|
}
|
|
114
876
|
}
|
|
115
|
-
|
|
116
|
-
CancelOrderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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-left: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"], components: [{ type: i2.ClrRadioWrapper, selector: "clr-radio-wrapper" }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { type: i2.ClrRadio, selector: "[clrRadio]" }, { type: i2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type:
|
|
877
|
+
DraftOrderDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DraftOrderDetailComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i1.ServerConfigService }, { token: i0.ChangeDetectorRef }, { token: i1.DataService }, { token: i1.NotificationService }, { token: i1.ModalService }, { token: OrderTransitionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
878
|
+
DraftOrderDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DraftOrderDetailComponent, selector: "vdr-draft-order-detail", usesInheritance: true, ngImport: i0, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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\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\" class=\"btn\" 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\r\n<div *ngIf=\"entity$ | async as order\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-lg-8\">\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 <div class=\"flex\">\r\n <button\r\n *ngIf=\"order.couponCodes.length === 0 && !displayCouponCodeInput\"\r\n class=\"btn btn-link btn-sm mr2\"\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 </div>\r\n <ng-container *ngIf=\"order.taxSummary.length\">\r\n <h4>{{ 'order.tax-summary' | translate }}</h4>\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 </div>\r\n <div class=\"clr-col-lg-4 order-cards\">\r\n <div class=\"card\">\r\n <div class=\"card-header\">\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 {{ 'order.customer' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <vdr-customer-label\r\n class=\"block mb2\"\r\n *ngIf=\"order.customer\"\r\n [customer]=\"order.customer\"\r\n ></vdr-customer-label>\r\n <button class=\"btn btn-link btn-sm\" (click)=\"setCustomer()\">\r\n {{ 'order.set-customer-for-order' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <h4 class=\"card-title\">\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 {{ 'order.billing-address' | translate }}\r\n </h4>\r\n <div class=\"card-text\">\r\n <vdr-formatted-address\r\n class=\"block mb2\"\r\n *ngIf=\"order.billingAddress\"\r\n [address]=\"order.billingAddress\"\r\n ></vdr-formatted-address>\r\n <button class=\"btn btn-link btn-sm\" (click)=\"setBillingAddress()\">\r\n {{ 'order.set-billing-address' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card\">\r\n <div class=\"card-header\">\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 {{ 'order.shipping' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <vdr-formatted-address\r\n class=\"block mb2\"\r\n *ngIf=\"order.shippingAddress\"\r\n [address]=\"order.shippingAddress\"\r\n ></vdr-formatted-address>\r\n <button class=\"btn btn-link btn-sm\" (click)=\"setShippingAddress()\">\r\n {{ 'order.set-shipping-address' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <div *ngFor=\"let shippingLine of order.shippingLines\">\r\n {{ shippingLine.shippingMethod.name }}\r\n </div>\r\n <button class=\"btn btn-link btn-sm\" (click)=\"setShippingMethod()\">\r\n {{ 'order.set-shipping-method' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\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 </div>\r\n </div>\r\n</div>\r\n", styles: [""], components: [{ type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { type: i1.EntityInfoComponent, selector: "vdr-entity-info", inputs: ["small", "entity"] }, { type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { type: DraftOrderVariantSelectorComponent, selector: "vdr-draft-order-variant-selector", inputs: ["currencyCode", "orderLineCustomFields"], outputs: ["addItem"] }, { type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { type: CouponCodeSelectorComponent, selector: "vdr-coupon-code-selector", inputs: ["couponCodes", "control"], outputs: ["addCouponCode", "removeCouponCode"] }, { type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { type: OrderCustomFieldsCardComponent, selector: "vdr-order-custom-fields-card", inputs: ["customFieldsConfig", "customFieldValues"], outputs: ["updateClick"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i4.TranslatePipe, "percent": i4$1.PercentPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
879
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DraftOrderDetailComponent, decorators: [{
|
|
118
880
|
type: Component,
|
|
119
|
-
args: [{ selector: 'vdr-
|
|
120
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
881
|
+
args: [{ selector: 'vdr-draft-order-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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\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\" class=\"btn\" 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\r\n<div *ngIf=\"entity$ | async as order\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-lg-8\">\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 <div class=\"flex\">\r\n <button\r\n *ngIf=\"order.couponCodes.length === 0 && !displayCouponCodeInput\"\r\n class=\"btn btn-link btn-sm mr2\"\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 </div>\r\n <ng-container *ngIf=\"order.taxSummary.length\">\r\n <h4>{{ 'order.tax-summary' | translate }}</h4>\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 </div>\r\n <div class=\"clr-col-lg-4 order-cards\">\r\n <div class=\"card\">\r\n <div class=\"card-header\">\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 {{ 'order.customer' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <vdr-customer-label\r\n class=\"block mb2\"\r\n *ngIf=\"order.customer\"\r\n [customer]=\"order.customer\"\r\n ></vdr-customer-label>\r\n <button class=\"btn btn-link btn-sm\" (click)=\"setCustomer()\">\r\n {{ 'order.set-customer-for-order' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <h4 class=\"card-title\">\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 {{ 'order.billing-address' | translate }}\r\n </h4>\r\n <div class=\"card-text\">\r\n <vdr-formatted-address\r\n class=\"block mb2\"\r\n *ngIf=\"order.billingAddress\"\r\n [address]=\"order.billingAddress\"\r\n ></vdr-formatted-address>\r\n <button class=\"btn btn-link btn-sm\" (click)=\"setBillingAddress()\">\r\n {{ 'order.set-billing-address' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card\">\r\n <div class=\"card-header\">\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 {{ 'order.shipping' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <vdr-formatted-address\r\n class=\"block mb2\"\r\n *ngIf=\"order.shippingAddress\"\r\n [address]=\"order.shippingAddress\"\r\n ></vdr-formatted-address>\r\n <button class=\"btn btn-link btn-sm\" (click)=\"setShippingAddress()\">\r\n {{ 'order.set-shipping-address' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <div *ngFor=\"let shippingLine of order.shippingLines\">\r\n {{ shippingLine.shippingMethod.name }}\r\n </div>\r\n <button class=\"btn btn-link btn-sm\" (click)=\"setShippingMethod()\">\r\n {{ 'order.set-shipping-method' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\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 </div>\r\n </div>\r\n</div>\r\n", styles: [""] }]
|
|
882
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i1.ServerConfigService }, { type: i0.ChangeDetectorRef }, { type: i1.DataService }, { type: i1.NotificationService }, { type: i1.ModalService }, { type: OrderTransitionService }]; } });
|
|
121
883
|
|
|
122
884
|
class FulfillOrderDialogComponent {
|
|
123
885
|
constructor(dataService, changeDetector) {
|
|
@@ -155,7 +917,11 @@ class FulfillOrderDialogComponent {
|
|
|
155
917
|
return effectiveTracInventory ? Math.min(unfulfilledCount, stockOnHand) : unfulfilledCount;
|
|
156
918
|
}
|
|
157
919
|
getUnfulfilledCount(line) {
|
|
158
|
-
const fulfilled = line.
|
|
920
|
+
const fulfilled = line.fulfillments
|
|
921
|
+
?.map(f => f.summary)
|
|
922
|
+
.flat()
|
|
923
|
+
.filter(row => row.orderLine.id === line.id)
|
|
924
|
+
.reduce((sum, row) => sum + row.quantity, 0) ?? 0;
|
|
159
925
|
return line.quantity - fulfilled;
|
|
160
926
|
}
|
|
161
927
|
canSubmit() {
|
|
@@ -178,7 +944,7 @@ class FulfillOrderDialogComponent {
|
|
|
178
944
|
}
|
|
179
945
|
}
|
|
180
946
|
FulfillOrderDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FulfillOrderDialogComponent, deps: [{ token: i1.DataService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
181
|
-
FulfillOrderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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}.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-left: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"], components: [{ type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { type: i1.ConfigurableInputComponent, selector: "vdr-configurable-input", inputs: ["operation", "operationDefinition", "readonly", "removable"], outputs: ["remove"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
947
|
+
FulfillOrderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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}.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-left: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"], components: [{ type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { type: i1.ConfigurableInputComponent, selector: "vdr-configurable-input", inputs: ["operation", "operationDefinition", "readonly", "removable", "position"], outputs: ["remove"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
182
948
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FulfillOrderDialogComponent, decorators: [{
|
|
183
949
|
type: Component,
|
|
184
950
|
args: [{ selector: 'vdr-fulfill-order-dialog', changeDetection: ChangeDetectionStrategy.OnPush, 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}.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-left: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"] }]
|
|
@@ -198,7 +964,7 @@ class FulfillmentStateLabelComponent {
|
|
|
198
964
|
}
|
|
199
965
|
}
|
|
200
966
|
FulfillmentStateLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FulfillmentStateLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
201
|
-
FulfillmentStateLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type:
|
|
967
|
+
FulfillmentStateLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }], pipes: { "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
202
968
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FulfillmentStateLabelComponent, decorators: [{
|
|
203
969
|
type: Component,
|
|
204
970
|
args: [{ selector: 'vdr-fulfillment-state-label', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
@@ -209,7 +975,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
209
975
|
class SimpleItemListComponent {
|
|
210
976
|
}
|
|
211
977
|
SimpleItemListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SimpleItemListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
212
|
-
SimpleItemListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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-left:2px}.items-list ul li{line-height:14px;text-overflow:ellipsis;overflow:hidden}.items-list .quantity{min-width:16px;display:inline-block}\n"], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type:
|
|
978
|
+
SimpleItemListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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-left:2px}.items-list ul li{line-height:14px;text-overflow:ellipsis;overflow:hidden}.items-list .quantity{min-width:16px;display:inline-block}\n"], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
213
979
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SimpleItemListComponent, decorators: [{
|
|
214
980
|
type: Component,
|
|
215
981
|
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-left:2px}.items-list ul li{line-height:14px;text-overflow:ellipsis;overflow:hidden}.items-list .quantity{min-width:16px;display:inline-block}\n"] }]
|
|
@@ -233,22 +999,13 @@ class FulfillmentDetailComponent {
|
|
|
233
999
|
return this.order.fulfillments && this.order.fulfillments.find(f => f.id === this.fulfillmentId);
|
|
234
1000
|
}
|
|
235
1001
|
get items() {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
itemMap.set(line.productVariant.name, count + 1);
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
itemMap.set(line.productVariant.name, 1);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return Array.from(itemMap.entries()).map(([name, quantity]) => ({ name, quantity }));
|
|
1002
|
+
return (this.fulfillment?.summary.map(row => {
|
|
1003
|
+
return {
|
|
1004
|
+
name: this.order.lines.find(line => line.id === row.orderLine.id)?.productVariant.name ??
|
|
1005
|
+
'',
|
|
1006
|
+
quantity: row.quantity,
|
|
1007
|
+
};
|
|
1008
|
+
}) ?? []);
|
|
252
1009
|
}
|
|
253
1010
|
buildCustomFieldsFormGroup() {
|
|
254
1011
|
const customFields = this.fulfillment.customFields;
|
|
@@ -294,114 +1051,21 @@ class FulfillmentCardComponent {
|
|
|
294
1051
|
if (!this.fulfillment) {
|
|
295
1052
|
return [];
|
|
296
1053
|
}
|
|
297
|
-
const suggested = this.nextSuggestedState();
|
|
298
|
-
return this.fulfillment.nextStates.filter(s => s !== suggested);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
FulfillmentCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FulfillmentCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
302
|
-
FulfillmentCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 class=\"btn\"\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"], components: [{ type: FulfillmentStateLabelComponent, selector: "vdr-fulfillment-state-label", inputs: ["state"] }, { type: FulfillmentDetailComponent, selector: "vdr-fulfillment-detail", inputs: ["fulfillmentId", "order"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i2.ClrIconCustomTag, selector: "clr-icon" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }], pipes: { "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FulfillmentCardComponent, decorators: [{
|
|
304
|
-
type: Component,
|
|
305
|
-
args: [{ selector: 'vdr-fulfillment-card', changeDetection: ChangeDetectionStrategy.OnPush, 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 class=\"btn\"\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"] }]
|
|
306
|
-
}], propDecorators: { fulfillment: [{
|
|
307
|
-
type: Input
|
|
308
|
-
}], order: [{
|
|
309
|
-
type: Input
|
|
310
|
-
}], transitionState: [{
|
|
311
|
-
type: Output
|
|
312
|
-
}] } });
|
|
313
|
-
|
|
314
|
-
class LineFulfillmentComponent {
|
|
315
|
-
constructor() {
|
|
316
|
-
this.fulfilledCount = 0;
|
|
317
|
-
this.fulfillments = [];
|
|
318
|
-
}
|
|
319
|
-
ngOnChanges(changes) {
|
|
320
|
-
if (this.line) {
|
|
321
|
-
this.fulfilledCount = this.getDeliveredCount(this.line);
|
|
322
|
-
this.fulfillmentStatus = this.getFulfillmentStatus(this.fulfilledCount, this.line.items.length);
|
|
323
|
-
this.fulfillments = this.getFulfillments(this.line);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Returns the number of items in an OrderLine which are fulfilled.
|
|
328
|
-
*/
|
|
329
|
-
getDeliveredCount(line) {
|
|
330
|
-
return line.items.reduce((sum, item) => sum + (item.fulfillment ? 1 : 0), 0);
|
|
331
|
-
}
|
|
332
|
-
getFulfillmentStatus(fulfilledCount, lineQuantity) {
|
|
333
|
-
if (fulfilledCount === lineQuantity) {
|
|
334
|
-
return 'full';
|
|
335
|
-
}
|
|
336
|
-
if (0 < fulfilledCount && fulfilledCount < lineQuantity) {
|
|
337
|
-
return 'partial';
|
|
338
|
-
}
|
|
339
|
-
return 'none';
|
|
340
|
-
}
|
|
341
|
-
getFulfillments(line) {
|
|
342
|
-
const counts = {};
|
|
343
|
-
for (const item of line.items) {
|
|
344
|
-
if (item.fulfillment) {
|
|
345
|
-
if (counts[item.fulfillment.id] === undefined) {
|
|
346
|
-
counts[item.fulfillment.id] = 1;
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
counts[item.fulfillment.id]++;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
const all = line.items.reduce((fulfillments, item) => {
|
|
354
|
-
return item.fulfillment ? [...fulfillments, item.fulfillment] : fulfillments;
|
|
355
|
-
}, []);
|
|
356
|
-
return Object.entries(counts).map(([id, count]) => {
|
|
357
|
-
return {
|
|
358
|
-
count,
|
|
359
|
-
// tslint:disable-next-line:no-non-null-assertion
|
|
360
|
-
fulfillment: all.find(f => f.id === id),
|
|
361
|
-
};
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
LineFulfillmentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LineFulfillmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
366
|
-
LineFulfillmentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: { line: "line", 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-500)}.item-partially-fulfilled{color:var(--color-warning-500)}.item-not-fulfilled{color:var(--color-error-500)}.fulfillment-detail{margin:6px 12px}.fulfillment-detail:not(:last-of-type){border-bottom:1px dashed var(--color-component-border-200)}\n"], components: [{ type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition"] }, { type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i2.ClrIconCustomTag, selector: "clr-icon" }, { type: i2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i4.TranslatePipe, "localeDate": i1.LocaleDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
367
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LineFulfillmentComponent, decorators: [{
|
|
368
|
-
type: Component,
|
|
369
|
-
args: [{ selector: 'vdr-line-fulfillment', changeDetection: ChangeDetectionStrategy.OnPush, 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-500)}.item-partially-fulfilled{color:var(--color-warning-500)}.item-not-fulfilled{color:var(--color-error-500)}.fulfillment-detail{margin:6px 12px}.fulfillment-detail:not(:last-of-type){border-bottom:1px dashed var(--color-component-border-200)}\n"] }]
|
|
370
|
-
}], propDecorators: { line: [{
|
|
371
|
-
type: Input
|
|
372
|
-
}], orderState: [{
|
|
373
|
-
type: Input
|
|
374
|
-
}] } });
|
|
375
|
-
|
|
376
|
-
class LineRefundsComponent {
|
|
377
|
-
getRefundedCount() {
|
|
378
|
-
const refunds = this.payments?.reduce((all, payment) => [...all, ...payment.refunds], []) ?? [];
|
|
379
|
-
return this.line.items.filter(i => {
|
|
380
|
-
if (i.refundId === null && !i.cancelled) {
|
|
381
|
-
return false;
|
|
382
|
-
}
|
|
383
|
-
if (i.refundId) {
|
|
384
|
-
const refund = refunds.find(r => r.id === i.refundId);
|
|
385
|
-
if (refund?.state === 'Failed') {
|
|
386
|
-
return false;
|
|
387
|
-
}
|
|
388
|
-
else {
|
|
389
|
-
return true;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return false;
|
|
393
|
-
}).length;
|
|
1054
|
+
const suggested = this.nextSuggestedState();
|
|
1055
|
+
return this.fulfillment.nextStates.filter(s => s !== suggested);
|
|
394
1056
|
}
|
|
395
1057
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type:
|
|
1058
|
+
FulfillmentCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FulfillmentCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1059
|
+
FulfillmentCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 class=\"btn\"\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"], components: [{ type: FulfillmentStateLabelComponent, selector: "vdr-fulfillment-state-label", inputs: ["state"] }, { type: FulfillmentDetailComponent, selector: "vdr-fulfillment-detail", inputs: ["fulfillmentId", "order"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }], pipes: { "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FulfillmentCardComponent, decorators: [{
|
|
399
1061
|
type: Component,
|
|
400
|
-
args: [{ selector: 'vdr-
|
|
401
|
-
}], propDecorators: {
|
|
1062
|
+
args: [{ selector: 'vdr-fulfillment-card', changeDetection: ChangeDetectionStrategy.OnPush, 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 class=\"btn\"\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"] }]
|
|
1063
|
+
}], propDecorators: { fulfillment: [{
|
|
402
1064
|
type: Input
|
|
403
|
-
}],
|
|
1065
|
+
}], order: [{
|
|
404
1066
|
type: Input
|
|
1067
|
+
}], transitionState: [{
|
|
1068
|
+
type: Output
|
|
405
1069
|
}] } });
|
|
406
1070
|
|
|
407
1071
|
class ModificationDetailComponent {
|
|
@@ -466,39 +1130,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
466
1130
|
type: Input
|
|
467
1131
|
}] } });
|
|
468
1132
|
|
|
469
|
-
class OrderCustomFieldsCardComponent {
|
|
470
|
-
constructor(formBuilder) {
|
|
471
|
-
this.formBuilder = formBuilder;
|
|
472
|
-
this.customFieldsConfig = [];
|
|
473
|
-
this.customFieldValues = {};
|
|
474
|
-
this.updateClick = new EventEmitter();
|
|
475
|
-
this.editable = false;
|
|
476
|
-
}
|
|
477
|
-
ngOnInit() {
|
|
478
|
-
this.customFieldForm = this.formBuilder.group({});
|
|
479
|
-
for (const field of this.customFieldsConfig) {
|
|
480
|
-
this.customFieldForm.addControl(field.name, this.formBuilder.control(this.customFieldValues[field.name]));
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
onUpdateClick() {
|
|
484
|
-
this.updateClick.emit(this.customFieldForm.value);
|
|
485
|
-
this.customFieldForm.markAsPristine();
|
|
486
|
-
this.editable = false;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
OrderCustomFieldsCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderCustomFieldsCardComponent, deps: [{ token: i3$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
490
|
-
OrderCustomFieldsCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 <ng-container *ngFor=\"let customField of customFieldsConfig\">\r\n <vdr-custom-field-control\r\n entityName=\"Order\"\r\n [customFieldsFormGroup]=\"customFieldForm\"\r\n [compact]=\"true\"\r\n [readonly]=\"customField.readonly || !editable\"\r\n [customField]=\"customField\"\r\n ></vdr-custom-field-control>\r\n </ng-container>\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 </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"], components: [{ type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.ClrIconCustomTag, selector: "clr-icon" }], pipes: { "translate": i4.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
491
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderCustomFieldsCardComponent, decorators: [{
|
|
492
|
-
type: Component,
|
|
493
|
-
args: [{ selector: 'vdr-order-custom-fields-card', changeDetection: ChangeDetectionStrategy.OnPush, 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 <ng-container *ngFor=\"let customField of customFieldsConfig\">\r\n <vdr-custom-field-control\r\n entityName=\"Order\"\r\n [customFieldsFormGroup]=\"customFieldForm\"\r\n [compact]=\"true\"\r\n [readonly]=\"customField.readonly || !editable\"\r\n [customField]=\"customField\"\r\n ></vdr-custom-field-control>\r\n </ng-container>\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 </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"] }]
|
|
494
|
-
}], ctorParameters: function () { return [{ type: i3$1.FormBuilder }]; }, propDecorators: { customFieldsConfig: [{
|
|
495
|
-
type: Input
|
|
496
|
-
}], customFieldValues: [{
|
|
497
|
-
type: Input
|
|
498
|
-
}], updateClick: [{
|
|
499
|
-
type: Output
|
|
500
|
-
}] } });
|
|
501
|
-
|
|
502
1133
|
const NODE_HEIGHT = 72;
|
|
503
1134
|
|
|
504
1135
|
class OrderProcessNodeComponent {
|
|
@@ -534,7 +1165,7 @@ class OrderProcessNodeComponent {
|
|
|
534
1165
|
}
|
|
535
1166
|
}
|
|
536
1167
|
OrderProcessNodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderProcessNodeComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
537
|
-
OrderProcessNodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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-left:-1px}.cancelled-node{margin-left: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"], directives: [{ type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type:
|
|
1168
|
+
OrderProcessNodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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-left:-1px}.cancelled-node{margin-left: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"], directives: [{ type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }], pipes: { "async": i4$1.AsyncPipe, "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
538
1169
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderProcessNodeComponent, decorators: [{
|
|
539
1170
|
type: Component,
|
|
540
1171
|
args: [{ selector: 'vdr-order-process-node', changeDetection: ChangeDetectionStrategy.OnPush, 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-left:-1px}.cancelled-node{margin-left: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"] }]
|
|
@@ -574,7 +1205,7 @@ class OrderProcessEdgeComponent {
|
|
|
574
1205
|
}
|
|
575
1206
|
}
|
|
576
1207
|
OrderProcessEdgeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderProcessEdgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
577
|
-
OrderProcessEdgeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], directives: [{ type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type:
|
|
1208
|
+
OrderProcessEdgeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], directives: [{ type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
578
1209
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderProcessEdgeComponent, decorators: [{
|
|
579
1210
|
type: Component,
|
|
580
1211
|
args: [{ selector: 'vdr-order-process-edge', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
@@ -722,309 +1353,120 @@ class RefundOrderDialogComponent {
|
|
|
722
1353
|
const refunds = this.order.payments?.reduce((all, payment) => [...all, ...payment.refunds], []) ?? [];
|
|
723
1354
|
const refundable = line.items.filter(i => {
|
|
724
1355
|
if (i.cancelled) {
|
|
725
|
-
return false;
|
|
726
|
-
}
|
|
727
|
-
if (i.refundId == null) {
|
|
728
|
-
return true;
|
|
729
|
-
}
|
|
730
|
-
const refund = refunds.find(r => r.id === i.refundId);
|
|
731
|
-
return refund?.state === 'Failed';
|
|
732
|
-
});
|
|
733
|
-
return 0 < refundable.length;
|
|
734
|
-
}
|
|
735
|
-
ngOnInit() {
|
|
736
|
-
this.lineQuantities = this.order.lines.reduce((result, line) => {
|
|
737
|
-
return {
|
|
738
|
-
...result,
|
|
739
|
-
[line.id]: {
|
|
740
|
-
quantity: 0,
|
|
741
|
-
refund: false,
|
|
742
|
-
cancel: false,
|
|
743
|
-
},
|
|
744
|
-
};
|
|
745
|
-
}, {});
|
|
746
|
-
this.settledPayments = (this.order.payments || []).filter(p => p.state === 'Settled');
|
|
747
|
-
if (this.settledPayments.length) {
|
|
748
|
-
this.selectedPayment = this.settledPayments[0];
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
handleZeroQuantity(line) {
|
|
752
|
-
if (line?.quantity === 0) {
|
|
753
|
-
line.cancel = false;
|
|
754
|
-
line.refund = false;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
isRefunding() {
|
|
758
|
-
const result = Object.values(this.lineQuantities).reduce((isRefunding, line) => {
|
|
759
|
-
return isRefunding || (0 < line.quantity && line.refund);
|
|
760
|
-
}, false);
|
|
761
|
-
return result;
|
|
762
|
-
}
|
|
763
|
-
isCancelling() {
|
|
764
|
-
const result = Object.values(this.lineQuantities).reduce((isCancelling, line) => {
|
|
765
|
-
return isCancelling || (0 < line.quantity && line.cancel);
|
|
766
|
-
}, false);
|
|
767
|
-
return result;
|
|
768
|
-
}
|
|
769
|
-
canSubmit() {
|
|
770
|
-
if (this.isRefunding()) {
|
|
771
|
-
return !!(this.selectedPayment &&
|
|
772
|
-
this.reason &&
|
|
773
|
-
0 < this.refundTotal &&
|
|
774
|
-
this.refundTotal <= this.settledPaymentsTotal);
|
|
775
|
-
}
|
|
776
|
-
else if (this.isCancelling()) {
|
|
777
|
-
return !!this.reason;
|
|
778
|
-
}
|
|
779
|
-
return false;
|
|
780
|
-
}
|
|
781
|
-
select() {
|
|
782
|
-
const payment = this.selectedPayment;
|
|
783
|
-
if (payment) {
|
|
784
|
-
const refundLines = this.getOrderLineInput(line => line.refund);
|
|
785
|
-
const cancelLines = this.getOrderLineInput(line => line.cancel);
|
|
786
|
-
this.resolveWith({
|
|
787
|
-
refund: {
|
|
788
|
-
lines: refundLines,
|
|
789
|
-
reason: this.reason,
|
|
790
|
-
shipping: this.refundShipping ? this.order.shippingWithTax : 0,
|
|
791
|
-
adjustment: this.adjustment,
|
|
792
|
-
paymentId: payment.id,
|
|
793
|
-
},
|
|
794
|
-
cancel: {
|
|
795
|
-
lines: cancelLines,
|
|
796
|
-
orderId: this.order.id,
|
|
797
|
-
reason: this.reason,
|
|
798
|
-
cancelShipping: this.refundShipping,
|
|
799
|
-
},
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
cancel() {
|
|
804
|
-
this.resolveWith();
|
|
805
|
-
}
|
|
806
|
-
getOrderLineInput(filterFn) {
|
|
807
|
-
return Object.entries(this.lineQuantities)
|
|
808
|
-
.filter(([orderLineId, line]) => 0 < line.quantity && filterFn(line))
|
|
809
|
-
.map(([orderLineId, line]) => ({
|
|
810
|
-
orderLineId,
|
|
811
|
-
quantity: line.quantity,
|
|
812
|
-
}));
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
RefundOrderDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RefundOrderDialogComponent, deps: [{ token: i1.I18nService }], target: i0.ɵɵFactoryTarget.Component });
|
|
816
|
-
RefundOrderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 mt4\" [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-left:12px}\n"], components: [{ type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition"] }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { type: i2.ClrSelectContainer, selector: "clr-select-container" }, { type: i2.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { type: i2.ClrInputContainer, selector: "clr-input-container" }, { type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { type: i2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i3$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i2.ClrSelect, selector: "[clrSelect]" }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2.ClrInput, selector: "[clrInput]" }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe, "currency": i4$1.CurrencyPipe, "number": i4$1.DecimalPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
817
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RefundOrderDialogComponent, decorators: [{
|
|
818
|
-
type: Component,
|
|
819
|
-
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 mt4\" [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-left:12px}\n"] }]
|
|
820
|
-
}], ctorParameters: function () { return [{ type: i1.I18nService }]; } });
|
|
821
|
-
|
|
822
|
-
class SettleRefundDialogComponent {
|
|
823
|
-
constructor() {
|
|
824
|
-
this.transactionId = '';
|
|
825
|
-
}
|
|
826
|
-
submit() {
|
|
827
|
-
this.resolveWith(this.transactionId);
|
|
828
|
-
}
|
|
829
|
-
cancel() {
|
|
830
|
-
this.resolveWith();
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
SettleRefundDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SettleRefundDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
834
|
-
SettleRefundDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i2.ClrInputContainer, selector: "clr-input-container" }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.ClrInput, selector: "[clrInput]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
835
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SettleRefundDialogComponent, decorators: [{
|
|
836
|
-
type: Component,
|
|
837
|
-
args: [{ selector: 'vdr-settle-refund-dialog', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
838
|
-
}] });
|
|
839
|
-
|
|
840
|
-
class OrderStateSelectDialogComponent {
|
|
841
|
-
constructor() {
|
|
842
|
-
this.nextStates = [];
|
|
843
|
-
this.message = '';
|
|
844
|
-
this.selectedState = '';
|
|
845
|
-
}
|
|
846
|
-
select() {
|
|
847
|
-
if (this.selectedState) {
|
|
848
|
-
this.resolveWith(this.selectedState);
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
cancel() {
|
|
852
|
-
this.resolveWith();
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
OrderStateSelectDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderStateSelectDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
856
|
-
OrderStateSelectDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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<clr-select-container>\r\n <select clrSelect 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</clr-select-container>\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: [""], components: [{ type: i2.ClrSelectContainer, selector: "clr-select-container" }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i2.ClrSelect, selector: "[clrSelect]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
857
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderStateSelectDialogComponent, decorators: [{
|
|
858
|
-
type: Component,
|
|
859
|
-
args: [{ selector: 'vdr-order-state-select-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'order.select-state' | translate }}</ng-template>\r\n<p>{{ message | translate }}</p>\r\n<clr-select-container>\r\n <select clrSelect 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</clr-select-container>\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: [""] }]
|
|
860
|
-
}] });
|
|
861
|
-
|
|
862
|
-
class OrderTransitionService {
|
|
863
|
-
constructor(dataService, modalService, notificationService, i18nService) {
|
|
864
|
-
this.dataService = dataService;
|
|
865
|
-
this.modalService = modalService;
|
|
866
|
-
this.notificationService = notificationService;
|
|
867
|
-
this.i18nService = i18nService;
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* Attempts to transition the Order to the last state it was in before it was transitioned
|
|
871
|
-
* to the "Modifying" state. If this fails, a manual prompt is used.
|
|
872
|
-
*/
|
|
873
|
-
transitionToPreModifyingState(orderId, nextStates) {
|
|
874
|
-
return this.getPreModifyingState(orderId).pipe(switchMap(state => {
|
|
875
|
-
const manualTransitionOptions = {
|
|
876
|
-
orderId,
|
|
877
|
-
nextStates,
|
|
878
|
-
message: this.i18nService.translate(marker('order.unable-to-transition-to-state-try-another'), { state }),
|
|
879
|
-
cancellable: false,
|
|
880
|
-
retry: 10,
|
|
881
|
-
};
|
|
882
|
-
if (state) {
|
|
883
|
-
return this.transitionToStateOrThrow(orderId, state).pipe(catchError(err => this.manuallyTransitionToState(manualTransitionOptions)));
|
|
884
|
-
}
|
|
885
|
-
else {
|
|
886
|
-
return this.manuallyTransitionToState(manualTransitionOptions);
|
|
887
|
-
}
|
|
888
|
-
}));
|
|
889
|
-
}
|
|
890
|
-
/**
|
|
891
|
-
* Displays a modal for manually selecting the next state.
|
|
892
|
-
*/
|
|
893
|
-
manuallyTransitionToState(options) {
|
|
894
|
-
return this.modalService
|
|
895
|
-
.fromComponent(OrderStateSelectDialogComponent, {
|
|
896
|
-
locals: {
|
|
897
|
-
nextStates: options.nextStates,
|
|
898
|
-
cancellable: options.cancellable,
|
|
899
|
-
message: options.message,
|
|
900
|
-
},
|
|
901
|
-
closable: false,
|
|
902
|
-
size: 'md',
|
|
903
|
-
})
|
|
904
|
-
.pipe(switchMap(result => {
|
|
905
|
-
if (result) {
|
|
906
|
-
return this.transitionToStateOrThrow(options.orderId, result);
|
|
907
|
-
}
|
|
908
|
-
else {
|
|
909
|
-
if (!options.cancellable) {
|
|
910
|
-
throw new Error(`An order state must be selected`);
|
|
911
|
-
}
|
|
912
|
-
else {
|
|
913
|
-
return EMPTY;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
}), retryWhen(errors => errors.pipe(delay(2000), take(options.retry))));
|
|
917
|
-
}
|
|
918
|
-
/**
|
|
919
|
-
* Attempts to get the last state the Order was in before it was transitioned
|
|
920
|
-
* to the "Modifying" state.
|
|
921
|
-
*/
|
|
922
|
-
getPreModifyingState(orderId) {
|
|
923
|
-
return this.dataService.order
|
|
924
|
-
.getOrderHistory(orderId, {
|
|
925
|
-
filter: {
|
|
926
|
-
type: {
|
|
927
|
-
eq: HistoryEntryType.ORDER_STATE_TRANSITION,
|
|
928
|
-
},
|
|
929
|
-
},
|
|
930
|
-
sort: {
|
|
931
|
-
createdAt: SortOrder.DESC,
|
|
932
|
-
},
|
|
933
|
-
})
|
|
934
|
-
.mapSingle(result => result.order)
|
|
935
|
-
.pipe(map(result => {
|
|
936
|
-
const item = result?.history.items.find(i => i.data.to === 'Modifying');
|
|
937
|
-
if (item) {
|
|
938
|
-
return item.data.from;
|
|
939
|
-
}
|
|
940
|
-
else {
|
|
941
|
-
return;
|
|
1356
|
+
return false;
|
|
942
1357
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
transitionToStateOrThrow(orderId, state) {
|
|
946
|
-
return this.dataService.order.transitionToState(orderId, state).pipe(map(({ transitionOrderToState }) => {
|
|
947
|
-
switch (transitionOrderToState?.__typename) {
|
|
948
|
-
case 'Order':
|
|
949
|
-
return transitionOrderToState?.state;
|
|
950
|
-
case 'OrderStateTransitionError':
|
|
951
|
-
this.notificationService.error(transitionOrderToState?.transitionError);
|
|
952
|
-
throw new Error(transitionOrderToState?.transitionError);
|
|
1358
|
+
if (i.refundId == null) {
|
|
1359
|
+
return true;
|
|
953
1360
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
OrderTransitionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderTransitionService, providedIn: 'root' });
|
|
959
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderTransitionService, decorators: [{
|
|
960
|
-
type: Injectable,
|
|
961
|
-
args: [{
|
|
962
|
-
providedIn: 'root',
|
|
963
|
-
}]
|
|
964
|
-
}], ctorParameters: function () { return [{ type: i1.DataService }, { type: i1.ModalService }, { type: i1.NotificationService }, { type: i1.I18nService }]; } });
|
|
965
|
-
|
|
966
|
-
class OrderTableComponent {
|
|
967
|
-
constructor() {
|
|
968
|
-
this.orderLineCustomFieldsVisible = false;
|
|
969
|
-
this.customFieldsForLine = {};
|
|
1361
|
+
const refund = refunds.find(r => r.id === i.refundId);
|
|
1362
|
+
return refund?.state === 'Failed';
|
|
1363
|
+
});
|
|
1364
|
+
return 0 < refundable.length;
|
|
970
1365
|
}
|
|
971
|
-
|
|
972
|
-
|
|
1366
|
+
ngOnInit() {
|
|
1367
|
+
this.lineQuantities = this.order.lines.reduce((result, line) => {
|
|
1368
|
+
return {
|
|
1369
|
+
...result,
|
|
1370
|
+
[line.id]: {
|
|
1371
|
+
quantity: 0,
|
|
1372
|
+
refund: false,
|
|
1373
|
+
cancel: false,
|
|
1374
|
+
},
|
|
1375
|
+
};
|
|
1376
|
+
}, {});
|
|
1377
|
+
this.settledPayments = (this.order.payments || []).filter(p => p.state === 'Settled');
|
|
1378
|
+
if (this.settledPayments.length) {
|
|
1379
|
+
this.selectedPayment = this.settledPayments[0];
|
|
1380
|
+
}
|
|
973
1381
|
}
|
|
974
|
-
|
|
975
|
-
|
|
1382
|
+
handleZeroQuantity(line) {
|
|
1383
|
+
if (line?.quantity === 0) {
|
|
1384
|
+
line.cancel = false;
|
|
1385
|
+
line.refund = false;
|
|
1386
|
+
}
|
|
976
1387
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1388
|
+
isRefunding() {
|
|
1389
|
+
const result = Object.values(this.lineQuantities).reduce((isRefunding, line) => {
|
|
1390
|
+
return isRefunding || (0 < line.quantity && line.refund);
|
|
1391
|
+
}, false);
|
|
1392
|
+
return result;
|
|
980
1393
|
}
|
|
981
|
-
|
|
982
|
-
|
|
1394
|
+
isCancelling() {
|
|
1395
|
+
const result = Object.values(this.lineQuantities).reduce((isCancelling, line) => {
|
|
1396
|
+
return isCancelling || (0 < line.quantity && line.cancel);
|
|
1397
|
+
}, false);
|
|
1398
|
+
return result;
|
|
983
1399
|
}
|
|
984
|
-
|
|
985
|
-
|
|
1400
|
+
canSubmit() {
|
|
1401
|
+
if (this.isRefunding()) {
|
|
1402
|
+
return !!(this.selectedPayment &&
|
|
1403
|
+
this.reason &&
|
|
1404
|
+
0 < this.refundTotal &&
|
|
1405
|
+
this.refundTotal <= this.settledPaymentsTotal);
|
|
1406
|
+
}
|
|
1407
|
+
else if (this.isCancelling()) {
|
|
1408
|
+
return !!this.reason;
|
|
1409
|
+
}
|
|
1410
|
+
return false;
|
|
986
1411
|
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1412
|
+
select() {
|
|
1413
|
+
const payment = this.selectedPayment;
|
|
1414
|
+
if (payment) {
|
|
1415
|
+
const refundLines = this.getOrderLineInput(line => line.refund);
|
|
1416
|
+
const cancelLines = this.getOrderLineInput(line => line.cancel);
|
|
1417
|
+
this.resolveWith({
|
|
1418
|
+
refund: {
|
|
1419
|
+
lines: refundLines,
|
|
1420
|
+
reason: this.reason,
|
|
1421
|
+
shipping: this.refundShipping ? this.order.shippingWithTax : 0,
|
|
1422
|
+
adjustment: this.adjustment,
|
|
1423
|
+
paymentId: payment.id,
|
|
1424
|
+
},
|
|
1425
|
+
cancel: {
|
|
1426
|
+
lines: cancelLines,
|
|
1427
|
+
orderId: this.order.id,
|
|
1428
|
+
reason: this.reason,
|
|
1429
|
+
cancelShipping: this.refundShipping,
|
|
1430
|
+
},
|
|
1002
1431
|
});
|
|
1003
|
-
this.customFieldsForLine[line.id] = result;
|
|
1004
1432
|
}
|
|
1005
1433
|
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
return ['/marketing', 'promotions', id];
|
|
1434
|
+
cancel() {
|
|
1435
|
+
this.resolveWith();
|
|
1009
1436
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1437
|
+
getOrderLineInput(filterFn) {
|
|
1438
|
+
return Object.entries(this.lineQuantities)
|
|
1439
|
+
.filter(([orderLineId, line]) => 0 < line.quantity && filterFn(line))
|
|
1440
|
+
.map(([orderLineId, line]) => ({
|
|
1441
|
+
orderLineId,
|
|
1442
|
+
quantity: line.quantity,
|
|
1443
|
+
}));
|
|
1016
1444
|
}
|
|
1017
1445
|
}
|
|
1018
|
-
|
|
1019
|
-
OrderTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderTableComponent, selector: "vdr-order-table", inputs: { order: "order", orderLineCustomFields: "orderLineCustomFields" }, ngImport: i0, template: "<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>{{ 'order.total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let line of order.lines\">\r\n <tr class=\"order-line\" [class.is-cancelled]=\"line.quantity === 0\">\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 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 {{ line.quantity }}\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment [line]=\"line\" [orderState]=\"order.state\"></vdr-line-fulfillment>\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\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 </td>\r\n </tr>\r\n <ng-container *ngIf=\"customFieldsForLine[line.id] as customFields\">\r\n <tr *ngIf=\"customFields.length\">\r\n <td colspan=\"6\" class=\"custom-fields-row\">\r\n <div class=\"order-line-custom-fields\">\r\n <div class=\"custom-field\" *ngFor=\"let field of customFields\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [readonly]=\"true\"\r\n [customField]=\"field.config\"\r\n [customFieldsFormGroup]=\"field.formGroup\"\r\n ></vdr-custom-field-control>\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\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\" colspan=\"2\"></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 <ng-container *ngFor=\"let discount of order.discounts\">\r\n <tr class=\"order-adjustment\" *ngIf=\"discount.type !== 'OTHER'\">\r\n <td colspan=\"5\" class=\"left clr-align-middle\">\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=\"clr-align-middle\">\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 </tr>\r\n </ng-container>\r\n <tr class=\"sub-total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.sub-total' | translate }}</td>\r\n <td colspan=\"4\"></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 </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\">{{ order.shippingLines[0]?.shippingMethod?.name }}</td>\r\n <td colspan=\"3\"></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 <tr class=\"total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.total' | translate }}</td>\r\n <td colspan=\"4\"></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 </tr>\r\n </tbody>\r\n</table>\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 .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-right:18px}.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)}.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}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-left:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"], components: [{ type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: ["line", "orderState"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition"] }, { type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }, { type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1020
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type:
|
|
1446
|
+
RefundOrderDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RefundOrderDialogComponent, deps: [{ token: i1.I18nService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1447
|
+
RefundOrderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 mt4\" [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-left:12px}\n"], components: [{ type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { type: i3$2.ClrSelectContainer, selector: "clr-select-container" }, { type: i3$2.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { type: i3$2.ClrInputContainer, selector: "clr-input-container" }, { type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i3$2.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i3$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i3$2.ClrSelect, selector: "[clrSelect]" }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$2.ClrInput, selector: "[clrInput]" }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe, "currency": i4$1.CurrencyPipe, "number": i4$1.DecimalPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1448
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RefundOrderDialogComponent, decorators: [{
|
|
1021
1449
|
type: Component,
|
|
1022
|
-
args: [{ selector: 'vdr-order-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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>{{ 'order.total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let line of order.lines\">\r\n <tr class=\"order-line\" [class.is-cancelled]=\"line.quantity === 0\">\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 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 {{ line.quantity }}\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment [line]=\"line\" [orderState]=\"order.state\"></vdr-line-fulfillment>\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\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 </td>\r\n </tr>\r\n <ng-container *ngIf=\"customFieldsForLine[line.id] as customFields\">\r\n <tr *ngIf=\"customFields.length\">\r\n <td colspan=\"6\" class=\"custom-fields-row\">\r\n <div class=\"order-line-custom-fields\">\r\n <div class=\"custom-field\" *ngFor=\"let field of customFields\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [readonly]=\"true\"\r\n [customField]=\"field.config\"\r\n [customFieldsFormGroup]=\"field.formGroup\"\r\n ></vdr-custom-field-control>\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\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\" colspan=\"2\"></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 <ng-container *ngFor=\"let discount of order.discounts\">\r\n <tr class=\"order-adjustment\" *ngIf=\"discount.type !== 'OTHER'\">\r\n <td colspan=\"5\" class=\"left clr-align-middle\">\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=\"clr-align-middle\">\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 </tr>\r\n </ng-container>\r\n <tr class=\"sub-total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.sub-total' | translate }}</td>\r\n <td colspan=\"4\"></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 </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\">{{ order.shippingLines[0]?.shippingMethod?.name }}</td>\r\n <td colspan=\"3\"></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 <tr class=\"total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.total' | translate }}</td>\r\n <td colspan=\"4\"></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 </tr>\r\n </tbody>\r\n</table>\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 .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-right:18px}.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)}.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}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-left:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"] }]
|
|
1023
|
-
}],
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1450
|
+
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 mt4\" [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-left:12px}\n"] }]
|
|
1451
|
+
}], ctorParameters: function () { return [{ type: i1.I18nService }]; } });
|
|
1452
|
+
|
|
1453
|
+
class SettleRefundDialogComponent {
|
|
1454
|
+
constructor() {
|
|
1455
|
+
this.transactionId = '';
|
|
1456
|
+
}
|
|
1457
|
+
submit() {
|
|
1458
|
+
this.resolveWith(this.transactionId);
|
|
1459
|
+
}
|
|
1460
|
+
cancel() {
|
|
1461
|
+
this.resolveWith();
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
SettleRefundDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SettleRefundDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1465
|
+
SettleRefundDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i3$2.ClrInputContainer, selector: "clr-input-container" }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$2.ClrInput, selector: "[clrInput]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SettleRefundDialogComponent, decorators: [{
|
|
1467
|
+
type: Component,
|
|
1468
|
+
args: [{ selector: 'vdr-settle-refund-dialog', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
1469
|
+
}] });
|
|
1028
1470
|
|
|
1029
1471
|
class PaymentDetailComponent {
|
|
1030
1472
|
}
|
|
@@ -1176,7 +1618,7 @@ class OrderHistoryComponent {
|
|
|
1176
1618
|
}
|
|
1177
1619
|
}
|
|
1178
1620
|
OrderHistoryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1179
|
-
OrderHistoryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderHistoryComponent, selector: "vdr-order-history", inputs: { order: "order", history: "history" }, outputs: { addNote: "addNote", updateNote: "updateNote", deleteNote: "deleteNote" }, ngImport: i0, template: "<h4>{{ 'order.order-history' | translate }}</h4>\r\n<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 <vdr-timeline-entry\r\n *ngFor=\"let entry of history\"\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>{{ modification.priceChange | localeCurrency: order.currencyCode }}</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: { 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 {{ 'order.history-items-cancelled' | translate: { count: entry.data.orderItemIds.length } }}\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 class=\"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 class=\"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>\r\n </vdr-timeline-entry>\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{margin-top:48px;display:block}.entry-list{margin-top:24px;margin-left:24px;margin-right:12px}.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-500)}.visibility-select .private{color:var(--color-success-500)}textarea.note{flex:1;height:36px;border-radius:3px;margin-right: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-500)}.note-visibility.private{color:var(--color-success-500)}\n"], components: [{ type: i1.TimelineEntryComponent, selector: "vdr-timeline-entry", inputs: ["displayType", "createdAt", "name", "featured", "iconShape", "isLast", "collapsed"], outputs: ["expandClick"] }, { type: i2.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { type: i1.HistoryEntryDetailComponent, selector: "vdr-history-entry-detail" }, { type: ModificationDetailComponent, selector: "vdr-modification-detail", inputs: ["order", "modification"] }, { type: PaymentDetailComponent, selector: "vdr-payment-detail", inputs: ["payment", "currencyCode"] }, { type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { type: SimpleItemListComponent, selector: "vdr-simple-item-list", inputs: ["items"] }, { type: FulfillmentDetailComponent, selector: "vdr-fulfillment-detail", inputs: ["fulfillmentId", "order"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition"] }], directives: [{ type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { type: i2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "translate": i4.TranslatePipe, "localeCurrency": i1.LocaleCurrencyPipe, "hasPermission": i1.HasPermissionPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1621
|
+
OrderHistoryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderHistoryComponent, selector: "vdr-order-history", inputs: { order: "order", history: "history" }, outputs: { addNote: "addNote", updateNote: "updateNote", deleteNote: "deleteNote" }, ngImport: i0, template: "<h4>{{ 'order.order-history' | translate }}</h4>\r\n<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 <vdr-timeline-entry\r\n *ngFor=\"let entry of history\"\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>{{ modification.priceChange | localeCurrency: order.currencyCode }}</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: { 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 {{ 'order.history-items-cancelled' | translate: { count: entry.data.orderItemIds.length } }}\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 class=\"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 class=\"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>\r\n </vdr-timeline-entry>\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{margin-top:48px;display:block}.entry-list{margin-top:24px;margin-left:24px;margin-right:12px}.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-500)}.visibility-select .private{color:var(--color-success-500)}textarea.note{flex:1;height:36px;border-radius:3px;margin-right: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-500)}.note-visibility.private{color:var(--color-success-500)}\n"], components: [{ type: i1.TimelineEntryComponent, selector: "vdr-timeline-entry", inputs: ["displayType", "createdAt", "name", "featured", "iconShape", "isLast", "collapsed"], outputs: ["expandClick"] }, { type: i3$2.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { type: i1.HistoryEntryDetailComponent, selector: "vdr-history-entry-detail" }, { type: ModificationDetailComponent, selector: "vdr-modification-detail", inputs: ["order", "modification"] }, { type: PaymentDetailComponent, selector: "vdr-payment-detail", inputs: ["payment", "currencyCode"] }, { type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { type: SimpleItemListComponent, selector: "vdr-simple-item-list", inputs: ["items"] }, { type: FulfillmentDetailComponent, selector: "vdr-fulfillment-detail", inputs: ["fulfillmentId", "order"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }], directives: [{ type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i3$2.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "translate": i4.TranslatePipe, "localeCurrency": i1.LocaleCurrencyPipe, "hasPermission": i1.HasPermissionPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1180
1622
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderHistoryComponent, decorators: [{
|
|
1181
1623
|
type: Component,
|
|
1182
1624
|
args: [{ selector: 'vdr-order-history', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h4>{{ 'order.order-history' | translate }}</h4>\r\n<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 <vdr-timeline-entry\r\n *ngFor=\"let entry of history\"\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>{{ modification.priceChange | localeCurrency: order.currencyCode }}</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: { 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 {{ 'order.history-items-cancelled' | translate: { count: entry.data.orderItemIds.length } }}\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 class=\"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 class=\"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>\r\n </vdr-timeline-entry>\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{margin-top:48px;display:block}.entry-list{margin-top:24px;margin-left:24px;margin-right:12px}.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-500)}.visibility-select .private{color:var(--color-success-500)}textarea.note{flex:1;height:36px;border-radius:3px;margin-right: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-500)}.note-visibility.private{color:var(--color-success-500)}\n"] }]
|
|
@@ -1206,7 +1648,7 @@ class PaymentStateLabelComponent {
|
|
|
1206
1648
|
}
|
|
1207
1649
|
}
|
|
1208
1650
|
PaymentStateLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PaymentStateLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1209
|
-
PaymentStateLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type:
|
|
1651
|
+
PaymentStateLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }], pipes: { "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1210
1652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PaymentStateLabelComponent, decorators: [{
|
|
1211
1653
|
type: Component,
|
|
1212
1654
|
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"] }]
|
|
@@ -1227,7 +1669,7 @@ class RefundStateLabelComponent {
|
|
|
1227
1669
|
}
|
|
1228
1670
|
}
|
|
1229
1671
|
RefundStateLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RefundStateLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1230
|
-
RefundStateLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type:
|
|
1672
|
+
RefundStateLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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"], components: [{ type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }], pipes: { "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1231
1673
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RefundStateLabelComponent, decorators: [{
|
|
1232
1674
|
type: Component,
|
|
1233
1675
|
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"] }]
|
|
@@ -1248,11 +1690,11 @@ class OrderPaymentCardComponent {
|
|
|
1248
1690
|
if (!this.payment) {
|
|
1249
1691
|
return [];
|
|
1250
1692
|
}
|
|
1251
|
-
return this.payment.nextStates.filter(s => s !== 'Settled');
|
|
1693
|
+
return this.payment.nextStates.filter(s => s !== 'Settled' && s !== 'Error');
|
|
1252
1694
|
}
|
|
1253
1695
|
}
|
|
1254
1696
|
OrderPaymentCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderPaymentCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1255
|
-
OrderPaymentCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 class=\"btn\"\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-right:6px;color:var(--color-grey-400)}.card-footer{display:flex;align-items:center;justify-content:flex-end}\n"], components: [{ type: PaymentStateLabelComponent, selector: "vdr-payment-state-label", inputs: ["state"] }, { type: PaymentDetailComponent, selector: "vdr-payment-detail", inputs: ["payment", "currencyCode"] }, { type: RefundStateLabelComponent, selector: "vdr-refund-state-label", inputs: ["state"] }, { type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { type: i1.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type:
|
|
1697
|
+
OrderPaymentCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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 class=\"btn\"\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-right:6px;color:var(--color-grey-400)}.card-footer{display:flex;align-items:center;justify-content:flex-end}\n"], components: [{ type: PaymentStateLabelComponent, selector: "vdr-payment-state-label", inputs: ["state"] }, { type: PaymentDetailComponent, selector: "vdr-payment-detail", inputs: ["payment", "currencyCode"] }, { type: RefundStateLabelComponent, selector: "vdr-refund-state-label", inputs: ["state"] }, { type: i1.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { type: i1.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i3$3.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }], pipes: { "translate": i4.TranslatePipe, "localeDate": i1.LocaleDatePipe, "localeCurrency": i1.LocaleCurrencyPipe, "stateI18nToken": i1.StateI18nTokenPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1256
1698
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderPaymentCardComponent, decorators: [{
|
|
1257
1699
|
type: Component,
|
|
1258
1700
|
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 class=\"btn\"\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-right:6px;color:var(--color-grey-400)}.card-footer{display:flex;align-items:center;justify-content:flex-end}\n"] }]
|
|
@@ -1405,27 +1847,55 @@ class OrderDetailComponent extends BaseDetailComponent {
|
|
|
1405
1847
|
});
|
|
1406
1848
|
}
|
|
1407
1849
|
transitionPaymentState({ payment, state }) {
|
|
1408
|
-
|
|
1409
|
-
.
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1850
|
+
if (state === 'Cancelled') {
|
|
1851
|
+
this.dataService.order.cancelPayment(payment.id).subscribe(({ cancelPayment }) => {
|
|
1852
|
+
switch (cancelPayment.__typename) {
|
|
1853
|
+
case 'Payment':
|
|
1854
|
+
this.notificationService.success(marker('order.transitioned-payment-to-state-success'), {
|
|
1855
|
+
state,
|
|
1856
|
+
});
|
|
1857
|
+
this.dataService.order.getOrder(this.id).single$.subscribe();
|
|
1858
|
+
this.fetchHistory.next();
|
|
1859
|
+
break;
|
|
1860
|
+
case 'PaymentStateTransitionError':
|
|
1861
|
+
this.notificationService.error(cancelPayment.transitionError);
|
|
1862
|
+
break;
|
|
1863
|
+
case 'CancelPaymentError':
|
|
1864
|
+
this.notificationService.error(cancelPayment.paymentErrorMessage);
|
|
1865
|
+
break;
|
|
1866
|
+
}
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
else {
|
|
1870
|
+
this.dataService.order
|
|
1871
|
+
.transitionPaymentToState(payment.id, state)
|
|
1872
|
+
.subscribe(({ transitionPaymentToState }) => {
|
|
1873
|
+
switch (transitionPaymentToState.__typename) {
|
|
1874
|
+
case 'Payment':
|
|
1875
|
+
this.notificationService.success(marker('order.transitioned-payment-to-state-success'), {
|
|
1876
|
+
state,
|
|
1877
|
+
});
|
|
1878
|
+
this.dataService.order.getOrder(this.id).single$.subscribe();
|
|
1879
|
+
this.fetchHistory.next();
|
|
1880
|
+
break;
|
|
1881
|
+
case 'PaymentStateTransitionError':
|
|
1882
|
+
this.notificationService.error(transitionPaymentToState.message);
|
|
1883
|
+
break;
|
|
1884
|
+
}
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1424
1887
|
}
|
|
1425
1888
|
canAddFulfillment(order) {
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1428
|
-
|
|
1889
|
+
const allFulfillmentSummaryRows = (order.fulfillments ?? []).reduce((all, fulfillment) => [...all, ...fulfillment.summary], []);
|
|
1890
|
+
let allItemsFulfilled = true;
|
|
1891
|
+
for (const line of order.lines) {
|
|
1892
|
+
const totalFulfilledCount = allFulfillmentSummaryRows
|
|
1893
|
+
.filter(row => row.orderLine.id === line.id)
|
|
1894
|
+
.reduce((sum, row) => sum + row.quantity, 0);
|
|
1895
|
+
if (totalFulfilledCount < line.quantity) {
|
|
1896
|
+
allItemsFulfilled = false;
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1429
1899
|
return (!allItemsFulfilled &&
|
|
1430
1900
|
!this.hasUnsettledModifications(order) &&
|
|
1431
1901
|
this.outstandingPaymentAmount(order) === 0 &&
|
|
@@ -1682,26 +2152,43 @@ class OrderDetailComponent extends BaseDetailComponent {
|
|
|
1682
2152
|
if (!input) {
|
|
1683
2153
|
return of(undefined);
|
|
1684
2154
|
}
|
|
1685
|
-
|
|
2155
|
+
if (input.cancel.lines?.length) {
|
|
2156
|
+
return this.dataService.order.cancelOrder(input.cancel).pipe(map(res => {
|
|
2157
|
+
const result = res.cancelOrder;
|
|
2158
|
+
switch (result.__typename) {
|
|
2159
|
+
case 'Order':
|
|
2160
|
+
this.refetchOrder(result).subscribe();
|
|
2161
|
+
this.notificationService.success(marker('order.cancelled-order-success'));
|
|
2162
|
+
return input;
|
|
2163
|
+
case 'CancelActiveOrderError':
|
|
2164
|
+
case 'QuantityTooGreatError':
|
|
2165
|
+
case 'MultipleOrderError':
|
|
2166
|
+
case 'OrderStateTransitionError':
|
|
2167
|
+
case 'EmptyOrderLineSelectionError':
|
|
2168
|
+
this.notificationService.error(result.message);
|
|
2169
|
+
return undefined;
|
|
2170
|
+
}
|
|
2171
|
+
}));
|
|
2172
|
+
}
|
|
2173
|
+
else {
|
|
2174
|
+
return [input];
|
|
2175
|
+
}
|
|
2176
|
+
}), switchMap(input => {
|
|
2177
|
+
if (!input) {
|
|
2178
|
+
return of(undefined);
|
|
2179
|
+
}
|
|
1686
2180
|
if (input.refund.lines.length) {
|
|
1687
|
-
|
|
2181
|
+
return this.dataService.order
|
|
1688
2182
|
.refundOrder(input.refund)
|
|
1689
|
-
.pipe(map(res => res.refundOrder))
|
|
2183
|
+
.pipe(map(res => res.refundOrder));
|
|
1690
2184
|
}
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
.cancelOrder(input.cancel)
|
|
1694
|
-
.pipe(map(res => res.cancelOrder)));
|
|
2185
|
+
else {
|
|
2186
|
+
return [undefined];
|
|
1695
2187
|
}
|
|
1696
|
-
return merge(...operations);
|
|
1697
2188
|
}))
|
|
1698
2189
|
.subscribe(result => {
|
|
1699
2190
|
if (result) {
|
|
1700
2191
|
switch (result.__typename) {
|
|
1701
|
-
case 'Order':
|
|
1702
|
-
this.refetchOrder(result).subscribe();
|
|
1703
|
-
this.notificationService.success(marker('order.cancelled-order-success'));
|
|
1704
|
-
break;
|
|
1705
2192
|
case 'Refund':
|
|
1706
2193
|
this.refetchOrder(result).subscribe();
|
|
1707
2194
|
if (result.state === 'Failed') {
|
|
@@ -1711,11 +2198,6 @@ class OrderDetailComponent extends BaseDetailComponent {
|
|
|
1711
2198
|
this.notificationService.success(marker('order.refund-order-success'));
|
|
1712
2199
|
}
|
|
1713
2200
|
break;
|
|
1714
|
-
case 'QuantityTooGreatError':
|
|
1715
|
-
case 'MultipleOrderError':
|
|
1716
|
-
case 'OrderStateTransitionError':
|
|
1717
|
-
case 'CancelActiveOrderError':
|
|
1718
|
-
case 'EmptyOrderLineSelectionError':
|
|
1719
2201
|
case 'AlreadyRefundedError':
|
|
1720
2202
|
case 'NothingToRefundError':
|
|
1721
2203
|
case 'PaymentOrderMismatchError':
|
|
@@ -1741,10 +2223,10 @@ class OrderDetailComponent extends BaseDetailComponent {
|
|
|
1741
2223
|
}
|
|
1742
2224
|
}
|
|
1743
2225
|
OrderDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderDetailComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i1.ServerConfigService }, { token: i0.ChangeDetectorRef }, { token: i1.DataService }, { token: i1.NotificationService }, { token: i1.ModalService }, { token: OrderTransitionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1744
|
-
OrderDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderDetailComponent, selector: "vdr-order-detail", usesInheritance: true, ngImport: i0, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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 </div>\r\n </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=\"btn btn-primary\"\r\n *ngIf=\"\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=\"btn btn-primary\"\r\n *ngIf=\"\r\n order.active === false &&\r\n order.state !== 'ArrangingAdditionalPayment' &&\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 class=\"btn btn-primary\" (click)=\"fulfillOrder()\" [disabled]=\"!canAddFulfillment(order)\">\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 *ngIf=\"order.nextStates.includes('Modifying')\">\r\n <button type=\"button\" class=\"btn\" 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 class=\"btn\"\r\n vdrDropdownItem\r\n *ngIf=\"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 class=\"btn\"\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\" class=\"btn\" 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\r\n<div *ngIf=\"entity$ | async as order\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-lg-8\">\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n ></vdr-order-table>\r\n <h4>{{ 'order.tax-summary' | translate }}</h4>\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\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-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 </div>\r\n <div class=\"clr-col-lg-4 order-cards\">\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 <div class=\"card\">\r\n <div class=\"card-header\">\r\n {{ 'order.customer' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n <h6 *ngIf=\"getOrderAddressLines(order.shippingAddress).length\">\r\n {{ 'order.shipping-address' | translate }}\r\n </h6>\r\n <vdr-formatted-address [address]=\"order.shippingAddress\"></vdr-formatted-address>\r\n <h6 *ngIf=\"getOrderAddressLines(order.billingAddress).length\">\r\n {{ 'order.billing-address' | translate }}\r\n </h6>\r\n <vdr-formatted-address [address]=\"order.billingAddress\"></vdr-formatted-address>\r\n </div>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"order.payments && 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 </ng-container>\r\n <ng-container *ngFor=\"let fulfillment of order.fulfillments\">\r\n <vdr-fulfillment-card\r\n [fulfillment]=\"fulfillment\"\r\n [order]=\"order\"\r\n (transitionState)=\"transitionFulfillment(fulfillment.id, $event)\"\r\n ></vdr-fulfillment-card>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\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"], components: [{ type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { type: i1.EntityInfoComponent, selector: "vdr-entity-info", inputs: ["small", "entity"] }, { type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition"] }, { type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields"] }, { type: i1.CustomDetailComponentHostComponent, selector: "vdr-custom-detail-component-host", inputs: ["locationId", "entity$", "detailForm"] }, { type: OrderHistoryComponent, selector: "vdr-order-history", inputs: ["order", "history"], outputs: ["addNote", "updateNote", "deleteNote"] }, { type: OrderCustomFieldsCardComponent, selector: "vdr-order-custom-fields-card", inputs: ["customFieldsConfig", "customFieldValues"], outputs: ["updateClick"] }, { type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { type: OrderPaymentCardComponent, selector: "vdr-order-payment-card", inputs: ["payment", "currencyCode"], outputs: ["settlePayment", "transitionPaymentState", "settleRefund"] }, { type: FulfillmentCardComponent, selector: "vdr-fulfillment-card", inputs: ["fulfillment", "order"], outputs: ["transitionState"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i4.TranslatePipe, "localeCurrency": i1.LocaleCurrencyPipe, "stateI18nToken": i1.StateI18nTokenPipe, "percent": i4$1.PercentPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2226
|
+
OrderDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderDetailComponent, selector: "vdr-order-detail", usesInheritance: true, ngImport: i0, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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 </div>\r\n </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=\"btn btn-primary\"\r\n *ngIf=\"\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=\"btn btn-primary\"\r\n *ngIf=\"\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 class=\"btn btn-primary\" (click)=\"fulfillOrder()\" [disabled]=\"!canAddFulfillment(order)\">\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 *ngIf=\"order.nextStates.includes('Modifying')\">\r\n <button type=\"button\" class=\"btn\" 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 class=\"btn\"\r\n vdrDropdownItem\r\n *ngIf=\"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 class=\"btn\"\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\" class=\"btn\" 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\r\n<div *ngIf=\"entity$ | async as order\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-lg-8\">\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n ></vdr-order-table>\r\n <h4>{{ 'order.tax-summary' | translate }}</h4>\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\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-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 </div>\r\n <div class=\"clr-col-lg-4 order-cards\">\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 <div class=\"card\">\r\n <div class=\"card-header\">\r\n {{ 'order.customer' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n <h6 *ngIf=\"getOrderAddressLines(order.shippingAddress).length\">\r\n {{ 'order.shipping-address' | translate }}\r\n </h6>\r\n <vdr-formatted-address [address]=\"order.shippingAddress\"></vdr-formatted-address>\r\n <h6 *ngIf=\"getOrderAddressLines(order.billingAddress).length\">\r\n {{ 'order.billing-address' | translate }}\r\n </h6>\r\n <vdr-formatted-address [address]=\"order.billingAddress\"></vdr-formatted-address>\r\n </div>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"order.payments && 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 </ng-container>\r\n <ng-container *ngFor=\"let fulfillment of order.fulfillments\">\r\n <vdr-fulfillment-card\r\n [fulfillment]=\"fulfillment\"\r\n [order]=\"order\"\r\n (transitionState)=\"transitionFulfillment(fulfillment.id, $event)\"\r\n ></vdr-fulfillment-card>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\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"], components: [{ type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { type: i1.EntityInfoComponent, selector: "vdr-entity-info", inputs: ["small", "entity"] }, { type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { type: i1.CustomDetailComponentHostComponent, selector: "vdr-custom-detail-component-host", inputs: ["locationId", "entity$", "detailForm"] }, { type: OrderHistoryComponent, selector: "vdr-order-history", inputs: ["order", "history"], outputs: ["addNote", "updateNote", "deleteNote"] }, { type: OrderCustomFieldsCardComponent, selector: "vdr-order-custom-fields-card", inputs: ["customFieldsConfig", "customFieldValues"], outputs: ["updateClick"] }, { type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { type: i1.FormattedAddressComponent, selector: "vdr-formatted-address", inputs: ["address"] }, { type: OrderPaymentCardComponent, selector: "vdr-order-payment-card", inputs: ["payment", "currencyCode"], outputs: ["settlePayment", "transitionPaymentState", "settleRefund"] }, { type: FulfillmentCardComponent, selector: "vdr-fulfillment-card", inputs: ["fulfillment", "order"], outputs: ["transitionState"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i4.TranslatePipe, "localeCurrency": i1.LocaleCurrencyPipe, "stateI18nToken": i1.StateI18nTokenPipe, "percent": i4$1.PercentPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1745
2227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderDetailComponent, decorators: [{
|
|
1746
2228
|
type: Component,
|
|
1747
|
-
args: [{ selector: 'vdr-order-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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 </div>\r\n </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=\"btn btn-primary\"\r\n *ngIf=\"\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=\"btn btn-primary\"\r\n *ngIf=\"\r\n order.active === false &&\r\n order.state !== 'ArrangingAdditionalPayment' &&\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 class=\"btn btn-primary\" (click)=\"fulfillOrder()\" [disabled]=\"!canAddFulfillment(order)\">\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 *ngIf=\"order.nextStates.includes('Modifying')\">\r\n <button type=\"button\" class=\"btn\" 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 class=\"btn\"\r\n vdrDropdownItem\r\n *ngIf=\"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 class=\"btn\"\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\" class=\"btn\" 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\r\n<div *ngIf=\"entity$ | async as order\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-lg-8\">\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n ></vdr-order-table>\r\n <h4>{{ 'order.tax-summary' | translate }}</h4>\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\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-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 </div>\r\n <div class=\"clr-col-lg-4 order-cards\">\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 <div class=\"card\">\r\n <div class=\"card-header\">\r\n {{ 'order.customer' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n <h6 *ngIf=\"getOrderAddressLines(order.shippingAddress).length\">\r\n {{ 'order.shipping-address' | translate }}\r\n </h6>\r\n <vdr-formatted-address [address]=\"order.shippingAddress\"></vdr-formatted-address>\r\n <h6 *ngIf=\"getOrderAddressLines(order.billingAddress).length\">\r\n {{ 'order.billing-address' | translate }}\r\n </h6>\r\n <vdr-formatted-address [address]=\"order.billingAddress\"></vdr-formatted-address>\r\n </div>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"order.payments && 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 </ng-container>\r\n <ng-container *ngFor=\"let fulfillment of order.fulfillments\">\r\n <vdr-fulfillment-card\r\n [fulfillment]=\"fulfillment\"\r\n [order]=\"order\"\r\n (transitionState)=\"transitionFulfillment(fulfillment.id, $event)\"\r\n ></vdr-fulfillment-card>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\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"] }]
|
|
2229
|
+
args: [{ selector: 'vdr-order-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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 </div>\r\n </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=\"btn btn-primary\"\r\n *ngIf=\"\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=\"btn btn-primary\"\r\n *ngIf=\"\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 class=\"btn btn-primary\" (click)=\"fulfillOrder()\" [disabled]=\"!canAddFulfillment(order)\">\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 *ngIf=\"order.nextStates.includes('Modifying')\">\r\n <button type=\"button\" class=\"btn\" 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 class=\"btn\"\r\n vdrDropdownItem\r\n *ngIf=\"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 class=\"btn\"\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\" class=\"btn\" 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\r\n<div *ngIf=\"entity$ | async as order\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-lg-8\">\r\n <vdr-order-table\r\n [order]=\"order\"\r\n [orderLineCustomFields]=\"orderLineCustomFields\"\r\n ></vdr-order-table>\r\n <h4>{{ 'order.tax-summary' | translate }}</h4>\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\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-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 </div>\r\n <div class=\"clr-col-lg-4 order-cards\">\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 <div class=\"card\">\r\n <div class=\"card-header\">\r\n {{ 'order.customer' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n <h6 *ngIf=\"getOrderAddressLines(order.shippingAddress).length\">\r\n {{ 'order.shipping-address' | translate }}\r\n </h6>\r\n <vdr-formatted-address [address]=\"order.shippingAddress\"></vdr-formatted-address>\r\n <h6 *ngIf=\"getOrderAddressLines(order.billingAddress).length\">\r\n {{ 'order.billing-address' | translate }}\r\n </h6>\r\n <vdr-formatted-address [address]=\"order.billingAddress\"></vdr-formatted-address>\r\n </div>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"order.payments && 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 </ng-container>\r\n <ng-container *ngFor=\"let fulfillment of order.fulfillments\">\r\n <vdr-fulfillment-card\r\n [fulfillment]=\"fulfillment\"\r\n [order]=\"order\"\r\n (transitionState)=\"transitionFulfillment(fulfillment.id, $event)\"\r\n ></vdr-fulfillment-card>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\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"] }]
|
|
1748
2230
|
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i1.ServerConfigService }, { type: i0.ChangeDetectorRef }, { type: i1.DataService }, { type: i1.NotificationService }, { type: i1.ModalService }, { type: OrderTransitionService }]; } });
|
|
1749
2231
|
|
|
1750
2232
|
var OrderEditResultType;
|
|
@@ -1788,7 +2270,7 @@ class OrderEditsPreviewDialogComponent {
|
|
|
1788
2270
|
}
|
|
1789
2271
|
}
|
|
1790
2272
|
OrderEditsPreviewDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderEditsPreviewDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1791
|
-
OrderEditsPreviewDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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: [""], components: [{ type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields"] }, { type:
|
|
2273
|
+
OrderEditsPreviewDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", 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: [""], components: [{ type: OrderTableComponent, selector: "vdr-order-table", inputs: ["order", "orderLineCustomFields", "isDraft"], outputs: ["adjust", "remove"] }, { type: i3$2.ClrSelectContainer, selector: "clr-select-container" }], directives: [{ type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i3$2.ClrSelect, selector: "[clrSelect]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$2.ClrTextarea, selector: "[clrTextarea]" }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }], pipes: { "translate": i4.TranslatePipe, "localeCurrency": i1.LocaleCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1792
2274
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderEditsPreviewDialogComponent, decorators: [{
|
|
1793
2275
|
type: Component,
|
|
1794
2276
|
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", styles: [""] }]
|
|
@@ -1802,7 +2284,6 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1802
2284
|
this.notificationService = notificationService;
|
|
1803
2285
|
this.modalService = modalService;
|
|
1804
2286
|
this.orderTransitionService = orderTransitionService;
|
|
1805
|
-
this.couponCodeInput$ = new Subject();
|
|
1806
2287
|
this.detailForm = new FormGroup({});
|
|
1807
2288
|
this.couponCodesControl = new FormControl();
|
|
1808
2289
|
this.modifyOrderInput = {
|
|
@@ -1902,11 +2383,6 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1902
2383
|
this.orderLineCustomFieldsFormArray.push(formGroup);
|
|
1903
2384
|
}
|
|
1904
2385
|
});
|
|
1905
|
-
this.availableCouponCodes$ = concat(this.couponCodeInput$.pipe(distinctUntilChanged(), switchMap(term => this.dataService.promotion.getPromotions(10, 0, {
|
|
1906
|
-
couponCode: { contains: term },
|
|
1907
|
-
}).single$), map(({ promotions }) =>
|
|
1908
|
-
// tslint:disable-next-line:no-non-null-assertion
|
|
1909
|
-
promotions.items.map(p => ({ code: p.couponCode, promotionName: p.name }))), startWith([])));
|
|
1910
2386
|
this.addItemCustomFieldsFormArray = new FormArray([]);
|
|
1911
2387
|
this.addItemCustomFieldsForm = new FormGroup({});
|
|
1912
2388
|
for (const customField of this.orderLineCustomFields) {
|
|
@@ -2049,8 +2525,14 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
2049
2525
|
this.modifyOrderInput.surcharges?.splice(index, 1);
|
|
2050
2526
|
}
|
|
2051
2527
|
previewAndModify(order) {
|
|
2052
|
-
const
|
|
2528
|
+
const modifyOrderInput = {
|
|
2053
2529
|
...this.modifyOrderInput,
|
|
2530
|
+
adjustOrderLines: this.modifyOrderInput.adjustOrderLines.map(line => {
|
|
2531
|
+
return transformRelationCustomFieldInputs(simpleDeepClone(line), this.orderLineCustomFields);
|
|
2532
|
+
}),
|
|
2533
|
+
};
|
|
2534
|
+
const input = {
|
|
2535
|
+
...modifyOrderInput,
|
|
2054
2536
|
...(this.billingAddressForm.dirty ? { updateBillingAddress: this.billingAddressForm.value } : {}),
|
|
2055
2537
|
...(this.shippingAddressForm.dirty
|
|
2056
2538
|
? { updateShippingAddress: this.shippingAddressForm.value }
|
|
@@ -2151,10 +2633,10 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
2151
2633
|
}
|
|
2152
2634
|
}
|
|
2153
2635
|
OrderEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderEditorComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i1.ServerConfigService }, { token: i0.ChangeDetectorRef }, { token: i1.DataService }, { token: i1.NotificationService }, { token: i1.ModalService }, { token: OrderTransitionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2154
|
-
OrderEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderEditorComponent, selector: "vdr-order-editor", usesInheritance: true, ngImport: i0, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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\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\">{{ 'common.custom-fields' | translate }}</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 [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [orderState]=\"order.state\"\r\n ></vdr-line-fulfillment>\r\n </td>\r\n <td *ngIf=\"orderLineCustomFields.length\" class=\"order-line-custom-field align-middle\">\r\n <ng-container *ngFor=\"let customField of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"orderLineCustomFieldsFormArray.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 {{ 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=\"let addedLine of addedLines; trackBy: trackByProductVariantId; let i = index\"\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 *ngIf=\"orderLineCustomFields.length\" class=\"order-line-custom-field align-middle\">\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\">{{ order.shippingLines[0]?.shippingMethod?.name }}</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=\"mb2\">{{ '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 class=\"mb4\" (productSelected)=\"addItemSelectedVariant = $event\">\r\n </vdr-product-variant-selector>\r\n <div *ngIf=\"addItemSelectedVariant\" class=\"flex mb4\">\r\n <img\r\n *ngIf=\"addItemSelectedVariant.productAsset as asset\"\r\n [src]=\"asset | assetPreview: 'tiny'\"\r\n class=\"mr4\"\r\n />\r\n <div>\r\n <strong class=\"mr4\">{{ 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 <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 <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]=\"couponCodesControl\"\r\n >\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <vdr-chip>{{ item.code }}</vdr-chip> {{ item.promotionName }}\r\n </ng-template>\r\n </ng-select>\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\" /></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 <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>{{ 'order.edit-shipping-address' | translate }}</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>{{ 'order.edit-billing-address' | translate }}</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", 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 .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-right:18px}.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)}.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 tr.modified td{background-color:var(--color-warning-100)}\n"], components: [{ type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { type: i1.EntityInfoComponent, selector: "vdr-entity-info", inputs: ["small", "entity"] }, { type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: ["line", "orderState"] }, { type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }, { type: i2.ClrAccordion, selector: "clr-accordion", inputs: ["clrAccordionMultiPanel"] }, { type: i2.ClrAccordionPanel, selector: "clr-accordion-panel", inputs: ["clrAccordionPanelDisabled", "clrAccordionPanelOpen"], outputs: ["clrAccordionPanelOpenChange"] }, { type: i2.ClrAccordionTitle, selector: "clr-accordion-title, clr-step-title" }, { type: i2.ClrAccordionContent, selector: "clr-accordion-content, clr-step-content" }, { type: i1.ProductVariantSelectorComponent, selector: "vdr-product-variant-selector", outputs: ["productSelected"] }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }, { type: i1.AffixedInputComponent, selector: "vdr-affixed-input", inputs: ["prefix", "suffix"] }, { type: i1.AddressFormComponent, selector: "vdr-address-form", inputs: ["customFields", "formGroup", "availableCountries"] }, { type: i2.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i2.ClrDatagridItemsTrackBy, selector: "[ngForTrackBy]", inputs: ["ngForTrackBy"] }, { type: i2.ClrIconCustomTag, selector: "clr-icon" }, { type: i2.ÇlrAccordionWillyWonka, selector: "clr-accordion" }, { type: i2.ÇlrAccordionOompaLoompa, selector: "clr-accordion-panel" }, { type: i2.ÇlrDatagridDetailRegisterer, selector: "[clrIfExpanded]" }, { type: i2.ClrIfExpanded, selector: "[clrIfExpanded]", inputs: ["clrIfExpanded"], outputs: ["clrIfExpandedChange"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i2.ClrTextarea, selector: "[clrTextarea]" }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe, "currency": i4$1.CurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2636
|
+
OrderEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderEditorComponent, selector: "vdr-order-editor", usesInheritance: true, ngImport: i0, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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\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\">{{ 'common.custom-fields' | translate }}</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 [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [orderState]=\"order.state\"\r\n ></vdr-line-fulfillment>\r\n </td>\r\n <td *ngIf=\"orderLineCustomFields.length\" class=\"order-line-custom-field align-middle\">\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=\"let addedLine of addedLines; trackBy: trackByProductVariantId; let i = index\"\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 *ngIf=\"orderLineCustomFields.length\" class=\"order-line-custom-field align-middle\">\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\">{{ order.shippingLines[0]?.shippingMethod?.name }}</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=\"mb2\">{{ '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 class=\"mb4\" (productSelected)=\"addItemSelectedVariant = $event\">\r\n </vdr-product-variant-selector>\r\n <div *ngIf=\"addItemSelectedVariant\" class=\"flex mb4\">\r\n <img\r\n *ngIf=\"addItemSelectedVariant.productAsset as asset\"\r\n [src]=\"asset | assetPreview: 'tiny'\"\r\n class=\"mr4\"\r\n />\r\n <div>\r\n <strong class=\"mr4\">{{ 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 <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 [label]=\"'order.tax-description' | translate\" 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>{{ 'order.edit-shipping-address' | translate }}</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>{{ 'order.edit-billing-address' | translate }}</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", 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-right: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)}.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 tr.modified td{background-color:var(--color-warning-100)}.order-table .order-line-custom-field{text-align:start}\n"], components: [{ type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { type: i1.EntityInfoComponent, selector: "vdr-entity-info", inputs: ["small", "entity"] }, { type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { type: LineRefundsComponent, selector: "vdr-line-refunds", inputs: ["line", "payments"] }, { type: LineFulfillmentComponent, selector: "vdr-line-fulfillment", inputs: ["line", "orderState"] }, { type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { type: i1.CustomFieldControlComponent, selector: "vdr-custom-field-control", inputs: ["entityName", "customFieldsFormGroup", "customField", "compact", "showLabel", "readonly"] }, { type: i3$2.ClrAccordion, selector: "clr-accordion", inputs: ["clrAccordionMultiPanel"] }, { type: i3$2.ClrAccordionPanel, selector: "clr-accordion-panel", inputs: ["clrAccordionPanelDisabled", "clrAccordionPanelOpen"], outputs: ["clrAccordionPanelOpenChange"] }, { type: i3$2.ClrAccordionTitle, selector: "clr-accordion-title, clr-step-title" }, { type: i3$2.ClrAccordionContent, selector: "clr-accordion-content, clr-step-content" }, { type: i1.ProductVariantSelectorComponent, selector: "vdr-product-variant-selector", outputs: ["productSelected"] }, { type: CouponCodeSelectorComponent, selector: "vdr-coupon-code-selector", inputs: ["couponCodes", "control"], outputs: ["addCouponCode", "removeCouponCode"] }, { type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }, { type: i1.AffixedInputComponent, selector: "vdr-affixed-input", inputs: ["prefix", "suffix"] }, { type: i1.AddressFormComponent, selector: "vdr-address-form", inputs: ["customFields", "formGroup", "availableCountries"] }, { type: i3$2.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$2.ClrDatagridItemsTrackBy, selector: "[ngForTrackBy]", inputs: ["ngForTrackBy"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i3$2.ÇlrAccordionWillyWonka, selector: "clr-accordion" }, { type: i3$2.ÇlrAccordionOompaLoompa, selector: "clr-accordion-panel" }, { type: i3$2.ÇlrDatagridDetailRegisterer, selector: "[clrIfExpanded]" }, { type: i3$2.ClrIfExpanded, selector: "[clrIfExpanded]", inputs: ["clrIfExpanded"], outputs: ["clrIfExpandedChange"] }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i3$2.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i3$2.ClrTextarea, selector: "[clrTextarea]" }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i4.TranslatePipe, "assetPreview": i1.AssetPreviewPipe, "localeCurrency": i1.LocaleCurrencyPipe, "currency": i4$1.CurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2155
2637
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderEditorComponent, decorators: [{
|
|
2156
2638
|
type: Component,
|
|
2157
|
-
args: [{ selector: 'vdr-order-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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\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\">{{ 'common.custom-fields' | translate }}</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 [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [orderState]=\"order.state\"\r\n ></vdr-line-fulfillment>\r\n </td>\r\n <td *ngIf=\"orderLineCustomFields.length\" class=\"order-line-custom-field align-middle\">\r\n <ng-container *ngFor=\"let customField of orderLineCustomFields\">\r\n <vdr-custom-field-control\r\n [customField]=\"customField\"\r\n [customFieldsFormGroup]=\"orderLineCustomFieldsFormArray.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 {{ 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=\"let addedLine of addedLines; trackBy: trackByProductVariantId; let i = index\"\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 *ngIf=\"orderLineCustomFields.length\" class=\"order-line-custom-field align-middle\">\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\">{{ order.shippingLines[0]?.shippingMethod?.name }}</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=\"mb2\">{{ '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 class=\"mb4\" (productSelected)=\"addItemSelectedVariant = $event\">\r\n </vdr-product-variant-selector>\r\n <div *ngIf=\"addItemSelectedVariant\" class=\"flex mb4\">\r\n <img\r\n *ngIf=\"addItemSelectedVariant.productAsset as asset\"\r\n [src]=\"asset | assetPreview: 'tiny'\"\r\n class=\"mr4\"\r\n />\r\n <div>\r\n <strong class=\"mr4\">{{ 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 <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 <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]=\"couponCodesControl\"\r\n >\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n <vdr-chip>{{ item.code }}</vdr-chip> {{ item.promotionName }}\r\n </ng-template>\r\n </ng-select>\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\" /></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 <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>{{ 'order.edit-shipping-address' | translate }}</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>{{ 'order.edit-billing-address' | translate }}</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", 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 .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-right:18px}.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)}.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 tr.modified td{background-color:var(--color-warning-100)}\n"] }]
|
|
2639
|
+
args: [{ selector: 'vdr-order-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\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\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\">{{ 'common.custom-fields' | translate }}</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 [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment\r\n [line]=\"line\"\r\n [orderState]=\"order.state\"\r\n ></vdr-line-fulfillment>\r\n </td>\r\n <td *ngIf=\"orderLineCustomFields.length\" class=\"order-line-custom-field align-middle\">\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=\"let addedLine of addedLines; trackBy: trackByProductVariantId; let i = index\"\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 *ngIf=\"orderLineCustomFields.length\" class=\"order-line-custom-field align-middle\">\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\">{{ order.shippingLines[0]?.shippingMethod?.name }}</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=\"mb2\">{{ '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 class=\"mb4\" (productSelected)=\"addItemSelectedVariant = $event\">\r\n </vdr-product-variant-selector>\r\n <div *ngIf=\"addItemSelectedVariant\" class=\"flex mb4\">\r\n <img\r\n *ngIf=\"addItemSelectedVariant.productAsset as asset\"\r\n [src]=\"asset | assetPreview: 'tiny'\"\r\n class=\"mr4\"\r\n />\r\n <div>\r\n <strong class=\"mr4\">{{ 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 <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 [label]=\"'order.tax-description' | translate\" 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>{{ 'order.edit-shipping-address' | translate }}</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>{{ 'order.edit-billing-address' | translate }}</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", 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-right: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)}.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 tr.modified td{background-color:var(--color-warning-100)}.order-table .order-line-custom-field{text-align:start}\n"] }]
|
|
2158
2640
|
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i1.ServerConfigService }, { type: i0.ChangeDetectorRef }, { type: i1.DataService }, { type: i1.NotificationService }, { type: i1.ModalService }, { type: OrderTransitionService }]; } });
|
|
2159
2641
|
|
|
2160
2642
|
class OrderListComponent extends BaseListComponent {
|
|
@@ -2163,6 +2645,7 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2163
2645
|
this.serverConfigService = serverConfigService;
|
|
2164
2646
|
this.dataService = dataService;
|
|
2165
2647
|
this.localStorageService = localStorageService;
|
|
2648
|
+
this.searchControl = new FormControl('');
|
|
2166
2649
|
this.searchOrderCodeControl = new FormControl('');
|
|
2167
2650
|
this.searchLastNameControl = new FormControl('');
|
|
2168
2651
|
this.orderStates = this.serverConfigService.getOrderProcessStates().map(item => item.name);
|
|
@@ -2172,7 +2655,7 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2172
2655
|
label: marker('order.filter-preset-open'),
|
|
2173
2656
|
config: {
|
|
2174
2657
|
active: false,
|
|
2175
|
-
states: this.orderStates.filter(s => s !== 'Delivered' && s !== 'Cancelled' && s !== 'Shipped'),
|
|
2658
|
+
states: this.orderStates.filter(s => s !== 'Delivered' && s !== 'Cancelled' && s !== 'Shipped' && s !== 'Draft'),
|
|
2176
2659
|
},
|
|
2177
2660
|
},
|
|
2178
2661
|
{
|
|
@@ -2198,21 +2681,37 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2198
2681
|
active: true,
|
|
2199
2682
|
},
|
|
2200
2683
|
},
|
|
2684
|
+
{
|
|
2685
|
+
name: 'draft',
|
|
2686
|
+
label: marker('order.filter-preset-draft'),
|
|
2687
|
+
config: {
|
|
2688
|
+
active: false,
|
|
2689
|
+
states: ['Draft'],
|
|
2690
|
+
},
|
|
2691
|
+
},
|
|
2201
2692
|
];
|
|
2693
|
+
this.canCreateDraftOrder = false;
|
|
2202
2694
|
super.setQueryFn(
|
|
2203
2695
|
// tslint:disable-next-line:no-shadowed-variable
|
|
2204
2696
|
(take, skip) => this.dataService.order.getOrders({ take, skip }).refetchOnChannelChange(), data => data.orders,
|
|
2205
2697
|
// tslint:disable-next-line:no-shadowed-variable
|
|
2206
|
-
(skip, take) => this.createQueryOptions(skip, take, this.
|
|
2698
|
+
(skip, take) => this.createQueryOptions(skip, take, this.searchControl.value, this.route.snapshot.queryParamMap.get('filter') || 'open'));
|
|
2207
2699
|
const lastFilters = this.localStorageService.get('orderListLastCustomFilters');
|
|
2208
2700
|
if (lastFilters) {
|
|
2209
2701
|
this.setQueryParam(lastFilters, { replaceUrl: true });
|
|
2210
2702
|
}
|
|
2703
|
+
this.canCreateDraftOrder = !!this.serverConfigService
|
|
2704
|
+
.getOrderProcessStates()
|
|
2705
|
+
.find(state => state.name === 'Created')
|
|
2706
|
+
?.to.includes('Draft');
|
|
2707
|
+
if (!this.canCreateDraftOrder) {
|
|
2708
|
+
this.filterPresets = this.filterPresets.filter(p => p.name !== 'draft');
|
|
2709
|
+
}
|
|
2211
2710
|
}
|
|
2212
2711
|
ngOnInit() {
|
|
2213
2712
|
super.ngOnInit();
|
|
2214
2713
|
this.activePreset$ = this.route.queryParamMap.pipe(map(qpm => qpm.get('filter') || 'open'), distinctUntilChanged());
|
|
2215
|
-
const searchTerms$ = merge(this.
|
|
2714
|
+
const searchTerms$ = merge(this.searchControl.valueChanges).pipe(filter(value => 2 < value.length || value.length === 0), debounceTime(250));
|
|
2216
2715
|
merge(searchTerms$, this.route.queryParamMap)
|
|
2217
2716
|
.pipe(takeUntil(this.destroy$))
|
|
2218
2717
|
.subscribe(val => {
|
|
@@ -2251,10 +2750,11 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2251
2750
|
}
|
|
2252
2751
|
createQueryOptions(
|
|
2253
2752
|
// tslint:disable-next-line:no-shadowed-variable
|
|
2254
|
-
skip, take,
|
|
2753
|
+
skip, take, searchTerm, activeFilterPreset) {
|
|
2255
2754
|
const filterConfig = this.filterPresets.find(p => p.name === activeFilterPreset);
|
|
2256
2755
|
// tslint:disable-next-line:no-shadowed-variable
|
|
2257
|
-
|
|
2756
|
+
let filter = {};
|
|
2757
|
+
let filterOperator = LogicalOperator.AND;
|
|
2258
2758
|
if (filterConfig) {
|
|
2259
2759
|
if (filterConfig.config.active != null) {
|
|
2260
2760
|
filter.active = {
|
|
@@ -2296,15 +2796,19 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2296
2796
|
};
|
|
2297
2797
|
}
|
|
2298
2798
|
}
|
|
2299
|
-
if (
|
|
2300
|
-
filter
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2799
|
+
if (searchTerm) {
|
|
2800
|
+
filter = {
|
|
2801
|
+
customerLastName: {
|
|
2802
|
+
contains: searchTerm,
|
|
2803
|
+
},
|
|
2804
|
+
transactionId: {
|
|
2805
|
+
contains: searchTerm,
|
|
2806
|
+
},
|
|
2807
|
+
code: {
|
|
2808
|
+
contains: searchTerm,
|
|
2809
|
+
},
|
|
2307
2810
|
};
|
|
2811
|
+
filterOperator = LogicalOperator.OR;
|
|
2308
2812
|
}
|
|
2309
2813
|
return {
|
|
2310
2814
|
options: {
|
|
@@ -2316,6 +2820,7 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2316
2820
|
sort: {
|
|
2317
2821
|
updatedAt: SortOrder.DESC,
|
|
2318
2822
|
},
|
|
2823
|
+
filterOperator,
|
|
2319
2824
|
},
|
|
2320
2825
|
};
|
|
2321
2826
|
}
|
|
@@ -2329,25 +2834,39 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2329
2834
|
}
|
|
2330
2835
|
}
|
|
2331
2836
|
OrderListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderListComponent, deps: [{ token: i1.ServerConfigService }, { token: i1.DataService }, { token: i1.LocalStorageService }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
2332
|
-
OrderListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderListComponent, selector: "vdr-order-list", usesInheritance: true, ngImport: i0, template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"search-form\">\r\n <div class=\"btn-group btn-outline-primary\" *ngIf=\"activePreset$ | async as activePreset\">\r\n <button\r\n class=\"btn\"\r\n *ngFor=\"let preset of filterPresets\"\r\n [class.btn-primary]=\"activePreset === preset.name\"\r\n (click)=\"selectFilterPreset(preset.name)\"\r\n >\r\n {{ preset.label | translate }}\r\n </button>\r\n <button\r\n class=\"btn\"\r\n [class.btn-primary]=\"activePreset === 'custom'\"\r\n (click)=\"selectFilterPreset('custom')\"\r\n >\r\n {{ 'order.filter-custom' | translate }}\r\n <clr-icon shape=\"angle down\"></clr-icon>\r\n </button>\r\n </div>\r\n\r\n <input\r\n type=\"text\"\r\n name=\"searchTerm\"\r\n [formControl]=\"searchOrderCodeControl\"\r\n [placeholder]=\"'order.search-by-order-code' | translate\"\r\n class=\"search-input\"\r\n />\r\n <input\r\n type=\"text\"\r\n name=\"searchTerm\"\r\n [formControl]=\"searchLastNameControl\"\r\n [placeholder]=\"'order.search-by-customer-last-name' | translate\"\r\n class=\"search-input\"\r\n />\r\n </div>\r\n <div class=\"custom-filters\" [class.expanded]=\"(activePreset$ | async) === 'custom'\">\r\n <form [formGroup]=\"customFilterForm\">\r\n <div class=\"flex align-center\">\r\n <ng-select\r\n [items]=\"orderStates\"\r\n appendTo=\"body\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n formControlName=\"states\"\r\n [placeholder]=\"'state.all-orders' | translate\"\r\n [clearable]=\"true\"\r\n [searchable]=\"false\"\r\n >\r\n <ng-template ng-option-tmp let-item=\"item\">{{ item | stateI18nToken | translate }}</ng-template>\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-label\"> {{ item | stateI18nToken | translate }}</span>\r\n <span class=\"ng-value-icon right\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n </ng-template>\r\n </ng-select>\r\n <button\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"customFilterForm.pristine\"\r\n (click)=\"applyCustomFilters()\"\r\n >\r\n {{ 'order.apply-filters' | translate }}\r\n <clr-icon shape=\"filter\"></clr-icon>\r\n </button>\r\n </div>\r\n <div class=\"flex\">\r\n <div>\r\n <label>{{ 'order.placed-at-start' | translate }}</label>\r\n <vdr-datetime-picker formControlName=\"placedAtStart\"></vdr-datetime-picker>\r\n </div>\r\n <div>\r\n <label>{{ 'order.placed-at-end' | translate }}</label>\r\n <vdr-datetime-picker formControlName=\"placedAtEnd\"></vdr-datetime-picker>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-list\"></vdr-action-bar-items>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<vdr-data-table\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.customer' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.state' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.total' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'common.updated-at' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.placed-at' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.shipping' | translate }}</vdr-dt-column>\r\n <vdr-dt-column></vdr-dt-column>\r\n <ng-template let-order=\"item\">\r\n <td class=\"left align-middle\">{{ order.code }}</td>\r\n <td class=\"left align-middle\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n </td>\r\n <td class=\"left align-middle\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </td>\r\n <td class=\"left align-middle\">{{ order.total | localeCurrency: order.currencyCode }}</td>\r\n <td class=\"left align-middle\">{{ order.updatedAt | timeAgo }}</td>\r\n <td class=\"left align-middle\">{{ order.orderPlacedAt | localeDate: 'medium' }}</td>\r\n <td class=\"left align-middle\">{{ getShippingNames(order) }}</td>\r\n <td class=\"right align-middle\">\r\n <vdr-table-row-action\r\n iconShape=\"shopping-cart\"\r\n [label]=\"'common.open' | translate\"\r\n [linkTo]=\"order.state === 'Modifying' ? ['./', order.id, 'modify'] : ['./', order.id]\"\r\n ></vdr-table-row-action>\r\n </td>\r\n </ng-template>\r\n</vdr-data-table>\r\n", styles: [".search-form{display:flex;flex-direction:column;align-items:baseline;width:100%;margin-bottom:6px}@media screen and (min-width: 768px){.search-form{flex-direction:row}}.search-input{margin-left:6px;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"], components: [{ type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { type: i1.DatetimePickerComponent, selector: "vdr-datetime-picker", inputs: ["yearRange", "weekStartDay", "timeGranularityInterval", "min", "max", "readonly"] }, { type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { type: i1.DataTableComponent, selector: "vdr-data-table", inputs: ["items", "itemsPerPage", "currentPage", "totalItems", "allSelected", "isRowSelectedFn", "emptyStateLabel"], outputs: ["allSelectChange", "rowSelectChange", "pageChange", "itemsPerPageChange"] }, { type: i1.DataTableColumnComponent, selector: "vdr-dt-column", inputs: ["expand"] }, { type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { type: i1.TableRowActionComponent, selector: "vdr-table-row-action", inputs: ["linkTo", "label", "iconShape", "disabled"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { type: i2.ClrLabel, selector: "label", inputs: ["for"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe, "localeCurrency": i1.LocaleCurrencyPipe, "timeAgo": i1.TimeAgoPipe, "localeDate": i1.LocaleDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2837
|
+
OrderListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: OrderListComponent, selector: "vdr-order-list", usesInheritance: true, ngImport: i0, template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"search-form\">\r\n <div class=\"filter-presets btn-group btn-outline-primary\" *ngIf=\"activePreset$ | async as activePreset\">\r\n <button\r\n class=\"btn\"\r\n *ngFor=\"let preset of filterPresets\"\r\n [class.btn-primary]=\"activePreset === preset.name\"\r\n (click)=\"selectFilterPreset(preset.name)\"\r\n >\r\n {{ preset.label | translate }}\r\n </button>\r\n <button\r\n class=\"btn\"\r\n [class.btn-primary]=\"activePreset === 'custom'\"\r\n (click)=\"selectFilterPreset('custom')\"\r\n >\r\n {{ 'order.filter-custom' | translate }}\r\n <clr-icon shape=\"angle down\"></clr-icon>\r\n </button>\r\n </div>\r\n <input\r\n type=\"text\"\r\n name=\"searchTerm\"\r\n [formControl]=\"searchControl\"\r\n [placeholder]=\"'order.search-by-order-filters' | translate\"\r\n class=\"search-input\"\r\n />\r\n </div>\r\n <div class=\"custom-filters\" [class.expanded]=\"(activePreset$ | async) === 'custom'\">\r\n <form [formGroup]=\"customFilterForm\">\r\n <div class=\"flex align-center\">\r\n <ng-select\r\n [items]=\"orderStates\"\r\n appendTo=\"body\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n formControlName=\"states\"\r\n [placeholder]=\"'state.all-orders' | translate\"\r\n [clearable]=\"true\"\r\n [searchable]=\"false\"\r\n >\r\n <ng-template ng-option-tmp let-item=\"item\">{{\r\n item | stateI18nToken | translate\r\n }}</ng-template>\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-label\"> {{ item | stateI18nToken | translate }}</span>\r\n <span class=\"ng-value-icon right\" (click)=\"clear(item)\" aria-hidden=\"true\"\r\n >\u00D7</span\r\n >\r\n </ng-template>\r\n </ng-select>\r\n <button\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"customFilterForm.pristine\"\r\n (click)=\"applyCustomFilters()\"\r\n >\r\n {{ 'order.apply-filters' | translate }}\r\n <clr-icon shape=\"filter\"></clr-icon>\r\n </button>\r\n </div>\r\n <div class=\"flex\">\r\n <div>\r\n <label>{{ 'order.placed-at-start' | translate }}</label>\r\n <vdr-datetime-picker formControlName=\"placedAtStart\"></vdr-datetime-picker>\r\n </div>\r\n <div>\r\n <label>{{ 'order.placed-at-end' | translate }}</label>\r\n <vdr-datetime-picker formControlName=\"placedAtEnd\"></vdr-datetime-picker>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </vdr-ab-left>\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 btn-primary mt1\" *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\r\n<vdr-data-table\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.customer' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.state' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.total' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'common.updated-at' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.placed-at' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.shipping' | translate }}</vdr-dt-column>\r\n <vdr-dt-column></vdr-dt-column>\r\n <ng-template let-order=\"item\">\r\n <td class=\"left align-middle\">{{ order.code }}</td>\r\n <td class=\"left align-middle\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n </td>\r\n <td class=\"left align-middle\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </td>\r\n <td class=\"left align-middle\">{{ order.totalWithTax | localeCurrency: order.currencyCode }}</td>\r\n <td class=\"left align-middle\">{{ order.updatedAt | timeAgo }}</td>\r\n <td class=\"left align-middle\">{{ order.orderPlacedAt | localeDate: 'medium' }}</td>\r\n <td class=\"left align-middle\">{{ getShippingNames(order) }}</td>\r\n <td class=\"right align-middle\">\r\n <vdr-table-row-action\r\n iconShape=\"shopping-cart\"\r\n [label]=\"'common.open' | translate\"\r\n [linkTo]=\"\r\n order.state === 'Modifying'\r\n ? ['./', order.id, 'modify']\r\n : order.state === 'Draft'\r\n ? ['./draft', order.id]\r\n : ['./', order.id]\r\n \"\r\n ></vdr-table-row-action>\r\n </td>\r\n </ng-template>\r\n</vdr-data-table>\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"], components: [{ type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { 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"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { type: i1.DatetimePickerComponent, selector: "vdr-datetime-picker", inputs: ["yearRange", "weekStartDay", "timeGranularityInterval", "min", "max", "readonly"] }, { type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { type: i1.DataTableComponent, selector: "vdr-data-table", inputs: ["items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "selectionManager", "allSelected", "isRowSelectedFn"], outputs: ["pageChange", "itemsPerPageChange", "allSelectChange", "rowSelectChange"] }, { type: i1.DataTableColumnComponent, selector: "vdr-dt-column", inputs: ["expand"] }, { type: i1.CustomerLabelComponent, selector: "vdr-customer-label", inputs: ["customer"] }, { type: i1.OrderStateLabelComponent, selector: "vdr-order-state-label", inputs: ["state"] }, { type: i1.TableRowActionComponent, selector: "vdr-table-row-action", inputs: ["linkTo", "label", "iconShape", "disabled"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$2.ClrIconCustomTag, selector: "clr-icon" }, { type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { type: i3$2.ClrLabel, selector: "label", inputs: ["for"] }, { type: i1.IfPermissionsDirective, selector: "[vdrIfPermissions]", inputs: ["vdrIfPermissions", "vdrIfPermissionsElse"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i4.TranslatePipe, "stateI18nToken": i1.StateI18nTokenPipe, "localeCurrency": i1.LocaleCurrencyPipe, "timeAgo": i1.TimeAgoPipe, "localeDate": i1.LocaleDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2333
2838
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderListComponent, decorators: [{
|
|
2334
2839
|
type: Component,
|
|
2335
|
-
args: [{ selector: 'vdr-order-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"search-form\">\r\n <div class=\"btn-group btn-outline-primary\" *ngIf=\"activePreset$ | async as activePreset\">\r\n <button\r\n class=\"btn\"\r\n *ngFor=\"let preset of filterPresets\"\r\n [class.btn-primary]=\"activePreset === preset.name\"\r\n (click)=\"selectFilterPreset(preset.name)\"\r\n >\r\n {{ preset.label | translate }}\r\n </button>\r\n <button\r\n class=\"btn\"\r\n [class.btn-primary]=\"activePreset === 'custom'\"\r\n (click)=\"selectFilterPreset('custom')\"\r\n >\r\n {{ 'order.filter-custom' | translate }}\r\n <clr-icon shape=\"angle down\"></clr-icon>\r\n </button>\r\n </div>\r\n
|
|
2840
|
+
args: [{ selector: 'vdr-order-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"search-form\">\r\n <div class=\"filter-presets btn-group btn-outline-primary\" *ngIf=\"activePreset$ | async as activePreset\">\r\n <button\r\n class=\"btn\"\r\n *ngFor=\"let preset of filterPresets\"\r\n [class.btn-primary]=\"activePreset === preset.name\"\r\n (click)=\"selectFilterPreset(preset.name)\"\r\n >\r\n {{ preset.label | translate }}\r\n </button>\r\n <button\r\n class=\"btn\"\r\n [class.btn-primary]=\"activePreset === 'custom'\"\r\n (click)=\"selectFilterPreset('custom')\"\r\n >\r\n {{ 'order.filter-custom' | translate }}\r\n <clr-icon shape=\"angle down\"></clr-icon>\r\n </button>\r\n </div>\r\n <input\r\n type=\"text\"\r\n name=\"searchTerm\"\r\n [formControl]=\"searchControl\"\r\n [placeholder]=\"'order.search-by-order-filters' | translate\"\r\n class=\"search-input\"\r\n />\r\n </div>\r\n <div class=\"custom-filters\" [class.expanded]=\"(activePreset$ | async) === 'custom'\">\r\n <form [formGroup]=\"customFilterForm\">\r\n <div class=\"flex align-center\">\r\n <ng-select\r\n [items]=\"orderStates\"\r\n appendTo=\"body\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n formControlName=\"states\"\r\n [placeholder]=\"'state.all-orders' | translate\"\r\n [clearable]=\"true\"\r\n [searchable]=\"false\"\r\n >\r\n <ng-template ng-option-tmp let-item=\"item\">{{\r\n item | stateI18nToken | translate\r\n }}</ng-template>\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-label\"> {{ item | stateI18nToken | translate }}</span>\r\n <span class=\"ng-value-icon right\" (click)=\"clear(item)\" aria-hidden=\"true\"\r\n >\u00D7</span\r\n >\r\n </ng-template>\r\n </ng-select>\r\n <button\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"customFilterForm.pristine\"\r\n (click)=\"applyCustomFilters()\"\r\n >\r\n {{ 'order.apply-filters' | translate }}\r\n <clr-icon shape=\"filter\"></clr-icon>\r\n </button>\r\n </div>\r\n <div class=\"flex\">\r\n <div>\r\n <label>{{ 'order.placed-at-start' | translate }}</label>\r\n <vdr-datetime-picker formControlName=\"placedAtStart\"></vdr-datetime-picker>\r\n </div>\r\n <div>\r\n <label>{{ 'order.placed-at-end' | translate }}</label>\r\n <vdr-datetime-picker formControlName=\"placedAtEnd\"></vdr-datetime-picker>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </vdr-ab-left>\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 btn-primary mt1\" *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\r\n<vdr-data-table\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.customer' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.state' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.total' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'common.updated-at' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.placed-at' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.shipping' | translate }}</vdr-dt-column>\r\n <vdr-dt-column></vdr-dt-column>\r\n <ng-template let-order=\"item\">\r\n <td class=\"left align-middle\">{{ order.code }}</td>\r\n <td class=\"left align-middle\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n </td>\r\n <td class=\"left align-middle\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </td>\r\n <td class=\"left align-middle\">{{ order.totalWithTax | localeCurrency: order.currencyCode }}</td>\r\n <td class=\"left align-middle\">{{ order.updatedAt | timeAgo }}</td>\r\n <td class=\"left align-middle\">{{ order.orderPlacedAt | localeDate: 'medium' }}</td>\r\n <td class=\"left align-middle\">{{ getShippingNames(order) }}</td>\r\n <td class=\"right align-middle\">\r\n <vdr-table-row-action\r\n iconShape=\"shopping-cart\"\r\n [label]=\"'common.open' | translate\"\r\n [linkTo]=\"\r\n order.state === 'Modifying'\r\n ? ['./', order.id, 'modify']\r\n : order.state === 'Draft'\r\n ? ['./draft', order.id]\r\n : ['./', order.id]\r\n \"\r\n ></vdr-table-row-action>\r\n </td>\r\n </ng-template>\r\n</vdr-data-table>\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"] }]
|
|
2336
2841
|
}], ctorParameters: function () { return [{ type: i1.ServerConfigService }, { type: i1.DataService }, { type: i1.LocalStorageService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
|
|
2337
2842
|
|
|
2338
2843
|
/**
|
|
2339
2844
|
* Resolves the id from the path into a Customer entity.
|
|
2340
2845
|
*/
|
|
2341
|
-
class OrderResolver
|
|
2846
|
+
class OrderResolver {
|
|
2342
2847
|
constructor(router, dataService) {
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2848
|
+
this.router = router;
|
|
2849
|
+
this.dataService = dataService;
|
|
2850
|
+
}
|
|
2851
|
+
/** @internal */
|
|
2852
|
+
resolve(route, state) {
|
|
2853
|
+
const id = route.paramMap.get('id');
|
|
2854
|
+
// Complete the entity stream upon navigating away
|
|
2855
|
+
const navigateAway$ = this.router.events.pipe(filter(event => event instanceof ActivationStart));
|
|
2856
|
+
const stream = this.dataService.order
|
|
2857
|
+
.getOrder(id)
|
|
2858
|
+
.mapStream(data => data.order)
|
|
2859
|
+
.pipe(switchMap(order => {
|
|
2860
|
+
if (order?.state === 'Draft' && route.component !== DraftOrderDetailComponent) {
|
|
2861
|
+
// Make sure Draft orders only get displayed with the DraftOrderDetailComponent
|
|
2862
|
+
this.router.navigate(['/orders/draft', id]);
|
|
2863
|
+
return EMPTY;
|
|
2864
|
+
}
|
|
2865
|
+
else {
|
|
2866
|
+
return [order];
|
|
2867
|
+
}
|
|
2868
|
+
}), takeUntil(navigateAway$), filter(notNullOrUndefined), shareReplay(1));
|
|
2869
|
+
return stream.pipe(take(1), map(() => stream));
|
|
2351
2870
|
}
|
|
2352
2871
|
}
|
|
2353
2872
|
OrderResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderResolver, deps: [{ token: i1$1.Router }, { token: i1.DataService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2359,6 +2878,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
2359
2878
|
}]
|
|
2360
2879
|
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1.DataService }]; } });
|
|
2361
2880
|
|
|
2881
|
+
class OrderGuard {
|
|
2882
|
+
constructor(dataService, router) {
|
|
2883
|
+
this.dataService = dataService;
|
|
2884
|
+
this.router = router;
|
|
2885
|
+
}
|
|
2886
|
+
canActivate(route, state) {
|
|
2887
|
+
const isDraft = state.url.includes('orders/draft');
|
|
2888
|
+
const id = route.paramMap.get('id');
|
|
2889
|
+
if (isDraft) {
|
|
2890
|
+
if (id === 'create') {
|
|
2891
|
+
return this.dataService.order
|
|
2892
|
+
.createDraftOrder()
|
|
2893
|
+
.pipe(map(({ createDraftOrder }) => this.router.parseUrl(`/orders/draft/${createDraftOrder.id}`)));
|
|
2894
|
+
}
|
|
2895
|
+
else {
|
|
2896
|
+
return true;
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
else {
|
|
2900
|
+
return true;
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
OrderGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderGuard, deps: [{ token: i1.DataService }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2905
|
+
OrderGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderGuard, providedIn: 'root' });
|
|
2906
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderGuard, decorators: [{
|
|
2907
|
+
type: Injectable,
|
|
2908
|
+
args: [{
|
|
2909
|
+
providedIn: 'root',
|
|
2910
|
+
}]
|
|
2911
|
+
}], ctorParameters: function () { return [{ type: i1.DataService }, { type: i1$1.Router }]; } });
|
|
2912
|
+
|
|
2362
2913
|
const orderRoutes = [
|
|
2363
2914
|
{
|
|
2364
2915
|
path: '',
|
|
@@ -2367,10 +2918,25 @@ const orderRoutes = [
|
|
|
2367
2918
|
breadcrumb: marker('breadcrumb.orders'),
|
|
2368
2919
|
},
|
|
2369
2920
|
},
|
|
2921
|
+
{
|
|
2922
|
+
path: 'draft/:id',
|
|
2923
|
+
component: DraftOrderDetailComponent,
|
|
2924
|
+
resolve: {
|
|
2925
|
+
entity: OrderResolver,
|
|
2926
|
+
},
|
|
2927
|
+
canActivate: [OrderGuard],
|
|
2928
|
+
canDeactivate: [CanDeactivateDetailGuard],
|
|
2929
|
+
data: {
|
|
2930
|
+
breadcrumb: orderBreadcrumb,
|
|
2931
|
+
},
|
|
2932
|
+
},
|
|
2370
2933
|
{
|
|
2371
2934
|
path: ':id',
|
|
2372
2935
|
component: OrderDetailComponent,
|
|
2373
|
-
resolve:
|
|
2936
|
+
resolve: {
|
|
2937
|
+
entity: OrderResolver,
|
|
2938
|
+
},
|
|
2939
|
+
canActivate: [OrderGuard],
|
|
2374
2940
|
canDeactivate: [CanDeactivateDetailGuard],
|
|
2375
2941
|
data: {
|
|
2376
2942
|
breadcrumb: orderBreadcrumb,
|
|
@@ -2379,7 +2945,9 @@ const orderRoutes = [
|
|
|
2379
2945
|
{
|
|
2380
2946
|
path: ':id/modify',
|
|
2381
2947
|
component: OrderEditorComponent,
|
|
2382
|
-
resolve:
|
|
2948
|
+
resolve: {
|
|
2949
|
+
entity: OrderResolver,
|
|
2950
|
+
},
|
|
2383
2951
|
// canDeactivate: [CanDeactivateDetailGuard],
|
|
2384
2952
|
data: {
|
|
2385
2953
|
breadcrumb: modifyingOrderBreadcrumb,
|
|
@@ -2434,7 +3002,13 @@ OrderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "1
|
|
|
2434
3002
|
OrderEditsPreviewDialogComponent,
|
|
2435
3003
|
ModificationDetailComponent,
|
|
2436
3004
|
AddManualPaymentDialogComponent,
|
|
2437
|
-
OrderStateSelectDialogComponent
|
|
3005
|
+
OrderStateSelectDialogComponent,
|
|
3006
|
+
DraftOrderDetailComponent,
|
|
3007
|
+
DraftOrderVariantSelectorComponent,
|
|
3008
|
+
SelectCustomerDialogComponent,
|
|
3009
|
+
SelectAddressDialogComponent,
|
|
3010
|
+
CouponCodeSelectorComponent,
|
|
3011
|
+
SelectShippingMethodDialogComponent], imports: [SharedModule, i1$1.RouterModule] });
|
|
2438
3012
|
OrderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderModule, imports: [[SharedModule, RouterModule.forChild(orderRoutes)]] });
|
|
2439
3013
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OrderModule, decorators: [{
|
|
2440
3014
|
type: NgModule,
|
|
@@ -2469,6 +3043,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
2469
3043
|
ModificationDetailComponent,
|
|
2470
3044
|
AddManualPaymentDialogComponent,
|
|
2471
3045
|
OrderStateSelectDialogComponent,
|
|
3046
|
+
DraftOrderDetailComponent,
|
|
3047
|
+
DraftOrderVariantSelectorComponent,
|
|
3048
|
+
SelectCustomerDialogComponent,
|
|
3049
|
+
SelectAddressDialogComponent,
|
|
3050
|
+
CouponCodeSelectorComponent,
|
|
3051
|
+
SelectShippingMethodDialogComponent,
|
|
2472
3052
|
],
|
|
2473
3053
|
}]
|
|
2474
3054
|
}] });
|
|
@@ -2479,5 +3059,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
2479
3059
|
* Generated bundle index. Do not edit.
|
|
2480
3060
|
*/
|
|
2481
3061
|
|
|
2482
|
-
export { AddManualPaymentDialogComponent, CancelOrderDialogComponent, FulfillOrderDialogComponent, FulfillmentCardComponent, FulfillmentDetailComponent, FulfillmentStateLabelComponent, LineFulfillmentComponent, LineRefundsComponent, ModificationDetailComponent, NODE_HEIGHT, OrderCustomFieldsCardComponent, OrderDetailComponent, OrderEditResultType, OrderEditorComponent, OrderEditsPreviewDialogComponent, OrderHistoryComponent, OrderListComponent, OrderModule, OrderPaymentCardComponent, OrderProcessEdgeComponent, OrderProcessGraphComponent, OrderProcessGraphDialogComponent, OrderProcessNodeComponent, OrderResolver, OrderStateSelectDialogComponent, OrderTableComponent, OrderTransitionService, PaymentDetailComponent, PaymentStateLabelComponent, RefundOrderDialogComponent, RefundStateLabelComponent, SettleRefundDialogComponent, SimpleItemListComponent, modifyingOrderBreadcrumb, orderBreadcrumb, orderRoutes };
|
|
3062
|
+
export { AddManualPaymentDialogComponent, CancelOrderDialogComponent, CouponCodeSelectorComponent, DraftOrderDetailComponent, DraftOrderVariantSelectorComponent, FulfillOrderDialogComponent, FulfillmentCardComponent, FulfillmentDetailComponent, FulfillmentStateLabelComponent, GET_CUSTOMER_ADDRESSES, LineFulfillmentComponent, LineRefundsComponent, ModificationDetailComponent, NODE_HEIGHT, OrderCustomFieldsCardComponent, OrderDetailComponent, OrderEditResultType, OrderEditorComponent, OrderEditsPreviewDialogComponent, OrderGuard, OrderHistoryComponent, OrderListComponent, OrderModule, OrderPaymentCardComponent, OrderProcessEdgeComponent, OrderProcessGraphComponent, OrderProcessGraphDialogComponent, OrderProcessNodeComponent, OrderResolver, OrderStateSelectDialogComponent, OrderTableComponent, OrderTransitionService, PaymentDetailComponent, PaymentStateLabelComponent, RefundOrderDialogComponent, RefundStateLabelComponent, SelectAddressDialogComponent, SelectCustomerDialogComponent, SelectShippingMethodDialogComponent, SettleRefundDialogComponent, SimpleItemListComponent, modifyingOrderBreadcrumb, orderBreadcrumb, orderRoutes };
|
|
2483
3063
|
//# sourceMappingURL=vendure-admin-ui-order.mjs.map
|