Files
docker-invoiceninja/docker/app/public/bundle.5891a157.js
2024-10-19 18:17:42 +00:00

2 lines
2.3 KiB
JavaScript

import{u as L,bJ as w,A as D,cd as N,z as Q,ec as F,j as a,H as R,C as j,c as e,e9 as $,bs as q,cg as C,c6 as i,S as g}from"./bundle.7539e3c6.js";import{C as A}from"./bundle.de201be3.js";import{u as O,I as z,a as B}from"./bundle.62fbe919.js";import{Q as E,a as G}from"./bundle.00005190.js";import{u as H}from"./bundle.bc54e3ad.js";import"./bundle.bc220abc.js";import"./bundle.55eaa298.js";function Y(){const[r]=L(),[y]=w(),l=D(),I=N(),{quote:t,errors:s,isDefaultTerms:v,isDefaultFooter:f,client:c,setIsDefaultFooter:T,setIsDefaultTerms:_,invoiceSum:k}=I,u=Q(),x=H(),P=O(),{handleChange:n,handleInvitationChange:S,handleLineItemChange:m,handleLineItemPropertyChange:d,handleCreateLineItem:h,handleDeleteLineItem:p}=F({client:c});return a(R,{children:[a("div",{className:"grid grid-cols-12 gap-4",children:[a(j,{className:"col-span-12 xl:col-span-4 h-max",withContainer:!0,children:[t&&a("div",{className:"flex space-x-20",children:[e("span",{className:"text-sm",style:{backgroundColor:u.$2,color:u.$3,colorScheme:u.$0},children:r("status")}),e($,{entity:t})]}),e(A,{resource:t,onChange:o=>n("client_id",o),onClearButtonClick:()=>n("client_id",""),onContactCheckboxChange:S,errorMessage:s==null?void 0:s.errors.client_id,textOnly:!0,readonly:!0})]}),e(E,{handleChange:n,errors:s}),e("div",{className:"col-span-12",children:a(q,{tabs:[r("products"),r("tasks")],defaultTabIndex:y.get("table")==="tasks"?1:0,children:[e("div",{children:t&&c?e(C,{type:"product",resource:t,items:t.line_items.filter(o=>o.type_id===i.Product),columns:P,relationType:"client_id",onLineItemChange:m,onSort:o=>n("line_items",o),onLineItemPropertyChange:d,onCreateItemClick:()=>h(i.Product),onDeleteRowClick:p}):e(g,{})}),e("div",{children:t&&c?e(C,{type:"task",resource:t,items:t.line_items.filter(o=>o.type_id===i.Task),columns:x,relationType:"client_id",onLineItemChange:m,onSort:o=>n("line_items",o),onLineItemPropertyChange:d,onCreateItemClick:()=>h(i.Task),onDeleteRowClick:p}):e(g,{})})]})}),e(G,{handleChange:n,errors:s,isDefaultFooter:f,isDefaultTerms:v,setIsDefaultFooter:T,setIsDefaultTerms:_}),t&&e(z,{relationType:"client_id",resource:t,invoiceSum:k,onChange:(o,b)=>n(o,b)})]}),(l==null?void 0:l.show_pdf_preview)&&e("div",{className:"my-4",children:t&&e(B,{for:"invoice",resource:t,entity:"quote",relationType:"client_id",endpoint:"/api/v1/live_preview?entity=:entity",withRemoveLogoCTA:!0})})]})}export{Y as default};