ng-easycommerce 0.0.633 → 0.0.635
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/README.md +4 -0
- package/bundles/ng-easycommerce.umd.js +51 -52
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -3
- package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +4 -2
- package/esm2015/lib/services/cart.service.js +12 -3
- package/esm2015/lib/services/options.service.js +20 -13
- package/esm2015/lib/services/products/product-detail.service.js +11 -7
- package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -3
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +4 -2
- package/esm5/lib/services/cart.service.js +12 -3
- package/esm5/lib/services/options.service.js +19 -35
- package/esm5/lib/services/products/product-detail.service.js +11 -7
- package/fesm2015/ng-easycommerce.js +45 -23
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +51 -52
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +1 -0
- package/lib/services/cart.service.d.ts +1 -1
- package/lib/services/options.service.d.ts +1 -1
- package/lib/services/products/product-detail.service.d.ts +2 -1
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# version 0.0.635
|
|
2
|
+
- Se agregó la posibilidad de incluir un comentario opcional al agregar un producto al carrito desde la ficha de producto (`product-detail`). Este comentario ahora también se muestra en el sidebar, en el carrito y en el detalle de órdenes.
|
|
3
|
+
# version 0.0.634
|
|
4
|
+
- Se volvio para atras el cambio de generación de breadcrumbs
|
|
1
5
|
# version 0.0.633
|
|
2
6
|
- mejorar la lógica de actualización de cantidad en el carrito
|
|
3
7
|
- optimizar la generación de breadcrumbs
|
|
@@ -989,17 +989,6 @@
|
|
|
989
989
|
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
990
990
|
return ar;
|
|
991
991
|
};
|
|
992
|
-
var __values = (this && this.__values) || function(o) {
|
|
993
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
994
|
-
if (m) return m.call(o);
|
|
995
|
-
if (o && typeof o.length === "number") return {
|
|
996
|
-
next: function () {
|
|
997
|
-
if (o && i >= o.length) o = void 0;
|
|
998
|
-
return { value: o && o[i++], done: !o };
|
|
999
|
-
}
|
|
1000
|
-
};
|
|
1001
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1002
|
-
};
|
|
1003
992
|
var OptionsService = /** @class */ (function () {
|
|
1004
993
|
function OptionsService(connection, constants) {
|
|
1005
994
|
var _this = this;
|
|
@@ -1133,31 +1122,26 @@
|
|
|
1133
1122
|
});
|
|
1134
1123
|
return final_result;
|
|
1135
1124
|
};
|
|
1136
|
-
this.generateBreadcrumb = function (code, elements,
|
|
1137
|
-
var
|
|
1138
|
-
if (
|
|
1139
|
-
|
|
1140
|
-
try {
|
|
1141
|
-
for (var elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
|
|
1142
|
-
var elem = elements_1_1.value;
|
|
1143
|
-
if (elem.code === code) {
|
|
1144
|
-
return __spread(path, [elem]);
|
|
1145
|
-
}
|
|
1146
|
-
if ((_b = elem.children) === null || _b === void 0 ? void 0 : _b.length) {
|
|
1147
|
-
var childPath = _this.generateBreadcrumb(code, elem.children, __spread(path, [elem]));
|
|
1148
|
-
if (childPath.length)
|
|
1149
|
-
return childPath;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1125
|
+
this.generateBreadcrumb = function (code, elements, result) {
|
|
1126
|
+
var element = elements.find(function (elem) { return elem.code == code; });
|
|
1127
|
+
if (element) {
|
|
1128
|
+
result.push(element);
|
|
1152
1129
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1130
|
+
else {
|
|
1131
|
+
elements.some(function (elem) {
|
|
1132
|
+
if (elem.children && elem.children.length) {
|
|
1133
|
+
var length_1 = result.length;
|
|
1134
|
+
var new_result = _this.generateBreadcrumb(code, elem.children, result);
|
|
1135
|
+
if (new_result.length > length_1) {
|
|
1136
|
+
result = new_result;
|
|
1137
|
+
result.push(elem);
|
|
1138
|
+
return true;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
return false;
|
|
1142
|
+
});
|
|
1159
1143
|
}
|
|
1160
|
-
return
|
|
1144
|
+
return result;
|
|
1161
1145
|
};
|
|
1162
1146
|
this.getAllData();
|
|
1163
1147
|
// this.authService.loggedIn.subscribe(res => res && this.getAllData());
|
|
@@ -4802,7 +4786,7 @@
|
|
|
4802
4786
|
* @public
|
|
4803
4787
|
* CART CRUD
|
|
4804
4788
|
*/
|
|
4805
|
-
this.addToCart = function (product, quantity, variant_id) {
|
|
4789
|
+
this.addToCart = function (product, quantity, variant_id, comments) {
|
|
4806
4790
|
var _a, _b, _c, _d;
|
|
4807
4791
|
var balance = _this.balanceCustomerSubject.value;
|
|
4808
4792
|
var applyMaxOrders = (_b = (_a = balance) === null || _a === void 0 ? void 0 : _a.applyMaxOrders, (_b !== null && _b !== void 0 ? _b : false));
|
|
@@ -4818,7 +4802,15 @@
|
|
|
4818
4802
|
_this.requestInProcess.next(true);
|
|
4819
4803
|
var added = _this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4820
4804
|
if (!added) {
|
|
4821
|
-
|
|
4805
|
+
var payload = {
|
|
4806
|
+
productCode: product.id,
|
|
4807
|
+
quantity: quantity,
|
|
4808
|
+
variantCode: variant_id,
|
|
4809
|
+
};
|
|
4810
|
+
if (comments) {
|
|
4811
|
+
payload.comments = comments;
|
|
4812
|
+
}
|
|
4813
|
+
_this.connection.post(_this.addItemApi(), payload)
|
|
4822
4814
|
.subscribe(function (res) {
|
|
4823
4815
|
// Manejar la respuesta HTTP exitosa (código 200)
|
|
4824
4816
|
_this.appendToCart(res);
|
|
@@ -5095,6 +5087,7 @@
|
|
|
5095
5087
|
variant_id: item.product.variants[0].code,
|
|
5096
5088
|
lot: item.orderItemLot,
|
|
5097
5089
|
quantity: item.quantity,
|
|
5090
|
+
comments: item.comments || '',
|
|
5098
5091
|
item_id: item.id,
|
|
5099
5092
|
total: item.total
|
|
5100
5093
|
};
|
|
@@ -7422,7 +7415,7 @@
|
|
|
7422
7415
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
7423
7416
|
}
|
|
7424
7417
|
};
|
|
7425
|
-
var __values
|
|
7418
|
+
var __values = (this && this.__values) || function(o) {
|
|
7426
7419
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
7427
7420
|
if (m) return m.call(o);
|
|
7428
7421
|
if (o && typeof o.length === "number") return {
|
|
@@ -7762,7 +7755,7 @@
|
|
|
7762
7755
|
CartEcComponent.prototype.checkStock = function (item) {
|
|
7763
7756
|
var e_1, _a;
|
|
7764
7757
|
try {
|
|
7765
|
-
for (var _b = __values
|
|
7758
|
+
for (var _b = __values(item.product.variants), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7766
7759
|
var variant = _c.value;
|
|
7767
7760
|
if (item.variant_id === variant.code) {
|
|
7768
7761
|
if (variant.stock === 0) {
|
|
@@ -7793,7 +7786,7 @@
|
|
|
7793
7786
|
res.forEach(function (item) {
|
|
7794
7787
|
var e_2, _a;
|
|
7795
7788
|
try {
|
|
7796
|
-
for (var _b = __values
|
|
7789
|
+
for (var _b = __values(item.product.variants), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7797
7790
|
var variant = _c.value;
|
|
7798
7791
|
if (item.variant_id === variant.code && !_this.exitUpdate) {
|
|
7799
7792
|
if (variant.stock === 0) {
|
|
@@ -8698,7 +8691,7 @@
|
|
|
8698
8691
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8699
8692
|
}
|
|
8700
8693
|
};
|
|
8701
|
-
var __values$
|
|
8694
|
+
var __values$1 = (this && this.__values) || function(o) {
|
|
8702
8695
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
8703
8696
|
if (m) return m.call(o);
|
|
8704
8697
|
if (o && typeof o.length === "number") return {
|
|
@@ -8843,7 +8836,7 @@
|
|
|
8843
8836
|
var e_1, _a;
|
|
8844
8837
|
var parent = e.target.parentElement.children;
|
|
8845
8838
|
try {
|
|
8846
|
-
for (var parent_1 = __values$
|
|
8839
|
+
for (var parent_1 = __values$1(parent), parent_1_1 = parent_1.next(); !parent_1_1.done; parent_1_1 = parent_1.next()) {
|
|
8847
8840
|
var button = parent_1_1.value;
|
|
8848
8841
|
if (button.classList.contains('active')) {
|
|
8849
8842
|
button.classList.remove('active');
|
|
@@ -8913,7 +8906,7 @@
|
|
|
8913
8906
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8914
8907
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8915
8908
|
};
|
|
8916
|
-
var __values$
|
|
8909
|
+
var __values$2 = (this && this.__values) || function(o) {
|
|
8917
8910
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
8918
8911
|
if (m) return m.call(o);
|
|
8919
8912
|
if (o && typeof o.length === "number") return {
|
|
@@ -9002,7 +8995,7 @@
|
|
|
9002
8995
|
var e_1, _a;
|
|
9003
8996
|
var parent = e.target.parentElement.children;
|
|
9004
8997
|
try {
|
|
9005
|
-
for (var parent_1 = __values$
|
|
8998
|
+
for (var parent_1 = __values$2(parent), parent_1_1 = parent_1.next(); !parent_1_1.done; parent_1_1 = parent_1.next()) {
|
|
9006
8999
|
var button = parent_1_1.value;
|
|
9007
9000
|
if (button.classList.contains('active')) {
|
|
9008
9001
|
button.classList.remove('active');
|
|
@@ -10928,9 +10921,10 @@
|
|
|
10928
10921
|
* @description agrega/actualiza un item en el carrito
|
|
10929
10922
|
* @param quantity cantidad a agregar
|
|
10930
10923
|
* @param variant_code **(opcional)** codigo de la variante seleccionada del producto.
|
|
10924
|
+
* @param comments **(opcional)** comentario personalizado del cliente.
|
|
10931
10925
|
* @returns
|
|
10932
10926
|
*/
|
|
10933
|
-
ProductDetailService.prototype.addToCart = function (quantity, variant_code) {
|
|
10927
|
+
ProductDetailService.prototype.addToCart = function (quantity, variant_code, comments) {
|
|
10934
10928
|
quantity = parseInt(quantity);
|
|
10935
10929
|
if (!this.variants.length) {
|
|
10936
10930
|
this.toastrService.show('cant-buy');
|
|
@@ -10943,9 +10937,9 @@
|
|
|
10943
10937
|
this.toastrService.show('no-variants');
|
|
10944
10938
|
break;
|
|
10945
10939
|
case 1:
|
|
10946
|
-
this.asociatedDataSubject.value.stock == 0
|
|
10947
|
-
this.toastrService.show('out-of-stock')
|
|
10948
|
-
variant = this.variants[0];
|
|
10940
|
+
this.asociatedDataSubject.value.stock == 0
|
|
10941
|
+
? this.toastrService.show('out-of-stock')
|
|
10942
|
+
: variant = this.variants[0];
|
|
10949
10943
|
break;
|
|
10950
10944
|
default:
|
|
10951
10945
|
if (variant_code) {
|
|
@@ -10964,10 +10958,13 @@
|
|
|
10964
10958
|
return;
|
|
10965
10959
|
if (!this.validateQuantity(quantity, variant.code))
|
|
10966
10960
|
return;
|
|
10967
|
-
var priceToValidate = product_selected.saleprice
|
|
10961
|
+
var priceToValidate = product_selected.saleprice
|
|
10962
|
+
? product_selected.saleprice * quantity
|
|
10963
|
+
: product_selected.price * quantity;
|
|
10968
10964
|
if (!this.validatePriceAndCredits(priceToValidate))
|
|
10969
10965
|
return;
|
|
10970
|
-
this.
|
|
10966
|
+
var product = this.makeAffordableProduct(product_selected);
|
|
10967
|
+
this.cartService.addToCart(product, quantity, variant.code, comments);
|
|
10971
10968
|
};
|
|
10972
10969
|
;
|
|
10973
10970
|
ProductDetailService.prototype.makeAffordableProduct = function (product_selected) {
|
|
@@ -11094,6 +11091,7 @@
|
|
|
11094
11091
|
_this.injector = injector;
|
|
11095
11092
|
_this.show = false;
|
|
11096
11093
|
_this.quantity = 1;
|
|
11094
|
+
_this.comments = '';
|
|
11097
11095
|
_this.breadcrumb = [];
|
|
11098
11096
|
_this.code = null;
|
|
11099
11097
|
_this.focusImage = null;
|
|
@@ -11102,7 +11100,8 @@
|
|
|
11102
11100
|
_this.hidePrices = false;
|
|
11103
11101
|
_this.creditAccountShowPrices = null;
|
|
11104
11102
|
_this.addToCart = function () {
|
|
11105
|
-
|
|
11103
|
+
var _a;
|
|
11104
|
+
_this.quantity > 0 && _this.productService.addToCart(_this.quantity, undefined, ((_a = _this.comments) === null || _a === void 0 ? void 0 : _a.trim()) || null);
|
|
11106
11105
|
};
|
|
11107
11106
|
_this.addAllProductosToCart = function () {
|
|
11108
11107
|
var _a, _b;
|
|
@@ -13518,8 +13517,8 @@
|
|
|
13518
13517
|
OrderEcComponent = __decorate$1l([
|
|
13519
13518
|
core.Component({
|
|
13520
13519
|
selector: 'app-order-ec',
|
|
13521
|
-
template: "<main class=\"py-5\" id=\"orderEcComponent\">\n <div class=\"container\">\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\n <div *ngIf=\"order; else noOrder\">\n\n <div class=\"row justify-content-between \">\n <div class=\"col-sm-auto col-12 font-brandon\">\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\n </div>\n <ng-container *ngIf=\"order?.invoice\">\n <div class=\"col-sm col-12 font-brandon\">\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\n class=\"btn btn-link btn-invoice\">\n <i class=\"fas fa-file-download me-1\"></i>\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\n </a>\n </div>\n </ng-container>\n <a (click)=\"volver()\" class=\"col-auto text-end\">\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\n </a>\n </div>\n\n <section id=\"orders\">\n <div class=\"row pt-2\">\n <div class=\"col-md-2 col-12\">\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\n <p class=\"\">\n {{ order.payments[0].state | translate }}\n </p>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\">\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\n <p class=\"\">\n {{ order.shipments[0].state | translate }}\n </p>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\">\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\n <p class=\"\">\n {{ order.payments[0]?.method?.name | translate }}\n </p>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\">\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\n <p class=\"\">\n {{ order.shipments[0].method.name }}\n </p>\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\n seguimiento</a>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\">\n <p class=\"st\">{{ 'date' | translate }}:</p>\n <p class=\"\">\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\n </p>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\" *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"st\">{{ 'total' | translate }}:</p>\n <h5 class=\"fw-bold\">\n {{ (order.totals.total) | ecCurrencySymbol}}\n\n </h5>\n </div>\n </div>\n </section>\n\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\n {{ 'repeat-order' | translate }}\n </button>\n </div>\n\n <div class=\"container py-3 border-top border-bottom\">\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\n {{ 'product' | translate | uppercase }}\n </div>\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\n {{ 'description' | translate | uppercase }}\n </div>\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\n <!-- {{ 'description' | translate | uppercase }} -->\n {{ 'lots' | translate | uppercase }}\n </div>\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n {{ 'unit-price' | translate | uppercase }}\n </div>\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\n {{ 'quantity' | translate | uppercase }}\n </div>\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n {{ 'total' | translate | uppercase }}\n </div>\n </div>\n <ng-container *ngFor=\"let item of order.items; let i = index\">\n <div class=\"row cart-items\">\n <div class=\"col-5 col-md-2 py-2\">\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\n <img class=\"smc maxwidth img-fluid rounded-custom \"\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\n </ng-container>\n <ng-template #defaultpicture>\n <img *ngIf=\"item.product.picturesdefault\"\n class=\"smc maxwidth img-fluid rounded-custom\"\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\n </ng-template>\n </div>\n <div\n class=\"col-md-4 col-7 flex-column flex-md-row justify-content-start d-flex align-items-center\">\n <p class=\"font-brandon d-flex w-100 mb-0\">\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\n </p>\n </div>\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\n value=\"{{ 'see' | translate | uppercase }}\">\n </div>\n <div class=\"container d-md-none\">\n <div class=\"row\">\n <div class=\"col-4\">\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\n </div>\n <div class=\"col-4 font-xl\" *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\n item.product.variants[0].saleprice : item.product.variants[0].price) |\n ecCurrencySymbol}}</p>\n </div>\n <div class=\"col-4 font-xl\" *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\n item.product.variants[0].saleprice : item.product.variants[0].price) *\n item.quantity) | ecCurrencySymbol}}</p>\n </div>\n </div>\n </div>\n\n <div class=\"col-2 d-none d-md-flex align-items-center\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"text-center w-100 m-0\">\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\n item.product.variants[0].price) | ecCurrencySymbol}}\n </p>\n </div>\n <div class=\"col-1 d-none d-md-flex align-items-center\">\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\n </div>\n <div class=\"col-2 d-none d-md-flex align-items-center\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"text-end w-100 m-0\">\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol}}</p>\n </div>\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\n <div class=\"card card-body\">\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">Estado</th>\n <th scope=\"col\">Cantidad</th>\n <th scope=\"col\">Fecha Solicitada</th>\n <th scope=\"col\">Fecha Estimada</th>\n <th scope=\"col\">Sede</th>\n <th scope=\"col\">Nota</th>\n <th scope=\"col\">Total Lote</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\n <tr>\n <th scope=\"row\">{{lot.id}}</th>\n <td>{{lot.lot_status}}</td>\n <td>{{lot.quantity}}</td>\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\n <ng-template #sinFechaEstimada>\n <td>Pendiente</td>\n </ng-template>\n <td>{{lot.shipping_address_name}}</td>\n <td>{{lot.notes}}</td>\n <td>{{lot.total_lot | ecCurrencySymbol}}</td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n\n </ng-container>\n </div>\n\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12 col-md-6\"></div>\n <div class=\"col-12 col-md-6\" *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <div class=\"row py-4\">\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\n translate }}</div>\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\n {{ (order.totals.subtotal) | ecCurrencySymbol }}\n </div>\n\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\n translate }}</div>\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\n {{ (order.totals.shipping || '0') | ecCurrencySymbol }}\n\n </div>\n\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\n translate }}</div>\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\n {{ (order.totals.promotion) | ecCurrencySymbol }}</div>\n\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\n {{ 'taxes' | translate }}</div>\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\n {{ (order.totals.taxes) | ecCurrencySymbol }}</div>\n\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\n <div class=\"col-6 font-brandon font-md text-end\">\n {{ (order.totals.total) | ecCurrencySymbol }}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</main>\n\n<ng-template #noOrder>\n <div class=\"w-100 h-50\">\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\n <h5>{{ 'no-orders' | translate }}</h5>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingView>\n <div class=\"w-100 h-50 py-5\">\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\n <app-loading-full-ec></app-loading-full-ec>\n </div>\n </div>\n</ng-template>",
|
|
13522
|
-
styles: [".maxwidth{max-width:100px}"]
|
|
13520
|
+
template: "<main class=\"py-5\" id=\"orderEcComponent\">\n <div class=\"container\">\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\n <div *ngIf=\"order; else noOrder\">\n\n <div class=\"row justify-content-between \">\n <div class=\"col-sm-auto col-12 font-brandon\">\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\n </div>\n <ng-container *ngIf=\"order?.invoice\">\n <div class=\"col-sm col-12 font-brandon\">\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\n class=\"btn btn-link btn-invoice\">\n <i class=\"fas fa-file-download me-1\"></i>\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\n </a>\n </div>\n </ng-container>\n <a (click)=\"volver()\" class=\"col-auto text-end\">\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\n </a>\n </div>\n\n <section id=\"orders\">\n <div class=\"row pt-2\">\n <div class=\"col-md-2 col-12\">\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\n <p class=\"\">\n {{ order.payments[0].state | translate }}\n </p>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\">\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\n <p class=\"\">\n {{ order.shipments[0].state | translate }}\n </p>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\">\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\n <p class=\"\">\n {{ order.payments[0]?.method?.name | translate }}\n </p>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\">\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\n <p class=\"\">\n {{ order.shipments[0].method.name }}\n </p>\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\n seguimiento</a>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\">\n <p class=\"st\">{{ 'date' | translate }}:</p>\n <p class=\"\">\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\n </p>\n </div>\n <div class=\"col-md-2 col-12 font-brandon\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"st\">{{ 'total' | translate }}:</p>\n <h5 class=\"fw-bold\">\n {{ (order.totals.total) | ecCurrencySymbol}}\n\n </h5>\n </div>\n </div>\n </section>\n\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\n {{ 'repeat-order' | translate }}\n </button>\n </div>\n\n <div class=\"container py-3 border-top border-bottom\">\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\n {{ 'product' | translate | uppercase }}\n </div>\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\n {{ 'description' | translate | uppercase }}\n </div>\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\n <!-- {{ 'description' | translate | uppercase }} -->\n {{ 'lots' | translate | uppercase }}\n </div>\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n {{ 'unit-price' | translate | uppercase }}\n </div>\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\n {{ 'quantity' | translate | uppercase }}\n </div>\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n {{ 'total' | translate | uppercase }}\n </div>\n </div>\n <ng-container *ngFor=\"let item of order.items; let i = index\">\n <div class=\"row cart-items\">\n <div class=\"col-5 col-md-2 py-2\">\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\n <img class=\"smc maxwidth img-fluid rounded-custom \"\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\n </ng-container>\n <ng-template #defaultpicture>\n <img *ngIf=\"item.product.picturesdefault\"\n class=\"smc maxwidth img-fluid rounded-custom\"\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\n </ng-template>\n </div> \n <div\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\n <p class=\"font-brandon d-flex w-100 mb-0\">\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\n </p>\n <p *ngIf=\"item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\n \"{{ item.comments }}\"\n </p>\n </div>\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\n value=\"{{ 'see' | translate | uppercase }}\">\n </div>\n <div class=\"container d-md-none\">\n <div class=\"row\">\n <div class=\"col-4\">\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\n </div>\n <div class=\"col-4 font-xl\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\n item.product.variants[0].saleprice : item.product.variants[0].price) |\n ecCurrencySymbol}}</p>\n </div>\n <div class=\"col-4 font-xl\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\n item.product.variants[0].saleprice : item.product.variants[0].price) *\n item.quantity) | ecCurrencySymbol}}</p>\n </div>\n </div>\n </div>\n\n <div class=\"col-2 d-none d-md-flex align-items-center\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"text-center w-100 m-0\">\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\n item.product.variants[0].price) | ecCurrencySymbol}}\n </p>\n </div>\n <div class=\"col-1 d-none d-md-flex align-items-center\">\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\n </div>\n <div class=\"col-2 d-none d-md-flex align-items-center\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <p class=\"text-end w-100 m-0\">\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol}}</p>\n </div>\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\n <div class=\"card card-body\">\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">Estado</th>\n <th scope=\"col\">Cantidad</th>\n <th scope=\"col\">Fecha Solicitada</th>\n <th scope=\"col\">Fecha Estimada</th>\n <th scope=\"col\">Sede</th>\n <th scope=\"col\">Nota</th>\n <th scope=\"col\">Total Lote</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\n <tr>\n <th scope=\"row\">{{lot.id}}</th>\n <td>{{lot.lot_status}}</td>\n <td>{{lot.quantity}}</td>\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\n <ng-template #sinFechaEstimada>\n <td>Pendiente</td>\n </ng-template>\n <td>{{lot.shipping_address_name}}</td>\n <td>{{lot.notes}}</td>\n <td>{{lot.total_lot | ecCurrencySymbol}}</td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n\n </ng-container>\n </div>\n\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12 col-md-6\"></div>\n <div class=\"col-12 col-md-6\"\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\n <div class=\"row py-4\">\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\n translate }}</div>\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\n {{ (order.totals.subtotal) | ecCurrencySymbol }}\n </div>\n\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\n translate }}</div>\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\n {{ (order.totals.shipping || '0') | ecCurrencySymbol }}\n\n </div>\n\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\n translate }}</div>\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\n {{ (order.totals.promotion) | ecCurrencySymbol }}</div>\n\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\n {{ 'taxes' | translate }}</div>\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\n {{ (order.totals.taxes) | ecCurrencySymbol }}</div>\n\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\n <div class=\"col-6 font-brandon font-md text-end\">\n {{ (order.totals.total) | ecCurrencySymbol }}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</main>\n\n<ng-template #noOrder>\n <div class=\"w-100 h-50\">\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\n <h5>{{ 'no-orders' | translate }}</h5>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingView>\n <div class=\"w-100 h-50 py-5\">\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\n <app-loading-full-ec></app-loading-full-ec>\n </div>\n </div>\n</ng-template>",
|
|
13521
|
+
styles: [".maxwidth{max-width:100px}.comment-truncated{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-height:3em}"]
|
|
13523
13522
|
})
|
|
13524
13523
|
], OrderEcComponent);
|
|
13525
13524
|
return OrderEcComponent;
|