@vendure/admin-ui 1.4.7 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/vendure-admin-ui-catalog.umd.js +134 -143
- package/bundles/vendure-admin-ui-catalog.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-core.umd.js +329 -269
- package/bundles/vendure-admin-ui-core.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-customer.umd.js +51 -20
- package/bundles/vendure-admin-ui-customer.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-order.umd.js +109 -19
- package/bundles/vendure-admin-ui-order.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-settings.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-system.umd.js.map +1 -1
- package/catalog/components/{product-assets/product-assets.component.d.ts → assets/assets.component.d.ts} +4 -10
- package/catalog/components/product-detail/product-detail.component.d.ts +2 -1
- package/catalog/components/product-variants-list/product-variants-list.component.d.ts +2 -1
- package/catalog/public_api.d.ts +1 -1
- package/catalog/vendure-admin-ui-catalog.metadata.json +1 -1
- package/core/common/generated-types.d.ts +109 -6
- package/core/common/version.d.ts +1 -1
- package/core/data/definitions/customer-definitions.d.ts +1 -0
- package/core/data/providers/customer-data.service.d.ts +1 -0
- package/core/data/providers/promotion-data.service.d.ts +2 -2
- package/core/public_api.d.ts +2 -0
- package/core/shared/components/asset-preview-links/asset-preview-links.component.d.ts +5 -0
- package/core/shared/components/object-tree/object-tree.component.d.ts +3 -3
- package/core/shared/dynamic-form-inputs/relation-form-input/generic/relation-generic-input.component.d.ts +15 -0
- package/core/vendure-admin-ui-core.metadata.json +1 -1
- package/customer/components/address-card/address-card.component.d.ts +2 -0
- package/customer/components/customer-detail/customer-detail.component.d.ts +2 -0
- package/customer/components/customer-list/customer-list.component.d.ts +1 -2
- package/customer/vendure-admin-ui-customer.metadata.json +1 -1
- package/esm2015/catalog/catalog.module.js +3 -3
- package/esm2015/catalog/components/assets/assets.component.js +93 -0
- package/esm2015/catalog/components/collection-detail/collection-detail.component.js +2 -2
- package/esm2015/catalog/components/facet-detail/facet-detail.component.js +3 -3
- package/esm2015/catalog/components/product-detail/product-detail.component.js +4 -3
- package/esm2015/catalog/components/product-variants-list/product-variants-list.component.js +9 -2
- package/esm2015/catalog/public_api.js +2 -2
- package/esm2015/core/common/generated-types.js +30 -1
- package/esm2015/core/common/introspection-result.js +189 -249
- package/esm2015/core/common/utilities/configurable-operation-utils.js +21 -3
- package/esm2015/core/common/version.js +2 -2
- package/esm2015/core/data/definitions/customer-definitions.js +8 -1
- package/esm2015/core/data/definitions/order-definitions.js +2 -1
- package/esm2015/core/data/providers/customer-data.service.js +5 -2
- package/esm2015/core/data/providers/interceptor.js +1 -1
- package/esm2015/core/data/providers/promotion-data.service.js +3 -2
- package/esm2015/core/data/providers/shipping-method-data.service.js +1 -1
- package/esm2015/core/data/utils/remove-readonly-custom-fields.js +1 -1
- package/esm2015/core/public_api.js +3 -1
- package/esm2015/core/shared/components/address-form/address-form.component.js +1 -1
- package/esm2015/core/shared/components/asset-gallery/asset-gallery.component.js +2 -2
- package/esm2015/core/shared/components/asset-preview/asset-preview.component.js +4 -4
- package/esm2015/core/shared/components/asset-preview-links/asset-preview-links.component.js +18 -0
- package/esm2015/core/shared/components/object-tree/object-tree.component.js +3 -3
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/generic/relation-generic-input.component.js +48 -0
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/relation-form-input.component.js +2 -2
- package/esm2015/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.js +1 -1
- package/esm2015/core/shared/shared.module.js +5 -1
- package/esm2015/customer/components/address-card/address-card.component.js +9 -3
- package/esm2015/customer/components/customer-detail/customer-detail.component.js +35 -13
- package/esm2015/customer/components/customer-list/customer-list.component.js +12 -9
- package/esm2015/order/components/add-manual-payment-dialog/add-manual-payment-dialog.component.js +1 -1
- package/esm2015/order/components/cancel-order-dialog/cancel-order-dialog.component.js +36 -6
- package/esm2015/order/components/fulfill-order-dialog/fulfill-order-dialog.component.js +1 -1
- package/esm2015/order/components/line-refunds/line-refunds.component.js +1 -1
- package/esm2015/order/components/modification-detail/modification-detail.component.js +1 -1
- package/esm2015/order/components/order-detail/order-detail.component.js +2 -2
- package/esm2015/order/components/order-editor/order-editor.component.js +23 -8
- package/esm2015/order/components/order-edits-preview-dialog/order-edits-preview-dialog.component.js +1 -1
- package/esm2015/order/components/order-history/order-history.component.js +2 -2
- package/esm2015/order/components/order-list/order-list.component.js +1 -1
- package/esm2015/order/components/order-table/order-table.component.js +3 -3
- package/esm2015/order/components/refund-order-dialog/refund-order-dialog.component.js +10 -5
- package/esm2015/order/order.routes.js +1 -1
- package/esm2015/settings/components/role-list/role-list.component.js +1 -1
- package/esm2015/settings/components/test-order-builder/test-order-builder.component.js +1 -1
- package/esm2015/settings/providers/routing/shipping-method-resolver.js +1 -1
- package/esm2015/system/components/job-list/job-list.component.js +1 -1
- package/fesm2015/vendure-admin-ui-catalog.js +105 -111
- package/fesm2015/vendure-admin-ui-catalog.js.map +1 -1
- package/fesm2015/vendure-admin-ui-core.js +310 -249
- package/fesm2015/vendure-admin-ui-core.js.map +1 -1
- package/fesm2015/vendure-admin-ui-customer.js +53 -22
- package/fesm2015/vendure-admin-ui-customer.js.map +1 -1
- package/fesm2015/vendure-admin-ui-order.js +69 -19
- package/fesm2015/vendure-admin-ui-order.js.map +1 -1
- package/fesm2015/vendure-admin-ui-settings.js.map +1 -1
- package/fesm2015/vendure-admin-ui-system.js.map +1 -1
- package/order/components/cancel-order-dialog/cancel-order-dialog.component.d.ts +3 -0
- package/order/components/order-editor/order-editor.component.d.ts +8 -2
- package/order/vendure-admin-ui-order.metadata.json +1 -1
- package/package.json +5 -5
- package/static/i18n-messages/cs.json +7 -1
- package/static/i18n-messages/de.json +7 -1
- package/static/i18n-messages/en.json +9 -3
- package/static/i18n-messages/es.json +7 -1
- package/static/i18n-messages/fr.json +7 -1
- package/static/i18n-messages/it.json +7 -1
- package/static/i18n-messages/pl.json +7 -1
- package/static/i18n-messages/pt_BR.json +7 -1
- package/static/i18n-messages/pt_PT.json +7 -1
- package/static/i18n-messages/ru.json +7 -1
- package/static/i18n-messages/uk.json +7 -1
- package/static/i18n-messages/zh_Hans.json +7 -1
- package/static/i18n-messages/zh_Hant.json +7 -1
- package/static/styles/global/_overrides.scss +6 -0
- package/static/theme.min.css +1 -1
- package/static/vendure-ui-config.json +25 -10
- package/esm2015/catalog/components/product-assets/product-assets.component.js +0 -108
|
@@ -2,13 +2,13 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, EventEmitter, Input, Output, Injectable, ElementRef, ViewChildren, HostBinding, NgModule } from '@angular/core';
|
|
3
3
|
import { FormGroup, FormControl, Validators, FormBuilder, FormArray } from '@angular/forms';
|
|
4
4
|
import * as i1 from '@vendure/admin-ui/core';
|
|
5
|
-
import { DataService, I18nService, configurableDefinitionToInstance, GlobalFlag, configurableOperationValueIsValid, toConfigurableOperationInput, ServerConfigService, HistoryEntryType, SortOrder, ModalService, NotificationService, BaseDetailComponent, EditNoteDialogComponent, BaseListComponent, LocalStorageService, AdjustmentType, BaseEntityResolver, createResolveData, CanDeactivateDetailGuard, detailBreadcrumb, SharedModule } from '@vendure/admin-ui/core';
|
|
5
|
+
import { DataService, getAppConfig, I18nService, configurableDefinitionToInstance, GlobalFlag, configurableOperationValueIsValid, toConfigurableOperationInput, ServerConfigService, HistoryEntryType, SortOrder, ModalService, NotificationService, BaseDetailComponent, EditNoteDialogComponent, BaseListComponent, LocalStorageService, AdjustmentType, BaseEntityResolver, createResolveData, CanDeactivateDetailGuard, detailBreadcrumb, SharedModule } from '@vendure/admin-ui/core';
|
|
6
6
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker';
|
|
7
7
|
import { isObject, summate, assertNever, notNullOrUndefined } from '@vendure/common/lib/shared-utils';
|
|
8
8
|
import * as i1$1 from '@angular/router';
|
|
9
9
|
import { Router, ActivatedRoute, RouterModule } from '@angular/router';
|
|
10
|
-
import { EMPTY, Subject, of, merge, BehaviorSubject } from 'rxjs';
|
|
11
|
-
import { switchMap, catchError, retryWhen, delay, take, map, startWith, mapTo, takeUntil,
|
|
10
|
+
import { EMPTY, Subject, of, merge, concat, BehaviorSubject } from 'rxjs';
|
|
11
|
+
import { switchMap, catchError, retryWhen, delay, take, map, startWith, mapTo, takeUntil, distinctUntilChanged, shareReplay, filter, debounceTime, tap } from 'rxjs/operators';
|
|
12
12
|
|
|
13
13
|
class AddManualPaymentDialogComponent {
|
|
14
14
|
constructor(dataService) {
|
|
@@ -48,9 +48,14 @@ AddManualPaymentDialogComponent.ctorParameters = () => [
|
|
|
48
48
|
|
|
49
49
|
class CancelOrderDialogComponent {
|
|
50
50
|
constructor(i18nService) {
|
|
51
|
+
var _a;
|
|
51
52
|
this.i18nService = i18nService;
|
|
53
|
+
this.cancelAll = true;
|
|
52
54
|
this.lineQuantities = {};
|
|
53
|
-
this.reasons =
|
|
55
|
+
this.reasons = (_a = getAppConfig().cancellationReasons) !== null && _a !== void 0 ? _a : [
|
|
56
|
+
marker('order.cancel-reason-customer-request'),
|
|
57
|
+
marker('order.cancel-reason-not-available'),
|
|
58
|
+
];
|
|
54
59
|
this.reasons = this.reasons.map(r => this.i18nService.translate(r));
|
|
55
60
|
}
|
|
56
61
|
get selectionCount() {
|
|
@@ -58,14 +63,39 @@ class CancelOrderDialogComponent {
|
|
|
58
63
|
}
|
|
59
64
|
ngOnInit() {
|
|
60
65
|
this.lineQuantities = this.order.lines.reduce((result, line) => {
|
|
61
|
-
return Object.assign(Object.assign({}, result), { [line.id]:
|
|
66
|
+
return Object.assign(Object.assign({}, result), { [line.id]: line.quantity });
|
|
62
67
|
}, {});
|
|
63
68
|
}
|
|
69
|
+
radioChanged() {
|
|
70
|
+
if (this.cancelAll) {
|
|
71
|
+
for (const line of this.order.lines) {
|
|
72
|
+
this.lineQuantities[line.id] = line.quantity;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
for (const line of this.order.lines) {
|
|
77
|
+
this.lineQuantities[line.id] = 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
checkIfAllSelected() {
|
|
82
|
+
var _a;
|
|
83
|
+
for (const [lineId, quantity] of Object.entries(this.lineQuantities)) {
|
|
84
|
+
const quantityInOrder = (_a = this.order.lines.find(line => line.id === lineId)) === null || _a === void 0 ? void 0 : _a.quantity;
|
|
85
|
+
if (quantityInOrder && quantity < quantityInOrder) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// If we got here, all of the selected quantities are equal to the order
|
|
90
|
+
// line quantities, i.e. everything is selected.
|
|
91
|
+
this.cancelAll = true;
|
|
92
|
+
}
|
|
64
93
|
select() {
|
|
65
94
|
this.resolveWith({
|
|
66
95
|
orderId: this.order.id,
|
|
67
96
|
lines: this.getLineInputs(),
|
|
68
97
|
reason: this.reason,
|
|
98
|
+
cancelShipping: this.cancelAll,
|
|
69
99
|
});
|
|
70
100
|
}
|
|
71
101
|
cancel() {
|
|
@@ -86,9 +116,9 @@ class CancelOrderDialogComponent {
|
|
|
86
116
|
CancelOrderDialogComponent.decorators = [
|
|
87
117
|
{ type: Component, args: [{
|
|
88
118
|
selector: 'vdr-cancel-order-dialog',
|
|
89
|
-
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-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 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 <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",
|
|
119
|
+
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",
|
|
90
120
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
91
|
-
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)}\n"]
|
|
121
|
+
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"]
|
|
92
122
|
},] }
|
|
93
123
|
];
|
|
94
124
|
CancelOrderDialogComponent.ctorParameters = () => [
|
|
@@ -645,11 +675,15 @@ OrderProcessGraphDialogComponent.ctorParameters = () => [
|
|
|
645
675
|
|
|
646
676
|
class RefundOrderDialogComponent {
|
|
647
677
|
constructor(i18nService) {
|
|
678
|
+
var _a;
|
|
648
679
|
this.i18nService = i18nService;
|
|
649
680
|
this.lineQuantities = {};
|
|
650
681
|
this.refundShipping = false;
|
|
651
682
|
this.adjustment = 0;
|
|
652
|
-
this.reasons =
|
|
683
|
+
this.reasons = (_a = getAppConfig().cancellationReasons) !== null && _a !== void 0 ? _a : [
|
|
684
|
+
marker('order.refund-reason-customer-request'),
|
|
685
|
+
marker('order.refund-reason-not-available'),
|
|
686
|
+
];
|
|
653
687
|
this.reasons = this.reasons.map(r => this.i18nService.translate(r));
|
|
654
688
|
}
|
|
655
689
|
get refundTotal() {
|
|
@@ -744,6 +778,7 @@ class RefundOrderDialogComponent {
|
|
|
744
778
|
lines: cancelLines,
|
|
745
779
|
orderId: this.order.id,
|
|
746
780
|
reason: this.reason,
|
|
781
|
+
cancelShipping: this.refundShipping,
|
|
747
782
|
},
|
|
748
783
|
});
|
|
749
784
|
}
|
|
@@ -763,9 +798,9 @@ class RefundOrderDialogComponent {
|
|
|
763
798
|
RefundOrderDialogComponent.decorators = [
|
|
764
799
|
{ type: Component, args: [{
|
|
765
800
|
selector: 'vdr-refund-order-dialog',
|
|
766
|
-
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
|
|
801
|
+
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",
|
|
767
802
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
768
|
-
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)}.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}.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"]
|
|
803
|
+
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"]
|
|
769
804
|
},] }
|
|
770
805
|
];
|
|
771
806
|
RefundOrderDialogComponent.ctorParameters = () => [
|
|
@@ -949,7 +984,7 @@ class OrderDetailComponent extends BaseDetailComponent {
|
|
|
949
984
|
canAddFulfillment(order) {
|
|
950
985
|
const allItemsFulfilled = order.lines
|
|
951
986
|
.reduce((items, line) => [...items, ...line.items], [])
|
|
952
|
-
.every(item => !!item.fulfillment);
|
|
987
|
+
.every(item => !!item.fulfillment || item.cancelled);
|
|
953
988
|
return (!allItemsFulfilled &&
|
|
954
989
|
!this.hasUnsettledModifications(order) &&
|
|
955
990
|
this.outstandingPaymentAmount(order) === 0 &&
|
|
@@ -1343,7 +1378,9 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1343
1378
|
this.notificationService = notificationService;
|
|
1344
1379
|
this.modalService = modalService;
|
|
1345
1380
|
this.orderTransitionService = orderTransitionService;
|
|
1381
|
+
this.couponCodeInput$ = new Subject();
|
|
1346
1382
|
this.detailForm = new FormGroup({});
|
|
1383
|
+
this.couponCodesControl = new FormControl();
|
|
1347
1384
|
this.modifyOrderInput = {
|
|
1348
1385
|
dryRun: true,
|
|
1349
1386
|
orderId: '',
|
|
@@ -1371,11 +1408,15 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1371
1408
|
}
|
|
1372
1409
|
ngOnInit() {
|
|
1373
1410
|
this.init();
|
|
1411
|
+
this.dataService.promotion.getPromotions();
|
|
1374
1412
|
this.addressCustomFields = this.getCustomFieldConfig('Address');
|
|
1375
1413
|
this.modifyOrderInput.orderId = this.route.snapshot.paramMap.get('id');
|
|
1376
1414
|
this.orderLineCustomFields = this.getCustomFieldConfig('OrderLine');
|
|
1377
1415
|
this.entity$.pipe(takeUntil(this.destroy$)).subscribe(order => {
|
|
1378
1416
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
1417
|
+
if (order.couponCodes.length) {
|
|
1418
|
+
this.couponCodesControl.setValue(order.couponCodes);
|
|
1419
|
+
}
|
|
1379
1420
|
this.surchargeForm = new FormGroup({
|
|
1380
1421
|
description: new FormControl('', Validators.required),
|
|
1381
1422
|
sku: new FormControl(''),
|
|
@@ -1434,6 +1475,11 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1434
1475
|
this.orderLineCustomFieldsFormArray.push(formGroup);
|
|
1435
1476
|
}
|
|
1436
1477
|
});
|
|
1478
|
+
this.availableCouponCodes$ = concat(this.couponCodeInput$.pipe(distinctUntilChanged(), switchMap(term => this.dataService.promotion.getPromotions(10, 0, {
|
|
1479
|
+
couponCode: { contains: term },
|
|
1480
|
+
}).single$), map(({ promotions }) =>
|
|
1481
|
+
// tslint:disable-next-line:no-non-null-assertion
|
|
1482
|
+
promotions.items.map(p => ({ code: p.couponCode, promotionName: p.name }))), startWith([])));
|
|
1437
1483
|
this.addItemCustomFieldsFormArray = new FormArray([]);
|
|
1438
1484
|
this.addItemCustomFieldsForm = new FormGroup({});
|
|
1439
1485
|
for (const customField of this.orderLineCustomFields) {
|
|
@@ -1471,7 +1517,8 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1471
1517
|
!!(surcharges === null || surcharges === void 0 ? void 0 : surcharges.length) ||
|
|
1472
1518
|
!!(adjustOrderLines === null || adjustOrderLines === void 0 ? void 0 : adjustOrderLines.length) ||
|
|
1473
1519
|
(this.shippingAddressForm.dirty && this.shippingAddressForm.valid) ||
|
|
1474
|
-
(this.billingAddressForm.dirty && this.billingAddressForm.valid)
|
|
1520
|
+
(this.billingAddressForm.dirty && this.billingAddressForm.valid) ||
|
|
1521
|
+
this.couponCodesControl.dirty);
|
|
1475
1522
|
}
|
|
1476
1523
|
isLineModified(line) {
|
|
1477
1524
|
var _a;
|
|
@@ -1583,7 +1630,7 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1583
1630
|
var _a;
|
|
1584
1631
|
const input = Object.assign(Object.assign(Object.assign(Object.assign({}, this.modifyOrderInput), (this.billingAddressForm.dirty ? { updateBillingAddress: this.billingAddressForm.value } : {})), (this.shippingAddressForm.dirty
|
|
1585
1632
|
? { updateShippingAddress: this.shippingAddressForm.value }
|
|
1586
|
-
: {})), { dryRun: true, note: (_a = this.note) !== null && _a !== void 0 ? _a : '', options: {
|
|
1633
|
+
: {})), { dryRun: true, couponCodes: this.couponCodesControl.dirty ? this.couponCodesControl.value : undefined, note: (_a = this.note) !== null && _a !== void 0 ? _a : '', options: {
|
|
1587
1634
|
recalculateShipping: this.recalculateShipping,
|
|
1588
1635
|
} });
|
|
1589
1636
|
const originalTotalWithTax = order.totalWithTax;
|
|
@@ -1608,7 +1655,10 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1608
1655
|
case 'OrderLimitError':
|
|
1609
1656
|
case 'OrderModificationStateError':
|
|
1610
1657
|
case 'PaymentMethodMissingError':
|
|
1611
|
-
case 'RefundPaymentIdMissingError':
|
|
1658
|
+
case 'RefundPaymentIdMissingError':
|
|
1659
|
+
case 'CouponCodeLimitError':
|
|
1660
|
+
case 'CouponCodeExpiredError':
|
|
1661
|
+
case 'CouponCodeInvalidError': {
|
|
1612
1662
|
this.notificationService.error(modifyOrder.message);
|
|
1613
1663
|
return of(false);
|
|
1614
1664
|
}
|
|
@@ -1672,9 +1722,9 @@ class OrderEditorComponent extends BaseDetailComponent {
|
|
|
1672
1722
|
OrderEditorComponent.decorators = [
|
|
1673
1723
|
{ type: Component, args: [{
|
|
1674
1724
|
selector: 'vdr-order-editor',
|
|
1675
|
-
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-selector class=\"mb4\" (productSelected)=\"addItemSelectedVariant = $event\">\r\n </vdr-product-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\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",
|
|
1725
|
+
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-selector class=\"mb4\" (productSelected)=\"addItemSelectedVariant = $event\">\r\n </vdr-product-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",
|
|
1676
1726
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1677
|
-
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:bold;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"]
|
|
1727
|
+
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:bold;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 .thumb img{width:50px;height:50px}.order-table tr.modified td{background-color:var(--color-warning-100)}\n"]
|
|
1678
1728
|
},] }
|
|
1679
1729
|
];
|
|
1680
1730
|
OrderEditorComponent.ctorParameters = () => [
|
|
@@ -1827,7 +1877,7 @@ class OrderHistoryComponent {
|
|
|
1827
1877
|
OrderHistoryComponent.decorators = [
|
|
1828
1878
|
{ type: Component, args: [{
|
|
1829
1879
|
selector: 'vdr-order-history',
|
|
1830
|
-
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-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",
|
|
1880
|
+
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",
|
|
1831
1881
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1832
1882
|
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"]
|
|
1833
1883
|
},] }
|
|
@@ -2284,9 +2334,9 @@ class OrderTableComponent {
|
|
|
2284
2334
|
OrderTableComponent.decorators = [
|
|
2285
2335
|
{ type: Component, args: [{
|
|
2286
2336
|
selector: 'vdr-order-table',
|
|
2287
|
-
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 <tr class=\"order-adjustment\" *
|
|
2337
|
+
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",
|
|
2288
2338
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2289
|
-
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:bold;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"]
|
|
2339
|
+
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:bold;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 .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"]
|
|
2290
2340
|
},] }
|
|
2291
2341
|
];
|
|
2292
2342
|
OrderTableComponent.propDecorators = {
|