ng-easycommerce 0.0.660-beta.1 → 0.0.661
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 +22 -58
- package/assets/ec-i18n/en.json +3 -1
- package/assets/ec-i18n/es.json +3 -1
- package/bundles/ng-easycommerce.umd.js +179 -512
- 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/core.consts.js +6 -1
- package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +5 -3
- package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +8 -5
- package/esm2015/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +11 -5
- package/esm2015/lib/ec-component/collection-ec/collection-ec.component.js +14 -450
- package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +30 -3
- package/esm2015/lib/ec-component/product-ec/product-ec.component.js +1 -2
- package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +8 -5
- package/esm2015/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +1 -3
- package/esm2015/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
- package/esm2015/lib/ec-pipe/ec-currency-symbol.pipe.js +2 -1
- package/esm2015/lib/services/cart.service.js +27 -12
- package/esm2015/lib/services/currency.service.js +43 -7
- package/esm5/lib/core.consts.js +6 -1
- package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +5 -3
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +8 -5
- package/esm5/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +11 -5
- package/esm5/lib/ec-component/collection-ec/collection-ec.component.js +13 -458
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +48 -3
- package/esm5/lib/ec-component/product-ec/product-ec.component.js +1 -2
- package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +8 -5
- package/esm5/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +1 -3
- package/esm5/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
- package/esm5/lib/ec-pipe/ec-currency-symbol.pipe.js +2 -1
- package/esm5/lib/services/cart.service.js +27 -12
- package/esm5/lib/services/currency.service.js +43 -7
- package/fesm2015/ng-easycommerce.js +157 -499
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +180 -513
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/core.consts.d.ts +5 -0
- package/lib/ec-component/account-ec/order-ec/order-ec.component.d.ts +1 -0
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +1 -0
- package/lib/ec-component/collection-ec/collection-ec.component.d.ts +4 -34
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +3 -0
- package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +1 -0
- package/lib/services/cart.service.d.ts +2 -2
- package/lib/services/currency.service.d.ts +14 -2
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
|
|
7
7
|
import { ToastrService, ToastrModule } from 'ngx-toastr';
|
|
8
8
|
import { ReplaySubject, of, BehaviorSubject, forkJoin, combineLatest, Observable, throwError } from 'rxjs';
|
|
9
9
|
import 'rxjs/add/operator/map';
|
|
10
|
-
import { take, map, catchError, filter, mapTo, finalize, skipWhile, concatMap } from 'rxjs/operators';
|
|
10
|
+
import { take, map, catchError, filter, mapTo, finalize, startWith, skipWhile, concatMap } from 'rxjs/operators';
|
|
11
11
|
import 'rxjs/add/operator/catch';
|
|
12
12
|
import 'rxjs/add/observable/of';
|
|
13
13
|
import * as moment from 'moment';
|
|
@@ -469,6 +469,11 @@ let Constants = class Constants {
|
|
|
469
469
|
* @example ['AR','ES','GB']
|
|
470
470
|
*/
|
|
471
471
|
this.countries = [];
|
|
472
|
+
/**
|
|
473
|
+
* @description contiene un arreglo de string cuyo contenido son los codigos de los paises a excluir.
|
|
474
|
+
* @example ['GB']
|
|
475
|
+
*/
|
|
476
|
+
this.excludedCountries = [];
|
|
472
477
|
/**
|
|
473
478
|
*
|
|
474
479
|
* @param countries debe contener los codigos de los paises que se quiere mostrar
|
|
@@ -4032,12 +4037,22 @@ let CartService = class CartService {
|
|
|
4032
4037
|
this.updateLocalCart();
|
|
4033
4038
|
this.requestInProcess.next(false);
|
|
4034
4039
|
};
|
|
4035
|
-
this.updateCartItemQuantity = (variant_id, quantity) => {
|
|
4036
|
-
|
|
4040
|
+
this.updateCartItemQuantity = (variant_id, quantity, comments) => {
|
|
4041
|
+
const normalizedComments = comments !== undefined ? ((comments !== null && comments !== void 0 ? comments : '')).trim() : undefined;
|
|
4042
|
+
const newItems = this.items.map(it => {
|
|
4043
|
+
if (it.variant_id !== variant_id)
|
|
4044
|
+
return it;
|
|
4045
|
+
const updated = Object.assign(Object.assign({}, it), { quantity: Number(quantity) });
|
|
4046
|
+
if (normalizedComments !== undefined) {
|
|
4047
|
+
updated.comments = normalizedComments;
|
|
4048
|
+
}
|
|
4049
|
+
return updated;
|
|
4050
|
+
});
|
|
4051
|
+
this.items = newItems;
|
|
4037
4052
|
this.cartItemsSubject.next(this.items);
|
|
4038
4053
|
this.requestInProcess.next(false);
|
|
4039
4054
|
this.updateLocalCart();
|
|
4040
|
-
this.toastrService.show('product-updated', { quantity
|
|
4055
|
+
this.toastrService.show('product-updated', { quantity });
|
|
4041
4056
|
};
|
|
4042
4057
|
this.appendToCart = (cart) => {
|
|
4043
4058
|
this.updateCartObj(cart);
|
|
@@ -4058,9 +4073,9 @@ let CartService = class CartService {
|
|
|
4058
4073
|
// this.googleAnalytics.removeFromCart(product);
|
|
4059
4074
|
this.analyticsService.callEvent('remove_from_cart', Object.assign(Object.assign({}, product), { currency: this.consts.currency.code }));
|
|
4060
4075
|
};
|
|
4061
|
-
this.addIfAllreadyExists = (product, variant_id, quantityAdd = 1) => this.items.find((item, index) => {
|
|
4076
|
+
this.addIfAllreadyExists = (product, variant_id, quantityAdd = 1, comments) => this.items.find((item, index) => {
|
|
4062
4077
|
if (item.product.id == product.id && item.variant_id == variant_id) {
|
|
4063
|
-
this.updateItemQuantity(item, this.findItem(product.id).quantity + quantityAdd);
|
|
4078
|
+
this.updateItemQuantity(item, this.findItem(product.id).quantity + quantityAdd, comments);
|
|
4064
4079
|
return true;
|
|
4065
4080
|
}
|
|
4066
4081
|
return false;
|
|
@@ -4112,7 +4127,7 @@ let CartService = class CartService {
|
|
|
4112
4127
|
return;
|
|
4113
4128
|
}
|
|
4114
4129
|
this.requestInProcess.next(true);
|
|
4115
|
-
let added = this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4130
|
+
let added = this.addIfAllreadyExists(product, variant_id, quantity, comments);
|
|
4116
4131
|
if (!added) {
|
|
4117
4132
|
const payload = {
|
|
4118
4133
|
productCode: product.id,
|
|
@@ -4152,13 +4167,13 @@ let CartService = class CartService {
|
|
|
4152
4167
|
!added && this.connection.post(this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id, id: id || '', order_item_id: order_item_id || '', lot_quantity: lot_quantity || '', unit_price: unit_price || '', unit_total: unit_total || '', ajustement_total: ajustement_total || '', total_lot: total_lot || '', lot_status: lot_status || '', date_request: date_request || '', notes: notes || '', shipping_address_id: shipping_address_id || '', shipping_address_name: shipping_address_name || '', action: action || 'newlot' })
|
|
4153
4168
|
.subscribe(res => this.appendToCart(res), err => this.handleError(err));
|
|
4154
4169
|
};
|
|
4155
|
-
this.addToCartPromise = (product, quantity, variant_id) => __awaiter$5(this, void 0, void 0, function* () {
|
|
4170
|
+
this.addToCartPromise = (product, quantity, variant_id, comments) => __awaiter$5(this, void 0, void 0, function* () {
|
|
4156
4171
|
if (!this.authService.isAbleToBuy()) {
|
|
4157
4172
|
this.toastrService.show('must-select-customer');
|
|
4158
4173
|
return;
|
|
4159
4174
|
}
|
|
4160
4175
|
this.requestInProcess.next(true);
|
|
4161
|
-
let added = this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4176
|
+
let added = this.addIfAllreadyExists(product, variant_id, quantity, comments);
|
|
4162
4177
|
if (!added) {
|
|
4163
4178
|
let result = yield (this.connection.post(this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id }).toPromise());
|
|
4164
4179
|
if (!result || result.error)
|
|
@@ -4200,13 +4215,18 @@ let CartService = class CartService {
|
|
|
4200
4215
|
items = items.filter(itemParam => !this.items.find(item => itemParam.variantCode == item.variant_id));
|
|
4201
4216
|
return [...items, ...paramsMerge];
|
|
4202
4217
|
};
|
|
4203
|
-
this.updateItemQuantity = (item, quantity) => {
|
|
4218
|
+
this.updateItemQuantity = (item, quantity, comments) => {
|
|
4204
4219
|
if (this.validateQuantity(item, quantity) && (this.validatePriceAndCredits(item, quantity))) {
|
|
4205
4220
|
this.requestInProcess.next(true);
|
|
4221
|
+
const payload = { quantity: Number(quantity) };
|
|
4222
|
+
if (comments !== undefined) {
|
|
4223
|
+
const cleaned = ((comments !== null && comments !== void 0 ? comments : '')).trim();
|
|
4224
|
+
payload.comments = cleaned;
|
|
4225
|
+
}
|
|
4206
4226
|
this.connection
|
|
4207
|
-
.put(this.updateItemQuantityApi(this.findItemByIdVariant(item.variant_id)),
|
|
4227
|
+
.put(this.updateItemQuantityApi(this.findItemByIdVariant(item.variant_id)), payload)
|
|
4208
4228
|
.pipe(finalize(() => this.requestInProcess.next(false)))
|
|
4209
|
-
.subscribe(res => this.updateCartObj(res) && this.updateCartItemQuantity(item.variant_id, Number(quantity)), err => this.handleError(err));
|
|
4229
|
+
.subscribe(res => this.updateCartObj(res) && this.updateCartItemQuantity(item.variant_id, Number(quantity), comments), err => this.handleError(err));
|
|
4210
4230
|
}
|
|
4211
4231
|
};
|
|
4212
4232
|
this.validateQuantity = (item, quantity) => {
|
|
@@ -6304,6 +6324,7 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6304
6324
|
this.creditAccountShowPrices = null;
|
|
6305
6325
|
this.showTaxLegend = false;
|
|
6306
6326
|
this.cartLoading = false;
|
|
6327
|
+
this.enableFieldNotesInArticleFile = false;
|
|
6307
6328
|
this.toDecimal = (amount) => this.consts.toDecimal(amount);
|
|
6308
6329
|
this.redirectRegister = () => this.router.navigateByUrl(`/auth/login`);
|
|
6309
6330
|
this.getVariants = product => {
|
|
@@ -6365,11 +6386,12 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6365
6386
|
this.cartService.promotions.subscribe(promotions => this.promotions = promotions);
|
|
6366
6387
|
// console.log(this.cartService.getTaxes());
|
|
6367
6388
|
this.channelConfigService.channelConfig$.subscribe(channel => {
|
|
6368
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6389
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
6369
6390
|
this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
6370
6391
|
this.hideDiscounts = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
6371
6392
|
this.hideTaxes = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
6372
6393
|
this.showTaxLegend = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.showTaxLegend, (_h !== null && _h !== void 0 ? _h : false));
|
|
6394
|
+
this.enableFieldNotesInArticleFile = (_k = (_j = channel) === null || _j === void 0 ? void 0 : _j.enableFieldNotesInArticleFile, (_k !== null && _k !== void 0 ? _k : false));
|
|
6373
6395
|
if (this.hidePrices) {
|
|
6374
6396
|
this.router.navigate(['/']);
|
|
6375
6397
|
}
|
|
@@ -6383,7 +6405,7 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6383
6405
|
this.ecOnInit();
|
|
6384
6406
|
}
|
|
6385
6407
|
actualizarCantidad(item, cantidad, stock, id) {
|
|
6386
|
-
var _a;
|
|
6408
|
+
var _a, _b, _c;
|
|
6387
6409
|
if (this.cartLoading) {
|
|
6388
6410
|
return;
|
|
6389
6411
|
}
|
|
@@ -6403,10 +6425,11 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6403
6425
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
6404
6426
|
}
|
|
6405
6427
|
}
|
|
6428
|
+
const keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
6406
6429
|
if (id) {
|
|
6407
6430
|
this.isDisabled = true; // Actualiza la propiedad vinculada a `[disabled]`
|
|
6408
6431
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
6409
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
6432
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
6410
6433
|
}
|
|
6411
6434
|
else {
|
|
6412
6435
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -6417,7 +6440,7 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6417
6440
|
}
|
|
6418
6441
|
else {
|
|
6419
6442
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
6420
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
6443
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
6421
6444
|
}
|
|
6422
6445
|
else {
|
|
6423
6446
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -6883,18 +6906,24 @@ let DataFormEcComponent = class DataFormEcComponent extends ComponentHelper {
|
|
|
6883
6906
|
* @returns un arreglo de countries.
|
|
6884
6907
|
*/
|
|
6885
6908
|
this.filterCountryByCode = (countries) => {
|
|
6909
|
+
// 1. Si hay países EXCLUIDOS, quítalos siempre
|
|
6910
|
+
let filtered = countries;
|
|
6911
|
+
if (this.consts.excludedCountries && this.consts.excludedCountries.length > 0) {
|
|
6912
|
+
filtered = filtered.filter(elem => !this.consts.excludedCountries.includes(elem.code));
|
|
6913
|
+
}
|
|
6914
|
+
// 2. Si hay países INCLUIDOS, aplica el filtro de inclusión
|
|
6886
6915
|
if (this.consts.getCountries().length > 0) {
|
|
6887
|
-
let countriesFiltered =
|
|
6916
|
+
let countriesFiltered = filtered.filter(elem => this.consts.getCountries().includes(elem.code));
|
|
6888
6917
|
if (countriesFiltered.length > 0) {
|
|
6889
6918
|
return countriesFiltered;
|
|
6890
6919
|
}
|
|
6891
6920
|
else {
|
|
6892
6921
|
console.error('El/los codigo/s ingresado/s no coinciden con los provistos desde el backend');
|
|
6893
|
-
return
|
|
6922
|
+
return filtered;
|
|
6894
6923
|
}
|
|
6895
6924
|
}
|
|
6896
6925
|
else {
|
|
6897
|
-
return
|
|
6926
|
+
return filtered;
|
|
6898
6927
|
}
|
|
6899
6928
|
};
|
|
6900
6929
|
this.showFormFacturacion = () => {
|
|
@@ -7228,7 +7257,7 @@ __decorate$Q([
|
|
|
7228
7257
|
DataFormEcComponent = __decorate$Q([
|
|
7229
7258
|
Component({
|
|
7230
7259
|
selector: 'app-dataform-ec',
|
|
7231
|
-
template: "<ng-container *ngIf=\"this.channelConfig.channelType != 'b2b' || (this.channelConfig.channelType == 'b2b' && authService.isAuthenticated()); else pleaseLogin\">\r\n<ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'LOAD_ADDRESS_AND_SELECTION' && this.authService.isAuthenticated() && this.addressBook != null\">\r\n <div class=\"container card p-4 mb-3\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-10 col-lg-8 text-center\">\r\n <div class=\"btn-group btn-group-toggle\" data-bs-toggle=\"buttons\">\r\n <label [class]=\"'btn btn-outline-secondary ' + (!getMode() ? 'active' : '')\">\r\n <input type=\"radio\" name=\"options\" id=\"option1\" autocomplete=\"off\" checked\r\n (change)=\"setMode('seleccion')\"> {{'select-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (getMode() ? 'active' : '')\" *ngIf=\"!getParamByChannelAndLanguage('btn_new_address_')\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\" (change)=\"setMode('carga')\">\r\n {{ 'new-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (selectAddress ? 'active' : '')\" *ngIf=\"getParamByChannelAndLanguage('btn_new_address_') as param\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\" (change)=\"setMode('carga')\">\r\n {{ param.value}}\r\n </label>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"getMode(); else addressSelection\">\r\n <div *ngIf=\"!require_login; else requireLoginView\">\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_LOAD_ADDRESS'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'billing-details'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <form (submit)=\"verifyValidate(false,this.cartService.items)\">\r\n <div class=\"row mt-df\"><!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutForm.controls['firstName']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutForm.controls['lastName']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"phoneNumber\"\r\n [formControl]=\"checkoutForm.controls['phoneNumber']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutForm.controls['email']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 3-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(countries$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutForm.controls['countryCode']\"\r\n (change)=\"onCountrySelected($event.target.value)\">\r\n <!-- <option selected [value]=\"countries[0].code\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">{{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.countryCode.touched && checkoutForm.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(provinces$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['provinceCode']\">\r\n<!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option>\r\n --> <option *ngFor=\"let province of provinces\" [value]=\"province.code\">{{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.provinceCode.touched && checkoutForm.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutForm.controls['city']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.city.touched && checkoutForm.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutForm.controls['street']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- form direcci\u00F3n -->\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutForm.controls['postcode']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\"> {{postalCodeErrorMessage | translate}} </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypes$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n (change)=\"onDocumentTypesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['documentType']\">\r\n<!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option>\r\n --> <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentType.touched && checkoutForm.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\"\r\n [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutForm.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">{{ 'document-number-help' | translate }}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"><!--Fila 6-->\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\" [innerHTML]=\"labelnotes.value\"><span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutForm.controls['notes']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 7-->\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label for=\"formFact\"><b>{{ 'same-billing-address' | translate }}</b> <input type=\"checkbox\"\r\n class=\"ms-2\" [checked]=\"viewDataFacturacion\" (change)=\"showFormFacturacion()\"\r\n id=\"formFact\"></label>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"col-12\">\r\n <p>\r\n <!-- <span class=\"required\"></span> -->\r\n <label class=\"required text-underline\">* {{ 'required-fields' | translate }}</label>\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.enabled\">\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.required\"\r\n class=\"required\">*</span>\r\n <label class=\"\" for=\"\"> {{ 'accept-terms' | translate }} <input class=\"ms-2\" name=\"terms\"\r\n [formControl]=\"checkoutForm.controls['terms']\" type=\"checkbox\" required\r\n (change)=\"onInputChange()\" /> </label><br />\r\n <a (click)=\"openModal(template)\" role=\"button\" class=\"ms-3 nota-input text-dark\">{{ 'whats-this' |\r\n translate }}</a>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.terms.touched && !checkoutForm.controls.terms.value\">\r\n <span class=\"text-danger\">{{ 'must-accept-terms' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"viewDataFacturacion ; else datosFormFacturacion\"> </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button type=\"submit\" [disabled]=\"!validado\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}</button>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #addressSelection>\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_ADDRESS_SELECTION'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'address-selection'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"this.addressBook; else addressBookNotResult\">\r\n\r\n <ng-container *ngIf=\"this.addressBook?.length ;else addressBookLoading\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-6 col-12 my-3\" *ngFor=\"let item of addressBook; let i = index\">\r\n <div class=\"card p-3\">\r\n <input class=\"ms-1 mt-3 form-check-input input-size-lg\" type=\"radio\" [name]=\"'n-'+i\" [id]=\"i\"\r\n [checked]=\"item.selected\" (click)=\"setSelectAddress(item)\" (change)=\"onInputChange()\">\r\n <div class=\"ms-5\">\r\n <h4 class=\"card-title\">\r\n <strong>{{'address'|translate}}</strong><br>\r\n <span class=\"text-uppercase h3\">{{item.street}}</span>\r\n </h4>\r\n <div class=\"row\">\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'country'|translate}}</strong> {{getCountry(item.countryCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'state'|translate}}</strong> {{getProvince(item.provinceCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'town-city'|translate}}</strong> {{item.city}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'postal-code'|translate}}</strong> {{item.postcode}}\r\n </h5>\r\n </div>\r\n <div class=\"row px-3\">\r\n <div class=\"card p-2 bg-light w-100\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">{{'address-contact'|translate}}</h5>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'first-name'|translate}}</strong>\r\n {{item.addressContact.firstName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'last-name'|translate}}</strong> {{item.addressContact.lastName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-type'|translate}}</strong>\r\n {{getDocumentType(item.addressContact.documentType)}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-number'|translate}}</strong>\r\n {{item.addressContact.documentNumber}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'email-address'|translate}}</strong> {{item.addressContact.email}}\r\n </h6>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n<!-- Se hardcodea el canal de mundo del juguete empresa A ya que se necesita con urgencia, se sustituira por un campo que llegara de backend. -->\r\n <div class=\"w-100\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"> \r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\"\r\n *ngIf=\"getLabelNotesParam() as labelnotes\" [innerHTML]=\"labelnotes.value\"></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [(ngModel)]=\"this.addressBookSelected.notes\" #ctrl=\"ngModel\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\"> \r\n <div class=\"invalid-feedback d-block\" *ngIf=\"\r\n addressingService.getTypeForm().viewForms.notes.required\r\n && (!addressBookSelected.notes || !addressBookSelected.notes.trim())\r\n \">\r\n {{ 'required-field' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button (click)=\"selectAddress(this.cartService.items)\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}\r\n </button>\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n</ng-template>\r\n\r\n\r\n<ng-template #requireLoginView>\r\n <div id=\"loginCheckout\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\" *ngIf=\"require_login\">\r\n <div class=\"col-12\">\r\n <app-login-form-ec (ready)=\"verifyValidate($event)\" [redirect]=\"false\" [title]=\"'need-login'\">\r\n </app-login-form-ec>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<ng-template #datosFormFacturacion>\r\n <div class=\"container-fluid px-0 px-md-2\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card \">\r\n <div class=\"card-header text-dark text-center\">\r\n <h3>{{'billing-data'|translate}}</h3>\r\n </div>\r\n <div class=\"card-body\">\r\n <form (submit)=\"verifyValidate()\">\r\n <div class=\"row mt-df\">\r\n <!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['firstName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['lastName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"phoneNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['phoneNumber']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutFormFacturacion.controls['email']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 3-->\r\n\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(countriesFacturacion$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['countryCode']\"\r\n (change)=\"onCountrySelectedFacturacion($event.target.value)\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">\r\n {{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.countryCode.touched && checkoutFormFacturacion.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(provincesFacturacion$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelectedFacturacion($event.target.value)\"\r\n [formControl]=\"checkoutFormFacturacion.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option> -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">\r\n {{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.provinceCode.touched && checkoutFormFacturacion.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutFormFacturacion.controls['city']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.city.touched && checkoutFormFacturacion.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutFormFacturacion.controls['street']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['postcode']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\">{{postalCodeErrorMessage |translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypesFacturacion$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentType']\"\r\n (change)=\"onDocumentTypesSelectedFacturacion($event.target.value)\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option> -->\r\n <option\r\n *ngFor=\"let item of documentTypes\"\r\n [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentType.touched && checkoutFormFacturacion.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\"\r\n [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'document-number-help'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}aaa <span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelNotesHtml\">\r\n <div [innerHTML]=\"labelNotesHtml\"></div>\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span>\r\n </label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutFormFacturacion.controls['notes']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<ng-template #template>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-body scrol-if\">\r\n <app-section-container-ec [name]=\"'terminos-y-condiciones'\"> </app-section-container-ec>\r\n </div>\r\n\r\n</ng-template>\r\n\r\n\r\n<ng-template #addressBookNotResult>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <h4> {{'address-book-not-result' | translate }} </h4>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #addressBookLoading>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n</ng-container>\r\n\r\n<ng-template #pleaseLogin>\r\n <div class=\"container\">\r\n <p>Por favor <a [routerLink]=\"['/auth/login']\" > Inicie Sesi\u00F3n</a></p>\r\n </div>\r\n</ng-template>",
|
|
7260
|
+
template: "<ng-container\r\n *ngIf=\"this.channelConfig.channelType != 'b2b' || (this.channelConfig.channelType == 'b2b' && authService.isAuthenticated()); else pleaseLogin\">\r\n <ng-container\r\n *ngIf=\"this.addressingService.modeSelectAddress == 'LOAD_ADDRESS_AND_SELECTION' && this.authService.isAuthenticated() && this.addressBook != null\">\r\n <div class=\"container card p-4 mb-3\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-10 col-lg-8 text-center\">\r\n <div class=\"btn-group btn-group-toggle\" data-bs-toggle=\"buttons\">\r\n <label [class]=\"'btn btn-outline-secondary ' + (!getMode() ? 'active' : '')\">\r\n <input type=\"radio\" name=\"options\" id=\"option1\" autocomplete=\"off\" checked\r\n (change)=\"setMode('seleccion')\"> {{'select-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (getMode() ? 'active' : '')\"\r\n *ngIf=\"!getParamByChannelAndLanguage('btn_new_address_')\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\"\r\n (change)=\"setMode('carga')\">\r\n {{ 'new-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (selectAddress ? 'active' : '')\"\r\n *ngIf=\"getParamByChannelAndLanguage('btn_new_address_') as param\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\"\r\n (change)=\"setMode('carga')\">\r\n {{ param.value}}\r\n </label>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getMode(); else addressSelection\">\r\n <div *ngIf=\"!require_login; else requireLoginView\">\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_LOAD_ADDRESS'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'billing-details'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <form (submit)=\"verifyValidate(false,this.cartService.items)\">\r\n <div class=\"row mt-df\"><!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutForm.controls['firstName']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutForm.controls['lastName']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"phoneNumber\"\r\n [formControl]=\"checkoutForm.controls['phoneNumber']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutForm.controls['email']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 3-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(countries$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutForm.controls['countryCode']\"\r\n (change)=\"onCountrySelected($event.target.value)\">\r\n <!-- <option selected [value]=\"countries[0].code\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">{{ country.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.countryCode.touched && checkoutForm.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(provinces$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option>\r\n -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">{{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.provinceCode.touched && checkoutForm.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutForm.controls['city']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.city.touched && checkoutForm.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span>\r\n <span class=\"char-count ms-2\" style=\"font-size: 0.9em; color: #888;\">\r\n {{ 50 - (checkoutForm.controls['street'].value?.length || 0) }} {{'remainingCharacters'|translate}}\r\n </span>\r\n </label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutForm.controls['street']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- form direcci\u00F3n -->\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutForm.controls['postcode']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\"> {{postalCodeErrorMessage | translate}} </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypes$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n (change)=\"onDocumentTypesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['documentType']\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option>\r\n -->\r\n <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentType.touched && checkoutForm.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutForm.controls['documentNumber']\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">{{ 'document-number-help' | translate }}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"><!--Fila 6-->\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\"\r\n [innerHTML]=\"labelnotes.value\"><span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutForm.controls['notes']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 7-->\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label for=\"formFact\"><b>{{ 'same-billing-address' | translate }}</b> <input type=\"checkbox\"\r\n class=\"ms-2\" [checked]=\"viewDataFacturacion\" (change)=\"showFormFacturacion()\"\r\n id=\"formFact\"></label>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"col-12\">\r\n <p>\r\n <!-- <span class=\"required\"></span> -->\r\n <label class=\"required text-underline\">* {{ 'required-fields' | translate }}</label>\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.enabled\">\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.required\"\r\n class=\"required\">*</span>\r\n <label class=\"\" for=\"\"> {{ 'accept-terms' | translate }} <input class=\"ms-2\" name=\"terms\"\r\n [formControl]=\"checkoutForm.controls['terms']\" type=\"checkbox\" required\r\n (change)=\"onInputChange()\" /> </label><br />\r\n <a (click)=\"openModal(template)\" role=\"button\" class=\"ms-3 nota-input text-dark\">{{ 'whats-this'\r\n |\r\n translate }}</a>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.terms.touched && !checkoutForm.controls.terms.value\">\r\n <span class=\"text-danger\">{{ 'must-accept-terms' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"viewDataFacturacion ; else datosFormFacturacion\"> </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button type=\"submit\" [disabled]=\"!validado\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}</button>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </form>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-template #addressSelection>\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_ADDRESS_SELECTION'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'address-selection'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"this.addressBook; else addressBookNotResult\">\r\n\r\n <ng-container *ngIf=\"this.addressBook?.length ;else addressBookLoading\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-6 col-12 my-3\" *ngFor=\"let item of addressBook; let i = index\">\r\n <div class=\"card p-3\">\r\n <input class=\"ms-1 mt-3 form-check-input input-size-lg\" type=\"radio\" [name]=\"'n-'+i\"\r\n [id]=\"i\" [checked]=\"item.selected\" (click)=\"setSelectAddress(item)\"\r\n (change)=\"onInputChange()\">\r\n <div class=\"ms-5\">\r\n <h4 class=\"card-title\">\r\n <strong>{{'address'|translate}}</strong><br>\r\n <span class=\"text-uppercase h3\">{{item.street}}</span>\r\n </h4>\r\n <div class=\"row\">\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'country'|translate}}</strong> {{getCountry(item.countryCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'state'|translate}}</strong> {{getProvince(item.provinceCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'town-city'|translate}}</strong> {{item.city}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'postal-code'|translate}}</strong> {{item.postcode}}\r\n </h5>\r\n </div>\r\n <div class=\"row px-3\">\r\n <div class=\"card p-2 bg-light w-100\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">{{'address-contact'|translate}}</h5>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'first-name'|translate}}</strong>\r\n {{item.addressContact.firstName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'last-name'|translate}}</strong>\r\n {{item.addressContact.lastName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-type'|translate}}</strong>\r\n {{getDocumentType(item.addressContact.documentType)}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-number'|translate}}</strong>\r\n {{item.addressContact.documentNumber}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'email-address'|translate}}</strong>\r\n {{item.addressContact.email}}\r\n </h6>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <!-- Se hardcodea el canal de mundo del juguete empresa A ya que se necesita con urgencia, se sustituira por un campo que llegara de backend. -->\r\n <div class=\"w-100\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\"\r\n [innerHTML]=\"labelnotes.value\"></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [(ngModel)]=\"this.addressBookSelected.notes\" #ctrl=\"ngModel\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"invalid-feedback d-block\" *ngIf=\"\r\n addressingService.getTypeForm().viewForms.notes.required\r\n && (!addressBookSelected.notes || !addressBookSelected.notes.trim())\r\n \">\r\n {{ 'required-field' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button (click)=\"selectAddress(this.cartService.items)\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}\r\n </button>\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </ng-template>\r\n\r\n\r\n <ng-template #requireLoginView>\r\n <div id=\"loginCheckout\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\" *ngIf=\"require_login\">\r\n <div class=\"col-12\">\r\n <app-login-form-ec (ready)=\"verifyValidate($event)\" [redirect]=\"false\" [title]=\"'need-login'\">\r\n </app-login-form-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n\r\n\r\n <ng-template #datosFormFacturacion>\r\n <div class=\"container-fluid px-0 px-md-2\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card \">\r\n <div class=\"card-header text-dark text-center\">\r\n <h3>{{'billing-data'|translate}}</h3>\r\n </div>\r\n <div class=\"card-body\">\r\n <form (submit)=\"verifyValidate()\">\r\n <div class=\"row mt-df\">\r\n <!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['firstName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['lastName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"phoneNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['phoneNumber']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutFormFacturacion.controls['email']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 3-->\r\n\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(countriesFacturacion$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['countryCode']\"\r\n (change)=\"onCountrySelectedFacturacion($event.target.value)\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">\r\n {{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.countryCode.touched && checkoutFormFacturacion.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(provincesFacturacion$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelectedFacturacion($event.target.value)\"\r\n [formControl]=\"checkoutFormFacturacion.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option> -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">\r\n {{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.provinceCode.touched && checkoutFormFacturacion.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutFormFacturacion.controls['city']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.city.touched && checkoutFormFacturacion.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutFormFacturacion.controls['street']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"postcode\" [formControl]=\"checkoutFormFacturacion.controls['postcode']\"\r\n value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\">{{postalCodeErrorMessage |translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 5-->\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(documentTypesFacturacion$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentType']\"\r\n (change)=\"onDocumentTypesSelectedFacturacion($event.target.value)\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option> -->\r\n <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">\r\n {{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentType.touched && checkoutFormFacturacion.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" [type]=\"'text'\"\r\n name=\"documentNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'document-number-help'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <label class=\"field-label\"\r\n *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}} <span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelNotesHtml\">\r\n <div [innerHTML]=\"labelNotesHtml\"></div>\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span>\r\n </label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutFormFacturacion.controls['notes']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n\r\n\r\n <ng-template #template>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-body scrol-if\">\r\n <app-section-container-ec [name]=\"'terminos-y-condiciones'\"> </app-section-container-ec>\r\n </div>\r\n\r\n </ng-template>\r\n\r\n\r\n <ng-template #addressBookNotResult>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <h4> {{'address-book-not-result' | translate }} </h4>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #addressBookLoading>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-template #pleaseLogin>\r\n <div class=\"container\">\r\n <p>Por favor <a [routerLink]=\"['/auth/login']\"> Inicie Sesi\u00F3n</a></p>\r\n </div>\r\n</ng-template>",
|
|
7232
7261
|
providers: [BsModalService],
|
|
7233
7262
|
styles: [".mt-df{margin:10px auto 0}.btn.btn-outline-secondary.active,.btn.btn-outline-secondary:hover{color:#fff!important}.required{color:red}.field-label{color:#000}.btn.valid-btn{background-color:#000;color:#fff;margin-right:-3px;margin-bottom:10px}label{color:#000}.input-size-lg{width:1.8rem;height:1.8rem}"]
|
|
7234
7263
|
})
|
|
@@ -7648,12 +7677,8 @@ var __decorate$V = (this && this.__decorate) || function (decorators, target, ke
|
|
|
7648
7677
|
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;
|
|
7649
7678
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7650
7679
|
};
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
};
|
|
7654
|
-
var CollectionEcComponent_1;
|
|
7655
|
-
let CollectionEcComponent = CollectionEcComponent_1 = class CollectionEcComponent extends ComponentHelper {
|
|
7656
|
-
constructor(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService, router, platformId) {
|
|
7680
|
+
let CollectionEcComponent = class CollectionEcComponent extends ComponentHelper {
|
|
7681
|
+
constructor(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService) {
|
|
7657
7682
|
super();
|
|
7658
7683
|
this.productsService = productsService;
|
|
7659
7684
|
this.paramsSrv = paramsSrv;
|
|
@@ -7664,21 +7689,12 @@ let CollectionEcComponent = CollectionEcComponent_1 = class CollectionEcComponen
|
|
|
7664
7689
|
this.cartService = cartService;
|
|
7665
7690
|
this.consts = consts;
|
|
7666
7691
|
this.filtersService = filtersService;
|
|
7667
|
-
this.router = router;
|
|
7668
7692
|
this.filters = [];
|
|
7669
7693
|
this.filtersConfig = { filters: [] };
|
|
7670
7694
|
this.finished = false;
|
|
7671
7695
|
this.loading = true;
|
|
7672
7696
|
this.breadcrumb = [];
|
|
7673
7697
|
this.isCollection = true;
|
|
7674
|
-
this.usingCachedProducts = false;
|
|
7675
|
-
this.allCachedProducts = [];
|
|
7676
|
-
this.subscriptionsConfigured = false;
|
|
7677
|
-
this.isScrolling = false;
|
|
7678
|
-
this.pendingScrollPosition = null;
|
|
7679
|
-
this.expectedProductCount = 0;
|
|
7680
|
-
this.filtersFromCache = false; // Flag para indicar si los filtros vienen del cache
|
|
7681
|
-
this.isCategoryChange = false; // Flag para indicar si es un cambio de categoría
|
|
7682
7698
|
this.productsWithUniqueVariant = false;
|
|
7683
7699
|
this.optionsFilters = ['all'];
|
|
7684
7700
|
/**
|
|
@@ -7747,113 +7763,23 @@ let CollectionEcComponent = CollectionEcComponent_1 = class CollectionEcComponen
|
|
|
7747
7763
|
this.getObjectWithVariant = () => {
|
|
7748
7764
|
return this.consts.getParamsProductsWithUniqueVariant();
|
|
7749
7765
|
};
|
|
7750
|
-
// Método personalizado para manejar selección de filtros que invalidará cache
|
|
7751
|
-
this.customSetFilterSelected = (filter, filterElement) => {
|
|
7752
|
-
// Invalidar cache completamente cuando se selecciona un filtro
|
|
7753
|
-
this.usingCachedProducts = false;
|
|
7754
|
-
this.allCachedProducts = [];
|
|
7755
|
-
this.filtersFromCache = false; // Ya no usamos filtros del cache
|
|
7756
|
-
this.isCategoryChange = true; // Marcar como cambio para reemplazar productos
|
|
7757
|
-
CollectionEcComponent_1.stateCache.delete(this.stateKey);
|
|
7758
|
-
console.log('🔄 Filtro seleccionado, invalidando cache y recargando desde endpoint para:', this.stateKey);
|
|
7759
|
-
// Solo limpiar productos, NO limpiar filtros para que no desaparezcan
|
|
7760
|
-
this.products = [];
|
|
7761
|
-
this.loading = true;
|
|
7762
|
-
// Llamar al método original del ProductsService que iniciará una carga completa
|
|
7763
|
-
const result = this.productsService.setFilterSelected(filter, filterElement);
|
|
7764
|
-
// La suscripción principal automáticamente actualizará los filtros
|
|
7765
|
-
// porque filtersFromCache = false y usingCachedProducts = false
|
|
7766
|
-
return result;
|
|
7767
|
-
};
|
|
7768
7766
|
this.paramsSrv.parameters.subscribe(param => this.params = param);
|
|
7769
7767
|
this.defaultFilters = this.consts.getDefaultFilters();
|
|
7770
7768
|
this.filtersConfig.filters = this.consts.getFilterConfig();
|
|
7771
7769
|
this.productsService.filtersInView$.subscribe(res => this.filterInView = res);
|
|
7772
|
-
// Inicializar propiedades de scroll y cache
|
|
7773
|
-
this.platformId = platformId;
|
|
7774
|
-
this.isRestoringState = false;
|
|
7775
|
-
this.usingCachedProducts = false;
|
|
7776
|
-
this.allCachedProducts = [];
|
|
7777
|
-
this.subscriptionsConfigured = false;
|
|
7778
|
-
this.isScrolling = false;
|
|
7779
|
-
this.pendingScrollPosition = null;
|
|
7780
|
-
this.expectedProductCount = 0;
|
|
7781
|
-
this.filtersFromCache = false;
|
|
7782
7770
|
this.ecOnConstruct();
|
|
7783
7771
|
}
|
|
7784
7772
|
ngOnInit() {
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
// NO llamar window.scroll(0, 0) para preservar posición
|
|
7790
|
-
this.products = [];
|
|
7791
|
-
this.ecOnInit();
|
|
7792
|
-
this.getProductsAndSubscribe(); // Llamar directamente
|
|
7793
|
-
}
|
|
7794
|
-
else {
|
|
7795
|
-
// Comportamiento normal con scroll al inicio
|
|
7796
|
-
window.scroll(0, 0);
|
|
7797
|
-
this.products = [];
|
|
7798
|
-
this.ecOnInit();
|
|
7799
|
-
this.getProductsAndSubscribe();
|
|
7800
|
-
}
|
|
7801
|
-
// Configurar manejo de estado
|
|
7802
|
-
this.setupBeforeUnloadHandler();
|
|
7773
|
+
window.scroll(0, 0);
|
|
7774
|
+
this.products = [];
|
|
7775
|
+
this.ecOnInit();
|
|
7776
|
+
this.getProductsAndSubscribe();
|
|
7803
7777
|
}
|
|
7804
7778
|
getProductsAndSubscribe() {
|
|
7805
|
-
// Verificar PRIMERO si hay estado guardado
|
|
7806
|
-
const savedState = CollectionEcComponent_1.stateCache.get(this.stateKey);
|
|
7807
|
-
if (savedState && savedState.products.length > 0) {
|
|
7808
|
-
console.log('📦 Restaurando desde cache:', savedState.products.length, 'productos');
|
|
7809
|
-
// Configurar modo cache ANTES de restaurar
|
|
7810
|
-
this.usingCachedProducts = true;
|
|
7811
|
-
this.allCachedProducts = [...savedState.products];
|
|
7812
|
-
this.isRestoringState = true;
|
|
7813
|
-
// Restaurar productos inmediatamente
|
|
7814
|
-
this.products = [...savedState.products];
|
|
7815
|
-
this.finished = savedState.finished;
|
|
7816
|
-
this.loading = false;
|
|
7817
|
-
// Restaurar filtros si están disponibles
|
|
7818
|
-
if (savedState.filters) {
|
|
7819
|
-
this.filters = [...savedState.filters];
|
|
7820
|
-
this.filtersFromCache = true; // Marcar que estos filtros vienen del cache
|
|
7821
|
-
console.log('📦 Filtros restaurados desde cache:', this.filters.length);
|
|
7822
|
-
}
|
|
7823
|
-
if (savedState.filters_top) {
|
|
7824
|
-
this.filters_top = [...savedState.filters_top];
|
|
7825
|
-
console.log('📦 Filtros top restaurados desde cache:', this.filters_top.length);
|
|
7826
|
-
}
|
|
7827
|
-
if (savedState.breadcrumb) {
|
|
7828
|
-
this.breadcrumb = [...savedState.breadcrumb];
|
|
7829
|
-
console.log('📦 Breadcrumb restaurado desde cache:', this.breadcrumb);
|
|
7830
|
-
}
|
|
7831
|
-
// IMPORTANTE: Configurar TODAS las suscripciones del padre (filtros, breadcrumb, etc.)
|
|
7832
|
-
// pero SIN resetear productos ni hacer petición inicial
|
|
7833
|
-
this.setupParentSubscriptionsOnly();
|
|
7834
|
-
// Configurar suscripción personalizada para detectar cambios de categoría
|
|
7835
|
-
this.setupCustomSubscription();
|
|
7836
|
-
this.subscriptionsConfigured = true;
|
|
7837
|
-
// Restaurar scroll después de que los productos se rendericen
|
|
7838
|
-
this.waitForProductRendering(savedState.scrollPosition);
|
|
7839
|
-
return;
|
|
7840
|
-
}
|
|
7841
|
-
console.log('🔄 No hay cache, carga normal');
|
|
7842
|
-
// Si no hay estado guardado, comportamiento normal
|
|
7843
|
-
this.usingCachedProducts = false;
|
|
7844
|
-
this.allCachedProducts = [];
|
|
7845
|
-
this.filtersFromCache = false; // No hay filtros del cache
|
|
7846
|
-
// Llamar al comportamiento original
|
|
7847
|
-
this.originalGetProductsAndSubscribe();
|
|
7848
|
-
this.subscriptionsConfigured = true;
|
|
7849
|
-
}
|
|
7850
|
-
originalGetProductsAndSubscribe() {
|
|
7851
7779
|
combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(([params, ready, queryParams]) => {
|
|
7852
7780
|
if (ready.readyAll) {
|
|
7853
7781
|
let cambio = false;
|
|
7854
7782
|
this.products = [];
|
|
7855
|
-
// Marcar como cambio de categoría para la carga inicial
|
|
7856
|
-
this.isCategoryChange = true;
|
|
7857
7783
|
if (!params['type'] || !params['value']) {
|
|
7858
7784
|
this.productsService.getProductsForFilter({ latest: true, limit: 10 }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
7859
7785
|
}
|
|
@@ -7883,16 +7809,7 @@ let CollectionEcComponent = CollectionEcComponent_1 = class CollectionEcComponen
|
|
|
7883
7809
|
}
|
|
7884
7810
|
else {
|
|
7885
7811
|
res = this.productsService.getProductsWithUniqueVariant(res, this.getObjectWithVariant());
|
|
7886
|
-
|
|
7887
|
-
const existingIds = new Set(this.products.map(p => p.id));
|
|
7888
|
-
const uniqueProducts = res.filter(p => !existingIds.has(p.id));
|
|
7889
|
-
if (uniqueProducts.length > 0) {
|
|
7890
|
-
console.log('➕ CollectionEC (variants): Agregando', uniqueProducts.length, 'de', res.length, 'productos únicos');
|
|
7891
|
-
this.products.push(...uniqueProducts);
|
|
7892
|
-
}
|
|
7893
|
-
else {
|
|
7894
|
-
console.log('⚠️ CollectionEC (variants): Todos los productos ya existen - ignorando', res.length, 'productos');
|
|
7895
|
-
}
|
|
7812
|
+
this.products.push(...res);
|
|
7896
7813
|
this.applyFiltersInView();
|
|
7897
7814
|
}
|
|
7898
7815
|
;
|
|
@@ -7904,16 +7821,7 @@ let CollectionEcComponent = CollectionEcComponent_1 = class CollectionEcComponen
|
|
|
7904
7821
|
cambio = false;
|
|
7905
7822
|
}
|
|
7906
7823
|
else {
|
|
7907
|
-
|
|
7908
|
-
const existingIds = new Set(this.products.map(p => p.id));
|
|
7909
|
-
const uniqueProducts = res.filter(p => !existingIds.has(p.id));
|
|
7910
|
-
if (uniqueProducts.length > 0) {
|
|
7911
|
-
console.log('➕ CollectionEC: Agregando', uniqueProducts.length, 'de', res.length, 'productos únicos');
|
|
7912
|
-
this.products.push(...uniqueProducts);
|
|
7913
|
-
}
|
|
7914
|
-
else {
|
|
7915
|
-
console.log('⚠️ CollectionEC: Todos los productos ya existen - ignorando', res.length, 'productos');
|
|
7916
|
-
}
|
|
7824
|
+
this.products.push(...res);
|
|
7917
7825
|
this.applyFiltersInView();
|
|
7918
7826
|
}
|
|
7919
7827
|
}
|
|
@@ -7930,141 +7838,6 @@ let CollectionEcComponent = CollectionEcComponent_1 = class CollectionEcComponen
|
|
|
7930
7838
|
}
|
|
7931
7839
|
});
|
|
7932
7840
|
}
|
|
7933
|
-
setupParentSubscriptionsOnly() {
|
|
7934
|
-
var _a;
|
|
7935
|
-
// Desuscribir cualquier suscripción anterior
|
|
7936
|
-
try {
|
|
7937
|
-
(_a = this.suscripcion) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
7938
|
-
}
|
|
7939
|
-
catch (e) { }
|
|
7940
|
-
// IMPORTANTE: Configurar suscripción a productos para navegación posterior
|
|
7941
|
-
this.suscripcion = this.productsService.products$.subscribe(res => {
|
|
7942
|
-
var _a;
|
|
7943
|
-
console.log('📦 Suscripción products$ (desde cache):', (_a = res) === null || _a === void 0 ? void 0 : _a.length, 'productos');
|
|
7944
|
-
this.loading = false;
|
|
7945
|
-
if (res && res.length > 0) {
|
|
7946
|
-
// Si estamos usando cache, agregar solo productos nuevos únicos
|
|
7947
|
-
if (this.usingCachedProducts) {
|
|
7948
|
-
const existingIds = new Set(this.products.map(p => p.id));
|
|
7949
|
-
const uniqueProducts = res.filter(p => !existingIds.has(p.id));
|
|
7950
|
-
if (uniqueProducts.length > 0) {
|
|
7951
|
-
console.log('➕ Cache: Agregando', uniqueProducts.length, 'productos adicionales');
|
|
7952
|
-
this.products.push(...uniqueProducts);
|
|
7953
|
-
this.usingCachedProducts = false; // Ya no solo cache
|
|
7954
|
-
}
|
|
7955
|
-
}
|
|
7956
|
-
else {
|
|
7957
|
-
// Determinar si es cambio de categoría o scroll infinito
|
|
7958
|
-
if (this.isCategoryChange) {
|
|
7959
|
-
// Cambio de categoría: reemplazar completamente
|
|
7960
|
-
console.log('🔄 Cambio de categoría: Reemplazando productos completamente');
|
|
7961
|
-
if (this.productsWithUniqueVariant) {
|
|
7962
|
-
this.products = this.productsService.getProductsWithUniqueVariant(res, this.getObjectWithVariant());
|
|
7963
|
-
}
|
|
7964
|
-
else {
|
|
7965
|
-
this.products = res;
|
|
7966
|
-
}
|
|
7967
|
-
this.applyFiltersInView();
|
|
7968
|
-
this.isCategoryChange = false; // Resetear bandera
|
|
7969
|
-
}
|
|
7970
|
-
else {
|
|
7971
|
-
// Scroll infinito: agregar productos únicos
|
|
7972
|
-
console.log('📜 Scroll infinito: Agregando productos únicos');
|
|
7973
|
-
const existingIds = new Set(this.products.map(p => p.id));
|
|
7974
|
-
let newProducts = res;
|
|
7975
|
-
if (this.productsWithUniqueVariant) {
|
|
7976
|
-
newProducts = this.productsService.getProductsWithUniqueVariant(res, this.getObjectWithVariant());
|
|
7977
|
-
}
|
|
7978
|
-
const uniqueProducts = newProducts.filter(p => !existingIds.has(p.id));
|
|
7979
|
-
if (uniqueProducts.length > 0) {
|
|
7980
|
-
console.log('➕ Agregando', uniqueProducts.length, 'productos únicos por scroll');
|
|
7981
|
-
this.products.push(...uniqueProducts);
|
|
7982
|
-
}
|
|
7983
|
-
else {
|
|
7984
|
-
console.log('⚠️ Todos los productos del scroll ya existen');
|
|
7985
|
-
}
|
|
7986
|
-
this.applyFiltersInView();
|
|
7987
|
-
}
|
|
7988
|
-
}
|
|
7989
|
-
}
|
|
7990
|
-
else if (res && res.length === 0) {
|
|
7991
|
-
// Si recibimos array vacío y no estamos usando cache, limpiar productos
|
|
7992
|
-
if (!this.usingCachedProducts) {
|
|
7993
|
-
this.products = [];
|
|
7994
|
-
}
|
|
7995
|
-
}
|
|
7996
|
-
this.finished = this.productsService.isFinished();
|
|
7997
|
-
this.analyticsService.callEvent('view_item_list', { products: this.products, item_list_name: 'Collection', item_list_id: 0 });
|
|
7998
|
-
});
|
|
7999
|
-
// Configurar suscripciones de filtros
|
|
8000
|
-
this.productsService.filters$.subscribe(res => {
|
|
8001
|
-
// IMPORTANTE: Solo actualizar filtros si NO vienen del cache
|
|
8002
|
-
if (!this.filtersFromCache) {
|
|
8003
|
-
console.log('🔄 Actualizando filtros desde server');
|
|
8004
|
-
this.breadcrumb = this.optionsService.getBreadcrumbByFilters(res);
|
|
8005
|
-
this.filters = this.getSpecificFilters(res, this.filtersConfig.filters);
|
|
8006
|
-
this.filters_top = this.getSpecificFilters(res, ['sort']);
|
|
8007
|
-
}
|
|
8008
|
-
else {
|
|
8009
|
-
console.log('🚫 Saltando actualización de filtros (usando cache)');
|
|
8010
|
-
// Una vez que han sido utilizados, resetear el flag
|
|
8011
|
-
this.filtersFromCache = false;
|
|
8012
|
-
}
|
|
8013
|
-
});
|
|
8014
|
-
this.productsService.finished().subscribe(res => this.finished = res);
|
|
8015
|
-
}
|
|
8016
|
-
setupCustomSubscription() {
|
|
8017
|
-
// Suscripción personalizada para detectar cambios de categoría/búsqueda
|
|
8018
|
-
combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(([params, ready, queryParams]) => {
|
|
8019
|
-
if (ready.readyAll && this.subscriptionsConfigured) {
|
|
8020
|
-
const currentKey = this.generateStateKey();
|
|
8021
|
-
// Si la clave cambió, significa que navegamos a una categoría diferente
|
|
8022
|
-
if (currentKey !== this.stateKey) {
|
|
8023
|
-
console.log('🔄 Cambio de categoría detectado, invalidando cache y recargando');
|
|
8024
|
-
this.stateKey = currentKey;
|
|
8025
|
-
// Limpiar cache y recargar normalmente
|
|
8026
|
-
this.invalidateCache();
|
|
8027
|
-
this.usingCachedProducts = false;
|
|
8028
|
-
this.allCachedProducts = [];
|
|
8029
|
-
this.filtersFromCache = false;
|
|
8030
|
-
// IMPORTANTE: Marcar que es cambio de categoría y resetear estado
|
|
8031
|
-
this.isCategoryChange = true;
|
|
8032
|
-
this.loading = true;
|
|
8033
|
-
this.products = [];
|
|
8034
|
-
// Recargar normalmente - pero solo la petición, no reconfigurar suscripciones
|
|
8035
|
-
this.loadNewCategory(params, queryParams);
|
|
8036
|
-
}
|
|
8037
|
-
}
|
|
8038
|
-
});
|
|
8039
|
-
}
|
|
8040
|
-
loadNewCategory(params, queryParams) {
|
|
8041
|
-
// Hacer solo la petición de productos sin reconfigurar todas las suscripciones
|
|
8042
|
-
let cambio = false;
|
|
8043
|
-
if (!params['type'] || !params['value']) {
|
|
8044
|
-
this.productsService.getProductsForFilter({ latest: true, limit: 10 }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
8045
|
-
}
|
|
8046
|
-
else {
|
|
8047
|
-
this.productsService.getProductsForFilter({ type: params.type, value: params.value }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
8048
|
-
cambio = true;
|
|
8049
|
-
this.type = params['type'];
|
|
8050
|
-
this.value = params['value'];
|
|
8051
|
-
}
|
|
8052
|
-
console.log('🔄 Nueva petición enviada para categoría:', params.type, params.value);
|
|
8053
|
-
}
|
|
8054
|
-
generateStateKey() {
|
|
8055
|
-
// Incluir ruta y parámetros para generar clave única
|
|
8056
|
-
const route = this.router.url.split('?')[0]; // Sin query params
|
|
8057
|
-
const params = this.activeRoute.snapshot.params;
|
|
8058
|
-
return `${route}_${JSON.stringify(params)}`;
|
|
8059
|
-
}
|
|
8060
|
-
invalidateCache() {
|
|
8061
|
-
// Limpiar cache específico y sessionStorage
|
|
8062
|
-
console.log('🗑️ Invalidando cache para:', this.stateKey);
|
|
8063
|
-
CollectionEcComponent_1.stateCache.delete(this.stateKey);
|
|
8064
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
8065
|
-
sessionStorage.removeItem(`collection_scroll_${this.stateKey}`);
|
|
8066
|
-
}
|
|
8067
|
-
}
|
|
8068
7841
|
onScroll() {
|
|
8069
7842
|
this.loading = true;
|
|
8070
7843
|
if (!this.productsService.isWaiting() && !this.productsService.getNext()) {
|
|
@@ -8072,183 +7845,7 @@ let CollectionEcComponent = CollectionEcComponent_1 = class CollectionEcComponen
|
|
|
8072
7845
|
this.loading = false;
|
|
8073
7846
|
}
|
|
8074
7847
|
}
|
|
8075
|
-
// Métodos de ciclo de vida requeridos
|
|
8076
|
-
ngAfterViewChecked() {
|
|
8077
|
-
// Solo verificar si hay un scroll pendiente
|
|
8078
|
-
if (this.pendingScrollPosition !== null && isPlatformBrowser(this.platformId)) {
|
|
8079
|
-
const productElements = document.querySelectorAll('.col-lg-3, .col-md-4, .col-6, [class*="product"], .product-item, .card');
|
|
8080
|
-
const currentProductCount = productElements.length;
|
|
8081
|
-
// Verificar si se han renderizado suficientes productos
|
|
8082
|
-
if (currentProductCount >= Math.min(this.expectedProductCount, 10)) {
|
|
8083
|
-
const targetPosition = this.pendingScrollPosition;
|
|
8084
|
-
this.pendingScrollPosition = null; // Limpiar para evitar loops
|
|
8085
|
-
// Usar requestAnimationFrame para asegurar que el rendering esté completo
|
|
8086
|
-
requestAnimationFrame(() => {
|
|
8087
|
-
requestAnimationFrame(() => {
|
|
8088
|
-
this.restoreScrollWithRetries(targetPosition);
|
|
8089
|
-
this.isRestoringState = false;
|
|
8090
|
-
});
|
|
8091
|
-
});
|
|
8092
|
-
}
|
|
8093
|
-
}
|
|
8094
|
-
}
|
|
8095
|
-
ngOnDestroy() {
|
|
8096
|
-
var _a;
|
|
8097
|
-
(_a = this.routerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
8098
|
-
this.saveCurrentState();
|
|
8099
|
-
// Limpiar scroll pendiente
|
|
8100
|
-
this.pendingScrollPosition = null;
|
|
8101
|
-
// Limpiar event listeners
|
|
8102
|
-
if (this.clickHandler) {
|
|
8103
|
-
document.removeEventListener('click', this.clickHandler);
|
|
8104
|
-
}
|
|
8105
|
-
}
|
|
8106
|
-
// Métodos de manejo de scroll y cache
|
|
8107
|
-
setupBeforeUnloadHandler() {
|
|
8108
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
8109
|
-
// Interceptar clics en productos para guardar estado
|
|
8110
|
-
this.clickHandler = (event) => {
|
|
8111
|
-
const target = event.target;
|
|
8112
|
-
// Buscar si el clic es en un enlace a producto
|
|
8113
|
-
const link = target.closest('a[href*="/product/"]');
|
|
8114
|
-
if (link && this.router.url.includes('/collection/')) {
|
|
8115
|
-
console.log('🎯 Clic en producto detectado, guardando estado');
|
|
8116
|
-
this.saveCurrentState();
|
|
8117
|
-
}
|
|
8118
|
-
};
|
|
8119
|
-
document.addEventListener('click', this.clickHandler);
|
|
8120
|
-
// Guardar durante scroll en la página de colección
|
|
8121
|
-
let scrollTimer;
|
|
8122
|
-
window.addEventListener('scroll', () => {
|
|
8123
|
-
// Solo guardar si estamos en una página de colección
|
|
8124
|
-
if (this.router.url.includes('/collection/')) {
|
|
8125
|
-
clearTimeout(scrollTimer);
|
|
8126
|
-
scrollTimer = setTimeout(() => this.saveCurrentState(), 300);
|
|
8127
|
-
}
|
|
8128
|
-
});
|
|
8129
|
-
// Guardar antes de que el usuario salga de la página
|
|
8130
|
-
window.addEventListener('beforeunload', () => {
|
|
8131
|
-
if (this.router.url.includes('/collection/')) {
|
|
8132
|
-
this.saveCurrentState();
|
|
8133
|
-
}
|
|
8134
|
-
});
|
|
8135
|
-
}
|
|
8136
|
-
}
|
|
8137
|
-
saveCurrentState() {
|
|
8138
|
-
if (isPlatformBrowser(this.platformId) && this.products && this.products.length > 0) {
|
|
8139
|
-
// Obtener posición de scroll de múltiples fuentes
|
|
8140
|
-
const scrollPos = Math.max(window.pageYOffset || 0, document.documentElement.scrollTop || 0, document.body.scrollTop || 0);
|
|
8141
|
-
// Solo guardar si tenemos una posición significativa o productos suficientes
|
|
8142
|
-
if (scrollPos > 10 || this.products.length > 10) {
|
|
8143
|
-
const state = {
|
|
8144
|
-
products: [...this.products],
|
|
8145
|
-
scrollPosition: scrollPos,
|
|
8146
|
-
finished: this.finished,
|
|
8147
|
-
loading: this.loading,
|
|
8148
|
-
page: Math.ceil(this.products.length / 10),
|
|
8149
|
-
allCachedProducts: this.usingCachedProducts ? [...this.allCachedProducts] : [...this.products],
|
|
8150
|
-
filters: this.filters ? [...this.filters] : undefined,
|
|
8151
|
-
filters_top: this.filters_top ? [...this.filters_top] : undefined,
|
|
8152
|
-
breadcrumb: this.breadcrumb ? [...this.breadcrumb] : undefined
|
|
8153
|
-
};
|
|
8154
|
-
CollectionEcComponent_1.stateCache.set(this.stateKey, state);
|
|
8155
|
-
// También guardar en sessionStorage como backup
|
|
8156
|
-
try {
|
|
8157
|
-
sessionStorage.setItem(`collection_scroll_${this.stateKey}`, scrollPos.toString());
|
|
8158
|
-
sessionStorage.setItem(`collection_products_${this.stateKey}`, this.products.length.toString());
|
|
8159
|
-
}
|
|
8160
|
-
catch (e) { }
|
|
8161
|
-
}
|
|
8162
|
-
}
|
|
8163
|
-
}
|
|
8164
|
-
restoreScrollWithRetries(targetPosition) {
|
|
8165
|
-
if (this.isScrolling) {
|
|
8166
|
-
return;
|
|
8167
|
-
}
|
|
8168
|
-
// Verificar si el target es mayor que la altura del documento
|
|
8169
|
-
const documentHeight = document.documentElement.scrollHeight;
|
|
8170
|
-
if (targetPosition > documentHeight) {
|
|
8171
|
-
targetPosition = Math.max(0, documentHeight - window.innerHeight);
|
|
8172
|
-
}
|
|
8173
|
-
// Solo verificar si el usuario ha hecho scroll muy lejos
|
|
8174
|
-
const currentPos = window.pageYOffset || document.documentElement.scrollTop;
|
|
8175
|
-
if (currentPos > 500 && Math.abs(currentPos - targetPosition) > 1000) {
|
|
8176
|
-
return;
|
|
8177
|
-
}
|
|
8178
|
-
this.isScrolling = true;
|
|
8179
|
-
// Intentar encontrar una posición más precisa basada en elementos del DOM
|
|
8180
|
-
const improvedPosition = this.tryScrollToProductByIndex(targetPosition);
|
|
8181
|
-
if (improvedPosition !== targetPosition) {
|
|
8182
|
-
targetPosition = improvedPosition;
|
|
8183
|
-
}
|
|
8184
|
-
let attempts = 0;
|
|
8185
|
-
const maxAttempts = 15;
|
|
8186
|
-
const tryScroll = () => {
|
|
8187
|
-
attempts++;
|
|
8188
|
-
// Usar scroll más agresivo si es necesario
|
|
8189
|
-
if (attempts < 3) {
|
|
8190
|
-
// Primeros intentos con smooth
|
|
8191
|
-
window.scrollTo({
|
|
8192
|
-
top: targetPosition,
|
|
8193
|
-
behavior: 'smooth'
|
|
8194
|
-
});
|
|
8195
|
-
}
|
|
8196
|
-
else {
|
|
8197
|
-
// Intentos posteriores más directos
|
|
8198
|
-
window.scrollTo(0, targetPosition);
|
|
8199
|
-
document.documentElement.scrollTop = targetPosition;
|
|
8200
|
-
document.body.scrollTop = targetPosition;
|
|
8201
|
-
}
|
|
8202
|
-
// Verificar después de un momento
|
|
8203
|
-
setTimeout(() => {
|
|
8204
|
-
const currentPos = window.pageYOffset || document.documentElement.scrollTop;
|
|
8205
|
-
const difference = Math.abs(currentPos - targetPosition);
|
|
8206
|
-
if (difference > 50 && attempts < maxAttempts) {
|
|
8207
|
-
const delay = attempts < 5 ? 100 : attempts < 10 ? 200 : 300;
|
|
8208
|
-
setTimeout(tryScroll, delay);
|
|
8209
|
-
}
|
|
8210
|
-
else {
|
|
8211
|
-
this.isScrolling = false; // Liberar flag cuando termine
|
|
8212
|
-
}
|
|
8213
|
-
}, 100);
|
|
8214
|
-
};
|
|
8215
|
-
// Intentar solo una vez inicialmente
|
|
8216
|
-
tryScroll();
|
|
8217
|
-
}
|
|
8218
|
-
tryScrollToProductByIndex(targetPosition) {
|
|
8219
|
-
// Intentar calcular a qué producto corresponde la posición
|
|
8220
|
-
const approximateIndex = Math.floor(targetPosition / 400); // Asumiendo ~400px por producto
|
|
8221
|
-
// Buscar elementos de producto
|
|
8222
|
-
const productElements = document.querySelectorAll('.col-lg-3, .col-md-4, .col-6, [class*="product"], .product-item, .card');
|
|
8223
|
-
if (productElements.length > approximateIndex && approximateIndex >= 0) {
|
|
8224
|
-
const targetElement = productElements[approximateIndex];
|
|
8225
|
-
const elementPosition = targetElement.offsetTop;
|
|
8226
|
-
// Usar la posición del elemento si es razonable
|
|
8227
|
-
if (Math.abs(elementPosition - targetPosition) < 800) {
|
|
8228
|
-
return elementPosition;
|
|
8229
|
-
}
|
|
8230
|
-
}
|
|
8231
|
-
return targetPosition; // Usar posición original si no encuentra elemento adecuado
|
|
8232
|
-
}
|
|
8233
|
-
waitForProductRendering(targetPosition) {
|
|
8234
|
-
var _a;
|
|
8235
|
-
// Configurar el scroll pendiente para que ngAfterViewChecked lo maneje
|
|
8236
|
-
this.pendingScrollPosition = targetPosition;
|
|
8237
|
-
this.expectedProductCount = ((_a = this.products) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
8238
|
-
// Timeout de seguridad en caso de que ngAfterViewChecked no se ejecute
|
|
8239
|
-
setTimeout(() => {
|
|
8240
|
-
if (this.pendingScrollPosition !== null) {
|
|
8241
|
-
const targetPos = this.pendingScrollPosition;
|
|
8242
|
-
this.pendingScrollPosition = null;
|
|
8243
|
-
this.restoreScrollWithRetries(targetPos);
|
|
8244
|
-
this.isRestoringState = false;
|
|
8245
|
-
}
|
|
8246
|
-
}, 2000);
|
|
8247
|
-
}
|
|
8248
7848
|
};
|
|
8249
|
-
// Propiedades para scroll y cache
|
|
8250
|
-
CollectionEcComponent.stateCache = new Map();
|
|
8251
|
-
CollectionEcComponent.maxCacheSize = 10;
|
|
8252
7849
|
CollectionEcComponent.ctorParameters = () => [
|
|
8253
7850
|
{ type: ProductsService },
|
|
8254
7851
|
{ type: ParametersService },
|
|
@@ -8258,9 +7855,7 @@ CollectionEcComponent.ctorParameters = () => [
|
|
|
8258
7855
|
{ type: AnalyticsService },
|
|
8259
7856
|
{ type: CartService },
|
|
8260
7857
|
{ type: Constants },
|
|
8261
|
-
{ type: FiltersService }
|
|
8262
|
-
{ type: Router },
|
|
8263
|
-
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
|
|
7858
|
+
{ type: FiltersService }
|
|
8264
7859
|
];
|
|
8265
7860
|
__decorate$V([
|
|
8266
7861
|
Input()
|
|
@@ -8274,13 +7869,12 @@ __decorate$V([
|
|
|
8274
7869
|
__decorate$V([
|
|
8275
7870
|
Input()
|
|
8276
7871
|
], CollectionEcComponent.prototype, "optionsFilters", void 0);
|
|
8277
|
-
CollectionEcComponent =
|
|
7872
|
+
CollectionEcComponent = __decorate$V([
|
|
8278
7873
|
Component({
|
|
8279
7874
|
selector: 'app-collection-ec',
|
|
8280
7875
|
template: "\r\n<div>\r\n <div class=\"collection\">\r\n <ng-content select=\"[collection]\"> </ng-content>\r\n </div>\r\n\r\n <div class=\"all\">\r\n <ng-content select=\"[all]\"> </ng-content>\r\n </div>\r\n</div>\r\n\r\n<app-blocks-ec [section]=\"'collection'\"></app-blocks-ec>",
|
|
8281
7876
|
styles: [".h1-custom{color:#00f}"]
|
|
8282
|
-
})
|
|
8283
|
-
__param$7(10, Inject(PLATFORM_ID))
|
|
7877
|
+
})
|
|
8284
7878
|
], CollectionEcComponent);
|
|
8285
7879
|
|
|
8286
7880
|
var __decorate$W = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -8381,7 +7975,7 @@ var __decorate$Y = (this && this.__decorate) || function (decorators, target, ke
|
|
|
8381
7975
|
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;
|
|
8382
7976
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8383
7977
|
};
|
|
8384
|
-
var __param$
|
|
7978
|
+
var __param$7 = (this && this.__param) || function (paramIndex, decorator) {
|
|
8385
7979
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
8386
7980
|
};
|
|
8387
7981
|
/** @dynamic */
|
|
@@ -8581,7 +8175,7 @@ FiltersEcComponent = __decorate$Y([
|
|
|
8581
8175
|
template: "",
|
|
8582
8176
|
styles: [""]
|
|
8583
8177
|
}),
|
|
8584
|
-
__param$
|
|
8178
|
+
__param$7(1, Inject(DOCUMENT))
|
|
8585
8179
|
], FiltersEcComponent);
|
|
8586
8180
|
|
|
8587
8181
|
var __decorate$Z = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -8590,7 +8184,7 @@ var __decorate$Z = (this && this.__decorate) || function (decorators, target, ke
|
|
|
8590
8184
|
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;
|
|
8591
8185
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8592
8186
|
};
|
|
8593
|
-
var __param$
|
|
8187
|
+
var __param$8 = (this && this.__param) || function (paramIndex, decorator) {
|
|
8594
8188
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
8595
8189
|
};
|
|
8596
8190
|
/** @dynamic */
|
|
@@ -8678,7 +8272,7 @@ FiltersTopEcComponent = __decorate$Z([
|
|
|
8678
8272
|
template: "",
|
|
8679
8273
|
styles: [".min-width-large{min-width:150px}"]
|
|
8680
8274
|
}),
|
|
8681
|
-
__param$
|
|
8275
|
+
__param$8(1, Inject(DOCUMENT))
|
|
8682
8276
|
], FiltersTopEcComponent);
|
|
8683
8277
|
|
|
8684
8278
|
var __decorate$_ = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -9101,11 +8695,28 @@ let CurrencyService = class CurrencyService {
|
|
|
9101
8695
|
this.getCurrencyListApi = () => 'shop-api/currencies';
|
|
9102
8696
|
this.getConvertibilityApi = (baseCurrency, targetCurrency) => 'shop-api/currencies?baseCurrency=' + baseCurrency + '&targetCurrency=' + targetCurrency;
|
|
9103
8697
|
/**
|
|
9104
|
-
* @description Se carga la moneda por defecto.
|
|
8698
|
+
* @description Se carga la moneda por defecto con metadatos (símbolo, posición, decimales).
|
|
9105
8699
|
*/
|
|
9106
|
-
this.loadDefaultCurrency = (
|
|
9107
|
-
|
|
9108
|
-
this.
|
|
8700
|
+
this.loadDefaultCurrency = (currencyCode) => {
|
|
8701
|
+
// Trae la lista igual para tener la configuración completa
|
|
8702
|
+
this.connection.get(this.getCurrencyListApi()).toPromise().then((list) => {
|
|
8703
|
+
var _a;
|
|
8704
|
+
this.currencyListSubject.next(list);
|
|
8705
|
+
this.consts.setCurrencyTypeConfig(list);
|
|
8706
|
+
const cfg = (_a = list) === null || _a === void 0 ? void 0 : _a.find(c => c.code === currencyCode);
|
|
8707
|
+
if (cfg) {
|
|
8708
|
+
// Setea moneda activa con su configuración completa
|
|
8709
|
+
this.consts.setCurrency(cfg.code, cfg);
|
|
8710
|
+
}
|
|
8711
|
+
else {
|
|
8712
|
+
this.consts.setCurrency(currencyCode);
|
|
8713
|
+
}
|
|
8714
|
+
this.load();
|
|
8715
|
+
}).catch(() => {
|
|
8716
|
+
// En caso de error, al menos fijá el código para no romper el flujo
|
|
8717
|
+
this.consts.setCurrency(currencyCode);
|
|
8718
|
+
this.load();
|
|
8719
|
+
});
|
|
9109
8720
|
};
|
|
9110
8721
|
/**
|
|
9111
8722
|
* @description calcula la convetibilidad del precio pasado por paramentro segun esta formula:
|
|
@@ -9124,12 +8735,32 @@ let CurrencyService = class CurrencyService {
|
|
|
9124
8735
|
this.getConvertibility(this.consts.currency.code, code);
|
|
9125
8736
|
});
|
|
9126
8737
|
/**
|
|
9127
|
-
*
|
|
8738
|
+
* Carga la lista de monedas desde la API y registra la configuración completa en `Constants`.
|
|
8739
|
+
*
|
|
8740
|
+
* Si no existe una moneda activa guardada en `localStorage`, inicializa la moneda activa
|
|
8741
|
+
* tomando la moneda base del canal (`ChannelConfigService.baseCurrency`) y sus metadatos
|
|
8742
|
+
* obtenidos de la lista (símbolo, posición, decimales). Si no se encuentra la base en la
|
|
8743
|
+
* lista, usa la primera disponible.
|
|
8744
|
+
*
|
|
8745
|
+
* Finalmente, llama a `load()` para propagar la configuración a los observables y (si aplica)
|
|
8746
|
+
* actualizar `localStorage`.
|
|
8747
|
+
*
|
|
8748
|
+
* @sideEffect Actualiza `currencyList$`, `Constants.setCurrencyTypeConfig` y potencialmente
|
|
8749
|
+
* `Constants.setCurrency`.
|
|
8750
|
+
* @returns void
|
|
9128
8751
|
*/
|
|
9129
8752
|
this.loadCurrencyList = () => {
|
|
9130
8753
|
this.connection.get(this.getCurrencyListApi()).toPromise().then(res => {
|
|
8754
|
+
var _a, _b, _c, _d;
|
|
9131
8755
|
this.currencyListSubject.next(res);
|
|
9132
8756
|
this.consts.setCurrencyTypeConfig(res);
|
|
8757
|
+
const stored = localStorage.getItem('currency');
|
|
8758
|
+
if (!stored) {
|
|
8759
|
+
const base = (_a = this.injector.get(ChannelConfigService).getActiveChannel()) === null || _a === void 0 ? void 0 : _a.baseCurrency;
|
|
8760
|
+
const cfg = (_c = (_b = res) === null || _b === void 0 ? void 0 : _b.find(c => c.code === base), (_c !== null && _c !== void 0 ? _c : (_d = res) === null || _d === void 0 ? void 0 : _d[0]));
|
|
8761
|
+
if (cfg)
|
|
8762
|
+
this.consts.setCurrency(cfg.code, cfg);
|
|
8763
|
+
}
|
|
9133
8764
|
this.load();
|
|
9134
8765
|
});
|
|
9135
8766
|
};
|
|
@@ -9203,7 +8834,6 @@ let CurrencyService = class CurrencyService {
|
|
|
9203
8834
|
}
|
|
9204
8835
|
};
|
|
9205
8836
|
this.injector.get(ChannelConfigService).channelConfig$.subscribe(channel => {
|
|
9206
|
-
console.log(channel);
|
|
9207
8837
|
channel.applyCurrencyExchange ? this.loadCurrencyList() : this.loadDefaultCurrency(channel.baseCurrency);
|
|
9208
8838
|
console.log(this.enableApplyCurrencyExchange);
|
|
9209
8839
|
});
|
|
@@ -9705,9 +9335,11 @@ let ProductDetailEcComponent = class ProductDetailEcComponent extends ComponentH
|
|
|
9705
9335
|
this.showReviews = false;
|
|
9706
9336
|
this.hidePrices = false;
|
|
9707
9337
|
this.creditAccountShowPrices = null;
|
|
9338
|
+
this.enableFieldNotesInArticleFile = false;
|
|
9708
9339
|
this.addToCart = () => {
|
|
9709
9340
|
var _a;
|
|
9710
|
-
|
|
9341
|
+
const note = ((_a = this.comments) === null || _a === void 0 ? void 0 : _a.trim()) || null;
|
|
9342
|
+
this.quantity > 0 && this.productService.addToCart(this.quantity, undefined, note);
|
|
9711
9343
|
};
|
|
9712
9344
|
this.addAllProductosToCart = () => {
|
|
9713
9345
|
var _a, _b;
|
|
@@ -9808,9 +9440,10 @@ let ProductDetailEcComponent = class ProductDetailEcComponent extends ComponentH
|
|
|
9808
9440
|
this.changeImgFocus(productParam.picturesdefault[0]);
|
|
9809
9441
|
});
|
|
9810
9442
|
this.injector.get(ChannelConfigService).channelConfig$.subscribe(channel => {
|
|
9811
|
-
var _a, _b;
|
|
9443
|
+
var _a, _b, _c, _d;
|
|
9812
9444
|
this.showReviews = channel.showReviews;
|
|
9813
9445
|
this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
9446
|
+
this.enableFieldNotesInArticleFile = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.enableFieldNotesInArticleFile, (_d !== null && _d !== void 0 ? _d : false));
|
|
9814
9447
|
});
|
|
9815
9448
|
this.cartService.showPrice$.subscribe((showPrice) => {
|
|
9816
9449
|
this.creditAccountShowPrices = showPrice;
|
|
@@ -9825,6 +9458,28 @@ let ProductDetailEcComponent = class ProductDetailEcComponent extends ComponentH
|
|
|
9825
9458
|
}
|
|
9826
9459
|
ngOnInit() {
|
|
9827
9460
|
this.ecOnInit();
|
|
9461
|
+
// Prellenar comentarios cuando:
|
|
9462
|
+
// - cargue el producto
|
|
9463
|
+
// - cambie la variante seleccionada (asociatedData$)
|
|
9464
|
+
// - cambien los ítems del carrito
|
|
9465
|
+
this.prefillSub = combineLatest([
|
|
9466
|
+
this.productService.product$.pipe(filter((p) => !!p && !!p.id)),
|
|
9467
|
+
this.productService.asociatedData$.pipe(startWith(null)),
|
|
9468
|
+
this.cartService.cartItems.pipe(startWith([])),
|
|
9469
|
+
]).subscribe(([product, data, items]) => {
|
|
9470
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
9471
|
+
const variantId = (_h = (_d = (_b = (_a = data) === null || _a === void 0 ? void 0 : _a.variantCode, (_b !== null && _b !== void 0 ? _b : (_c = data) === null || _c === void 0 ? void 0 : _c.variant_id)), (_d !== null && _d !== void 0 ? _d : (_g = (_f = (_e = product) === null || _e === void 0 ? void 0 : _e.variants) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.code)), (_h !== null && _h !== void 0 ? _h : null));
|
|
9472
|
+
const match = (_j = items) === null || _j === void 0 ? void 0 : _j.find(it => {
|
|
9473
|
+
var _a, _b, _c, _d;
|
|
9474
|
+
return ((_b = (_a = it) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.id) === ((_c = product) === null || _c === void 0 ? void 0 : _c.id) &&
|
|
9475
|
+
(variantId ? ((_d = it) === null || _d === void 0 ? void 0 : _d.variant_id) === variantId : true);
|
|
9476
|
+
});
|
|
9477
|
+
this.comments = (_l = (_k = match) === null || _k === void 0 ? void 0 : _k.comments, (_l !== null && _l !== void 0 ? _l : ''));
|
|
9478
|
+
});
|
|
9479
|
+
}
|
|
9480
|
+
ngOnDestroy() {
|
|
9481
|
+
var _a;
|
|
9482
|
+
(_a = this.prefillSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
9828
9483
|
}
|
|
9829
9484
|
scroll() {
|
|
9830
9485
|
let el = this.contact.nativeElement;
|
|
@@ -9955,7 +9610,6 @@ let ProductEcComponent = class ProductEcComponent extends ComponentHelper {
|
|
|
9955
9610
|
ngOnChanges() {
|
|
9956
9611
|
}
|
|
9957
9612
|
selectItem(product) {
|
|
9958
|
-
console.log('entro');
|
|
9959
9613
|
this.analyticsService.callEvent('select_item', product);
|
|
9960
9614
|
}
|
|
9961
9615
|
};
|
|
@@ -10390,7 +10044,7 @@ var __decorate$1a = (this && this.__decorate) || function (decorators, target, k
|
|
|
10390
10044
|
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;
|
|
10391
10045
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10392
10046
|
};
|
|
10393
|
-
var __param$
|
|
10047
|
+
var __param$9 = (this && this.__param) || function (paramIndex, decorator) {
|
|
10394
10048
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10395
10049
|
};
|
|
10396
10050
|
let SellerDashboardContainerEcComponent = class SellerDashboardContainerEcComponent extends ComponentHelper {
|
|
@@ -10503,7 +10157,7 @@ SellerDashboardContainerEcComponent = __decorate$1a([
|
|
|
10503
10157
|
template: "<section *ngIf=\"user\" id=\"seller-dashboard\">\r\n <div class=\"section-content mt-5 mb-2 tablaVendedores\">\r\n <div class=\"container-xl\">\r\n <div class=\"row\">\r\n <main class=\"col-md-12\">\r\n\r\n <ul *ngIf=\"hasHeader()\" class=\"nav nav-tabs\">\r\n <li class=\"nav-item col-12 col-lg-2\">\r\n <a *ngIf=\"hasUIComponent('HEADER_TAB')\" class=\"nav-link active cursor-pointer px-4\"\r\n aria-current=\"page\">\r\n {{ 'my-clients' | translate }}\r\n </a>\r\n </li>\r\n <li class=\"ms-auto row\">\r\n <div\r\n class=\"d-flex justify-content-end justify-content-lg-end justify-content-xl-end col-12 col-md-12 col-lg-auto\">\r\n <ng-container *ngIf=\"hasUIComponent('GENERATE_BUDGET_BTN') \">\r\n <a *ngIf=\"authService.getCustomer()?.id; else withoutCustomer\"\r\n [routerLink]=\"'/collection'\"\r\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"><i\r\n class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate }}\r\n </a>\r\n <ng-template #withoutCustomer>\r\n <a class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"\r\n (click)=\"toastrService.show('must-select-customer')\">\r\n <i class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate\r\n }}\r\n </a>\r\n </ng-template>\r\n </ng-container>\r\n <a *ngIf=\"hasUIComponent('MANAGE_ORDERS_BTN')\"\r\n (click)=\"navigateExternal(constants.getUrlBase())\"\r\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center me- me-lg-4 mr- mr-lg-4\"><i\r\n class=\"bi bi-archive-fill me-2 mr-2\"></i>{{ 'manage-orders' | translate }}</a>\r\n </div>\r\n <div class=\"d-flex camposVendedores col-12 col-md-12 col-lg-auto justify-content-end\">\r\n <select *ngIf=\"hasUIComponent('SORT_SELECT')\" id=\"customerSort\" name=\"customerSort\"\r\n (change)=\"sortCustomers($event.target.value)\" class=\"mb-1 ordenarVendedores form-select\">\r\n <option selected hidden disabled>{{ 'order-by' | translate }}</option>\r\n <option value='asc_firstName'>{{ 'client' | translate }} (A-Z)</option>\r\n <option value='desc_firstName'>{{ 'client' | translate }} (Z-A)</option>\r\n <option value='asc_id'>Menor a Mayor c\u00F3digo</option>\r\n <option value='desc_id'>Mayor a Menor c\u00F3digo</option>\r\n </select>\r\n <form *ngIf=\"hasUIComponent('SEARCH_FORM')\"\r\n class=\"col-lg-auto mb-lg-0 d-flex ms-3 ml-3 d-flex buscadorVendedores\">\r\n <input type=\"text\" name=\"searchInput\" class=\"form-control\"\r\n placeholder=\"{{ 'search' | translate }}\" [(ngModel)]=\"searchInput\"\r\n (keyup.enter)=\"updateCustomers()\">\r\n <button class=\"btn btn-primary ms-1 ml-1 bg-white border-dark btnSearch\"><i\r\n class=\"bi bi-search text-dark\" (click)=\"updateCustomers()\"></i></button>\r\n </form>\r\n </div>\r\n </li>\r\n </ul>\r\n\r\n <ng-container *ngIf=\"user.customers?.length; else noCustomers\">\r\n\r\n <article class=\"card card-body mb-1 carritoProductoHeader m-0 py-0 mt-4\">\r\n <div class=\"row align-items-center font-bold border-bottom\">\r\n <div class=\"col-3 col-md-2 text-left\">\r\n <small>{{ 'code' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-5 col-md-3 mb-md-0\">\r\n <small>{{ 'client' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\r\n <small>{{ 'user' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-4 col-md-2 text-left\">\r\n <small>{{ 'new-orders' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-2 col-md-2 text-left d-none d-md-block\">\r\n <small></small>\r\n </div>\r\n\r\n </div>\r\n </article>\r\n\r\n <article *ngFor=\"let customer of filteredCustomers\" [class]=\"'card card-body mb-3 cadaVendedor ' + (isActive(customer) ? 'activo':'')\">\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-3 col-md-2 text-left ps-2 pl-2\">\r\n <div class=\"price h6 pb-0 mb-0 ps-3 pl-1\">\r\n {{ customer.managementSystemInternalCode || 'n/a' }}\r\n </div>\r\n </div>\r\n <div class=\"col-5 col-md-3 text-left\">\r\n <div class=\"price h6 fw-normal ps-2 pl-2 pb-0 mb-0\">\r\n {{ customer.firstName }} {{ customer.lastName }}\r\n <p class=\"d-block d-md-none fs-6 mt-1 mb-0 p-0 userMobile\">\r\n {{ customer.email }}\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\r\n <div class=\"price h6 fw-normal pb-0 mb-0 ps-2 pl-2\">\r\n {{ customer.email }}\r\n </div>\r\n </div>\r\n <div class=\"col-4 col-md-2 text-left ps-2 pl-2\">\r\n <div *ngIf=\"true\" class=\"contNumero\">\r\n {{ customer.ordersNotApproved }}\r\n </div>\r\n </div>\r\n <div class=\"col-12 col-md-2 btnIngresar\">\r\n\r\n <ng-container\r\n *ngIf=\"authService.getCustomer()?.id == customer.id; else noActiveCustomer\">\r\n <a (click)=\"changeCustomer(null)\"\r\n class=\"btn btn-seller-primary justify-content-center\">\r\n <i class=\"bi bi-box-arrow-left me-2 mr-2\"></i>\r\n <small class=\"me-2 mr-2 d-none d-md-block\">\r\n {{ 'exit' | translate | uppercase }}\r\n </small>\r\n </a>\r\n </ng-container>\r\n <ng-template #noActiveCustomer>\r\n <a (click)=\"changeCustomer(customer)\"\r\n class=\"btn btn-seller-primary justify-content-center\">\r\n <i class=\"bi bi-box-arrow-in-right me-2 mr-2\"></i>\r\n <small class=\"me-2 mr-2 d-none d-md-block\">\r\n {{ 'operate-as' | translate | uppercase }}\r\n </small>\r\n </a>\r\n </ng-template>\r\n\r\n </div>\r\n </div>\r\n </article>\r\n\r\n </ng-container>\r\n\r\n </main>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n\r\n<ng-template #noCustomers>\r\n <h4 class=\"text-center p-5\">{{ 'no-customers' | translate }}</h4>\r\n</ng-template>",
|
|
10504
10158
|
styles: ["#seller-dashboard{--seller-dashboard-primary-color:0,0,0}.btn-seller-primary{color:#fff!important;background-color:rgba(var(--seller-dashboard-primary-color),1)!important;border-color:rgba(var(--seller-dashboard-primary-color),1)!important}.btn-seller-primary:hover{background-color:rgba(var(--seller-dashboard-primary-color),.9)!important}.btn-seller-primary:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)!important}.btnGestionar{padding:6px 12px!important;height:36px;display:flex;align-items:center;justify-content:center;margin-left:10px}.ordenarVendedores{width:150px!important;color:#8b8b8b!important;background-color:#fff;border:1px solid #b6b6b6!important;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px}.buscadorVendedores{margin-bottom:4px!important}.buscadorVendedores input{border:1px solid #b6b6b6!important;width:200px}.buscadorVendedores .btnSearch{border:1px solid #b6b6b6!important;padding:.375rem .75rem;font-size:1rem}.buscadorVendedores .btnSearch:focus{background-color:#fff!important}.carritoProductoHeader{border:none!important}.carritoProductoHeader small{font-size:13px}.cadaVendedor{padding:5px 0;margin-bottom:0!important;border:none!important;border-bottom:1px solid #ccc!important;border-radius:0!important;-webkit-border-radius:0}.cadaVendedor .btnIngresar a{padding:10px!important;border-width:1px!important;border-style:solid!important;display:flex;align-items:center;width:100%!important;margin-left:auto;color:#fff}.cadaVendedor .btnIngresar .contNumero{background-color:#eee;width:20px;height:20px;color:#000;font-size:13px;display:flex;align-items:center;justify-content:center;font-weight:600;border-radius:20px;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px}.userMobile{font-size:14px!important;font-style:italic!important}.cadaVendedor .btnIngresar a:hover{background-color:rgba(var(--seller-dashboard-primary-color),.85)}.cadaVendedor .btnIngresar a:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.border-bottom{border-bottom:1px solid #000!important}@media screen and (max-width:1200px){.btnGestionar{font-size:12px}}@media screen and (max-width:992px){.camposVendedores{justify-content:flex-end;margin-top:8px;margin-bottom:4px}}@media all and (max-width:768px){.ordenarVendedores{width:140px!important}.buscadorVendedores input{width:140px}.cadaVendedor .btnIngresar a{width:70px!important}}@media all and (max-width:576px){.tablaVendedores .nav-tabs .nav-link{font-size:13px;padding:6px!important}.btnGestionar{padding:6px 8px!important;font-size:13px;height:36px;display:flex;align-items:center;justify-content:center;margin-top:3px;margin-left:10px}.buscadorVendedores input,.ordenarVendedores{font-size:13px}}.fs-6{font-size:1rem!important}.cadaVendedor.activo{background-color:#eee}"]
|
|
10505
10159
|
}),
|
|
10506
|
-
__param$
|
|
10160
|
+
__param$9(3, Inject('env'))
|
|
10507
10161
|
], SellerDashboardContainerEcComponent);
|
|
10508
10162
|
|
|
10509
10163
|
var __decorate$1b = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -11027,8 +10681,8 @@ __decorate$1f([
|
|
|
11027
10681
|
PriceEcComponent = __decorate$1f([
|
|
11028
10682
|
Component({
|
|
11029
10683
|
selector: 'app-price-ec',
|
|
11030
|
-
template: "<!-- Si hay templates personalizados, se proyectan -->\r\n<ng-container *ngIf=\"customSalePriceTemplate || customPriceTemplate; else defaultPriceBlock\">\r\n <ng-container *ngTemplateOutlet=\"customPriceTemplate || defaultPriceBlock\"></ng-container>\r\n</ng-container>\r\n\r\n<ng-template #defaultPriceBlock>\r\n <div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\r\n <del class=\"tachado\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\r\n {{ saleprice.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ saleprice.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </div>\r\n\r\n <ng-template #onlyprice>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePrice>\r\n <ng-container *ngIf=\"customSimplePriceTemplate; else fallbackSimplePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimplePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimplePrice>\r\n <div [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePriceDel>\r\n <div [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n <span class=\"lnth\">{{ price | ecCurrencySymbol }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simpleSalePrice>\r\n <ng-container *ngIf=\"customSimpleSalePriceTemplate; else fallbackSimpleSalePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimpleSalePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimpleSalePrice>\r\n <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<!-- Secci\u00F3n de impuestos -->\r\n<ng-container *ngIf=\"shouldShowTaxes\">\r\n <ng-container *ngIf=\"showTaxLegendOnly; else detailedTaxBlock\">\r\n <ng-container *ngIf=\"customOnlyTaxLabelTemplate; else defaultOnlyTaxLabelBlock\">\r\n <ng-container *ngTemplateOutlet=\"customOnlyTaxLabelTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultOnlyTaxLabelBlock>\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: {{ basePrice | ecCurrencySymbol }}
|
|
11031
|
-
styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}.taxes-section{margin-top:.5rem;border-radius:.5rem;font-size:.95rem;color:#333;line-height:1.4;max-width:400px}.taxes-title{font-weight:500;margin-bottom:.2rem;font-size:.7rem;color:#222}.taxes-list{list-style-type:none;padding-left:0;margin:0}.taxes-list li{margin-bottom:.05rem;font-size:.65rem;display:flex;justify-content:space-between}"]
|
|
10684
|
+
template: "<!-- Si hay templates personalizados, se proyectan -->\r\n<ng-container *ngIf=\"customSalePriceTemplate || customPriceTemplate; else defaultPriceBlock\">\r\n <ng-container *ngTemplateOutlet=\"customPriceTemplate || defaultPriceBlock\"></ng-container>\r\n</ng-container>\r\n\r\n<ng-template #defaultPriceBlock>\r\n <div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\r\n <del class=\"tachado\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\r\n {{ saleprice.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ saleprice.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </div>\r\n\r\n <ng-template #onlyprice>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePrice>\r\n <ng-container *ngIf=\"customSimplePriceTemplate; else fallbackSimplePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimplePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimplePrice>\r\n <div [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePriceDel>\r\n <div [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n <span class=\"lnth\">{{ price | ecCurrencySymbol }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simpleSalePrice>\r\n <ng-container *ngIf=\"customSimpleSalePriceTemplate; else fallbackSimpleSalePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimpleSalePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimpleSalePrice>\r\n <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<!-- Secci\u00F3n de impuestos -->\r\n<ng-container *ngIf=\"shouldShowTaxes\">\r\n <ng-container *ngIf=\"showTaxLegendOnly; else detailedTaxBlock\">\r\n <ng-container *ngIf=\"customOnlyTaxLabelTemplate; else defaultOnlyTaxLabelBlock\">\r\n <ng-container *ngTemplateOutlet=\"customOnlyTaxLabelTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultOnlyTaxLabelBlock>\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: <span class=\"nowrap-price\">{{ basePrice | ecCurrencySymbol }}</span>\r\n </p>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-template #detailedTaxBlock>\r\n <ng-container *ngIf=\"customTaxTemplate; else defaultTaxBlock\">\r\n <ng-container *ngTemplateOutlet=\"customTaxTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-template #defaultTaxBlock>\r\n <div class=\"taxes-section\">\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: <span class=\"nowrap-price\">{{ basePrice | ecCurrencySymbol }}</span></p>\r\n <ul class=\"taxes-list\">\r\n <li>\r\n {{ taxes.Name }}: {{ taxeAmount | ecCurrencySymbol }}\r\n </li>\r\n </ul>\r\n </div>\r\n</ng-template>",
|
|
10685
|
+
styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}.taxes-section{margin-top:.5rem;border-radius:.5rem;font-size:.95rem;color:#333;line-height:1.4;max-width:400px}.taxes-title{font-weight:500;margin-bottom:.2rem;font-size:.7rem;color:#222}.taxes-list{list-style-type:none;padding-left:0;margin:0}.taxes-list li{margin-bottom:.05rem;font-size:.65rem;display:flex;justify-content:space-between}.nowrap-price{white-space:nowrap}"]
|
|
11032
10686
|
})
|
|
11033
10687
|
], PriceEcComponent);
|
|
11034
10688
|
|
|
@@ -11131,7 +10785,7 @@ var __decorate$1h = (this && this.__decorate) || function (decorators, target, k
|
|
|
11131
10785
|
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;
|
|
11132
10786
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11133
10787
|
};
|
|
11134
|
-
var __param$
|
|
10788
|
+
var __param$a = (this && this.__param) || function (paramIndex, decorator) {
|
|
11135
10789
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
11136
10790
|
};
|
|
11137
10791
|
/** @dynamic */
|
|
@@ -11255,7 +10909,7 @@ RedSysProEcComponent = __decorate$1h([
|
|
|
11255
10909
|
providers: [BsModalService],
|
|
11256
10910
|
styles: [".half-width{width:49%!important}.ml-1{margin-left:1%}#card-form{height:450px}.iframeStyle{height:800px;width:100%;max-height:800px}"]
|
|
11257
10911
|
}),
|
|
11258
|
-
__param$
|
|
10912
|
+
__param$a(6, Inject(DOCUMENT))
|
|
11259
10913
|
], RedSysProEcComponent);
|
|
11260
10914
|
|
|
11261
10915
|
var __decorate$1i = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -11716,6 +11370,7 @@ let OrderEcComponent = class OrderEcComponent extends ComponentHelper {
|
|
|
11716
11370
|
this.hidePrices = false;
|
|
11717
11371
|
this.hideDiscounts = false;
|
|
11718
11372
|
this.hideTaxes = false;
|
|
11373
|
+
this.enableFieldNotesInArticleFile = false;
|
|
11719
11374
|
this.toDate = (date, format) => moment(date).format(!format && 'DD/MM/YYYY, h:mm:ss a' || format);
|
|
11720
11375
|
this.callError = () => {
|
|
11721
11376
|
this.error = '?';
|
|
@@ -11746,7 +11401,7 @@ let OrderEcComponent = class OrderEcComponent extends ComponentHelper {
|
|
|
11746
11401
|
this.callError();
|
|
11747
11402
|
};
|
|
11748
11403
|
this.channelConfigService.channelConfig$.subscribe((config) => {
|
|
11749
|
-
var _a, _b, _c, _d, _e, _f;
|
|
11404
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11750
11405
|
if (config && config.allowRepeatOrders !== undefined) {
|
|
11751
11406
|
this.allowRepeatOrders = config.allowRepeatOrders;
|
|
11752
11407
|
}
|
|
@@ -11756,6 +11411,7 @@ let OrderEcComponent = class OrderEcComponent extends ComponentHelper {
|
|
|
11756
11411
|
this.hidePrices = (_b = (_a = config) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
11757
11412
|
this.hideDiscounts = (_d = (_c = config) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
11758
11413
|
this.hideTaxes = (_f = (_e = config) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
11414
|
+
this.enableFieldNotesInArticleFile = (_h = (_g = config) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
11759
11415
|
});
|
|
11760
11416
|
this.cartService.showPrice$.subscribe((showPrice) => {
|
|
11761
11417
|
this.creditAccountShowPrices = showPrice;
|
|
@@ -11782,7 +11438,7 @@ __decorate$1l([
|
|
|
11782
11438
|
OrderEcComponent = __decorate$1l([
|
|
11783
11439
|
Component({
|
|
11784
11440
|
selector: 'app-order-ec',
|
|
11785
|
-
template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\r\n <div *ngIf=\"order; else noOrder\">\r\n\r\n <div class=\"row justify-content-between \">\r\n <div class=\"col-sm-auto col-12 font-brandon\">\r\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\r\n </div>\r\n <ng-container *ngIf=\"order?.invoice\">\r\n <div class=\"col-sm col-12 font-brandon\">\r\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\r\n class=\"btn btn-link btn-invoice\">\r\n <i class=\"fas fa-file-download me-1\"></i>\r\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\r\n </a>\r\n </div>\r\n </ng-container>\r\n <a (click)=\"volver()\" class=\"col-auto text-end\">\r\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\r\n </a>\r\n </div>\r\n\r\n <section id=\"orders\">\r\n <div class=\"row pt-2\">\r\n <div class=\"col-md-2 col-12\">\r\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0]?.method?.name | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\r\n seguimiento</a>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'date' | translate }}:</p>\r\n <p class=\"\">\r\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\r\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n\r\n </h5>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\r\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\r\n {{ 'product' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\r\n {{ 'description' | translate | uppercase }}\r\n </div>\r\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\r\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\r\n <!-- {{ 'description' | translate | uppercase }} -->\r\n {{ 'lots' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'quantity' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let item of order.items; let i = index\">\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n </ng-container>\r\n <ng-template #defaultpicture>\r\n <img *ngIf=\"item.product.picturesdefault\"\r\n class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n </ng-template>\r\n </div> \r\n <div\r\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\r\n <p class=\"font-brandon d-flex w-100 mb-0\">\r\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\r\n </p>\r\n <p *ngIf=\"item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\r\n \"{{ item.comments }}\"\r\n </p>\r\n </div>\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\r\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\r\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\r\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\r\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\r\n value=\"{{ 'see' | translate | uppercase }}\">\r\n </div>\r\n <div class=\"container d-md-none\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) |\r\n ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) *\r\n item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\">\r\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n </p>\r\n </div>\r\n <div class=\"col-1 d-none d-md-flex align-items-center\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-end w-100 m-0\">\r\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\r\n <div class=\"card card-body\">\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">#</th>\r\n <th scope=\"col\">Estado</th>\r\n <th scope=\"col\">Cantidad</th>\r\n <th scope=\"col\">Fecha Solicitada</th>\r\n <th scope=\"col\">Fecha Estimada</th>\r\n <th scope=\"col\">Sede</th>\r\n <th scope=\"col\">Nota</th>\r\n <th scope=\"col\">Total Lote</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\r\n <tr>\r\n <th scope=\"row\">{{lot.id}}</th>\r\n <td>{{lot.lot_status}}</td>\r\n <td>{{lot.quantity}}</td>\r\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\r\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n <ng-template #sinFechaEstimada>\r\n <td>Pendiente</td>\r\n </ng-template>\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol:'alwaysShowDecimals'}}</td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-6\"></div>\r\n <div class=\"col-12 col-md-6\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <div class=\"row py-4\">\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.subtotal) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.shipping || '0') | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n\r\n </div>\r\n\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\r\n {{ 'taxes' | translate }}</div>\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\r\n <div class=\"col-6 font-brandon font-md text-end\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</main>\r\n\r\n<ng-template #noOrder>\r\n <div class=\"w-100 h-50\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <h5>{{ 'no-orders' | translate }}</h5>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loadingView>\r\n <div class=\"w-100 h-50 py-5\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
11441
|
+
template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\r\n <div *ngIf=\"order; else noOrder\">\r\n\r\n <div class=\"row justify-content-between \">\r\n <div class=\"col-sm-auto col-12 font-brandon\">\r\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\r\n </div>\r\n <ng-container *ngIf=\"order?.invoice\">\r\n <div class=\"col-sm col-12 font-brandon\" *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\r\n class=\"btn btn-link btn-invoice\">\r\n <i class=\"fas fa-file-download me-1\"></i>\r\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\r\n </a>\r\n </div>\r\n </ng-container>\r\n <a (click)=\"volver()\" class=\"col-auto text-end\">\r\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\r\n </a>\r\n </div>\r\n\r\n <section id=\"orders\">\r\n <div class=\"row pt-2\">\r\n <div class=\"col-md-2 col-12\">\r\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0]?.method?.name | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\r\n seguimiento</a>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'date' | translate }}:</p>\r\n <p class=\"\">\r\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\r\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n\r\n </h5>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\r\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\r\n {{ 'product' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\r\n {{ 'description' | translate | uppercase }}\r\n </div>\r\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\r\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\r\n <!-- {{ 'description' | translate | uppercase }} -->\r\n {{ 'lots' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'quantity' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let item of order.items; let i = index\">\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n </ng-container>\r\n <ng-template #defaultpicture>\r\n <img *ngIf=\"item.product.picturesdefault\"\r\n class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n </ng-template>\r\n </div> \r\n <div\r\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\r\n <p class=\"font-brandon d-flex w-100 mb-0\">\r\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\r\n </p>\r\n <p *ngIf=\"enableFieldNotesInArticleFile && item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\r\n \"{{ item.comments }}\"\r\n </p>\r\n </div>\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\r\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\r\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\r\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\r\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\r\n value=\"{{ 'see' | translate | uppercase }}\">\r\n </div>\r\n <div class=\"container d-md-none\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) |\r\n ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) *\r\n item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\">\r\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n </p>\r\n </div>\r\n <div class=\"col-1 d-none d-md-flex align-items-center\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-end w-100 m-0\">\r\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\r\n <div class=\"card card-body\">\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">#</th>\r\n <th scope=\"col\">Estado</th>\r\n <th scope=\"col\">Cantidad</th>\r\n <th scope=\"col\">Fecha Solicitada</th>\r\n <th scope=\"col\">Fecha Estimada</th>\r\n <th scope=\"col\">Sede</th>\r\n <th scope=\"col\">Nota</th>\r\n <th scope=\"col\">Total Lote</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\r\n <tr>\r\n <th scope=\"row\">{{lot.id}}</th>\r\n <td>{{lot.lot_status}}</td>\r\n <td>{{lot.quantity}}</td>\r\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\r\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n <ng-template #sinFechaEstimada>\r\n <td>Pendiente</td>\r\n </ng-template>\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol:'alwaysShowDecimals'}}</td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-6\"></div>\r\n <div class=\"col-12 col-md-6\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <div class=\"row py-4\">\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.subtotal) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.shipping || '0') | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n\r\n </div>\r\n\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\r\n {{ 'taxes' | translate }}</div>\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\r\n <div class=\"col-6 font-brandon font-md text-end\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</main>\r\n\r\n<ng-template #noOrder>\r\n <div class=\"w-100 h-50\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <h5>{{ 'no-orders' | translate }}</h5>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loadingView>\r\n <div class=\"w-100 h-50 py-5\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
11786
11442
|
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}"]
|
|
11787
11443
|
})
|
|
11788
11444
|
], OrderEcComponent);
|
|
@@ -13285,12 +12941,10 @@ let PaypalExpressEcComponent = class PaypalExpressEcComponent extends ComponentH
|
|
|
13285
12941
|
this.loading = false;
|
|
13286
12942
|
}
|
|
13287
12943
|
else {
|
|
13288
|
-
/* console.log('Entro al else'); */
|
|
13289
12944
|
this.renderPayPal();
|
|
13290
12945
|
}
|
|
13291
12946
|
}
|
|
13292
12947
|
catch (error) {
|
|
13293
|
-
/* console.log('Entro al catch'); */
|
|
13294
12948
|
this.renderPayPal();
|
|
13295
12949
|
}
|
|
13296
12950
|
}, 1000);
|
|
@@ -16646,6 +16300,7 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16646
16300
|
this.creditAccountShowPrices = null;
|
|
16647
16301
|
this.showTaxLegend = false;
|
|
16648
16302
|
this.cartLoading = false;
|
|
16303
|
+
this.enableFieldNotesInArticleFile = false;
|
|
16649
16304
|
this.getVariants = product => {
|
|
16650
16305
|
let item = product.product;
|
|
16651
16306
|
if (item.variants && item.variants.length && item.variants[0].options && item.variants[0].options.length) {
|
|
@@ -16694,10 +16349,11 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16694
16349
|
this.user = u;
|
|
16695
16350
|
});
|
|
16696
16351
|
this.channelConfigService.channelConfig$.subscribe(channel => {
|
|
16697
|
-
var _a, _b, _c, _d, _e, _f;
|
|
16352
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
16698
16353
|
this.hideDiscounts = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hideDiscounts, (_b !== null && _b !== void 0 ? _b : false));
|
|
16699
16354
|
this.hideTaxes = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideTaxes, (_d !== null && _d !== void 0 ? _d : false));
|
|
16700
16355
|
this.showTaxLegend = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.showTaxLegend, (_f !== null && _f !== void 0 ? _f : false));
|
|
16356
|
+
this.enableFieldNotesInArticleFile = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
16701
16357
|
});
|
|
16702
16358
|
this.cartService.showPrice$.subscribe((showPrice) => {
|
|
16703
16359
|
this.creditAccountShowPrices = showPrice;
|
|
@@ -16707,7 +16363,7 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16707
16363
|
});
|
|
16708
16364
|
}
|
|
16709
16365
|
actualizarCantidad(item, cantidad, stock, id) {
|
|
16710
|
-
var _a;
|
|
16366
|
+
var _a, _b, _c;
|
|
16711
16367
|
if (this.cartLoading) {
|
|
16712
16368
|
return;
|
|
16713
16369
|
}
|
|
@@ -16727,13 +16383,14 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16727
16383
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
16728
16384
|
}
|
|
16729
16385
|
}
|
|
16386
|
+
const keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
16730
16387
|
if (id) {
|
|
16731
16388
|
const elem = document.getElementById(id);
|
|
16732
16389
|
if (elem) {
|
|
16733
16390
|
elem.disabled = true;
|
|
16734
16391
|
}
|
|
16735
16392
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
16736
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
16393
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
16737
16394
|
}
|
|
16738
16395
|
else {
|
|
16739
16396
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -16746,7 +16403,7 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16746
16403
|
}
|
|
16747
16404
|
else {
|
|
16748
16405
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
16749
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
16406
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
16750
16407
|
}
|
|
16751
16408
|
}
|
|
16752
16409
|
}
|
|
@@ -17016,7 +16673,7 @@ var __decorate$21 = (this && this.__decorate) || function (decorators, target, k
|
|
|
17016
16673
|
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;
|
|
17017
16674
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17018
16675
|
};
|
|
17019
|
-
var __param$
|
|
16676
|
+
var __param$b = (this && this.__param) || function (paramIndex, decorator) {
|
|
17020
16677
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
17021
16678
|
};
|
|
17022
16679
|
class ParamsContext {
|
|
@@ -17087,7 +16744,7 @@ AddActionRedirectDirective = __decorate$21([
|
|
|
17087
16744
|
Directive({
|
|
17088
16745
|
selector: "[ecAddActionRedirect]",
|
|
17089
16746
|
}),
|
|
17090
|
-
__param$
|
|
16747
|
+
__param$b(0, Inject(DOCUMENT))
|
|
17091
16748
|
], AddActionRedirectDirective);
|
|
17092
16749
|
|
|
17093
16750
|
var __decorate$22 = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -17169,7 +16826,7 @@ var __decorate$23 = (this && this.__decorate) || function (decorators, target, k
|
|
|
17169
16826
|
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;
|
|
17170
16827
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17171
16828
|
};
|
|
17172
|
-
var __param$
|
|
16829
|
+
var __param$c = (this && this.__param) || function (paramIndex, decorator) {
|
|
17173
16830
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
17174
16831
|
};
|
|
17175
16832
|
class ParamsContext$1 {
|
|
@@ -17301,7 +16958,7 @@ ProductOffDirective = __decorate$23([
|
|
|
17301
16958
|
Directive({
|
|
17302
16959
|
selector: "[ecProductOff]",
|
|
17303
16960
|
}),
|
|
17304
|
-
__param$
|
|
16961
|
+
__param$c(0, Inject(DOCUMENT))
|
|
17305
16962
|
], ProductOffDirective);
|
|
17306
16963
|
|
|
17307
16964
|
var __decorate$24 = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -17539,6 +17196,7 @@ ecCurrencySymbolPipe.ctorParameters = () => [
|
|
|
17539
17196
|
ecCurrencySymbolPipe = __decorate$27([
|
|
17540
17197
|
Pipe({
|
|
17541
17198
|
name: 'ecCurrencySymbol',
|
|
17199
|
+
pure: false
|
|
17542
17200
|
})
|
|
17543
17201
|
], ecCurrencySymbolPipe);
|
|
17544
17202
|
|
|
@@ -17839,7 +17497,7 @@ var __decorate$2d = (this && this.__decorate) || function (decorators, target, k
|
|
|
17839
17497
|
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;
|
|
17840
17498
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17841
17499
|
};
|
|
17842
|
-
var __param$
|
|
17500
|
+
var __param$d = (this && this.__param) || function (paramIndex, decorator) {
|
|
17843
17501
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
17844
17502
|
};
|
|
17845
17503
|
let StandardReuseStrategy = class StandardReuseStrategy {
|
|
@@ -17871,7 +17529,7 @@ StandardReuseStrategy.ctorParameters = () => [
|
|
|
17871
17529
|
];
|
|
17872
17530
|
StandardReuseStrategy = __decorate$2d([
|
|
17873
17531
|
Injectable(),
|
|
17874
|
-
__param$
|
|
17532
|
+
__param$d(0, Inject('env'))
|
|
17875
17533
|
], StandardReuseStrategy);
|
|
17876
17534
|
|
|
17877
17535
|
/*
|