ng-easycommerce 0.0.647 → 0.0.649
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 +6 -0
- package/bundles/ng-easycommerce.umd.js +61 -32
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +2 -2
- package/esm2015/lib/ec-component/checkout-ec/detail-checkout-block-ec/detail-checkout-block-ec.component.js +2 -2
- package/esm2015/lib/ec-component/checkout-ec/shipment-ec/shipment-ec.component.js +2 -2
- package/esm2015/lib/ec-pipe/ec-currency-symbol.pipe.js +42 -30
- package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +2 -2
- package/esm5/lib/ec-component/checkout-ec/detail-checkout-block-ec/detail-checkout-block-ec.component.js +2 -2
- package/esm5/lib/ec-component/checkout-ec/shipment-ec/shipment-ec.component.js +2 -2
- package/esm5/lib/ec-pipe/ec-currency-symbol.pipe.js +59 -30
- package/fesm2015/ng-easycommerce.js +44 -32
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +61 -32
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-pipe/ec-currency-symbol.pipe.d.ts +6 -5
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
# version 0.0.649
|
|
2
|
+
- se pone el metodo de envio con innerHtml para poder usar codigo html
|
|
3
|
+
# version 0.0.648
|
|
4
|
+
- `ec-currency-symbol`: se agrega el parámetro EcCurrencyDecimalsMode para controlar decimales por binding. Modos:
|
|
5
|
+
-`respectGlobalConfig` (default), `alwaysShowDecimals`, `alwaysHideDecimals`
|
|
6
|
+
- Ejemplo: {{ total | ecCurrencySymbol:'alwaysShowDecimals' }}
|
|
1
7
|
# version 0.0.647
|
|
2
8
|
- Checkout se oculta el subtotal siempre y cuando sea = al total.
|
|
3
9
|
- Se modifica funcionamiento en selector de canal para que modal sea mas grande y redirija a home.
|
|
@@ -9075,7 +9075,7 @@
|
|
|
9075
9075
|
ShipmentEcComponent = __decorate$T([
|
|
9076
9076
|
core.Component({
|
|
9077
9077
|
selector: 'app-shipment-ec',
|
|
9078
|
-
template: "<!-- <div class=\"checkout-title\">\r\n <h3>{{'shipment-methods'|translate}}</h3>\r\n</div> -->\r\n\r\n<div class=\"container-fluid\">\r\n <div class=\"col-12\">\r\n <div class=\"card text-center\">\r\n <div class=\"card-header text-dark\">\r\n <h4>{{ 'select-method' | translate }}</h4>\r\n <div class=\"btn-toolbar justify-content-center\" role=\"toolbar\" aria-label=\"Envios toolbar\"\r\n *ngIf=\"(shipmentService.methods | async) as methods; else noMethods\">\r\n <div class=\"\" role=\"group\" aria-label=\"Grupo botones envio\">\r\n <div class=\"d-flex align-content-start justify-content-center flex-wrap\">\r\n <button [disabled]=\"this.shipmentService.buttonsDisabled || this.buttonsDisabled\" type=\"button\" class=\"btn btn-outline-secondary mx-1 mb-1\"\r\n *ngFor=\"let method of deleteUPS(methods); let x = index\"\r\n (click)=\"setMethod(method, post_code); setActive($event)\">\r\n {{ method.name | translate }}\r\n </button>\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card-body\">\r\n <div class=\"row justify-content-center mb-2\" *ngIf=\"moreInfoInMethod && methodSelect && methodSelect.description\">\r\n <div class=\"col-12 col-md-6 col-lg-4 d-flex flex-column mb-2\" [id]=\"methodSelect.code\">\r\n <ng-container *ngFor=\"let line of methodSelect.description.split('\\r\\n'); let i=index\">\r\n <span [id]=\"methodSelect.code+'-'+i\" [class]=\"'line-'+i\">
|
|
9078
|
+
template: "<!-- <div class=\"checkout-title\">\r\n <h3>{{'shipment-methods'|translate}}</h3>\r\n</div> -->\r\n\r\n<div class=\"container-fluid\">\r\n <div class=\"col-12\">\r\n <div class=\"card text-center\">\r\n <div class=\"card-header text-dark\">\r\n <h4>{{ 'select-method' | translate }}</h4>\r\n <div class=\"btn-toolbar justify-content-center\" role=\"toolbar\" aria-label=\"Envios toolbar\"\r\n *ngIf=\"(shipmentService.methods | async) as methods; else noMethods\">\r\n <div class=\"\" role=\"group\" aria-label=\"Grupo botones envio\">\r\n <div class=\"d-flex align-content-start justify-content-center flex-wrap\">\r\n <button [disabled]=\"this.shipmentService.buttonsDisabled || this.buttonsDisabled\" type=\"button\" class=\"btn btn-outline-secondary mx-1 mb-1\"\r\n *ngFor=\"let method of deleteUPS(methods); let x = index\"\r\n (click)=\"setMethod(method, post_code); setActive($event)\">\r\n {{ method.name | translate }}\r\n </button>\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card-body\">\r\n <div class=\"row justify-content-center mb-2\" *ngIf=\"moreInfoInMethod && methodSelect && methodSelect.description\">\r\n <div class=\"col-12 col-md-6 col-lg-4 d-flex flex-column mb-2\" [id]=\"methodSelect.code\">\r\n <ng-container *ngFor=\"let line of methodSelect.description.split('\\r\\n'); let i=index\">\r\n <span [id]=\"methodSelect.code+'-'+i\" [class]=\"'line-'+i\" [innerHTML]=\"line\"> </span>\r\n </ng-container>\r\n </div>\r\n <!--<span> <b>{{ 'information' | translate }}:</b> {{methodSelect.description}} </span>-->\r\n </div>\r\n <div class=\"row justify-content-center\" *ngIf=\"this.costs\">\r\n <ng-container *ngIf=\"!loading_internal ; else loading\">\r\n <div class=\"col-auto text-dark\" *ngFor=\"let cost of costs; let y = index\">\r\n <ng-container *ngIf=\"cost.contracts.length > 0\">\r\n <ng-container *ngIf=\"costs.length > 1; else uniqueShipment\">\r\n <span><b>{{ cost.name | translate }}</b></span>\r\n <hr />\r\n </ng-container>\r\n <ng-template #uniqueShipment>\r\n <span><b>{{ methodSelect.name | translate }}</b></span>\r\n <hr />\r\n </ng-template>\r\n <div class=\"option\" *ngFor=\"let contract of cost.contracts; let i = index\">\r\n <div class=\"form-check current-contract\">\r\n <input class=\"form-check-input\" [checked]=\"(y === 0 && i === 0) ? true : contract.selected\" type=\"radio\" name=\"card\" [id]=\"cost.name + i\"\r\n value=\"dark\" (click)=\"verifyValidate(cost.name, contract)\">\r\n <label class=\"form-check-label\" [for]=\"cost.name + i\" aria-label=\"Dark grey\">\r\n <span\r\n [class]=\"(cost.name == 'home_delivery') ? 'shipment-contractname home_delivery' : 'shipment-contractname' \"\r\n *ngIf=\"validName(contract.name)\">{{ contract.name | translate }}</span>\r\n <span *ngIf=\"contract.computed\"><br class=\"shipment-contractname\">{{ contract.computed | translate }}<br\r\n class=\"shipment-contractname\"></span>\r\n <div *ngIf=\"contract.detail\" class=\"contract-detail\">\r\n <div *ngFor=\"let line of contract.detail.split(' - '); let i = index\" [class]=\"'contrat-item-'+i\">\r\n <span *ngIf=\"i == 0\"><b>{{ line }}</b></span>\r\n <span class=\"inside-detail\" *ngIf=\"i > 0\">{{ line }}</span>\r\n </div>\r\n </div>\r\n <span *ngIf=\"contract.price > 0\" [class]=\"'inside-detail ' + ( costos?.amount == 0 ? ' free ' : '') \">\r\n <br class=\"shipment-contractname\" *ngIf=\"!contract.computed\">\r\n {{ ('price'|translate) + ': ' + (contract.price | ecCurrencySymbol) }}</span>\r\n <!-- <span *ngIf=\"contract.price == 0\" [class]=\"'inside-detail ' + ( costos?.amount == 0 ? ' free ' : '') \">\r\n <br class=\"shipment-contractname\" *ngIf=\"!contract.computed\"> {{ ('free'|translate) }}</span> -->\r\n <br>\r\n </label>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n</div>\r\n\r\n<ng-template #noMethods>\r\n <div class=\"d-flex flex-row w-100 justify-content-center mt-2\">\r\n <h5 class=\"text-secondary\">{{'no-shipment-methods'|translate}}</h5>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loading>\r\n <app-loading-full-ec></app-loading-full-ec>\r\n</ng-template>\r\n",
|
|
9079
9079
|
providers: [ShipmentService],
|
|
9080
9080
|
styles: [".shipment-container{width:100%;max-height:500px!important}.points-container{margin-top:10px;max-height:300px;overflow:scroll}agm-map{height:300px}.ancho-100{width:200px}.ancho-50{width:100px}.group-shipping{margin:10px 0}.option-container>div{margin-bottom:15px}@media only screen and (min-width:600px){.option-container{display:flex;justify-content:space-between;margin-top:20px}}hr{margin-top:0!important}.option{align-items:flex-start;margin-bottom:20px}.option label{margin:0 0 0 10px}.inside-detail{color:gray!important;font-weight:400}.inside-detail.free{text-decoration:line-through}.active{color:#fff!important}"]
|
|
9081
9081
|
})
|
|
@@ -13595,7 +13595,7 @@
|
|
|
13595
13595
|
OrderEcComponent = __decorate$1l([
|
|
13596
13596
|
core.Component({
|
|
13597
13597
|
selector: 'app-order-ec',
|
|
13598
|
-
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}}\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}}</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}}</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}}\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}}</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}}</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 }}\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 }}\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 }}</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 }}</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 }}\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>",
|
|
13598
|
+
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>",
|
|
13599
13599
|
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}"]
|
|
13600
13600
|
})
|
|
13601
13601
|
], OrderEcComponent);
|
|
@@ -14829,7 +14829,7 @@
|
|
|
14829
14829
|
DetailCheckoutBlockEcComponent = __decorate$1u([
|
|
14830
14830
|
core.Component({
|
|
14831
14831
|
selector: 'app-detail-checkout-block-ec',
|
|
14832
|
-
template: "<div id=\"appDetailCheckoutBlockEc\" class=\"d-flex flex-row w-100 justify-content-center flex-wrap\"\r\n *ngIf=\"data && (creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <ng-container *ngFor=\"let item of data; let i = index\">\r\n <ng-container *ngIf=\"shouldShowItem(item.type) && !shouldHideSubtotal(item)\">\r\n <div class=\"d-flex flex-column justify-content-center mx-sm-3 mx-2 text-center mb-4 resumen\">\r\n <i ngClass=\"mb-2 colorIconoCheckout\" [class]=\"getIcon(item)\"></i>\r\n <strong class=\"text-center w-100 font-brandon font-md mb-1\">\r\n {{ getTypeLabel(item.type) | translate }}\r\n </strong>\r\n <span class=\"text-center w-100 font-brandon font-md text-gray\">{{ (item.amount != 0 ) ? (item.amount |\r\n ecCurrencySymbol) : ('free' | translate) }}</span>\r\n </div>\r\n </ng-container>\r\n\r\n\r\n <!-- Mostrar total de descuentos -->\r\n <div class=\"d-flex flex-column justify-content-center mx-sm-3 mx-2 text-center mb-4 resumen\"\r\n *ngIf=\"!hideDiscounts && this.discountTotal != 0 && i === 1\">\r\n <i ngClass=\"mb-2 colorIconoCheckout\" [class]=\"getIcon2('discount')\"></i>\r\n <strong class=\"text-center w-100 font-brandon font-md mb-1\">Descuento</strong>\r\n <span class=\"text-center w-100 font-brandon font-md text-gray\">{{ (this.discountTotal | ecCurrencySymbol)\r\n }}</span>\r\n </div>\r\n\r\n <!-- Mostrar total de cupones -->\r\n <div class=\"d-flex flex-column justify-content-center mx-sm-3 mx-2 text-center mb-4 resumen\"\r\n *ngIf=\"!hideDiscounts && this.couponTotal != 0 && i === 1\">\r\n <i ngClass=\"mb-2 colorIconoCheckout\" [class]=\"getIcon2('coupon')\"></i>\r\n <strong class=\"text-center w-100 font-brandon font-md mb-1\">Cupon</strong>\r\n <span class=\"text-center w-100 font-brandon font-md text-gray\">{{(this.couponTotal| ecCurrencySymbol)\r\n }}</span>\r\n </div>\r\n <div class=\"d-flex flex-column justify-content-center mx-sm-3 mx-2 text-center mb-4 resumen\"\r\n *ngIf=\"!hideTaxes && this.clientTaxes != 0 && i === 1\">\r\n <i ngClass=\"mb-2 colorIconoCheckout\" [class]=\"getIcon2('clienTaxe')\"></i>\r\n <strong class=\"text-center w-100 font-brandon font-md mb-1\">{{ 'clientTaxes' | translate }}</strong>\r\n <span class=\"text-center w-100 font-brandon font-md text-gray\">{{(this.clientTaxes | ecCurrencySymbol)\r\n }}</span>\r\n </div>\r\n </ng-container>\r\n</div>",
|
|
14832
|
+
template: "<div id=\"appDetailCheckoutBlockEc\" class=\"d-flex flex-row w-100 justify-content-center flex-wrap\"\r\n *ngIf=\"data && (creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <ng-container *ngFor=\"let item of data; let i = index\">\r\n <ng-container *ngIf=\"shouldShowItem(item.type) && !shouldHideSubtotal(item)\">\r\n <div class=\"d-flex flex-column justify-content-center mx-sm-3 mx-2 text-center mb-4 resumen\">\r\n <i ngClass=\"mb-2 colorIconoCheckout\" [class]=\"getIcon(item)\"></i>\r\n <strong class=\"text-center w-100 font-brandon font-md mb-1\">\r\n {{ getTypeLabel(item.type) | translate }}\r\n </strong>\r\n <span class=\"text-center w-100 font-brandon font-md text-gray\">{{ (item.amount != 0 ) ? (item.amount |\r\n ecCurrencySymbol:'alwaysShowDecimals') : ('free' | translate) }}</span>\r\n </div>\r\n </ng-container>\r\n\r\n\r\n <!-- Mostrar total de descuentos -->\r\n <div class=\"d-flex flex-column justify-content-center mx-sm-3 mx-2 text-center mb-4 resumen\"\r\n *ngIf=\"!hideDiscounts && this.discountTotal != 0 && i === 1\">\r\n <i ngClass=\"mb-2 colorIconoCheckout\" [class]=\"getIcon2('discount')\"></i>\r\n <strong class=\"text-center w-100 font-brandon font-md mb-1\">Descuento</strong>\r\n <span class=\"text-center w-100 font-brandon font-md text-gray\">{{ (this.discountTotal | ecCurrencySymbol:'alwaysShowDecimals')\r\n }}</span>\r\n </div>\r\n\r\n <!-- Mostrar total de cupones -->\r\n <div class=\"d-flex flex-column justify-content-center mx-sm-3 mx-2 text-center mb-4 resumen\"\r\n *ngIf=\"!hideDiscounts && this.couponTotal != 0 && i === 1\">\r\n <i ngClass=\"mb-2 colorIconoCheckout\" [class]=\"getIcon2('coupon')\"></i>\r\n <strong class=\"text-center w-100 font-brandon font-md mb-1\">Cupon</strong>\r\n <span class=\"text-center w-100 font-brandon font-md text-gray\">{{(this.couponTotal| ecCurrencySymbol:'alwaysShowDecimals')\r\n }}</span>\r\n </div>\r\n <div class=\"d-flex flex-column justify-content-center mx-sm-3 mx-2 text-center mb-4 resumen\"\r\n *ngIf=\"!hideTaxes && this.clientTaxes != 0 && i === 1\">\r\n <i ngClass=\"mb-2 colorIconoCheckout\" [class]=\"getIcon2('clienTaxe')\"></i>\r\n <strong class=\"text-center w-100 font-brandon font-md mb-1\">{{ 'clientTaxes' | translate }}</strong>\r\n <span class=\"text-center w-100 font-brandon font-md text-gray\">{{(this.clientTaxes | ecCurrencySymbol:'alwaysShowDecimals')\r\n }}</span>\r\n </div>\r\n </ng-container>\r\n</div>",
|
|
14833
14833
|
styles: [""]
|
|
14834
14834
|
})
|
|
14835
14835
|
], DetailCheckoutBlockEcComponent);
|
|
@@ -20070,6 +20070,22 @@
|
|
|
20070
20070
|
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;
|
|
20071
20071
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20072
20072
|
};
|
|
20073
|
+
var __read$9 = (this && this.__read) || function (o, n) {
|
|
20074
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
20075
|
+
if (!m) return o;
|
|
20076
|
+
var i = m.call(o), r, ar = [], e;
|
|
20077
|
+
try {
|
|
20078
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
20079
|
+
}
|
|
20080
|
+
catch (error) { e = { error: error }; }
|
|
20081
|
+
finally {
|
|
20082
|
+
try {
|
|
20083
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
20084
|
+
}
|
|
20085
|
+
finally { if (e) throw e.error; }
|
|
20086
|
+
}
|
|
20087
|
+
return ar;
|
|
20088
|
+
};
|
|
20073
20089
|
var ecCurrencySymbolPipe = /** @class */ (function () {
|
|
20074
20090
|
function ecCurrencySymbolPipe(productsService, currencyPipe, consts, currencyService, injector) {
|
|
20075
20091
|
var _this = this;
|
|
@@ -20078,44 +20094,57 @@
|
|
|
20078
20094
|
this.consts = consts;
|
|
20079
20095
|
this.currencyService = currencyService;
|
|
20080
20096
|
this.injector = injector;
|
|
20081
|
-
this.changeSymbolTransform = function (valor) {
|
|
20082
|
-
try {
|
|
20083
|
-
return _this.positionSymbol(_this.checkingWithoutDecimals(_this.clearSymbol(valor)));
|
|
20084
|
-
}
|
|
20085
|
-
catch (error) {
|
|
20086
|
-
console.error('Errores en custom pipe -> ', error);
|
|
20087
|
-
return valor;
|
|
20088
|
-
}
|
|
20089
|
-
};
|
|
20090
20097
|
this.clearSymbol = function (value) { return value.replace('$', ''); };
|
|
20091
|
-
this.positionSymbol = function (value) {
|
|
20092
|
-
this.checkingWithoutDecimals = function (value) {
|
|
20098
|
+
this.positionSymbol = function (value) {
|
|
20093
20099
|
var _a, _b, _c;
|
|
20094
|
-
|
|
20095
|
-
|
|
20096
|
-
|
|
20097
|
-
//?.trim() == "00" && value.trim().slice(0, value.trim().length - 3) || value
|
|
20098
|
-
}
|
|
20099
|
-
else {
|
|
20100
|
-
var val = (_c = value) === null || _c === void 0 ? void 0 : _c.split(',');
|
|
20101
|
-
(val[1] && val[1].length > 2) ? val[1] = val[1].slice(0, 2) : val[1] = "00";
|
|
20102
|
-
value = val[0] + ',' + val[1];
|
|
20103
|
-
return value;
|
|
20104
|
-
}
|
|
20100
|
+
return ((_a = _this.consts) === null || _a === void 0 ? void 0 : _a.currency.position.toUpperCase()) === 'LEFT'
|
|
20101
|
+
? _this.currency.symbol + " " + ((_b = value) === null || _b === void 0 ? void 0 : _b.trim())
|
|
20102
|
+
: ((_c = value) === null || _c === void 0 ? void 0 : _c.trim()) + " " + _this.currency.symbol;
|
|
20105
20103
|
};
|
|
20106
20104
|
this.currencyService.currency$.subscribe(function (res) {
|
|
20107
20105
|
_this.currency = res;
|
|
20108
20106
|
});
|
|
20109
20107
|
}
|
|
20110
|
-
ecCurrencySymbolPipe.prototype.transform = function (value) {
|
|
20108
|
+
ecCurrencySymbolPipe.prototype.transform = function (value, mode) {
|
|
20109
|
+
if (mode === void 0) { mode = 'respectGlobalConfig'; }
|
|
20110
|
+
var _a;
|
|
20111
|
+
var formatter = new Intl.NumberFormat('de-DE', {
|
|
20112
|
+
style: 'currency',
|
|
20113
|
+
currency: 'USD',
|
|
20114
|
+
});
|
|
20115
|
+
if (value == null)
|
|
20116
|
+
return '';
|
|
20117
|
+
value = this.currencyService.calculateConvetibility(value, this.currency.ratio).toString();
|
|
20118
|
+
var formatted = (_a = formatter.format(value)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
20119
|
+
return this.changeSymbolTransform(formatted, mode);
|
|
20120
|
+
};
|
|
20121
|
+
ecCurrencySymbolPipe.prototype.changeSymbolTransform = function (valor, mode) {
|
|
20122
|
+
try {
|
|
20123
|
+
var cleared = this.clearSymbol(valor);
|
|
20124
|
+
var withDecimals = this.applyDecimalsPolicy(cleared, mode);
|
|
20125
|
+
return this.positionSymbol(withDecimals);
|
|
20126
|
+
}
|
|
20127
|
+
catch (e) {
|
|
20128
|
+
console.error('Errores en ecCurrencySymbolPipe -> ', e);
|
|
20129
|
+
return valor;
|
|
20130
|
+
}
|
|
20131
|
+
};
|
|
20132
|
+
ecCurrencySymbolPipe.prototype.applyDecimalsPolicy = function (value, mode) {
|
|
20111
20133
|
var _a;
|
|
20112
|
-
var
|
|
20113
|
-
|
|
20114
|
-
|
|
20115
|
-
|
|
20116
|
-
|
|
20134
|
+
var withoutDecimalGlobal = !!((_a = this.consts) === null || _a === void 0 ? void 0 : _a.currency.withoutDecimal);
|
|
20135
|
+
// prioridad: argumento del pipe > config global
|
|
20136
|
+
var forceShow = mode === 'alwaysShowDecimals';
|
|
20137
|
+
var forceHide = mode === 'alwaysHideDecimals';
|
|
20138
|
+
var showDecimals = forceShow ? true : forceHide ? false : !withoutDecimalGlobal;
|
|
20139
|
+
var _b = __read$9((value || '').split(','), 2), ent = _b[0], _c = _b[1], dec = _c === void 0 ? '00' : _c;
|
|
20140
|
+
if (showDecimals) {
|
|
20141
|
+
if (dec.length > 2)
|
|
20142
|
+
dec = dec.slice(0, 2);
|
|
20143
|
+
return ent + "," + dec;
|
|
20144
|
+
}
|
|
20145
|
+
else {
|
|
20146
|
+
return ent;
|
|
20117
20147
|
}
|
|
20118
|
-
return valueTransform;
|
|
20119
20148
|
};
|
|
20120
20149
|
ecCurrencySymbolPipe.ctorParameters = function () { return [
|
|
20121
20150
|
{ type: ProductsService },
|