whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> //home/qbizpnmr/arif.umairtax.com/public/Create-DwMm49-m.js
import{u as x,L as B,a9 as w,bO as E,bP as P,i as g,p as n,d1 as k,j as r,Q as O,d2 as F,bV as L,bW as N,be as Q,bf as l,r as V,e as $,$ as q}from"./bundle.OlIVtvc7.js";/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function A(){const[s]=x();return[{name:s("create"),href:"/clients/create"},{name:s("settings"),href:"/clients/create/settings"},{name:s("documents"),href:"/clients/create/documents"},{name:s("locations"),href:"/clients/create/locations"}]}function H(){var h,_;const{documentTitle:s}=B("new_client"),[t]=x(),v=w(),[S]=E(),y=P(),C=[{name:t("clients"),href:"/clients"},{name:t("new_client"),href:g("/clients/create")}],[a,i]=n.useState(),[d,m]=n.useState(!1),[e,f]=n.useState(),[o,T]=n.useState([{first_name:"",last_name:"",email:"",phone:"",send_email:!1}]),j=A(),{data:u}=k({});n.useEffect(()=>{u&&f({...u.data,group_settings_id:S.get("group")||""})},[u]);const p=async()=>{if(!d){if(Q.set(e,"contacts",o),l.processing(),i(void 0),!((e==null?void 0:e.name)!=""||o[0].first_name!=""||o[0].last_name!=""))return i({message:t("invalid_name // needs translation"),errors:{name:[t("please_enter_a_client_or_contact_name")]}}),l.error(),p;m(!0),await y({excludeToasters:!0}),V("POST",$("/api/v1/clients"),e).then(c=>{l.success("created_client"),q(["clients"]),v(g("/clients/:id",{id:c.data.data.id}))}).catch(c=>{var b;((b=c.response)==null?void 0:b.status)===422&&(i(c.response.data),l.dismiss())}).finally(()=>m(!1))}};return r.jsxs(O,{title:s,breadcrumbs:C,onSaveClick:p,disableSaveButton:d,children:[a?r.jsx(F,{errors:a,entity:"client",withoutTopMessage:!!((h=a.errors)!=null&&h.id),withoutListBullets:!!((_=a.errors)!=null&&_.id)}):null,e&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(L,{tabs:j}),r.jsx(N,{context:{errors:a,setErrors:i,client:e,setClient:f,contacts:o,setContacts:T}})]})]})}export{H as default};
Copyright ©2021 || Defacer Indonesia