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

2 lines
4.4 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 I,x as k,j as d,H as w,C,c as a,bt as o,cj as c,ck as F,cl as v,I as D,as as T,bs as j,cm as p,by as M,bk as E}from"./bundle.8ee8d669.js";function O(u){var i,m,h,_,f,g,n,b,V,N,S,x;const{t:r}=I(),{invoice:e,handleChange:t}=u,s=k();return d(w,{children:[d(C,{className:"col-span-12 lg:col-span-6 xl:col-span-4 h-max",children:[a(o,{leftSide:r("invoice_date"),children:a(c,{type:"date",onValueChange:l=>t("date",l),value:(e==null?void 0:e.date)||"",errorMessage:(i=u.errors)==null?void 0:i.errors.date})}),a(o,{leftSide:r("due_date"),children:a(c,{type:"date",onValueChange:l=>t("due_date",l),value:(e==null?void 0:e.due_date)||"",errorMessage:(m=u.errors)==null?void 0:m.errors.due_date})}),a(o,{leftSide:r("partial"),children:a(F,{value:(e==null?void 0:e.partial)||"",onValueChange:l=>t("partial",parseFloat(l)||0),changeOverride:!0,errorMessage:(h=u.errors)==null?void 0:h.errors.partial})}),e&&e.partial>0&&a(o,{leftSide:r("partial_due_date"),children:a(c,{type:"date",onValueChange:l=>t("partial_due_date",l),value:(e==null?void 0:e.partial_due_date)||"",errorMessage:(_=u.errors)==null?void 0:_.errors.partial_due_date})}),e&&((f=s==null?void 0:s.custom_fields)==null?void 0:f.invoice1)&&a(v,{field:"invoice1",defaultValue:(e==null?void 0:e.custom_value1)||"",value:s.custom_fields.invoice1,onValueChange:l=>t("custom_value1",l.toString())}),e&&((g=s==null?void 0:s.custom_fields)==null?void 0:g.invoice2)&&a(v,{field:"invoice2",defaultValue:(e==null?void 0:e.custom_value2)||"",value:s.custom_fields.invoice2,onValueChange:l=>t("custom_value2",l.toString())})]}),d(C,{className:"col-span-12 lg:col-span-6 xl:col-span-4 h-max",children:[a(o,{leftSide:r("invoice_number_short"),children:a(c,{id:"number",onValueChange:l=>t("number",l),value:(e==null?void 0:e.number)||"",errorMessage:(n=u.errors)==null?void 0:n.errors.number})}),a(o,{leftSide:r("po_number_short"),children:a(c,{id:"po_number",onValueChange:l=>t("po_number",l),value:(e==null?void 0:e.po_number)||"",errorMessage:(b=u.errors)==null?void 0:b.errors.po_number})}),a(o,{leftSide:r("discount"),children:d("div",{className:"flex space-x-2",children:[a("div",{className:"w-full lg:w-1/2",children:a(F,{onValueChange:l=>t("discount",parseFloat(l)||0),value:(e==null?void 0:e.discount)||"",errorMessage:(V=u.errors)==null?void 0:V.errors.discount})}),a("div",{className:"w-full lg:w-1/2",children:d(D,{onValueChange:l=>t("is_amount_discount",JSON.parse(l)),value:e==null?void 0:e.is_amount_discount.toString(),errorMessage:(N=u.errors)==null?void 0:N.errors.is_amount_discount,customSelector:!0,dismissable:!1,children:[a("option",{value:"false",children:r("percent")}),a("option",{value:"true",children:r("amount")})]})})]})}),e&&((S=s==null?void 0:s.custom_fields)==null?void 0:S.invoice3)&&a(v,{field:"invoice3",defaultValue:(e==null?void 0:e.custom_value3)||"",value:s.custom_fields.invoice3,onValueChange:l=>t("custom_value3",l.toString())}),e&&((x=s==null?void 0:s.custom_fields)==null?void 0:x.invoice4)&&a(v,{field:"invoice4",defaultValue:(e==null?void 0:e.custom_value4)||"",value:s.custom_fields.invoice4,onValueChange:l=>t("custom_value4",l.toString())})]})]})}function A(u){const{t:r}=I(),{isAdmin:e,isOwner:t}=T(),{invoice:s,handleChange:i,isDefaultTerms:m,isDefaultFooter:h,setIsDefaultFooter:_,setIsDefaultTerms:f}=u,g=[r("public_notes"),r("private_notes"),r("terms"),r("footer"),...e||t?[r("custom_fields")]:[]];return a(C,{className:"col-span-12 xl:col-span-8 h-max px-6",children:d(j,{tabs:g,withoutVerticalMargin:!0,children:[a("div",{className:"mb-4",children:a(p,{value:(s==null?void 0:s.public_notes)||"",onChange:n=>i("public_notes",n)})}),a("div",{className:"mb-4",children:a(p,{value:(s==null?void 0:s.private_notes)||"",onChange:n=>i("private_notes",n)})}),d("div",{children:[a(p,{value:(s==null?void 0:s.terms)||"",onChange:n=>i("terms",n)}),a(o,{className:"mt-4",leftSide:a(M,{checked:m,onValueChange:n=>f(n)}),noExternalPadding:!0,noVerticalPadding:!0,children:a("span",{className:"font-medium",children:r("save_as_default_terms")})})]}),d("div",{children:[a(p,{value:(s==null?void 0:s.footer)||"",onChange:n=>i("footer",n)}),a(o,{className:"mt-4",leftSide:a(M,{checked:h,onValueChange:n=>_(n)}),noExternalPadding:!0,noVerticalPadding:!0,children:a("span",{className:"font-medium",children:r("save_as_default_footer")})})]}),d("div",{className:"my-4",children:[d("span",{className:"text-sm",children:[r("custom_fields"),"  "]}),a(E,{to:"/settings/custom_fields/invoices",className:"capitalize",children:r("click_here")})]})]})})}export{O as I,A as a};