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/fesm5/ng-easycommerce.js
CHANGED
|
@@ -9089,7 +9089,7 @@ var ShipmentEcComponent = /** @class */ (function (_super) {
|
|
|
9089
9089
|
ShipmentEcComponent = __decorate$T([
|
|
9090
9090
|
Component({
|
|
9091
9091
|
selector: 'app-shipment-ec',
|
|
9092
|
-
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\">
|
|
9092
|
+
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",
|
|
9093
9093
|
providers: [ShipmentService],
|
|
9094
9094
|
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}"]
|
|
9095
9095
|
})
|
|
@@ -13609,7 +13609,7 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
13609
13609
|
OrderEcComponent = __decorate$1l([
|
|
13610
13610
|
Component({
|
|
13611
13611
|
selector: 'app-order-ec',
|
|
13612
|
-
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>",
|
|
13612
|
+
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>",
|
|
13613
13613
|
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}"]
|
|
13614
13614
|
})
|
|
13615
13615
|
], OrderEcComponent);
|
|
@@ -14843,7 +14843,7 @@ var DetailCheckoutBlockEcComponent = /** @class */ (function (_super) {
|
|
|
14843
14843
|
DetailCheckoutBlockEcComponent = __decorate$1u([
|
|
14844
14844
|
Component({
|
|
14845
14845
|
selector: 'app-detail-checkout-block-ec',
|
|
14846
|
-
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>",
|
|
14846
|
+
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>",
|
|
14847
14847
|
styles: [""]
|
|
14848
14848
|
})
|
|
14849
14849
|
], DetailCheckoutBlockEcComponent);
|
|
@@ -20084,6 +20084,22 @@ var __decorate$27 = (this && this.__decorate) || function (decorators, target, k
|
|
|
20084
20084
|
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;
|
|
20085
20085
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20086
20086
|
};
|
|
20087
|
+
var __read$9 = (this && this.__read) || function (o, n) {
|
|
20088
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
20089
|
+
if (!m) return o;
|
|
20090
|
+
var i = m.call(o), r, ar = [], e;
|
|
20091
|
+
try {
|
|
20092
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
20093
|
+
}
|
|
20094
|
+
catch (error) { e = { error: error }; }
|
|
20095
|
+
finally {
|
|
20096
|
+
try {
|
|
20097
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
20098
|
+
}
|
|
20099
|
+
finally { if (e) throw e.error; }
|
|
20100
|
+
}
|
|
20101
|
+
return ar;
|
|
20102
|
+
};
|
|
20087
20103
|
var ecCurrencySymbolPipe = /** @class */ (function () {
|
|
20088
20104
|
function ecCurrencySymbolPipe(productsService, currencyPipe, consts, currencyService, injector) {
|
|
20089
20105
|
var _this = this;
|
|
@@ -20092,44 +20108,57 @@ var ecCurrencySymbolPipe = /** @class */ (function () {
|
|
|
20092
20108
|
this.consts = consts;
|
|
20093
20109
|
this.currencyService = currencyService;
|
|
20094
20110
|
this.injector = injector;
|
|
20095
|
-
this.changeSymbolTransform = function (valor) {
|
|
20096
|
-
try {
|
|
20097
|
-
return _this.positionSymbol(_this.checkingWithoutDecimals(_this.clearSymbol(valor)));
|
|
20098
|
-
}
|
|
20099
|
-
catch (error) {
|
|
20100
|
-
console.error('Errores en custom pipe -> ', error);
|
|
20101
|
-
return valor;
|
|
20102
|
-
}
|
|
20103
|
-
};
|
|
20104
20111
|
this.clearSymbol = function (value) { return value.replace('$', ''); };
|
|
20105
|
-
this.positionSymbol = function (value) {
|
|
20106
|
-
this.checkingWithoutDecimals = function (value) {
|
|
20112
|
+
this.positionSymbol = function (value) {
|
|
20107
20113
|
var _a, _b, _c;
|
|
20108
|
-
|
|
20109
|
-
|
|
20110
|
-
|
|
20111
|
-
//?.trim() == "00" && value.trim().slice(0, value.trim().length - 3) || value
|
|
20112
|
-
}
|
|
20113
|
-
else {
|
|
20114
|
-
var val = (_c = value) === null || _c === void 0 ? void 0 : _c.split(',');
|
|
20115
|
-
(val[1] && val[1].length > 2) ? val[1] = val[1].slice(0, 2) : val[1] = "00";
|
|
20116
|
-
value = val[0] + ',' + val[1];
|
|
20117
|
-
return value;
|
|
20118
|
-
}
|
|
20114
|
+
return ((_a = _this.consts) === null || _a === void 0 ? void 0 : _a.currency.position.toUpperCase()) === 'LEFT'
|
|
20115
|
+
? _this.currency.symbol + " " + ((_b = value) === null || _b === void 0 ? void 0 : _b.trim())
|
|
20116
|
+
: ((_c = value) === null || _c === void 0 ? void 0 : _c.trim()) + " " + _this.currency.symbol;
|
|
20119
20117
|
};
|
|
20120
20118
|
this.currencyService.currency$.subscribe(function (res) {
|
|
20121
20119
|
_this.currency = res;
|
|
20122
20120
|
});
|
|
20123
20121
|
}
|
|
20124
|
-
ecCurrencySymbolPipe.prototype.transform = function (value) {
|
|
20122
|
+
ecCurrencySymbolPipe.prototype.transform = function (value, mode) {
|
|
20123
|
+
if (mode === void 0) { mode = 'respectGlobalConfig'; }
|
|
20124
|
+
var _a;
|
|
20125
|
+
var formatter = new Intl.NumberFormat('de-DE', {
|
|
20126
|
+
style: 'currency',
|
|
20127
|
+
currency: 'USD',
|
|
20128
|
+
});
|
|
20129
|
+
if (value == null)
|
|
20130
|
+
return '';
|
|
20131
|
+
value = this.currencyService.calculateConvetibility(value, this.currency.ratio).toString();
|
|
20132
|
+
var formatted = (_a = formatter.format(value)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
20133
|
+
return this.changeSymbolTransform(formatted, mode);
|
|
20134
|
+
};
|
|
20135
|
+
ecCurrencySymbolPipe.prototype.changeSymbolTransform = function (valor, mode) {
|
|
20136
|
+
try {
|
|
20137
|
+
var cleared = this.clearSymbol(valor);
|
|
20138
|
+
var withDecimals = this.applyDecimalsPolicy(cleared, mode);
|
|
20139
|
+
return this.positionSymbol(withDecimals);
|
|
20140
|
+
}
|
|
20141
|
+
catch (e) {
|
|
20142
|
+
console.error('Errores en ecCurrencySymbolPipe -> ', e);
|
|
20143
|
+
return valor;
|
|
20144
|
+
}
|
|
20145
|
+
};
|
|
20146
|
+
ecCurrencySymbolPipe.prototype.applyDecimalsPolicy = function (value, mode) {
|
|
20125
20147
|
var _a;
|
|
20126
|
-
var
|
|
20127
|
-
|
|
20128
|
-
|
|
20129
|
-
|
|
20130
|
-
|
|
20148
|
+
var withoutDecimalGlobal = !!((_a = this.consts) === null || _a === void 0 ? void 0 : _a.currency.withoutDecimal);
|
|
20149
|
+
// prioridad: argumento del pipe > config global
|
|
20150
|
+
var forceShow = mode === 'alwaysShowDecimals';
|
|
20151
|
+
var forceHide = mode === 'alwaysHideDecimals';
|
|
20152
|
+
var showDecimals = forceShow ? true : forceHide ? false : !withoutDecimalGlobal;
|
|
20153
|
+
var _b = __read$9((value || '').split(','), 2), ent = _b[0], _c = _b[1], dec = _c === void 0 ? '00' : _c;
|
|
20154
|
+
if (showDecimals) {
|
|
20155
|
+
if (dec.length > 2)
|
|
20156
|
+
dec = dec.slice(0, 2);
|
|
20157
|
+
return ent + "," + dec;
|
|
20158
|
+
}
|
|
20159
|
+
else {
|
|
20160
|
+
return ent;
|
|
20131
20161
|
}
|
|
20132
|
-
return valueTransform;
|
|
20133
20162
|
};
|
|
20134
20163
|
ecCurrencySymbolPipe.ctorParameters = function () { return [
|
|
20135
20164
|
{ type: ProductsService },
|