whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> //home/qbizpnmr/arif.umairtax.com/public/Payments-Go3Iq7p8.js
import{u as A,a3 as I,j as e,ax as _,ay as R,ac as H,aQ as Q,bs as V,a as O,a9 as W,bv as U,f as K,d as Y,Y as q,bt as Z,g as G,Z as P,b as J,bw as X,bx as ee,by as b,l as k,dp as se,aA as B,i as F,bD as te,bE as ae,H as ne,h as ie,bG as re,r as oe,e as le,L as ce,eq as de,p as w,O as ue,$ as me,Q as pe,k as xe,a4 as T,aC as he,aD as ye,a5 as be,a6 as fe,a7 as je,a8 as D}from"./bundle.OlIVtvc7.js";import{u as Ce,a as ve,d as ge}from"./usePaymentColumns-nJ_NJo1i.js";import{D as ke}from"./DataTableColumnsPicker-BAbL5ze4.js";import{u as L}from"./useActions-5wRXt2Qd.js";import{a as Pe,b as $e}from"./payments-BhlrdSKU.js";import{P as Se}from"./PaymentStatus-z209A_tu.js";import{I as Ne}from"./InvoiceStatus-BkeECTVy.js";import{a as we}from"./CreditStatus-Bi9XtGcq.js";import{u as Te}from"./useGenerateActivityElement-6K_jcbzu.js";import{I as Ee}from"./ImportButton-CbAh905F.js";import"./payment-status-DaLbqgbM.js";import"./invoice-status-We6cAxTk.js";import"./Import-Dp8FQZJ0.js";const Ae=()=>{const[a]=A(),t=Pe(),m=r=>r.every(({client:o})=>o==null?void 0:o.contacts.some(({email:c})=>c)),{setChangeTemplateVisible:p,setChangeTemplateResources:x,setChangeTemplateEntityContext:l}=I();return[({selectedResources:r,selectedIds:o,setSelected:c})=>m(r)&&e.jsx(_,{onClick:()=>{t(o,"email"),c([])},icon:e.jsx(R,{element:H}),children:a("email_payment")}),({selectedResources:r})=>e.jsx(_,{onClick:()=>{p(!0),x(r),l({endpoint:"/api/v1/payments/bulk",entity:"payment"})},icon:e.jsx(R,{element:Q}),children:a("run_template")})]},M=V(null),z=V(!1);ie.extend(re);const E=ne.div` background-color: ${({theme:a})=>a.backgroundColor}; &:hover { background-color: ${({theme:a})=>a.hoverBackgroundColor}; } `;function _e(){var j,C,v,i,g;const[a]=A(),t=O(),m=W(),p=L({showCommonBulkAction:!0,showEditAction:!0}),{timeFormat:x}=U(),{dateFormat:l}=K(),d=Y(),r=q(),o=Z(),c=G(),$=Te(),[s,S]=P(M),[h,f]=P(z),{data:u}=J({queryKey:["/api/v1/activities",s==null?void 0:s.id,"payment"],queryFn:()=>oe("POST",le("/api/v1/activities/entity"),{entity:"payment",entity_id:s==null?void 0:s.id}).then(n=>n.data.data),enabled:s!==null&&h,staleTime:1/0});return e.jsx(X,{size:"regular",visible:h,onClose:()=>{f(!1),S(null)},title:`${a("payment")} ${s==null?void 0:s.number}`,topRight:s&&(r("edit_payment")||o(s))?e.jsx(ae,{label:a("actions"),resource:s,actions:p}):null,withoutActionContainer:!0,withoutHeaderBorder:!0,children:e.jsxs(ee,{tabs:[a("overview"),a("activity")],width:"full",withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"px-6",children:[e.jsx(b,{className:"border-b border-dashed",leftSide:a("payment_amount"),withoutWrappingLeftSide:!0,pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:s?d(s==null?void 0:s.amount,(j=s.client)==null?void 0:j.country_id,s.currency_id):null}),e.jsx(b,{className:"border-b border-dashed",leftSide:a("applied"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:s?d(s.applied,(C=s.client)==null?void 0:C.country_id,s.currency_id):null}),e.jsx(b,{className:"border-b border-dashed",leftSide:a("date"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:s?k(s.date,l):null}),e.jsx(b,{className:"border-b border-dashed",leftSide:a("payment_type"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:s?a(se[s.type_id]):null}),e.jsx(b,{leftSide:a("status"),pushContentToRight:!0,noExternalPadding:!0,children:s?e.jsx(Se,{entity:s}):null})]}),e.jsx(B,{withoutPadding:!0,borderColor:t.$20}),e.jsx("div",{className:"flex flex-col space-y-4 px-6 py-5",children:(v=s==null?void 0:s.invoices)==null?void 0:v.map((n,N)=>{var y;return e.jsxs(E,{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:()=>{!c("invoice",n)&&m(F("/invoices/:id/edit",{id:n.id}))},style:{borderColor:t.$20},theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},children:[e.jsxs("span",{className:"font-medium",style:{color:t.$3},children:[a("invoice")," ",n.number]}),e.jsxs("div",{className:"inline-flex items-center space-x-1",style:{color:t.$17},children:[e.jsx("span",{children:d(n.amount,(y=s.client)==null?void 0:y.country_id,s.currency_id)}),e.jsx("span",{children:"-"}),e.jsx("span",{children:k(n.date,l)})]}),e.jsx("div",{children:e.jsx(Ne,{entity:n})})]},N)})}),!!((i=s==null?void 0:s.credits)!=null&&i.length)&&e.jsx(B,{withoutPadding:!0,borderColor:t.$20}),e.jsx("div",{className:"flex flex-col space-y-4 px-6 py-5",children:(g=s==null?void 0:s.credits)==null?void 0:g.map((n,N)=>{var y;return e.jsxs(E,{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:()=>{!c("credit",n)&&m(F("/credits/:id/edit",{id:n.id}))},style:{borderColor:t.$20},theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},children:[e.jsxs("span",{className:"font-medium",style:{color:t.$3},children:[a("credit")," ",n.number]}),e.jsxs("div",{className:"inline-flex items-center space-x-1",style:{color:t.$17},children:[e.jsx("span",{children:d(n.amount,(y=s.client)==null?void 0:y.country_id,s.currency_id)}),e.jsx("span",{children:"-"}),e.jsx("span",{children:k(n.date,l)})]}),e.jsx("div",{children:e.jsx(we,{entity:n})})]},N)})})]}),e.jsx("div",{children:e.jsx("div",{className:"flex flex-col pt-3 px-3",children:u==null?void 0:u.map(n=>e.jsxs(E,{className:"flex space-x-3 p-4 rounded-md flex-1 min-w-0",theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$25},children:[e.jsx("div",{className:"flex items-center justify-center",children:e.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:t.$20},children:e.jsx(te,{size:"1.3rem",color:t.$16,filledColor:t.$16})})}),e.jsxs("div",{className:"flex flex-col space-y-0.5 flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm",style:{color:t.$3},children:$(n)}),e.jsxs("div",{className:"flex w-full items-center space-x-1 text-xs truncate",style:{color:t.$17},children:[e.jsx("span",{className:"whitespace-nowrap",children:k(n.created_at,`${l} ${x}`)}),e.jsx("span",{children:"-"}),e.jsx("span",{children:n.ip})]})]})]},n.id))})})]})})}function Oe(){ce("payments");const[a]=A(),t=q(),m=G(),p=L(),x=de(),l=Ce(),d=ve(),r=Ae(),o=[{name:a("payments"),href:"/payments"}],[c,$]=w.useState(""),[s,S]=P(M),[h,f]=P(z),{data:u}=$e({id:c,include:"credits"});w.useEffect(()=>{u&&h&&S(u)},[u,h]),w.useEffect(()=>()=>f(!1),[]);const{changeTemplateVisible:j,setChangeTemplateVisible:C,changeTemplateResources:v}=I();return ue({on:"App\\Events\\Payment\\PaymentWasUpdated",callback:()=>me(["payments"])}),e.jsxs(pe,{title:a("payments"),breadcrumbs:o,docsLink:"en/payments/",children:[e.jsx(xe,{resource:"payment",columns:l,endpoint:"/api/v1/payments?include=client,invoices&without_deleted_clients=true&sort=id|desc",linkToCreate:"/payments/create",bulkRoute:"/api/v1/payments/bulk",linkToEdit:"/payments/:id/edit",withResourcefulActions:!0,customActions:p,customFilters:x,customBulkActions:r,customFilterPlaceholder:"status",showRestore:i=>!i.is_deleted,rightSide:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ke,{columns:d,defaultColumns:ge,table:"payment"}),e.jsx(be,{type:"component",component:e.jsx(Ee,{route:"/payments/import"}),guards:[fe(T("create_payment"),T("edit_payment"))]})]}),onTableRowClick:i=>{$(i.id),f(!0)},linkToCreateGuards:[T("create_payment")],hideEditableOptions:!t("edit_payment"),showRestoreBulk:i=>i.every(g=>he(g)===ye.Archived),enableSavingFilterPreference:!0}),!m("payment",s)&&e.jsx(_e,{}),e.jsx(je,{entity:"payment",entities:v,visible:j,setVisible:C,labelFn:i=>e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx(D,{children:a("number")}),e.jsx("span",{children:i.number})]}),bulkLabelFn:i=>e.jsxs("div",{className:"flex space-x-2",children:[e.jsxs(D,{children:[a("number"),":"]}),e.jsx("span",{children:i.number})]}),bulkUrl:"/api/v1/payments/bulk"})]})}export{Oe as default};
Copyright ©2021 || Defacer Indonesia