import{J as m}from"./JsBarcode-BLmDeO4K.js";import{i as k,k as g,C as b,e as r,a as t,t as e,u as a,f as n,g as f,F as y,h as v,b as x,o as c,n as w}from"./app-WJL2kJBE.js";import{_ as p}from"./Attachments-b32bHynY.js";import"./DialogModal-B87MAZJT.js";import"./Modal-B9NNWAdE.js";import"./DangerButton-BS8d3PUv.js";import"./SecondaryButton-DT9RUAGX.js";const _={key:0,class:"mt-auto bg-gray-100 dark:bg-gray-800 -m-6 py-6 px-4 md:px-6 rounded-md print:bg-white print:mt-0 print:pt-0 print:h-full print:overflow-visible"},C={class:"bg-white dark:bg-gray-900 p-4 rounded-md shadow overflow-x-auto border dark:border-gray-700 print:border-0 print:shadow-none print:pt-0"},D={class:"block sm:flex justify-between print:flex"},$={class:"mb-4 sm:mb-0"},j={class:"py-4 w-full"},B={class:"text-xl text-center uppercase font-extrabold"},E={class:"mt-6 block sm:flex justify-between print:flex"},N={class:"w-full sm:w-1/2 leading-snug mb-6 sm:mb-0"},T={class:"text-left w-full sm:w-1/2 leading-snug"},V={class:"text-sm font-bold"},z={key:0,class:"font-bold"},F={key:1},O={key:2},S={key:0,class:"print:hidden mt-6 p-4 w-full border dark:border-gray-700 rounded-md"},q=["href"],I={class:"-mx-4 overflow-x-auto"},J={class:"w-full mt-8 mb-4",style:{"min-width":"500px"}},L={class:"px-6 py-2 text-left"},M={class:"px-6 py-2 w-32 text-center"},Q={class:"group-hover:bg-gray-100 dark:group-hover:bg-gray-700 border-t dark:border-gray-700 px-6 py-2"},R={class:"group-hover:bg-gray-100 dark:group-hover:bg-gray-700 border-t dark:border-gray-700 px-6 py-2 w-32 text-center"},U={key:1,class:"py-4 w-full"},A={key:2,class:"py-4 w-full"},G={class:"mt-auto pt-4 w-full text-center text-sm text-gray-500 hidden print:block"},tt={__name:"Details",props:{checkout:Object},setup(o){const{t:s}=k({}),u=o;return g(()=>{m("#barcode",u.checkout.reference,{width:1,margin:0,fontSize:0,height:"30",format:"CODE128"})}),b(()=>{m("#barcode",u.checkout.reference,{width:1,margin:0,fontSize:0,height:"30",format:"CODE128"})}),(l,d)=>o.checkout?(c(),r("div",_,[t("div",C,[t("div",D,[t("p",$,e(l.$settings.name),1)]),d[2]||(d[2]=t("div",{class:"border-b dark:border-gray-700 my-4 -mx-4"},null,-1)),t("div",j,[t("h1",B,e(a(s)("Checkout")),1),d[0]||(d[0]=t("div",{class:"mt-4 flex items-center justify-center"},[t("div",{class:"inline-flex bg-white p-2 rounded-md mx-auto"},[t("svg",{id:"barcode",class:"mt-px"})])],-1))]),t("div",E,[t("div",N,[d[1]||(d[1]=t("div",{class:"text-sm font-bold"}," ",-1)),t("div",null,e(a(s)("Date"))+": "+e(l.$date(o.checkout.date)),1),t("div",null,e(a(s)("Reference"))+": "+e(o.checkout.reference),1),t("div",null,e(a(s)("Created at"))+": "+e(l.$datetime(o.checkout.created_at)),1)]),t("div",T,[t("div",V,e(a(s)("For"))+":",1),t("div",null,e(o.checkout.customer.name),1),o.checkout.customer.company?(c(),r("div",z,e(o.checkout.customer.company),1)):n("",!0),o.checkout.customer.phone?(c(),r("div",F,e(a(s)("Tel"))+": "+e(o.checkout.customer.phone),1)):n("",!0),o.checkout.customer.email?(c(),r("div",O,e(a(s)("Email"))+": "+e(o.checkout.customer.email),1)):n("",!0)])]),o.checkout.attachment?(c(),r("div",S,[f(e(a(s)("This record has an attachment"))+", ",1),t("a",{href:o.checkout.attachment,target:"_blank",class:"link"},e(a(s)("click here to view")),9,q)])):n("",!0),t("div",I,[t("table",J,[t("tr",null,[t("th",L,e(a(s)("Item")),1),t("th",M,e(a(s)("Quantity")),1)]),(c(!0),r(y,null,v(o.checkout.items,(i,h)=>(c(),r("tr",{key:"i_"+i.id,class:w(["group avoid",{"bg-gray-50 dark:bg-gray-800":h%2!=0,"border-b dark:border-gray-700":o.checkout.items.length==h+1}])},[t("td",Q,e(i.name)+" ("+e(i.code)+") ",1),t("td",R,e(l.$number(i.quantity))+" "+e(i.unit||""),1)],2))),128))])]),o.checkout.attachments&&o.checkout.attachments.length?(c(),r("div",U,[x(p,{attachments:o.checkout.attachments},null,8,["attachments"])])):n("",!0),o.checkout.note?(c(),r("div",A,e(o.checkout.note),1)):n("",!0)]),t("div",G,e(a(s)("This is computer generated document, no signature required.")),1)])):n("",!0)}};export{tt as default};
