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

2 lines
4.3 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{u as V,_ as x,x as S,j as u,H as F,C as p,c as a,bt as r,cj as o,ck as C,cl as v,I as M,ai as N,as as k,bH as w,bs as A,cm as f,by as b,bk as D}from"./bundle.8ee8d669.js";function T(g){var m,h,_,d;const{t:n}=V(),{handleChange:t,errors:l}=g,[e]=x(N),i=S();return u(F,{children:[u(p,{className:"col-span-12 lg:col-span-6 xl:col-span-4 h-max",children:[a(r,{leftSide:n("quote_date"),children:a(o,{type:"date",onValueChange:s=>t("date",s),value:(e==null?void 0:e.date)||"",errorMessage:l==null?void 0:l.errors.date})}),a(r,{leftSide:n("valid_until"),children:a(o,{type:"date",onValueChange:s=>t("due_date",s),value:(e==null?void 0:e.due_date)||"",errorMessage:l==null?void 0:l.errors.due_date})}),a(r,{leftSide:n("partial"),children:a(C,{value:(e==null?void 0:e.partial)||"",onValueChange:s=>t("partial",parseFloat(s)),changeOverride:!0,errorMessage:l==null?void 0:l.errors.partial})}),e&&e.partial>0&&a(r,{leftSide:n("partial_due_date"),children:a(o,{type:"date",onValueChange:s=>t("partial_due_date",s),value:(e==null?void 0:e.partial_due_date)||"",errorMessage:l==null?void 0:l.errors.partial_due_date})}),e&&((m=i==null?void 0:i.custom_fields)==null?void 0:m.invoice1)&&a(v,{field:"quote1",defaultValue:(e==null?void 0:e.custom_value1)||"",value:i.custom_fields.invoice1,onValueChange:s=>t("custom_value1",String(s))}),e&&((h=i==null?void 0:i.custom_fields)==null?void 0:h.invoice2)&&a(v,{field:"quote2",defaultValue:(e==null?void 0:e.custom_value2)||"",value:i.custom_fields.invoice2,onValueChange:s=>t("custom_value2",String(s))})]}),u(p,{className:"col-span-12 lg:col-span-6 xl:col-span-4 h-max",children:[a(r,{leftSide:n("quote_number_short"),children:a(o,{id:"number",onValueChange:s=>t("number",s),value:(e==null?void 0:e.number)||"",errorMessage:l==null?void 0:l.errors.number})}),a(r,{leftSide:n("po_number_short"),children:a(o,{id:"po_number",onValueChange:s=>t("po_number",s),value:(e==null?void 0:e.po_number)||"",errorMessage:l==null?void 0:l.errors.po_number})}),a(r,{leftSide:n("discount"),children:u("div",{className:"flex space-x-2",children:[a("div",{className:"w-full lg:w-1/2",children:a(C,{value:(e==null?void 0:e.discount)||"",onValueChange:s=>t("discount",parseFloat(s)),errorMessage:l==null?void 0:l.errors.discount})}),a("div",{className:"w-full lg:w-1/2",children:u(M,{onValueChange:s=>t("is_amount_discount",JSON.parse(s)),value:e==null?void 0:e.is_amount_discount.toString(),errorMessage:l==null?void 0:l.errors.is_amount_discount,children:[a("option",{value:"false",children:n("percent")}),a("option",{value:"true",children:n("amount")})]})})]})}),e&&((_=i==null?void 0:i.custom_fields)==null?void 0:_.invoice3)&&a(v,{field:"quote3",defaultValue:(e==null?void 0:e.custom_value3)||"",value:i.custom_fields.invoice3,onValueChange:s=>t("custom_value3",String(s))}),e&&((d=i==null?void 0:i.custom_fields)==null?void 0:d.invoice4)&&a(v,{field:"quote4",defaultValue:(e==null?void 0:e.custom_value4)||"",value:i.custom_fields.invoice4,onValueChange:s=>t("custom_value4",String(s))})]})]})}function j(g){const[n]=V(),{handleChange:t,isDefaultTerms:l,isDefaultFooter:e,setIsDefaultFooter:i,setIsDefaultTerms:m}=g,{isAdmin:h,isOwner:_}=k(),d=w(N),s=[n("terms"),n("footer"),n("public_notes"),n("private_notes"),...h||_?[n("custom_fields")]:[]];return a(p,{className:"col-span-12 xl:col-span-8 h-max px-6",children:u(A,{tabs:s,withoutVerticalMargin:!0,children:[u("div",{children:[a(f,{value:(d==null?void 0:d.terms)||"",onChange:c=>t("terms",c)}),a(r,{className:"mt-4",leftSide:a(b,{checked:l,onValueChange:c=>m(c)}),noExternalPadding:!0,noVerticalPadding:!0,children:a("span",{className:"font-medium",children:n("save_as_default_terms")})})]}),u("div",{children:[a(f,{value:(d==null?void 0:d.footer)||"",onChange:c=>t("footer",c)}),a(r,{className:"mt-4",leftSide:a(b,{checked:e,onValueChange:c=>i(c)}),noExternalPadding:!0,noVerticalPadding:!0,children:a("span",{className:"font-medium",children:n("save_as_default_footer")})})]}),a("div",{className:"mb-4",children:a(f,{value:(d==null?void 0:d.public_notes)||"",onChange:c=>t("public_notes",c)})}),a("div",{className:"mb-4",children:a(f,{value:(d==null?void 0:d.private_notes)||"",onChange:c=>t("private_notes",c)})}),u("div",{className:"my-4",children:[u("span",{className:"text-sm",children:[n("custom_fields"),"  "]}),a(D,{to:"/settings/custom_fields/invoices",className:"capitalize",children:n("click_here")})]})]})})}export{T as Q,j as a};