Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCST-2334: Ability to review the line item order configuration, discounts and dynamic properties #441

Merged
merged 7 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@
"items-purchased": "Die Anzahl der gekauften Artikel",
"lines-per-order": "Zeilen pro Bestellung",
"revenue-per-customer": "Umsatz pro Kunde"
},
"configuration": {
"title": "Konfiguration"
}
},
"dialogs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
"fee-total": "Total fee"
}
},
"customerOrder-item-detail": {
"labels": {
"product": "Product name"
}
},
"customerOrder-list": {
"title": "Customer orders",
"labels": {
Expand Down Expand Up @@ -194,74 +199,98 @@
"labels": {
"transactionId": "Transaction Id",
"outerId": "Outer Id"
}
},
"transactions-list": {
"title": "Payment gateway transactions",
"subtitle": "List of all payment gateway interactions"
},
"transaction-detail": {
"title": "Transaction details",
"subtitle": "Raw transaction data "
},
"shipment-detail": {
"title": "Shipment #{{number}}",
"title-new": "New shipment",
"subtitle": "Edit shipment details",
"labels": {
"shipment-method": "Shipment method",
"approved": "Approved",
"shipment-number": "Shipment ID",
"status": "Status",
"fulfillment-center": "Fulfillment center",
"from": "Date and time",
"employee": "Assigned to",
"price": "Shipment amount",
"price-with-tax": "Shipment amount with tax",
"shipment-method-option": "Shipment method",
"tracking-number": "Tracking number",
"tracking-url": "Tracking URL",
"delivery-date": "Delivery date",
"vendor": "Vendor"
},
"placeholders": {
"status": "Select...",
"shipment-method": "Select...",
"fulfillment-center": "Select or search a center...",
"shipment-method-option": "Default shipment method",
"vendor": "Select..."
}
},
"shipment-items": {
"title": "{{title}} line items",
"subtitle": "Edit shipment items",
"labels": {
"item": "Item",
"status": "Status",
"quantity": "Qty",
"price": "Price",
"total": "Total"
}
},
"catalog-items-select": {
"title": "Add item to order"
},
"newOperation-wizard": {
"title": "New operation",
"subtitle": "Select operation type",
"menu": {
"shipment-operation": {
"description": "Shipment document"
}
},
"transactions-list": {
"title": "Payment gateway transactions",
"subtitle": "List of all payment gateway interactions"
},
"transaction-detail": {
"title": "Transaction details",
"subtitle": "Raw transaction data "
},
"shipment-detail": {
"title": "Shipment #{{number}}",
"title-new": "New shipment",
"subtitle": "Edit shipment details",
"labels": {
"shipment-method": "Shipment method",
"approved": "Approved",
"shipment-number": "Shipment ID",
"status": "Status",
"fulfillment-center": "Fulfillment center",
"from": "Date and time",
"employee": "Assigned to",
"price": "Shipment amount",
"price-with-tax": "Shipment amount with tax",
"shipment-method-option": "Shipment method",
"tracking-number": "Tracking number",
"tracking-url": "Tracking URL",
"delivery-date": "Delivery date",
"vendor": "Vendor"
},
"placeholders": {
"status": "Select...",
"shipment-method": "Select...",
"fulfillment-center": "Select or search a center...",
"shipment-method-option": "Default shipment method",
"vendor": "Select..."
}
},
"shipment-items": {
"title": "{{title}} line items",
"subtitle": "Edit shipment items",
"labels": {
"item": "Item",
"status": "Status",
"quantity": "Qty",
"price": "Price",
"total": "Total"
}
},
"catalog-items-select": {
"title": "Add item to order"
},
"newOperation-wizard": {
"title": "New operation",
"subtitle": "Select operation type",
"menu": {
"shipment-operation": {
"description": "Shipment document"
},
"payment-operation": {
"description": "Incoming payment document"
},
"refund-operation": {
"description": "Refund document"
}
}
},
"configuration": {
"title": "Configuration",
"labels": {
"picture": "Image",
"quantity": "Quantity",
"product-name": "Product name"
},
"payment-operation": {
"description": "Incoming payment document"
"descr": {
"no-configuration": "This product does not support configuration."
}
},
"customerOrder-item-discounts": {
"title": "Discounts",
"labels": {
"name": "Name",
"coupon": "Coupon",
"discountAmount": "Discount amount",
"discountAmountWithTax": "Discount amount with tax",
"currency": "Currency"
},
"refund-operation": {
"description": "Refund document"
"descr": {
"no-discounts": "This entity doesn't have any discounts yet."
}
}
}
},
},
"widgets": {
"notifications": {
"title": "Notification feed",
Expand Down Expand Up @@ -330,6 +359,12 @@
},
"customerOrder-list": {
"title": "Orders"
},
"configuration": {
"title": "Configuration"
},
"customerOrder-item-discounts": {
"title": "Discounts"
}
},
"dialogs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@
"revenue-per-customer": "Доход от одного клиента",
"title": "Статистика по заказам",
"not-authorized": "Нет доступа. У вас нет доступа к этой функции. Свяжитесь с администратором своей учетной записи для получения доступа."
},
"configuration": {
"title": "Конфигурация"
}
},
"dialogs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
angular.module('virtoCommerce.orderModule')
.controller('virtoCommerce.orderModule.customerOrderItemConfigurationController', [
'$scope', 'platformWebApp.uiGridHelper', 'platformWebApp.bladeNavigationService',
function ($scope, uiGridHelper, bladeNavigationService) {
var blade = $scope.blade;
blade.title = 'orders.blades.configuration.title';
blade.headIcon = 'fas fa-sliders';

$scope.setGridOptions = function (gridOptions) {
uiGridHelper.initialize($scope, gridOptions, function (gridApi) {
$scope.gridApi = gridApi;
});
};

$scope.selectNode = function (item) {
$scope.selectedNodeId = item.id;

var newBlade = {
id: "listItemDetail",
controller: 'virtoCommerce.catalogModule.itemDetailController',
template: 'Modules/$(VirtoCommerce.Catalog)/Scripts/blades/item-detail.tpl.html',
title: item.name,
itemId: item.productId
};
bladeNavigationService.showBlade(newBlade, blade);
}

function initialize() {
blade.isLoading = false;
}

initialize();
}]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<div class="blade-content __medium-wide">
<div class="blade-inner">
<div class="inner-block" ng-init="setGridOptions({
rowTemplate: 'configuration-list.row.html',
data: 'blade.currentEntity.configurationItems',
rowHeight: 61,
enableSorting: false,
columnDefs: [
{
name: 'imageUrl', displayName: 'orders.blades.configuration.labels.picture',
enableColumnResizing: false, width: 75, cellTemplate: 'configuration-item-list-icon.cell.html'
},
{ name: 'name', displayName: 'orders.blades.configuration.labels.product-name'},
{ name: 'quantity', displayName: 'orders.blades.configuration.labels.quantity', width: 120 }
]})">
<div class="table-wrapper" ng-if="blade.currentEntity.configurationItems.length" style="margin: 0 -21px 0;">
<div ui-grid="gridOptions" ui-grid-auto-resize ui-grid-save-state ui-grid-resize-columns ui-grid-move-columns ui-grid-pinning ui-grid-height></div>
</div>
<div class="note" ng-if="!blade.currentEntity.configurationItems.length">{{ 'orders.blades.configuration.descr.no-configuration' | translate }}</div>
</div>
</div>
</div>

