(window.webpackJsonp=window.webpackJsonp||[]).push([[10,100,133],{295:function(t,e,r){"use strict";r.r(e);var o=r(0),n=r(2);r(8),r(35),r(10);function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,o)}return r}function d(t){for(var e=1;e({items:[],pagination:{},fetching:!0,itemCreatedMessage:"¡Enviado correctamente!",itemUpdatedMessage:"¡Actualizado correctamente!"}),watchQuery:["page","s"],methods:{onItemCreated(data){this.$notify(this.itemCreatedMessage),this.items.unshift(data),this.items.length>this.pagination.per_page&&(this.pagination.current_page===this.pagination.last_page&&this.pagination.last_page++,this.items.splice(this.items.length-1,1))},onItemUpdated(t){var{item:e,data:data}=t;this.$notify(this.itemUpdatedMessage),Object.assign(e,data)},onItemDeleted(t){var{item:e,index:r}=t;this.pagination.total--,this.items.splice(r,1);var{current_page:o,last_page:n,per_page:l}=this.pagination;o===n&&this.pagination.to--,o1&&this.updateQueryString(d(d({},this.$route.query),{},{page:o-1}))},onPaginate(t){var e;this.fetching="start"===t.status,null!==(e=t.data)&&void 0!==e&&e.data&&(this.items=t.data.data,this.pagination=t.data.meta)},updateQueryString(t){var e=arguments,r=this;return Object(o.a)(function*(){var o={};for(var n of t=Array.isArray(t)?t:[...e])"object"==typeof n?Object.assign(o,n):o[n]=r[n]||void 0;r.fetching=!0;try{yield r.$router.push({name:r.$route.name,query:o})}catch(t){}})()},fetchItems(t){var e=this;return Object(o.a)(function*(){e.fetching=!0;try{var data=yield e.$axios.$get(e.serverAction,{params:t});e.items=data.data,e.pagination=data.meta}catch(t){}e.fetching=!1})()}}}},307:function(t,e,r){"use strict";r.r(e);r(19),r(14),r(29);var o=r(0),n=(r(43),r(4)),l=r(22),d=r(60),c={props:{order:{type:Object,default:()=>({})}},data:()=>({items:[],giftPreimumDiscounts:[],payment:{},giftCard:{},fetching:!1,headers:[{text:"Producto",value:"detalle",sortable:!1},{text:"Cantidad",value:"cantidad",sortable:!1,align:"center"},{text:"Costo",value:"cantidad",sortable:!1,align:"center"},{text:"Total",value:"total",sortable:!1,align:"end",styles:"text-align: end !important;"}],OFFER_TYPES:l.a.OFFER_TYPES}),computed:{summaryHeaders(){var t=[{title:"Subtotal",amount:this.subtotal+this.freight},{title:"Total Neto",amount:this.untaxedTotal},{title:"IVA (19.0%)",amount:this.iva},{title:"Propina",amount:this.tip},{title:"Total a Pagar",amount:this.total,styles:"border-top: rgb(0, 23, 50) 5px solid;"}];return this.giftCardAmount&&t.splice(1,0,{title:"Tarjeta de regalo",amount:this.giftCardAmount}),this.discount&&t.splice(this.giftCardAmount?2:1,0,{title:"Descuento",amount:this.discount}),t},priceKeys(){var t=this.isPriceList;return{price:t?"priceListPrice":"price",offerPrice:t?"pl_offer_price":"preciooferta",hasOffer:t?"hasPriceListOffer":"hasOffer",is2x1Offer:t?"priceListOfferIs2X1":"offerIs2X1",offerType:t?"pl_offer_type":"tipooferta",offerTag:p=>p.preferences[t?"pl_offer_tag":"offer_tag"]}},iva(){return.19*this.untaxedTotal},total(){return this.untaxedTotal+this.tip+this.iva},untaxedTotal(){return(this.subtotal-this.discount+this.freight+this.giftCardAmount)/1.19},subtotal(){return this.items.reduce((t,e)=>t+this.quantity(e)*e.precio,0)},tip(){var t,e;return null!==(t=null===(e=this.order)||void 0===e?void 0:e.propina)&&void 0!==t?t:0},freight(){var t,e;return null!==(t=null===(e=this.order)||void 0===e?void 0:e.freight)&&void 0!==t?t:0},giftCardAmount(){return this.giftCard.amount||0},discount(){var t,e,r,o,n,l,c=null!==(t=this.order)&&void 0!==t?t:{};return d.a.orderDiscount({subtotal:null!==(e=null==c?void 0:c.total_wo_offers)&&void 0!==e?e:0,fixedPoints:null!==(r=c.fixed_points)&&void 0!==r?r:0,percentagePoints:null!==(o=c.percentage_points)&&void 0!==o?o:0,coupon:{scope:"global",type:c.discount_type,value:null!==(n=c.discount_value)&&void 0!==n?n:0,limit:null!==(l=c.discount_limit_value)&&void 0!==l?l:0}})},orderEmail(){var t;return Object(n.p)((null===(t=this.order)||void 0===t?void 0:t.email)||"")},orderId(){var t,e;return(null===(t=this.order)||void 0===t?void 0:t.registro)||(null===(e=this.order)||void 0===e?void 0:e.id)},orderStatus(){var t=[{value:"pending",label:"PENDIENTE",color:"blue",icon:"fas fa-history"},{value:"denied",label:"CANCELADO",color:"red",icon:"fa fa-times-circle-o"},{value:"billed",label:"PAGADO",color:"green",icon:"fas fa-check-circle"},{value:"cancelled",label:"ANULADO",color:"amber",icon:"fas fa-times-circle"},{value:"not_processed",label:"SIN PROCESAR",color:"teal",icon:"fa fa-refresh"}].filter(t=>{var e;return t.value===(null===(e=this.order)||void 0===e?void 0:e.status)});return t},method(){var t,e;return null!==(t=null===(e=this.order)||void 0===e?void 0:e.medio_pago)&&void 0!==t?t:""},paidWith(){return"flow"===this.method||"etpay"===this.method},isCartPage(){return this.routeIs("cart")},isAdminPage(){return this.routeIs("admin.orders")||this.routeIs("admin.discounts")||this.routeIs("admin.corporate-discounts")},isMobile(){return this.$isMobile()},isPriceList(){return this.routeIs("price-list.cart")},isGiftPreimumDiscounts(){return Object(n.i)(this.giftPreimumDiscounts)}},watch:{order(t){t&&(t.items?this.setData(t):this.fetchItems())}},created(){this.order.items?this.setData(this.order):this.fetchItems()},methods:{close(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.$emit("close",this.items.map(t=>({codigo:t.codigo,cantidad:t.cantidad}))):this.$emit("close",this.order),this.items=[],this.payment={},this.giftCard={},this.giftPreimumDiscounts=[]},fetchItems(){var t=this;return Object(o.a)(function*(){t.fetching=!0;try{var e=t.isAdminPage?"admin/orders":"orders",{data:r}=yield t.$axios.get("/".concat(e,"/").concat(t.orderId));t.setData(r)}catch(t){}t.fetching=!1})()},setData(t){var e,r;this.items=t.items,this.payment=t.payment,this.giftCard=null!==(e=t.giftCard)&&void 0!==e?e:{},this.giftPreimumDiscounts=null!==(r=t.gifts)&&void 0!==r?r:[]},quantity:t=>t.cantidadMath.round(100*(1-t/e)),hasOffer(t,e){var r=(new Date).getTime(),o=t=>new Date(t).getTime();return!t.product.agotado&&t.product.oferta&&t.product.iniciooferta&&t.product.venceoferta&&(this.offerIs2X1(t)||t.product.tipooferta===this.OFFER_TYPES.percentage||t.product.tipooferta===this.OFFER_TYPES.fixed_amount&&t.product.preciooferta=r},offerIs2X1(t){return t.product.tipooferta===this.OFFER_TYPES.fixed_amount&&t.product.is_2x1&&t.product.offer_2x1_value>1}}},v=c,_=(r(672),r(1)),component=Object(_.a)(v,function(){var t,e,r,o,n,l=this,d=l._self._c;return d("v-card",{attrs:{loading:l.fetching}},[d("v-toolbar",{attrs:{dense:"",flat:""}},[d("v-spacer"),l._v(" "),d("v-tooltip",{attrs:{bottom:""},scopedSlots:l._u([{key:"activator",fn:function(t){var{on:e}=t;return[d("v-btn",l._g({attrs:{fab:"",small:"",dark:"",color:"red",disabled:l.fetching},on:{click:function(t){return l.close()}}},e),[d("v-icon",[l._v("\n fas fa-times\n ")])],1)]}}])},[l._v(" "),d("span",[l._v("Cerrar")])])],1),l._v(" "),d("v-card-text",{staticClass:"text-center"},[d("v-icon",{attrs:{size:"90",color:null===(t=l.orderStatus[0])||void 0===t?void 0:t.color},domProps:{textContent:l._s(null===(e=l.orderStatus[0])||void 0===e?void 0:e.icon)}}),l._v(" "),d("h2",{staticClass:"black--text",domProps:{textContent:l._s(l.paidWith&&l.isCartPage||"billed"!=(null===(r=l.orderStatus[0])||void 0===r?void 0:r.value)?"COMPRA CON PAGO ".concat(null===(o=l.orderStatus[0])||void 0===o?void 0:o.label):"COMPRA REALIZADA CON EXITO ")}}),l._v(" "),l.isAdminPage?l._e():d("P",{staticClass:"mb-0 black--text"},[l._v("\n "+l._s(l.paidWith&&l.isCartPage?"Debe realizar el pago para poder finalizar la compra ":" Tu compra ha sido realizada con exito")+"\n !enviamos un correo electronico a "+l._s(l.orderEmail)+"!\n ")]),l._v(" "),l.isAdminPage?l._e():d("v-toolbar",{attrs:{flat:"",dense:""}},[d("v-spacer"),l._v(" "),d("v-toolbar-title",[d("strong",{staticClass:"colorTitle",class:l.isMobile?"text-subtitle-1 font-weight-bold":""},[l._v("\n Resumen del Pedido\n ")])]),l._v(" "),d("v-spacer")],1),l._v(" "),d("v-divider"),l._v(" "),l.order?d("v-row",{staticClass:"my-2"},[d("v-col",{staticClass:"mb-0 py-0",attrs:{cols:"12"}},[d("strong",{staticClass:"grey--text"},[l._v("\n Número de orden:\n ")]),l._v(" "),d("strong",{staticClass:"colorTitle",domProps:{textContent:l._s(l.orderId)}}),l._v(" "),d("strong",{staticClass:"red--text"},[l._v("\n "+l._s(l.str_to_date(l.order.created_at))+"\n ")]),l._v(" "),d("v-divider")],1),l._v(" "),d("v-col",{staticClass:"text-left py-0",attrs:{cols:"12"}},[d("strong",{staticClass:"grey--text"},[l._v("\n Fecha del entrega:\n ")]),l._v(" "),d("strong",{staticClass:"orange--text text-uppercase",domProps:{textContent:l._s(l.str_to_date(l.order.fechaent))}}),l._v(" "),d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n Datos Personales\n ")]),l._v(" "),d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n NOMBRE:\n ")]),l._v(" "),d("strong",{staticClass:"colorTitle text-uppercase",domProps:{textContent:l._s(l.order.cliente)}}),l._v(" "),d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n RUT:\n ")]),l._v(" "),d("strong",{staticClass:"colorTitle",domProps:{textContent:l._s(l.order.rut)}}),l._v(" "),d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n TELEFONO:\n ")]),l._v(" "),d("strong",{staticClass:"colorTitle",domProps:{textContent:l._s(l.order.telefono)}}),l._v(" "),d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n CORREO:\n ")]),l._v(" "),d("strong",{staticClass:"colorTitle",domProps:{textContent:l._s(l.order.email)}}),l._v(" "),d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n Datos de Envío\n ")]),l._v(" "),d("br"),l._v(" "),d("strong",{staticClass:"colorTitle text-lowercase"},[l._v("\n "+l._s(l.order.region)+", "+l._s(l.order.comunaenvio)+", "+l._s(null===(n=l.order.direccionenvio)||void 0===n?void 0:n.replace(/[0-9]+/g,""))+", "+l._s(l.order.n_dpto)+"\n ")]),l._v(" "),l.order.dpto?[d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n Casa o Dpto:\n ")]),l._v(" "),d("strong",{staticClass:"colorTitle text-lowercase"},[l._v("\n "+l._s(l.order.dpto)+",\n ")])]:l._e(),l._v(" "),l.order.edificio?[d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n Edificio:\n ")]),l._v(" "),d("strong",{staticClass:"colorTitle text-lowercase"},[l._v("\n "+l._s(l.order.edificio)+"\n ")])]:l._e(),l._v(" "),l.order.condominioenvio?[d("br"),l._v(" "),d("strong",{staticClass:"grey--text"},[l._v("\n Condominio:\n ")]),l._v(" "),d("strong",{staticClass:"colorTitle text-lowercase"},[l._v("\n "+l._s(l.order.condominioenvio)+"\n ")])]:l._e(),l._v(" "),d("br"),l._v(" "),l.order.punto_referencia?d("strong",{staticClass:"grey--text"},[l._v("\n Instrucciones:\n ")]):l._e(),l._v(" "),d("br"),l._v(" "),d("strong",{staticClass:"colorTitle text-lowercase",domProps:{textContent:l._s(l.order.punto_referencia)}})],2)],1):l._e(),l._v(" "),l.isAdminPage?d("v-toolbar",{attrs:{flat:"",dense:""}},[d("v-spacer"),l._v(" "),d("v-toolbar-title",[d("strong",{staticClass:"colorTitle"},[l._v("\n Resumen del Pedido\n ")])]),l._v(" "),d("v-spacer")],1):l._e(),l._v(" "),d("v-data-table",{staticClass:"elevation-1",attrs:{dense:"",items:l.items,headers:l.headers,"hide-default-footer":"","loading-text":"Cargando Información"},scopedSlots:l._u([{key:"body",fn:function(){return[d("tbody",[l._l(l.items,function(t){return d("tr",{key:t.id},[d("td",{staticStyle:{"text-align":"initial",padding:"0 5px"},attrs:{width:l.isMobile?200:""}},[l._v("\n "+l._s(t.detalle)+"\n "),t.presentation&&"SIN PRESENTACION"!==t.presentation.nombre?d("div",[l._v("\n ("+l._s(t.presentation.nombre)+")\n ")]):l._e(),l._v(" "),null!=t&&t.oferta&&l.quantity(t)>=(null==t?void 0:t.cant_min_oferta)?d("v-chip",{staticClass:"font-weight-bold",attrs:{"x-small":"",color:"pink","text-color":"white"}},[t.is_2x1?d("strong",[l._v("\n "+l._s(t.offer_2x1_value)+"x1\n ")]):1===t.tipooferta?d("strong",[l._v("\n - "+l._s(t.preciooferta)+"%\n ")]):d("strong",[l._v("\n - "+l._s(l.percentage(t.preciooferta,t.original_price))+"%\n ")])]):l._e()],1),l._v(" "),d("td",{staticStyle:{padding:"0 5px"},attrs:{width:l.isMobile?50:""}},[l._v("\n "+l._s(l.quantity(t))+" "+l._s(t.unidad)+"\n ")]),l._v(" "),d("td",{staticStyle:{padding:"0 5px"},attrs:{width:l.isMobile?50:""}},[l._v("\n "+l._s(l.$toCurrency(t.precio))+"\n ")]),l._v(" "),d("td",{staticStyle:{"text-align":"end !important",padding:"0 5px"}},[l._v("\n "+l._s(l.$toCurrency(l.quantity(t)*t.precio))+"\n ")])])}),l._v(" "),l.isGiftPreimumDiscounts?l._l(l.giftPreimumDiscounts,function(t){return d("tr",{key:t.name},[d("td",{staticStyle:{"text-align":"initial",padding:"0 5px"},attrs:{width:l.isMobile?200:""}},[l._v("\n "+l._s(t.name)+"\n ")]),l._v(" "),d("td",{staticStyle:{padding:"0 5px"},attrs:{width:l.isMobile?50:""}},[l._v("\n "+l._s(t.qty)+"\n ")]),l._v(" "),d("td",{staticStyle:{"text-align":"end !important",padding:"0 5px"}},[d("v-chip",{staticClass:"font-weight-bold",attrs:{"x-small":"",color:"pink","text-color":"white"}},[d("strong",[l._v("\n Gratis\n ")])])],1)])}):l._e(),l._v(" "),l.freight>0?d("tr",[d("td",{staticStyle:{"text-align":"initial",padding:"0 5px"},attrs:{width:l.isMobile?200:""}},[d("v-icon",{staticClass:"mr-1",attrs:{small:"",color:"primary"}},[l._v("fas fa-shipping-fast")]),l._v("\n Costo de Envío\n "),d("div",{staticClass:"text-caption grey--text"},[l._v("\n (Despacho a domicilio)\n ")])],1),l._v(" "),d("td",{staticStyle:{padding:"0 5px"},attrs:{width:l.isMobile?50:""}},[l._v("\n 1 UN\n ")]),l._v(" "),d("td",{staticStyle:{padding:"0 5px"},attrs:{width:l.isMobile?50:""}},[l._v("\n "+l._s(l.$toCurrency(l.freight))+"\n ")]),l._v(" "),d("td",{staticStyle:{"text-align":"end !important",padding:"0 5px"}},[l._v("\n "+l._s(l.$toCurrency(l.freight))+"\n ")])]):l._e(),l._v(" "),l._l(l.summaryHeaders,function(header,i){return d("tr",{key:"summary_header_".concat(i)},[d("td",{staticClass:"text-right",staticStyle:{padding:"0 5px"},style:header.styles,attrs:{colspan:"3",width:l.isMobile?250:""}},[["Subtotal","Total a Pagar"].includes(header.title)?d("strong",[l._v("\n "+l._s(header.title)+":\n ")]):d("span",[l._v("\n "+l._s(header.title)+":\n "),["Descuento"].includes(header.title)&&l.order.discount_code?d("span",{staticClass:"text-caption font-weight-bold"},[d("br"),l._v("\n Codigo del cupon utilizado:\n ")]):l._e()])]),l._v(" "),d("td",{staticClass:"text-right",staticStyle:{padding:"0 5px"},style:header.styles,attrs:{colspan:"1"}},[["Subtotal","Total a Pagar"].includes(header.title)?d("strong",{domProps:{textContent:l._s(l.$toCurrency(header.amount))}}):d("span",[l._v("\n "+l._s(l.$toCurrency(header.amount))+"\n "),["Descuento"].includes(header.title)&&l.order.discount_code?d("span",{staticClass:"text-caption font-weight-bold"},[d("br"),l._v("\n "+l._s(l.order.discount_code)+"\n ")]):l._e()])])])})],2)]},proxy:!0}])})],1),l._v(" "),d("v-card-actions",[d("v-spacer"),l._v(" "),d("v-btn",{attrs:{dark:"",small:"",disabled:l.fetching,color:"red"},on:{click:function(t){return l.close()}}},[d("strong",[l._v("\n "+l._s(l.paidWith&&l.isCartPage?"Ir a Pagar":"Cerrar")+"\n ")]),l._v("\n  \n "),l.paidWith&&l.isCartPage?d("v-icon",{attrs:{color:"black"}},[l._v("\n fas fa-credit-card\n ")]):l._e()],1),l._v(" "),l.isAdminPage||l.isCartPage?l._e():d("v-btn",{attrs:{dark:"",small:"",color:"green",disabled:l.fetching},on:{click:function(t){return l.close(!0)}}},[d("strong",[l._v("\n Solicitar pedido\n ")])])],1)],1)},[],!1,null,null,null);e.default=component.exports},392:function(t,e,r){"use strict";r.r(e);var o=r(0),n=r(4),l=r(681),d=r(307),c=r(295),v=r(87),_={components:{OrderDetails:d.default},mixins:[c.default,v.default],props:{discount:{type:Object,required:!0}},data:t=>({serverAction:"/admin/corporate-discounts/".concat(t.discount.id,"/orders"),today:n.C,exporting:!1,viewOrder:!1,items:[],orderData:{},form:t.$vform.make({init_date:null,end_date:null}),headers:[{text:"Pedido",value:"id"},{text:"Fecha",value:"created_at"},{text:"Nombre",value:"cliente"},{text:"Descuento",value:"discount_value"},{text:"Total",value:"total"}]}),fetch(){this.fetchItems()},watch:{"form.init_date"(t){this.submit()},"form.end_date"(t){this.submit()}},methods:{submit(){this.form.init_date&&this.form.end_date&&this.$nextTick(()=>this.fetchItems())},fetchItems(){var t=this;return Object(o.a)(function*(){t.fetching=!0;try{var{data:{data:e,meta:r}}=yield t.$axios.get(t.serverAction,{params:{init_date:t.form.init_date,end_date:t.form.end_date}});t.items=e.map(t=>new l.a(t)),t.pagination=r}catch(t){}finally{t.fetching=!1}})()},onPaginate(t){var e;this.fetching="start"===t.status,null!==(e=t.data)&&void 0!==e&&e.data&&(this.items=t.data.data.map(t=>new l.a(t)),this.pagination=t.data.meta)},generateReport(t){var e=this;return Object(o.a)(function*(){e.exporting=!0;try{var r=yield e.$axios.get(e.serverAction,{responseType:"blob",params:{init_date:e.form.init_date,end_date:e.form.end_date,format:t}});Object(n.e)(r)}catch(t){}e.exporting=!1})()},openOrder(t){this.viewOrder=!0,this.orderData=t},closeOrder(){this.viewOrder=!1,this.orderData={}}}},h=r(1),component=Object(h.a)(_,function(){var t=this,e=t._self._c;return e("div",[e("v-row",{attrs:{justify:"center"}},[e("v-col",{attrs:{cols:"12",md:"3",lg:"2"}},[e("input-label",{attrs:{text:"Desde",icon:"fa-asterisk"}}),t._v(" "),e("app-date-input",{attrs:{clearable:"","hide-details":"auto",disabled:t.form.busy,"persistent-hint":"",hint:"Si no se ingresa una fecha se exportaran todos los registro","date-picker-options":{max:t.today},error:t.form.errors.has("init_date"),"error-messages":t.form.errors.get("init_date")},model:{value:t.form.init_date,callback:function(e){t.$set(t.form,"init_date",e)},expression:"form.init_date"}})],1),t._v(" "),e("v-col",{attrs:{cols:"12",md:"3",lg:"2"}},[e("input-label",{attrs:{text:"Hasta",icon:"fa-asterisk"}}),t._v(" "),e("app-date-input",{attrs:{clearable:"","hide-details":"auto",disabled:t.form.busy,"persistent-hint":"",hint:"Si no se ingresa una fecha se exportaran todos los registro","date-picker-options":{max:t.today},error:t.form.errors.has("end_date"),"error-messages":t.form.errors.get("end_date")},model:{value:t.form.end_date,callback:function(e){t.$set(t.form,"end_date",e)},expression:"form.end_date"}})],1),t._v(" "),t.items.length?e("v-col",{attrs:{cols:"12",md:"3",lg:"2"}},[e("br"),t._v(" "),e("v-btn",{attrs:{dark:"",block:"",color:"green",loading:t.exporting},on:{click:function(e){return t.generateReport("xlsx")}}},[e("v-icon",{staticClass:"mr-1"},[t._v("fas fa-file-excel")]),t._v("\n  \n "),e("strong",[t._v("\n Exportar a Excel\n ")])],1)],1):t._e()],1),t._v(" "),e("app-data-table",{attrs:{name:"corporate-discount-orders",actions:[],items:t.items,headers:t.headers,loading:t.fetching,pagination:t.pagination,"hide-input-search":"",heading:"Reporte de uso","pagination-strategy":"fetch","server-action":t.serverAction},on:{paginating:t.onPaginate},scopedSlots:t._u([{key:"item.created_at",fn:function(e){var{item:r}=e;return[t._v("\n "+t._s(t.str_to_date(r.created_at,"created_at"))+"\n ")]}},{key:"item.discount_value",fn:function(r){var{item:o}=r;return[e("strong",[t._v("\n "+t._s(o.discount_value)+"%\n ")])]}},{key:"item.total",fn:function(r){var{item:o}=r;return[e("strong",{domProps:{textContent:t._s(t.$toCurrency(o.paymentAmount))}})]}},{key:"append-actions",fn:function(r){var{item:o}=r;return[e("v-tooltip",{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var{on:n}=r;return[e("v-btn",t._g({attrs:{small:"",icon:"",color:"amber",disabled:t.fetching},on:{click:function(e){return t.openOrder(o)}}},n),[e("v-icon",[t._v("fa-eye")])],1)]}}],null,!0)},[t._v(" "),e("span",[t._v("Ver Pedido")])])]}}],null,!0)}),t._v(" "),e("v-dialog",{attrs:{width:t.$isMobile()?"100%":"60%"},model:{value:t.viewOrder,callback:function(e){t.viewOrder=e},expression:"viewOrder"}},[0!==Object.entries(t.orderData).length?e("order-details",{attrs:{order:t.orderData},on:{close:t.closeOrder}}):t._e()],1)],1)},[],!1,null,null,null);e.default=component.exports},666:function(t,e,r){t.exports={}},672:function(t,e,r){"use strict";r(666)},681:function(t,e,r){"use strict";r.d(e,"a",function(){return o});r(8),r(10);class o{constructor(data){for(var t of Object.keys(data))this[t]=data[t]}get statusLabel(){var t;return null===(t=o.STATUSES[this.status])||void 0===t?void 0:t.label}get isBilled(){return this.status===o.STATUSES.billed.value}get isCancelled(){return this.status===o.STATUSES.cancelled.value}get isPending(){return this.status===o.STATUSES.pending.value}get isNotProcessed(){return this.status===o.STATUSES.not_processed.value}get paymentAmount(){return Math.round(this.untaxedTotal)+this.propina+this.iva}get iva(){return.19*this.untaxedTotal}get untaxedTotal(){var t,e,r=null!==(t=null===(e=this.giftCard||this.gift_card)||void 0===e?void 0:e.amount)&&void 0!==t?t:0;return(this.total-this.discountAmount+r+this.freight)/1.19}get discountAmount(){if(!this.discount_value&&!this.fixed_points&&!this.percentage_points)return 0;var t=this.calculateDiscountAmount();return this.discount_limit_value>0&&t>this.discount_limit_value?this.discount_limit_value:t}calculateDiscountAmount(){var t=1===this.discount_type?this.total_wo_offers*this.discount_value/100+this.fixed_points:this.discount_value+this.fixed_points;return!t&&this.percentage_points?this.total_wo_offers*this.percentage_points/100:this.percentage_points?t+this.total_wo_offers*this.percentage_points/100:t}}o.STATUSES=Object.freeze({pending:{value:"pending",label:"Pendiente"},denied:{value:"denied",label:"Cancelado"},billed:{value:"billed",label:"Pagado"},cancelled:{value:"cancelled",label:"Anulado"},not_processed:{value:"not_processed",label:"Sin procesar"}})}}]);