import{J as u}from"./JsBarcode-BLmDeO4K.js";import{i as k,k as g,C as b,e as a,a as e,t,u as i,f as c,g as f,F as y,h as p,b as v,o as r,n as x}from"./app-WJL2kJBE.js";import{_ as w}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"},ee={__name:"Details",props:{checkin:Object},setup(s){const{t:n}=k({}),h=s;return g(()=>{u("#barcode",h.checkin.reference,{width:1,margin:0,fontSize:0,height:"30",format:"CODE128"})}),b(()=>{u("#barcode",h.checkin.reference,{width:1,margin:0,fontSize:0,height:"30",format:"CODE128"})}),(l,o)=>s.checkin?(r(),a("div",_,[e("div",C,[e("div",D,[e("p",$,t(l.$settings.name),1)]),o[2]||(o[2]=e("div",{class:"border-b dark:border-gray-700 my-4 -mx-4"},null,-1)),e("div",j,[e("h1",B,t(i(n)("Checkin")),1),o[0]||(o[0]=e("div",{class:"mt-4 flex items-center justify-center"},[e("div",{class:"inline-flex bg-white p-2 rounded-md mx-auto"},[e("svg",{id:"barcode",class:"mt-px"})])],-1))]),e("div",E,[e("div",N,[o[1]||(o[1]=e("div",{class:"text-sm font-bold"}," ",-1)),e("div",null,t(i(n)("Date"))+": "+t(l.$date(s.checkin.date)),1),e("div",null,t(i(n)("Reference"))+": "+t(s.checkin.reference),1),e("div",null,t(i(n)("Created at"))+": "+t(l.$datetime(s.checkin.created_at)),1)]),e("div",T,[e("div",V,t(i(n)("For"))+":",1),e("div",null,t(s.checkin.supplier.name),1),s.checkin.supplier.company?(r(),a("div",z,t(s.checkin.supplier.company),1)):c("",!0),s.checkin.supplier.phone?(r(),a("div",F,t(i(n)("Tel"))+": "+t(s.checkin.supplier.phone),1)):c("",!0),s.checkin.supplier.email?(r(),a("div",O,t(i(n)("Email"))+": "+t(s.checkin.supplier.email),1)):c("",!0)])]),s.checkin.attachment?(r(),a("div",S,[f(t(i(n)("This record has an attachment"))+", ",1),e("a",{href:s.checkin.attachment,target:"_blank",class:"link"},t(i(n)("click here to view")),9,q)])):c("",!0),e("div",I,[e("table",J,[e("tr",null,[e("th",L,t(i(n)("Item")),1),e("th",M,t(i(n)("Quantity")),1)]),(r(!0),a(y,null,p(s.checkin.items,(d,m)=>(r(),a("tr",{key:"i_"+d.id,class:x(["group avoid",{"bg-gray-50 dark:bg-gray-800":m%2!=0,"border-b dark:border-gray-700":s.checkin.items.length==m+1}])},[e("td",Q,t(d.name)+" ("+t(d.code)+") ",1),e("td",R,t(l.$number(d.quantity))+" "+t(d.unit||""),1)],2))),128))])]),s.checkin.attachments&&s.checkin.attachments.length?(r(),a("div",U,[v(w,{attachments:s.checkin.attachments},null,8,["attachments"])])):c("",!0),s.checkin.note?(r(),a("div",A,t(s.checkin.note),1)):c("",!0)]),e("div",G,t(i(n)("This is computer generated document, no signature required.")),1)])):c("",!0)}};export{ee as default};