<script type="text/ng-template" id="configuration-list.row.html">
<div ng-click='grid.appScope.selectNode(row.entity)' ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell" ng-class="{'ui-grid-row-header-cell': col.isRowHeader, '__hovered': grid.appScope.contextMenuEntity === row.entity, '__selected': row.entity.id ===grid.appScope.selectedNodeId}" role="{{col.isRowHeader ? 'rowheader' : 'gridcell' }}" ui-grid-cell></div>
</script>

<script type="text/ng-template" id="configuration-item-list-icon.cell.html">
<div class="ui-grid-cell-contents">
<div class="product-img">
<img class="image" ng-src="{{COL_FIELD}}" ng-if="COL_FIELD">
<span class="table-ico fas fa-image" ng-if="!COL_FIELD"></span>
</div>
</div>
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
angular.module('virtoCommerce.orderModule')
.controller('virtoCommerce.orderModule.customerOrderItemDetailController', [
'$scope', 'platformWebApp.bladeNavigationService', 'platformWebApp.authService',
function ($scope, bladeNavigationService, authService) {
var blade = $scope.blade;
blade.updatePermission = 'order:update';
blade.isVisiblePrices = authService.checkPermission('order:read_prices');
blade.formScope = null;
blade.metaFields = [
{
title: "orders.blades.customerOrder-item-detail.labels.product",
colSpan: 2,
templateUrl: "name.html"
},
{
templateUrl: "status.html"
},
{
title: "orders.blades.customerOrder-items.labels.quantity",
templateUrl: "quantity.html"
},
{
title: "orders.blades.customerOrder-items.labels.price",
templateUrl: "price.html"
},
{
title: "orders.blades.customerOrder-items.labels.priceWithTax",
templateUrl: "priceWithTax.html"
},
{
title: "orders.blades.customerOrder-items.labels.discount",
templateUrl: "discountAmount.html"
},
{
title: "orders.blades.customerOrder-items.labels.discountWithTax",
templateUrl: "discountAmountWithTax.html"
},
{
title: "orders.blades.customerOrder-items.labels.tax",
templateUrl: "taxTotal.html"
},
{
title: "orders.blades.customerOrder-items.labels.total",
templateUrl: "extendedPriceWithTax.html"
}
];

blade.refresh = function () {
blade.isLoading = false;
};

blade.openStatusSettingManagement = function () {
var newBlade = {
id: 'settingDetailChild',
controller: 'platformWebApp.settingDictionaryController',
template: '$(Platform)/Scripts/app/settings/blades/setting-dictionary.tpl.html',
currentEntityId: 'OrderLineItem.Statuses',
isApiSave: true,
};
bladeNavigationService.showBlade(newBlade, blade);
};

blade.recalculate = function() {
if (blade.formScope && blade.formScope.$valid && angular.isFunction(blade.recalculateFn)) {
blade.recalculateFn();
}
}

blade.setForm = function (form) { blade.formScope = form; }

blade.openItemDetail = function () {
var newBlade = {
id: "listItemDetail",
controller: 'virtoCommerce.catalogModule.itemDetailController',
template: 'Modules/$(VirtoCommerce.Catalog)/Scripts/blades/item-detail.tpl.html',
title: blade.currentEntity.name,
itemId: blade.currentEntity.productId,
productType: blade.currentEntity.productType
};
bladeNavigationService.showBlade(newBlade, blade);
};

$scope.$watch("blade.order", function (order) {
blade.currentEntity = _.filter(order.items, function (item) { return item.id === blade.currentEntityId })[0];
}, true);

blade.refresh();
}]);
Loading
Loading