whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> /home/qbizpnmr/arif.umairtax.com/public/InvoiceSlider-C-0dW-62.js
import{u as R,a as q,f as D,bo as le,j as s,l as c,bp as O,bq as h,i as u,br as te,bs as ee,Z as U,w as oe,I as de,J as ae,K as ie,a9 as ce,Y as me,bt as ue,g as xe,p as H,bu as he,d as pe,bv as be,b as Y,bw as je,bx as fe,by as m,aA as P,aO as ge,bz as _e,bA as Ce,bf as $e,a$ as ye,bB as Ne,b1 as ke,b2 as we,R as Te,N as Se,D as Ee,h as se,bC as Pe,aH as Re,bD as Be,bE as Ae,bj as v,bF as ze,r as I,e as L,H as B,bG as Fe}from"./bundle.OlIVtvc7.js";import{u as He}from"./Actions-qiDN9dzt.js";import{P as Ie}from"./PaymentStatus-z209A_tu.js";import{I as Le}from"./InvoiceStatus-BkeECTVy.js";import{E as qe}from"./EmailRecord-DsIG6Q4V.js";import{C as De}from"./CloudPlay-C_FtsbNl.js";import{H as Oe}from"./History-C-yFGmPI.js";function Ge(d){const{expenseId:n}=d,[e]=R(),i=q(),{dateFormat:t}=D(),{data:r}=le({id:n});return s.jsx(s.Fragment,{children:r&&s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsxs("span",{className:"text-sm",style:{color:i.$3},children:[c(r.date,t)," -"]}),s.jsx("span",{className:"text-sm",style:{color:i.$3},children:e("expense")}),s.jsx("div",{children:s.jsx(O,{color:i.$17,size:"1.1rem"})}),s.jsxs(h,{to:u("/expenses/:id/edit",{id:n}),children:["# ",r.number]})]})})}function Ve(d){const{taskId:n}=d,[e]=R(),i=q(),{dateFormat:t}=D(),{data:r}=te({id:n});return s.jsx(s.Fragment,{children:r&&s.jsxs("div",{className:"flex items-center space-x-1",children:[r.date&&s.jsxs("span",{className:"text-sm",style:{color:i.$3},children:[c(r.date,t)," -"]}),s.jsx("span",{className:"text-sm",style:{color:i.$3},children:e("task")}),s.jsx("div",{children:s.jsx(O,{color:i.$17,size:"1.1rem"})}),s.jsxs(h,{to:u("/tasks/:id/edit",{id:n}),children:["# ",r.number]})]})})}const Me=ee(null),Qe=ee(!1);se.extend(Fe);const X=B.div` background-color: ${({theme:d})=>d.backgroundColor}; &:hover { background-color: ${({theme:d})=>d.hoverBackgroundColor}; } `,We=B.div` background-color: ${({theme:d})=>d.backgroundColor}; &:hover { background-color: ${({theme:d})=>d.hoverBackgroundColor}; } `,Ke=B.div` background-color: ${({theme:d})=>d.backgroundColor}; &:hover { background-color: ${({theme:d})=>d.hoverBackgroundColor}; } `,Ze=B.div` background-color: ${({theme:d})=>d.backgroundColor}; &:hover { background-color: ${({theme:d})=>d.hoverBackgroundColor}; } `;function Je(){const[d]=R();return n=>{var t,r,p,$,y,N,j,k,w,f,T,b,S,g;let e=v(`activity_${n.activity_type_id}`,{});n.activity_type_id===10&&n.client&&(e=v("activity_10_online",{}).replace(":contact",":client")),n.activity_type_id===54&&n.client&&(e=e.replace(":user",":client"));const i={client:s.jsx(h,{to:u("/clients/:id",{id:(t=n.client)==null?void 0:t.hashed_id}),children:(r=n.client)==null?void 0:r.label}),user:((p=n.user)==null?void 0:p.label)??d("system"),invoice:s.jsx(h,{to:u("/invoices/:id/edit",{id:($=n.invoice)==null?void 0:$.hashed_id}),children:(y=n==null?void 0:n.invoice)==null?void 0:y.label}),recurring_invoice:s.jsx(h,{to:u("/recurring_invoices/:id/edit",{id:(N=n==null?void 0:n.recurring_invoice)==null?void 0:N.hashed_id}),children:(j=n==null?void 0:n.recurring_invoice)==null?void 0:j.label}),contact:s.jsx(h,{to:u("/clients/:id/edit",{id:(k=n==null?void 0:n.contact)==null?void 0:k.hashed_id}),children:(w=n==null?void 0:n.contact)==null?void 0:w.label}),notes:(n==null?void 0:n.notes)&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"'",n==null?void 0:n.notes,"'"]}),payment_amount:(f=n==null?void 0:n.payment_amount)==null?void 0:f.label,payment:s.jsx(h,{to:u("/payments/:id/edit",{id:(T=n==null?void 0:n.payment)==null?void 0:T.hashed_id}),children:(b=n==null?void 0:n.payment)==null?void 0:b.label}),credit:s.jsx(h,{to:u("/credits/:id/edit",{id:(S=n==null?void 0:n.credit)==null?void 0:S.hashed_id}),children:(g=n==null?void 0:n.credit)==null?void 0:g.label})};for(const[A,z]of Object.entries(i))e=ze(e,`:${A}`,()=>z);return e}}function ns(){var V,M,Q,W,K,Z,J;const[d,n]=U(Qe),[e,i]=U(Me),[t]=R(),r=q(),p=oe(),$=de(),y=ae(),N=ie({withTimezone:!0,formatOnlyDate:!0}),j=ce(),k=me(),w=ue(),f=xe(),T=Je(),[b,S]=H.useState(!1),[g,A]=H.useState([]),z=he(),E=pe(),re=He({showCommonBulkAction:!0,showEditAction:!0}),{timeFormat:G}=be(),{dateFormat:x}=D(),{data:o}=Y({queryKey:["/api/v1/invoices",e==null?void 0:e.id,"payments"],queryFn:()=>I("GET",L(`/api/v1/invoices/${e==null?void 0:e.id}?include=payments,activities.history&reminder_schedule=true&show_schedule=true`)).then(l=>l.data.data),enabled:e!==null&&d,staleTime:1/0}),ne=async()=>{const l=await z.fetchQuery(["/api/v1/invoices",e==null?void 0:e.id,"emailHistory"],()=>I("POST",L("/api/v1/emails/entityHistory"),{entity:"invoice",entity_id:e==null?void 0:e.id}),{staleTime:1/0}).then(a=>a.data);A(l)},{data:F}=Y({queryKey:["/api/v1/activities/entity",e==null?void 0:e.id],queryFn:()=>I("POST",L("/api/v1/activities/entity"),{entity:"invoice",entity_id:e==null?void 0:e.id}).then(l=>l.data.data),enabled:e!==null&&d,staleTime:1/0});return H.useEffect(()=>{e&&ne()},[e]),s.jsx(je,{visible:d,onClose:()=>{n(!1),i(null)},size:"regular",title:`${t("invoice")} ${e==null?void 0:e.number}`,topRight:e&&(k("edit_invoice")||w(e))?s.jsx(Ae,{label:t("actions"),resource:e,actions:re}):null,withoutActionContainer:!0,withoutHeaderBorder:!0,children:s.jsxs(fe,{tabs:[t("overview"),t("history"),t("activity"),t("email_history")],width:"full",withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"px-6",children:[s.jsx(m,{className:"border-b border-dashed",leftSide:t("invoice_amount"),pushContentToRight:!0,withoutWrappingLeftSide:!0,noExternalPadding:!0,style:{borderColor:r.$20},children:e?E(e==null?void 0:e.amount,(V=e.client)==null?void 0:V.country_id,(M=e.client)==null?void 0:M.settings.currency_id):null}),s.jsx(m,{className:"border-b border-dashed",leftSide:t("balance_due"),pushContentToRight:!0,withoutWrappingLeftSide:!0,noExternalPadding:!0,style:{borderColor:r.$20},children:e?E(e.balance,(Q=e.client)==null?void 0:Q.country_id,(W=e.client)==null?void 0:W.settings.currency_id):null}),s.jsx(m,{className:"border-b border-dashed",leftSide:t("date"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:r.$20},children:e?c(e==null?void 0:e.date,x):null}),s.jsx(m,{className:"border-b border-dashed",leftSide:t("due_date"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:r.$20},children:e?c(e.due_date,x):null}),s.jsx(m,{leftSide:t("status"),pushContentToRight:!0,noExternalPadding:!0,children:e?s.jsx(Le,{entity:e}):null})]}),s.jsx(P,{withoutPadding:!0,borderColor:r.$20}),s.jsxs("div",{className:"flex space-x-4 items-center justify-center px-6 py-5",children:[s.jsxs(X,{className:"flex flex-col items-center justify-center space-y-2 shadow-sm border px-14 py-5 cursor-pointer rounded-md",onClick:()=>e?ge(e):null,style:{borderColor:r.$20},theme:{backgroundColor:r.$1,hoverBackgroundColor:r.$4},children:[s.jsx(De,{color:r.$17,filledColor:r.$17,size:"1.3rem"}),s.jsx("span",{className:"font-medium whitespace-nowrap",style:{color:r.$3},children:t("view_portal")})]}),e?s.jsxs(X,{className:"flex flex-col items-center justify-center space-y-2 shadow-sm border px-14 py-5 cursor-pointer rounded-md",onClick:()=>{navigator.clipboard.writeText(Ce(e)??""),$e.success("copied_to_clipboard",{value:""})},style:{borderColor:r.$20},theme:{backgroundColor:r.$1,hoverBackgroundColor:r.$4},children:[s.jsx(_e,{color:r.$17,filledColor:r.$17,size:"1.3rem"}),s.jsx("span",{className:"font-medium whitespace-nowrap",style:{color:r.$3},children:t("copy_link")})]}):null]}),s.jsx(P,{withoutPadding:!0,borderColor:r.$20}),e&&e.next_send_date?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2 whitespace-nowrap px-6",children:[s.jsx(ye,{size:"regular",width:"auto",tooltipElement:s.jsx("article",{className:we("prose prose-sm",{"prose-invert":!(p!=null&&p.dark_mode)}),dangerouslySetInnerHTML:{__html:ke((o==null?void 0:o.reminder_schedule)??"")}}),children:s.jsxs("h3",{className:"flex mt-2 italic",children:[t("reminders")," ",s.jsx(Ne,{className:"mt-1 ml-1"})]})}),s.jsx(m,{className:"border-b border-dashed",leftSide:t("next_send_date"),pushContentToRight:!0,noExternalPadding:!0,withoutWrappingLeftSide:!0,style:{borderColor:r.$20},children:e?N(e.next_send_date,"","",y($(e.client,"timezone_id")).timeZone):null}),s.jsx(m,{className:"border-b border-dashed",leftSide:t("reminder_last_sent"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:r.$20},children:e?c(e.reminder_last_sent,x):null}),e.reminder1_sent?s.jsx(m,{className:"border-b border-dashed",leftSide:t("first_reminder"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:r.$20},children:e?c(e.reminder1_sent,x):null}):null,e.reminder2_sent?s.jsx(m,{className:"border-b border-dashed",leftSide:t("second_reminder"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:r.$20},children:e?c(e.reminder2_sent,x):null}):null,e.reminder3_sent?s.jsx(m,{leftSide:t("third_reminder"),pushContentToRight:!0,noExternalPadding:!0,children:e?c(e.reminder3_sent,x):null}):null]}),s.jsx(P,{withoutPadding:!0,borderColor:r.$20})]}):null,!!((K=o==null?void 0:o.payments)!=null&&K.length)&&s.jsx("div",{className:"flex flex-col space-y-4 px-6 py-5",children:(o==null?void 0:o.payments)&&o.payments.map(l=>l.paymentables.filter(a=>a.invoice_id===(e==null?void 0:e.id)&&a.archived_at===0).map(a=>{var _,C;return s.jsxs(Ze,{className:"flex flex-col items-start justify-center space-y-2 shadow-sm text-sm border p-5 w-full cursor-pointer rounded-md",onClick:()=>{!f("payment",l)&&j(u("/payments/:id/edit",{id:l.id}))},style:{borderColor:r.$20},theme:{backgroundColor:r.$1,hoverBackgroundColor:r.$4},children:[s.jsxs("span",{className:"font-medium",style:{color:r.$3},children:[t("payment")," ",l.number]}),s.jsxs("div",{className:"inline-flex items-center space-x-1",style:{color:r.$17},children:[s.jsx("span",{children:E(a.amount,(_=e==null?void 0:e.client)==null?void 0:_.country_id,(C=e==null?void 0:e.client)==null?void 0:C.settings.currency_id)}),s.jsx("span",{children:"-"}),s.jsx("span",{children:c(a.created_at,x)})]}),s.jsx("div",{children:s.jsx(Ie,{entity:l})})]},l.id)}))}),!!((Z=e==null?void 0:e.line_items)!=null&&Z.some(l=>l.expense_id||l.task_id))&&s.jsx(P,{withoutPadding:!0,borderColor:r.$20}),e&&s.jsx("div",{className:"flex flex-col px-6 py-5",children:e.line_items.map((l,a)=>(l.expense_id||l.task_id)&&s.jsxs(Te.Fragment,{children:[l.expense_id&&s.jsx(Ge,{expenseId:l.expense_id}),l.task_id&&s.jsx(Ve,{taskId:l.task_id})]},a))})]}),s.jsxs("div",{children:[(o==null?void 0:o.activities)&&o.activities.filter(({history:l})=>l==null?void 0:l.id).length===0&&s.jsx(Se,{children:t("api_404")}),!!((J=o==null?void 0:o.activities)!=null&&J.length)&&s.jsx("div",{className:"flex flex-col px-3",children:(o==null?void 0:o.activities)&&o.activities.filter(({history:l})=>l==null?void 0:l.id).map(l=>{var a,_,C;return s.jsxs(We,{className:"flex items-center justify-start p-4 space-x-3 rounded-md cursor-pointer",onClick:()=>j(u("/activities/:id",{id:l.id})),theme:{backgroundColor:r.$1,hoverBackgroundColor:r.$25},children:[s.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:r.$20},children:s.jsx(Oe,{size:"1.3rem",color:r.$16,filledColor:r.$16})}),s.jsxs("div",{className:"flex flex-col items-start space-y-0.5 justify-center",children:[s.jsxs("div",{className:"flex space-x-1 text-sm",children:[s.jsx("span",{style:{color:r.$3},children:e!=null&&e.client?E(l.history.amount,(a=e==null?void 0:e.client)==null?void 0:a.country_id,(_=e==null?void 0:e.client)==null?void 0:_.settings.currency_id):null}),s.jsx("div",{children:s.jsx(O,{color:r.$17,size:"1.1rem"})}),s.jsx(Ee,{to:`/clients/${l.client_id}`,renderSpan:f("client",e==null?void 0:e.client),children:(C=e==null?void 0:e.client)==null?void 0:C.display_name})]}),s.jsxs("div",{className:"flex items-center space-x-1 text-xs",style:{color:r.$17},children:[s.jsx("span",{children:c(l.created_at,`${x} ${G}`)}),s.jsx("span",{children:se.unix(l.created_at).fromNow()})]})]})]},l.id)})})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center border-b px-6 pb-4 justify-between",style:{borderColor:r.$20},children:[s.jsx(Pe,{label:t("comments_only"),checked:b,onValueChange:l=>S(l)}),s.jsx(Re,{entity:"invoice",entityId:o==null?void 0:o.id,label:(o==null?void 0:o.number)||""})]}),s.jsx("div",{className:"flex flex-col pt-3 px-3",children:F==null?void 0:F.filter(l=>b&&l.activity_type_id===141||!b).map(l=>s.jsxs(Ke,{className:"flex space-x-3 p-4 rounded-md flex-1 min-w-0",theme:{backgroundColor:r.$1,hoverBackgroundColor:r.$25},children:[s.jsx("div",{className:"flex items-center justify-center",children:s.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:r.$20},children:s.jsx(Be,{size:"1.3rem",color:r.$16,filledColor:r.$16})})}),s.jsxs("div",{className:"flex flex-col space-y-0.5 flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm",style:{color:r.$3},children:T(l)}),s.jsxs("div",{className:"flex w-full items-center space-x-1 text-xs truncate",style:{color:r.$17},children:[s.jsx("span",{className:"whitespace-nowrap",children:c(l.created_at,`${x} ${G}`)}),s.jsx("span",{children:"-"}),s.jsx("span",{children:l.ip})]})]})]},l.id))})]}),s.jsxs("div",{className:"flex flex-col space-y-2 px-6",children:[!g.length&&s.jsx("span",{className:"text-sm px-4",style:{color:r.$3},children:t("email_history_empty")}),g.map((l,a)=>s.jsx(qe,{className:"py-4",emailRecord:l,index:a,withAllBorders:!0},a))]})]})})}export{ns as I,Qe as a,Me as i,Je as u};
Copyright ©2021 || Defacer Indonesia