@vendure/admin-ui 1.6.3 → 1.7.0
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 +196 -20
- package/bundles/vendure-admin-ui-catalog.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-core.umd.js +309 -327
- package/bundles/vendure-admin-ui-core.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-customer.umd.js +39 -18
- package/bundles/vendure-admin-ui-customer.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-order.umd.js +179 -137
- package/bundles/vendure-admin-ui-order.umd.js.map +1 -1
- package/catalog/components/generate-product-variants/generate-product-variants.component.d.ts +3 -3
- package/catalog/components/option-value-input/option-value-input.component.d.ts +20 -8
- package/catalog/components/product-variants-editor/product-variants-editor.component.d.ts +10 -3
- package/catalog/vendure-admin-ui-catalog.metadata.json +1 -1
- package/core/common/generated-types.d.ts +91 -19
- package/core/common/utilities/configurable-operation-utils.d.ts +4 -2
- package/core/common/version.d.ts +1 -1
- package/core/data/definitions/order-definitions.d.ts +2 -0
- package/core/data/definitions/product-definitions.d.ts +1 -0
- package/core/data/providers/order-data.service.d.ts +1 -0
- package/core/data/providers/product-data.service.d.ts +1 -0
- package/core/shared/components/custom-field-control/custom-field-control.component.d.ts +6 -2
- package/core/shared/components/data-table/data-table.component.d.ts +5 -2
- package/core/shared/components/facet-value-selector/facet-value-selector.component.d.ts +2 -1
- package/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.d.ts +2 -0
- package/core/shared/dynamic-form-inputs/register-dynamic-input-components.d.ts +2 -1
- package/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.d.ts +10 -2
- package/core/shared/pipes/custom-field-label.pipe.d.ts +4 -10
- package/core/vendure-admin-ui-core.metadata.json +1 -1
- package/customer/components/customer-group-list/customer-group-list.component.d.ts +6 -4
- package/customer/vendure-admin-ui-customer.metadata.json +1 -1
- package/esm2015/catalog/components/generate-product-variants/generate-product-variants.component.js +12 -5
- package/esm2015/catalog/components/option-value-input/option-value-input.component.js +62 -12
- package/esm2015/catalog/components/product-variants-editor/product-variants-editor.component.js +109 -11
- package/esm2015/core/common/generated-types.js +2 -1
- package/esm2015/core/common/introspection-result.js +191 -255
- package/esm2015/core/common/utilities/configurable-operation-utils.js +13 -10
- package/esm2015/core/common/version.js +2 -2
- package/esm2015/core/components/app-shell/app-shell.component.js +1 -1
- package/esm2015/core/components/main-nav/main-nav.component.js +1 -1
- package/esm2015/core/data/definitions/order-definitions.js +445 -431
- package/esm2015/core/data/definitions/product-definitions.js +9 -1
- package/esm2015/core/data/providers/order-data.service.js +7 -2
- package/esm2015/core/data/providers/product-data.service.js +5 -2
- package/esm2015/core/shared/components/custom-field-control/custom-field-control.component.js +9 -3
- package/esm2015/core/shared/components/data-table/data-table.component.js +9 -2
- package/esm2015/core/shared/components/facet-value-selector/facet-value-selector.component.js +5 -2
- package/esm2015/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.js +11 -2
- package/esm2015/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.js +15 -2
- package/esm2015/core/shared/pipes/custom-field-label.pipe.js +4 -19
- package/esm2015/customer/components/customer-group-list/customer-group-list.component.js +25 -12
- package/esm2015/order/components/fulfill-order-dialog/fulfill-order-dialog.component.js +3 -2
- package/esm2015/order/components/fulfillment-detail/fulfillment-detail.component.js +9 -18
- package/esm2015/order/components/line-fulfillment/line-fulfillment.component.js +10 -21
- package/esm2015/order/components/order-custom-fields-card/order-custom-fields-card.component.js +30 -4
- package/esm2015/order/components/order-detail/order-detail.component.js +79 -38
- package/esm2015/order/components/order-list/order-list.component.js +22 -15
- package/esm2015/order/components/order-payment-card/order-payment-card.component.js +2 -2
- package/esm2015/order/components/order-table/order-table.component.js +10 -2
- package/fesm2015/vendure-admin-ui-catalog.js +177 -22
- package/fesm2015/vendure-admin-ui-catalog.js.map +1 -1
- package/fesm2015/vendure-admin-ui-core.js +725 -733
- package/fesm2015/vendure-admin-ui-core.js.map +1 -1
- package/fesm2015/vendure-admin-ui-customer.js +23 -11
- package/fesm2015/vendure-admin-ui-customer.js.map +1 -1
- package/fesm2015/vendure-admin-ui-order.js +155 -94
- package/fesm2015/vendure-admin-ui-order.js.map +1 -1
- package/order/components/line-fulfillment/line-fulfillment.component.d.ts +2 -2
- package/order/components/modification-detail/modification-detail.component.d.ts +1 -1
- package/order/components/order-custom-fields-card/order-custom-fields-card.component.d.ts +4 -2
- package/order/components/order-list/order-list.component.d.ts +1 -0
- package/order/components/order-table/order-table.component.d.ts +1 -0
- package/order/vendure-admin-ui-order.metadata.json +1 -1
- package/package.json +2 -2
- package/static/i18n-messages/cs.json +6 -2
- package/static/i18n-messages/de.json +6 -2
- package/static/i18n-messages/en.json +8 -3
- package/static/i18n-messages/es.json +6 -2
- package/static/i18n-messages/fr.json +6 -2
- package/static/i18n-messages/it.json +6 -2
- package/static/i18n-messages/pl.json +6 -2
- package/static/i18n-messages/pt_BR.json +6 -2
- package/static/i18n-messages/pt_PT.json +6 -2
- package/static/i18n-messages/ru.json +6 -2
- package/static/i18n-messages/uk.json +6 -2
- package/static/i18n-messages/zh_Hans.json +6 -2
- package/static/i18n-messages/zh_Hant.json +6 -2
- package/static/styles/_variables.scss +3 -0
- package/static/styles/global/_sass-overrides.scss +3 -0
- package/static/styles/global/_utilities.scss +1 -0
- package/static/styles/styles.scss +1 -0
- package/static/styles/ui-extension-theme.scss +1 -0
- package/static/theme.min.css +1 -1
|
@@ -2,12 +2,12 @@ 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, getAppConfig, I18nService, configurableDefinitionToInstance, GlobalFlag, configurableOperationValueIsValid, toConfigurableOperationInput, ServerConfigService, HistoryEntryType, SortOrder,
|
|
5
|
+
import { DataService, getAppConfig, I18nService, configurableDefinitionToInstance, GlobalFlag, configurableOperationValueIsValid, toConfigurableOperationInput, ServerConfigService, ModalService, HistoryEntryType, SortOrder, NotificationService, BaseDetailComponent, EditNoteDialogComponent, BaseListComponent, LogicalOperator, 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,
|
|
10
|
+
import { EMPTY, Subject, of, concat, merge, BehaviorSubject } from 'rxjs';
|
|
11
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 {
|
|
@@ -158,7 +158,8 @@ class FulfillOrderDialogComponent {
|
|
|
158
158
|
return effectiveTracInventory ? Math.min(unfulfilledCount, stockOnHand) : unfulfilledCount;
|
|
159
159
|
}
|
|
160
160
|
getUnfulfilledCount(line) {
|
|
161
|
-
|
|
161
|
+
var _a, _b;
|
|
162
|
+
const fulfilled = (_b = (_a = line.fulfillments) === null || _a === void 0 ? void 0 : _a.map(f => f.summary).flat().filter(row => row.orderLine.id === line.id).reduce((sum, row) => sum + row.quantity, 0)) !== null && _b !== void 0 ? _b : 0;
|
|
162
163
|
return line.quantity - fulfilled;
|
|
163
164
|
}
|
|
164
165
|
canSubmit() {
|
|
@@ -251,23 +252,14 @@ class FulfillmentDetailComponent {
|
|
|
251
252
|
return this.order.fulfillments && this.order.fulfillments.find(f => f.id === this.fulfillmentId);
|
|
252
253
|
}
|
|
253
254
|
get items() {
|
|
254
|
-
var _a;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
itemMap.set(line.productVariant.name, count + 1);
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
itemMap.set(line.productVariant.name, 1);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return Array.from(itemMap.entries()).map(([name, quantity]) => ({ name, quantity }));
|
|
255
|
+
var _a, _b;
|
|
256
|
+
return ((_b = (_a = this.fulfillment) === null || _a === void 0 ? void 0 : _a.summary.map(row => {
|
|
257
|
+
var _a, _b;
|
|
258
|
+
return {
|
|
259
|
+
name: (_b = (_a = this.order.lines.find(line => line.id === row.orderLine.id)) === null || _a === void 0 ? void 0 : _a.productVariant.name) !== null && _b !== void 0 ? _b : '',
|
|
260
|
+
quantity: row.quantity,
|
|
261
|
+
};
|
|
262
|
+
})) !== null && _b !== void 0 ? _b : []);
|
|
271
263
|
}
|
|
272
264
|
buildCustomFieldsFormGroup() {
|
|
273
265
|
const customFields = this.fulfillment.customFields;
|
|
@@ -336,7 +328,8 @@ class LineFulfillmentComponent {
|
|
|
336
328
|
* Returns the number of items in an OrderLine which are fulfilled.
|
|
337
329
|
*/
|
|
338
330
|
getDeliveredCount(line) {
|
|
339
|
-
|
|
331
|
+
var _a, _b;
|
|
332
|
+
return ((_b = (_a = line.fulfillments) === null || _a === void 0 ? void 0 : _a.reduce((sum, fulfillment) => { var _a, _b; return sum + ((_b = (_a = fulfillment.summary.find(s => s.orderLine.id === line.id)) === null || _a === void 0 ? void 0 : _a.quantity) !== null && _b !== void 0 ? _b : 0); }, 0)) !== null && _b !== void 0 ? _b : 0);
|
|
340
333
|
}
|
|
341
334
|
getFulfillmentStatus(fulfilledCount, lineQuantity) {
|
|
342
335
|
if (fulfilledCount === lineQuantity) {
|
|
@@ -348,27 +341,15 @@ class LineFulfillmentComponent {
|
|
|
348
341
|
return 'none';
|
|
349
342
|
}
|
|
350
343
|
getFulfillments(line) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
counts[item.fulfillment.id] = 1;
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
counts[item.fulfillment.id]++;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
const all = line.items.reduce((fulfillments, item) => {
|
|
363
|
-
return item.fulfillment ? [...fulfillments, item.fulfillment] : fulfillments;
|
|
364
|
-
}, []);
|
|
365
|
-
return Object.entries(counts).map(([id, count]) => {
|
|
344
|
+
var _a, _b;
|
|
345
|
+
return ((_b = (_a = line.fulfillments) === null || _a === void 0 ? void 0 : _a.map(fulfillment => {
|
|
346
|
+
var _a;
|
|
347
|
+
const summaryLine = fulfillment.summary.find(s => s.orderLine.id === line.id);
|
|
366
348
|
return {
|
|
367
|
-
count,
|
|
368
|
-
|
|
369
|
-
fulfillment: all.find(f => f.id === id),
|
|
349
|
+
count: (_a = summaryLine === null || summaryLine === void 0 ? void 0 : summaryLine.quantity) !== null && _a !== void 0 ? _a : 0,
|
|
350
|
+
fulfillment,
|
|
370
351
|
};
|
|
371
|
-
});
|
|
352
|
+
})) !== null && _b !== void 0 ? _b : []);
|
|
372
353
|
}
|
|
373
354
|
}
|
|
374
355
|
LineFulfillmentComponent.decorators = [
|
|
@@ -484,8 +465,9 @@ ModificationDetailComponent.propDecorators = {
|
|
|
484
465
|
};
|
|
485
466
|
|
|
486
467
|
class OrderCustomFieldsCardComponent {
|
|
487
|
-
constructor(formBuilder) {
|
|
468
|
+
constructor(formBuilder, modalService) {
|
|
488
469
|
this.formBuilder = formBuilder;
|
|
470
|
+
this.modalService = modalService;
|
|
489
471
|
this.customFieldsConfig = [];
|
|
490
472
|
this.customFieldValues = {};
|
|
491
473
|
this.updateClick = new EventEmitter();
|
|
@@ -502,17 +484,40 @@ class OrderCustomFieldsCardComponent {
|
|
|
502
484
|
this.customFieldForm.markAsPristine();
|
|
503
485
|
this.editable = false;
|
|
504
486
|
}
|
|
487
|
+
onCancelClick() {
|
|
488
|
+
if (this.customFieldForm.dirty) {
|
|
489
|
+
this.modalService
|
|
490
|
+
.dialog({
|
|
491
|
+
title: marker('catalog.confirm-cancel'),
|
|
492
|
+
buttons: [
|
|
493
|
+
{ type: 'secondary', label: marker('common.keep-editing') },
|
|
494
|
+
{ type: 'danger', label: marker('common.discard-changes'), returnValue: true },
|
|
495
|
+
],
|
|
496
|
+
})
|
|
497
|
+
.subscribe(result => {
|
|
498
|
+
if (result) {
|
|
499
|
+
this.customFieldForm.reset();
|
|
500
|
+
this.customFieldForm.markAsPristine();
|
|
501
|
+
this.editable = false;
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
this.editable = false;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
505
509
|
}
|
|
506
510
|
OrderCustomFieldsCardComponent.decorators = [
|
|
507
511
|
{ type: Component, args: [{
|
|
508
512
|
selector: 'vdr-order-custom-fields-card',
|
|
509
|
-
template: "<div class=\"card\" *ngIf=\"customFieldsConfig.length\">\r\n <div class=\"card-header\">\r\n {{ 'common.custom-fields' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text custom-field-form\" [class.editable]=\"editable\">\r\n <
|
|
513
|
+
template: "<div class=\"card\" *ngIf=\"customFieldsConfig.length\">\r\n <div class=\"card-header\">\r\n {{ 'common.custom-fields' | translate }}\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"card-text custom-field-form\" [class.editable]=\"editable\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Order\"\r\n [customFields]=\"customFieldsConfig\"\r\n [customFieldsFormGroup]=\"customFieldForm\"\r\n [readonly]=\"!editable\"\r\n [compact]=\"true\"\r\n ></vdr-tabbed-custom-fields>\r\n </div>\r\n </div>\r\n <div class=\"card-footer\">\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"editable = true\" *ngIf=\"!editable\">\r\n <clr-icon shape=\"pencil\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <button\r\n class=\"btn btn-sm btn-primary\"\r\n (click)=\"onUpdateClick()\"\r\n *ngIf=\"editable\"\r\n [disabled]=\"customFieldForm.pristine || customFieldForm.invalid\"\r\n >\r\n <clr-icon shape=\"check\"></clr-icon>\r\n {{ 'common.update' | translate }}\r\n </button>\r\n <button\r\n class=\"btn btn-sm btn-secondary\"\r\n (click)=\"onCancelClick()\"\r\n *ngIf=\"editable\"\r\n >\r\n <clr-icon shape=\"times\"></clr-icon>\r\n {{ 'common.cancel' | translate }}\r\n </button>\r\n </div>\r\n</div>\r\n",
|
|
510
514
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
511
515
|
styles: ["vdr-custom-field-control{margin-bottom:6px;display:block}.custom-field-form ::ng-deep .clr-control-label{color:var(--color-grey-400)}.custom-field-form.editable ::ng-deep .clr-control-label{color:inherit}\n"]
|
|
512
516
|
},] }
|
|
513
517
|
];
|
|
514
518
|
OrderCustomFieldsCardComponent.ctorParameters = () => [
|
|
515
|
-
{ type: FormBuilder }
|
|
519
|
+
{ type: FormBuilder },
|
|
520
|
+
{ type: ModalService }
|
|
516
521
|
];
|
|
517
522
|
OrderCustomFieldsCardComponent.propDecorators = {
|
|
518
523
|
customFieldsConfig: [{ type: Input }],
|
|
@@ -964,27 +969,56 @@ class OrderDetailComponent extends BaseDetailComponent {
|
|
|
964
969
|
});
|
|
965
970
|
}
|
|
966
971
|
transitionPaymentState({ payment, state }) {
|
|
967
|
-
|
|
968
|
-
.
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
972
|
+
if (state === 'Cancelled') {
|
|
973
|
+
this.dataService.order.cancelPayment(payment.id).subscribe(({ cancelPayment }) => {
|
|
974
|
+
switch (cancelPayment.__typename) {
|
|
975
|
+
case 'Payment':
|
|
976
|
+
this.notificationService.success(marker('order.transitioned-payment-to-state-success'), {
|
|
977
|
+
state,
|
|
978
|
+
});
|
|
979
|
+
this.dataService.order.getOrder(this.id).single$.subscribe();
|
|
980
|
+
this.fetchHistory.next();
|
|
981
|
+
break;
|
|
982
|
+
case 'PaymentStateTransitionError':
|
|
983
|
+
this.notificationService.error(cancelPayment.transitionError);
|
|
984
|
+
break;
|
|
985
|
+
case 'CancelPaymentError':
|
|
986
|
+
this.notificationService.error(cancelPayment.paymentErrorMessage);
|
|
987
|
+
break;
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
else {
|
|
992
|
+
this.dataService.order
|
|
993
|
+
.transitionPaymentToState(payment.id, state)
|
|
994
|
+
.subscribe(({ transitionPaymentToState }) => {
|
|
995
|
+
switch (transitionPaymentToState.__typename) {
|
|
996
|
+
case 'Payment':
|
|
997
|
+
this.notificationService.success(marker('order.transitioned-payment-to-state-success'), {
|
|
998
|
+
state,
|
|
999
|
+
});
|
|
1000
|
+
this.dataService.order.getOrder(this.id).single$.subscribe();
|
|
1001
|
+
this.fetchHistory.next();
|
|
1002
|
+
break;
|
|
1003
|
+
case 'PaymentStateTransitionError':
|
|
1004
|
+
this.notificationService.error(transitionPaymentToState.message);
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
983
1009
|
}
|
|
984
1010
|
canAddFulfillment(order) {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1011
|
+
var _a;
|
|
1012
|
+
const allFulfillmentSummaryRows = ((_a = order.fulfillments) !== null && _a !== void 0 ? _a : []).reduce((all, fulfillment) => [...all, ...fulfillment.summary], []);
|
|
1013
|
+
let allItemsFulfilled = true;
|
|
1014
|
+
for (const line of order.lines) {
|
|
1015
|
+
const totalFulfilledCount = allFulfillmentSummaryRows
|
|
1016
|
+
.filter(row => row.orderLine.id === line.id)
|
|
1017
|
+
.reduce((sum, row) => sum + row.quantity, 0);
|
|
1018
|
+
if (totalFulfilledCount < line.quantity) {
|
|
1019
|
+
allItemsFulfilled = false;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
988
1022
|
return (!allItemsFulfilled &&
|
|
989
1023
|
!this.hasUnsettledModifications(order) &&
|
|
990
1024
|
this.outstandingPaymentAmount(order) === 0 &&
|
|
@@ -1244,26 +1278,43 @@ class OrderDetailComponent extends BaseDetailComponent {
|
|
|
1244
1278
|
if (!input) {
|
|
1245
1279
|
return of(undefined);
|
|
1246
1280
|
}
|
|
1247
|
-
|
|
1281
|
+
if ((_a = input.cancel.lines) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1282
|
+
return this.dataService.order.cancelOrder(input.cancel).pipe(map(res => {
|
|
1283
|
+
const result = res.cancelOrder;
|
|
1284
|
+
switch (result.__typename) {
|
|
1285
|
+
case 'Order':
|
|
1286
|
+
this.refetchOrder(result).subscribe();
|
|
1287
|
+
this.notificationService.success(marker('order.cancelled-order-success'));
|
|
1288
|
+
return input;
|
|
1289
|
+
case 'CancelActiveOrderError':
|
|
1290
|
+
case 'QuantityTooGreatError':
|
|
1291
|
+
case 'MultipleOrderError':
|
|
1292
|
+
case 'OrderStateTransitionError':
|
|
1293
|
+
case 'EmptyOrderLineSelectionError':
|
|
1294
|
+
this.notificationService.error(result.message);
|
|
1295
|
+
return undefined;
|
|
1296
|
+
}
|
|
1297
|
+
}));
|
|
1298
|
+
}
|
|
1299
|
+
else {
|
|
1300
|
+
return [input];
|
|
1301
|
+
}
|
|
1302
|
+
}), switchMap(input => {
|
|
1303
|
+
if (!input) {
|
|
1304
|
+
return of(undefined);
|
|
1305
|
+
}
|
|
1248
1306
|
if (input.refund.lines.length) {
|
|
1249
|
-
|
|
1307
|
+
return this.dataService.order
|
|
1250
1308
|
.refundOrder(input.refund)
|
|
1251
|
-
.pipe(map(res => res.refundOrder))
|
|
1309
|
+
.pipe(map(res => res.refundOrder));
|
|
1252
1310
|
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
.cancelOrder(input.cancel)
|
|
1256
|
-
.pipe(map(res => res.cancelOrder)));
|
|
1311
|
+
else {
|
|
1312
|
+
return [undefined];
|
|
1257
1313
|
}
|
|
1258
|
-
return merge(...operations);
|
|
1259
1314
|
}))
|
|
1260
1315
|
.subscribe(result => {
|
|
1261
1316
|
if (result) {
|
|
1262
1317
|
switch (result.__typename) {
|
|
1263
|
-
case 'Order':
|
|
1264
|
-
this.refetchOrder(result).subscribe();
|
|
1265
|
-
this.notificationService.success(marker('order.cancelled-order-success'));
|
|
1266
|
-
break;
|
|
1267
1318
|
case 'Refund':
|
|
1268
1319
|
this.refetchOrder(result).subscribe();
|
|
1269
1320
|
if (result.state === 'Failed') {
|
|
@@ -1273,11 +1324,6 @@ class OrderDetailComponent extends BaseDetailComponent {
|
|
|
1273
1324
|
this.notificationService.success(marker('order.refund-order-success'));
|
|
1274
1325
|
}
|
|
1275
1326
|
break;
|
|
1276
|
-
case 'QuantityTooGreatError':
|
|
1277
|
-
case 'MultipleOrderError':
|
|
1278
|
-
case 'OrderStateTransitionError':
|
|
1279
|
-
case 'CancelActiveOrderError':
|
|
1280
|
-
case 'EmptyOrderLineSelectionError':
|
|
1281
1327
|
case 'AlreadyRefundedError':
|
|
1282
1328
|
case 'NothingToRefundError':
|
|
1283
1329
|
case 'PaymentOrderMismatchError':
|
|
@@ -1896,6 +1942,7 @@ class OrderListComponent extends BaseListComponent {
|
|
|
1896
1942
|
this.serverConfigService = serverConfigService;
|
|
1897
1943
|
this.dataService = dataService;
|
|
1898
1944
|
this.localStorageService = localStorageService;
|
|
1945
|
+
this.searchControl = new FormControl('');
|
|
1899
1946
|
this.searchOrderCodeControl = new FormControl('');
|
|
1900
1947
|
this.searchLastNameControl = new FormControl('');
|
|
1901
1948
|
this.orderStates = this.serverConfigService.getOrderProcessStates().map(item => item.name);
|
|
@@ -1936,7 +1983,7 @@ class OrderListComponent extends BaseListComponent {
|
|
|
1936
1983
|
// tslint:disable-next-line:no-shadowed-variable
|
|
1937
1984
|
(take, skip) => this.dataService.order.getOrders({ take, skip }).refetchOnChannelChange(), data => data.orders,
|
|
1938
1985
|
// tslint:disable-next-line:no-shadowed-variable
|
|
1939
|
-
(skip, take) => this.createQueryOptions(skip, take, this.
|
|
1986
|
+
(skip, take) => this.createQueryOptions(skip, take, this.searchControl.value, this.route.snapshot.queryParamMap.get('filter') || 'open'));
|
|
1940
1987
|
const lastFilters = this.localStorageService.get('orderListLastCustomFilters');
|
|
1941
1988
|
if (lastFilters) {
|
|
1942
1989
|
this.setQueryParam(lastFilters, { replaceUrl: true });
|
|
@@ -1946,7 +1993,7 @@ class OrderListComponent extends BaseListComponent {
|
|
|
1946
1993
|
var _a;
|
|
1947
1994
|
super.ngOnInit();
|
|
1948
1995
|
this.activePreset$ = this.route.queryParamMap.pipe(map(qpm => qpm.get('filter') || 'open'), distinctUntilChanged());
|
|
1949
|
-
const searchTerms$ = merge(this.
|
|
1996
|
+
const searchTerms$ = merge(this.searchControl.valueChanges).pipe(filter(value => 2 < value.length || value.length === 0), debounceTime(250));
|
|
1950
1997
|
merge(searchTerms$, this.route.queryParamMap)
|
|
1951
1998
|
.pipe(takeUntil(this.destroy$))
|
|
1952
1999
|
.subscribe(val => {
|
|
@@ -1979,11 +2026,12 @@ class OrderListComponent extends BaseListComponent {
|
|
|
1979
2026
|
}
|
|
1980
2027
|
createQueryOptions(
|
|
1981
2028
|
// tslint:disable-next-line:no-shadowed-variable
|
|
1982
|
-
skip, take,
|
|
2029
|
+
skip, take, searchTerm, activeFilterPreset) {
|
|
1983
2030
|
var _a;
|
|
1984
2031
|
const filterConfig = this.filterPresets.find(p => p.name === activeFilterPreset);
|
|
1985
2032
|
// tslint:disable-next-line:no-shadowed-variable
|
|
1986
|
-
|
|
2033
|
+
let filter = {};
|
|
2034
|
+
let filterOperator = LogicalOperator.AND;
|
|
1987
2035
|
if (filterConfig) {
|
|
1988
2036
|
if (filterConfig.config.active != null) {
|
|
1989
2037
|
filter.active = {
|
|
@@ -2025,15 +2073,19 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2025
2073
|
};
|
|
2026
2074
|
}
|
|
2027
2075
|
}
|
|
2028
|
-
if (
|
|
2029
|
-
filter
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2076
|
+
if (searchTerm) {
|
|
2077
|
+
filter = {
|
|
2078
|
+
customerLastName: {
|
|
2079
|
+
contains: searchTerm,
|
|
2080
|
+
},
|
|
2081
|
+
transactionId: {
|
|
2082
|
+
contains: searchTerm,
|
|
2083
|
+
},
|
|
2084
|
+
code: {
|
|
2085
|
+
contains: searchTerm,
|
|
2086
|
+
},
|
|
2036
2087
|
};
|
|
2088
|
+
filterOperator = LogicalOperator.OR;
|
|
2037
2089
|
}
|
|
2038
2090
|
return {
|
|
2039
2091
|
options: {
|
|
@@ -2043,6 +2095,7 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2043
2095
|
sort: {
|
|
2044
2096
|
updatedAt: SortOrder.DESC,
|
|
2045
2097
|
},
|
|
2098
|
+
filterOperator,
|
|
2046
2099
|
},
|
|
2047
2100
|
};
|
|
2048
2101
|
}
|
|
@@ -2058,7 +2111,7 @@ class OrderListComponent extends BaseListComponent {
|
|
|
2058
2111
|
OrderListComponent.decorators = [
|
|
2059
2112
|
{ type: Component, args: [{
|
|
2060
2113
|
selector: 'vdr-order-list',
|
|
2061
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"search-form\">\r\n <div class=\"btn-group btn-outline-primary\" *ngIf=\"activePreset$ | async as activePreset\">\r\n <button\r\n class=\"btn\"\r\n *ngFor=\"let preset of filterPresets\"\r\n [class.btn-primary]=\"activePreset === preset.name\"\r\n (click)=\"selectFilterPreset(preset.name)\"\r\n >\r\n {{ preset.label | translate }}\r\n </button>\r\n <button\r\n class=\"btn\"\r\n [class.btn-primary]=\"activePreset === 'custom'\"\r\n (click)=\"selectFilterPreset('custom')\"\r\n >\r\n {{ 'order.filter-custom' | translate }}\r\n <clr-icon shape=\"angle down\"></clr-icon>\r\n </button>\r\n </div>\r\n
|
|
2114
|
+
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"search-form\">\r\n <div class=\"btn-group btn-outline-primary\" *ngIf=\"activePreset$ | async as activePreset\">\r\n <button\r\n class=\"btn\"\r\n *ngFor=\"let preset of filterPresets\"\r\n [class.btn-primary]=\"activePreset === preset.name\"\r\n (click)=\"selectFilterPreset(preset.name)\"\r\n >\r\n {{ preset.label | translate }}\r\n </button>\r\n <button\r\n class=\"btn\"\r\n [class.btn-primary]=\"activePreset === 'custom'\"\r\n (click)=\"selectFilterPreset('custom')\"\r\n >\r\n {{ 'order.filter-custom' | translate }}\r\n <clr-icon shape=\"angle down\"></clr-icon>\r\n </button>\r\n </div>\r\n <input\r\n type=\"text\"\r\n name=\"searchTerm\"\r\n [formControl]=\"searchControl\"\r\n [placeholder]=\"'order.search-by-order-filters' | translate\"\r\n class=\"search-input\"\r\n />\r\n </div>\r\n <div class=\"custom-filters\" [class.expanded]=\"(activePreset$ | async) === 'custom'\">\r\n <form [formGroup]=\"customFilterForm\">\r\n <div class=\"flex align-center\">\r\n <ng-select\r\n [items]=\"orderStates\"\r\n appendTo=\"body\"\r\n [addTag]=\"false\"\r\n [multiple]=\"true\"\r\n formControlName=\"states\"\r\n [placeholder]=\"'state.all-orders' | translate\"\r\n [clearable]=\"true\"\r\n [searchable]=\"false\"\r\n >\r\n <ng-template ng-option-tmp let-item=\"item\">{{ item | stateI18nToken | translate }}</ng-template>\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-label\"> {{ item | stateI18nToken | translate }}</span>\r\n <span class=\"ng-value-icon right\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n </ng-template>\r\n </ng-select>\r\n <button\r\n class=\"btn btn-secondary\"\r\n [disabled]=\"customFilterForm.pristine\"\r\n (click)=\"applyCustomFilters()\"\r\n >\r\n {{ 'order.apply-filters' | translate }}\r\n <clr-icon shape=\"filter\"></clr-icon>\r\n </button>\r\n </div>\r\n <div class=\"flex\">\r\n <div>\r\n <label>{{ 'order.placed-at-start' | translate }}</label>\r\n <vdr-datetime-picker formControlName=\"placedAtStart\"></vdr-datetime-picker>\r\n </div>\r\n <div>\r\n <label>{{ 'order.placed-at-end' | translate }}</label>\r\n <vdr-datetime-picker formControlName=\"placedAtEnd\"></vdr-datetime-picker>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"order-list\"></vdr-action-bar-items>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<vdr-data-table\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.customer' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.state' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.total' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'common.updated-at' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.placed-at' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'order.shipping' | translate }}</vdr-dt-column>\r\n <vdr-dt-column></vdr-dt-column>\r\n <ng-template let-order=\"item\">\r\n <td class=\"left align-middle\">{{ order.code }}</td>\r\n <td class=\"left align-middle\">\r\n <vdr-customer-label [customer]=\"order.customer\"></vdr-customer-label>\r\n </td>\r\n <td class=\"left align-middle\">\r\n <vdr-order-state-label [state]=\"order.state\"></vdr-order-state-label>\r\n </td>\r\n <td class=\"left align-middle\">{{ order.totalWithTax | localeCurrency: order.currencyCode }}</td>\r\n <td class=\"left align-middle\">{{ order.updatedAt | timeAgo }}</td>\r\n <td class=\"left align-middle\">{{ order.orderPlacedAt | localeDate: 'medium' }}</td>\r\n <td class=\"left align-middle\">{{ getShippingNames(order) }}</td>\r\n <td class=\"right align-middle\">\r\n <vdr-table-row-action\r\n iconShape=\"shopping-cart\"\r\n [label]=\"'common.open' | translate\"\r\n [linkTo]=\"order.state === 'Modifying' ? ['./', order.id, 'modify'] : ['./', order.id]\"\r\n ></vdr-table-row-action>\r\n </td>\r\n </ng-template>\r\n</vdr-data-table>\r\n",
|
|
2062
2115
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2063
2116
|
styles: [".search-form{display:flex;flex-direction:column;align-items:baseline;width:100%;margin-bottom:6px}@media screen and (min-width: 768px){.search-form{flex-direction:row}}.search-input{margin-left:6px;margin-top:6px;min-width:300px}.custom-filters{overflow:hidden;max-height:0;padding-bottom:6px}.custom-filters.expanded{max-height:initial}.custom-filters>form{display:flex;flex-direction:column;align-items:center}.custom-filters>form>div{width:100%}ng-select{flex:1;min-width:200px;height:36px}ng-select ::ng-deep .ng-select-container{height:36px}\n"]
|
|
2064
2117
|
},] }
|
|
@@ -2084,7 +2137,7 @@ class OrderPaymentCardComponent {
|
|
|
2084
2137
|
if (!this.payment) {
|
|
2085
2138
|
return [];
|
|
2086
2139
|
}
|
|
2087
|
-
return this.payment.nextStates.filter(s => s !== 'Settled');
|
|
2140
|
+
return this.payment.nextStates.filter(s => s !== 'Settled' && s !== 'Error');
|
|
2088
2141
|
}
|
|
2089
2142
|
}
|
|
2090
2143
|
OrderPaymentCardComponent.decorators = [
|
|
@@ -2330,11 +2383,19 @@ class OrderTableComponent {
|
|
|
2330
2383
|
return promotion.couponCode || undefined;
|
|
2331
2384
|
}
|
|
2332
2385
|
}
|
|
2386
|
+
getShippingNames(order) {
|
|
2387
|
+
if (order.shippingLines.length) {
|
|
2388
|
+
return order.shippingLines.map(shippingLine => shippingLine.shippingMethod.name).join(', ');
|
|
2389
|
+
}
|
|
2390
|
+
else {
|
|
2391
|
+
return '';
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2333
2394
|
}
|
|
2334
2395
|
OrderTableComponent.decorators = [
|
|
2335
2396
|
{ type: Component, args: [{
|
|
2336
2397
|
selector: 'vdr-order-table',
|
|
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
|
|
2398
|
+
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\">{{ getShippingNames(order) }}</td>\r\n <td colspan=\"3\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.shippingWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.shipping | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr class=\"total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.total' | translate }}</td>\r\n <td colspan=\"4\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.totalWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.total | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>\r\n",
|
|
2338
2399
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2339
2400
|
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"]
|
|
2340
2401
|
},] }
|