1import{f as n,h as g,r as _,o as u,c as x,w as N,a as o,l as p,t as v,k as V,m as y,n as A,q as L,s as P}from"./app-zm5yPjOO.js";const S={class:"row mt-2"},T={class:"col-12"},j={key:0,class:"text-muted small mb-3"},W={__name:"ModalConfirmMarkPaid",emits:["confirmed"],setup(D,{expose:k,emit:C}){const M=C,d=n(),s=n([]),l=n(""),i=n(!1),t=n(""),b=g(()=>s.value.reduce((a,e)=>a+(e.commission_amount_in_cents||0),0)),f=g(()=>[...new Set(s.value.map(a=>a.advisor_name))]),h=a=>"$"+P(Math.round((a||0)/100)),w=a=>{var e;s.value=a||[],l.value="",t.value="",(e=d.value)==null||e.Open()},B=async()=>{t.value="",i.value=!0,await axios.post(route("admin.advisors.commissions.markPaid"),{ids:s.value.map(a=>a.id),note:l.value||null}).then(()=>{var a;M("confirmed"),(a=d.value)==null||a.Close()}).catch(a=>{var r,m,c;const e=(r=a.response)==null?void 0:r.data;t.value=((m=e==null?void 0:e.ids)==null?void 0:m[0])||((c=e==null?void 0:e.note)==null?void 0:c[0])||"No se pudieron marcar las comisiones."}).finally(()=>{i.value=!1})};return k({open:w}),(a,e)=>{const r=_("WidgetBanner"),m=_("super-modal");return u(),x(m,{ref_key:"mdlConfirm",ref:d,keyModal:"mdlConfirmMarkPaid",title:"Marcar comisiones como pagadas","accept-title":"SÃ, marcar como pagadas",isLoading:i.value,dissableAccept:i.value||s.value.length===0,heightModal:"auto",widthModal:"520px",onAccept:B},{body:N(()=>[o("div",S,[o("div",T,[o("p",null,[e[1]||(e[1]=p(" Vas a marcar ")),o("b",null,v(s.value.length),1),e[2]||(e[2]=p(" comisión(es) como pagadas por un total de ")),o("b",null,v(h(b.value)),1),e[3]||(e[3]=p(". "))]),f.value.length?(u(),V("p",j," Asesor(es): "+v(f.value.join(", ")),1)):y("",!0),e[4]||(e[4]=o("label",{class:"input-label"},"Nota o referencia del pago (opcional)",-1)),A(o("input",{"onUpdate:modelValue":e[0]||(e[0]=c=>l.value=c),type:"text",class:"form-control",maxlength:"500",placeholder:"Ej: Transferencia Bancolombia 30/09"},null,512),[[L,l.value]]),t.value?(u(),x(r,{key:1,type:"danger",text:t.value,class:"mt-3"},null,8,["text"])):y("",!0)])])]),_:1},8,["isLoading","dissableAccept"])}}};export{W as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.