1import{A as S}from"./AdminShow.7f97a11c.js";import{F as U}from"./FormError.d57359a0.js";import{d as $,E as i,K as A,r as E,c as O,w as V,o as n,a as o,f as l,t as d,g as p,j as v,a1 as P,i as y,F as D,$ as C,h as T}from"./app.0910bc5f.js";import{u as B}from"./useAddress.ab17cc14.js";import{_ as L}from"./_plugin-vue_export-helper.cdc0426e.js";import"./AdminLayout.35064541.js";import"./cartStore.18679c79.js";import"./toast.esm.0d046d16.js";import"./ripple.esm.4dd86dd7.js";import"./portal.esm.e7473283.js";import"./index.esm.2be4ce49.js";import"./index.esm.c2643f12.js";import"./datatable.esm.ed6d3750.js";import"./index.esm.71f75d81.js";import"./dropdown.esm.2f138a85.js";import"./index.esm.2501d83a.js";import"./focustrap.esm.fa167002.js";import"./index.esm.e87d3cb0.js";import"./calendar.esm.6e7ab20d.js";import"./index.esm.de052757.js";import"./confirmdialog.esm.d2d703cf.js";import"./dialog.esm.768e2748.js";import"./useForm.e3e2df4d.js";const N=$({props:["id","insertViewLink"],setup(e){const t={},g=i(parseInt(e.id)),f=i({}),w=i({}),h=i(!1);Object.assign(t,{id:g,one2m:f,m2m:w,loading:h,insertViewLink:e.insertViewLink});const b=i(""),s=i(""),m=i(""),c=i("");Object.assign(t,{region:b,province:s,city:m,barangay:c,resolveAddress:async a=>{const _=await B.resolveAddress({region_id:a.data.region_id,province_id:a.data.province_id,city_id:a.data.city_id,barangay_id:a.data.barangay_id});b.value=_.region.name,s.value=_.province.name,m.value=_.city.name,c.value=_.barangay.name}});const u=i([]),k=async()=>{try{const a=await axios.get("/admin/order-status");u.value=a.data.data}catch(a){console.log(a)}};return Object.assign(t,{orderStatusOptions:u,getOptions:k}),A(()=>{k()}),t},components:{AdminShow:S,FormError:U}}),j={class:"row"},F={class:"col"},I={key:0},q={class:"row"},G={class:"col-md-6 border p-3 customer-info"},M={class:"border-bottom pb-3"},R={class:"border-bottom pb-3"},z={class:"border-bottom pb-3"},K={class:"border-bottom pb-3"},Q={class:"border-bottom pb-3"},Z={class:"border-bottom pb-3"},H={class:"border-bottom pb-3"},J={class:"border-bottom pb-3"},W={class:"border-bottom pb-3"},X={class:"border-bottom pb-3"},Y={class:"border-bottom pb-3"},x={class:"border-bottom pb-3"},oo={class:"border-bottom pb-3"},to={class:"col-md-6"},so={class:"row mb-4"},eo={class:"col"},ro=["onUpdate:modelValue"],no=["value"],io=["onUpdate:modelValue"],lo={class:"col-auto"},ao=["disabled"],uo={key:0,class:"row"},mo={class:"col"},po=["onUpdate:modelValue"],bo={key:1,class:"alert alert-success alert-dismissible fade show",role:"alert"},co=["on@click"],_o={class:"table table-striped border"},vo={key:0,class:"name-pr"},go=["href"],fo={align:"right"},wo={class:"row"},ho={class:"col-md-7 offset-md-5"},ko={class:"table order-total-show"},Vo={align:"right"},yo={align:"right"},Do={align:"right"},Co={align:"right"},So={class:"grand-total text-primary fw-bold",align:"right"},Uo={class:"d-flex justify-content-end"},$o=["href","download"];function Ao(e,t,g,f,w,h){const b=E("admin-show");return n(),O(b,{id:e.id,"onUpdate:id":t[0]||(t[0]=s=>e.id=s),controller:"orders",title:"Order","insert-view-link":e.insertViewLink,loading:e.loading,"onUpdate:loading":t[1]||(t[1]=s=>e.loading=s),one2m:e.one2m,m2m:e.m2m,showDefaultSubmitButton:!1,afterGetData:e.resolveAddress},{header:V(({entity:s})=>[o("div",j,[o("div",F,[o("h1",null,[s.id?(n(),l("span",I," Editing Order "+d(s.number),1)):p("",!0)])])])]),form:V(({entity:s,displaySaved:m,submitting:c})=>[o("div",q,[o("div",G,[o("dl",null,[t[2]||(t[2]=o("dt",null,"Number",-1)),o("dd",M,d(s.number),1),t[3]||(t[3]=o("dt",null,"Total",-1)),o("dd",R,d(s.total),1),t[4]||(t[4]=o("dt",null,"Date & Time",-1)),o("dd",z,d(s.datetime),1),t[5]||(t[5]=o("dt",null,"First Name",-1)),o("dd",K,d(s.name),1),t[6]||(t[6]=o("dt",null,"Email",-1)),o("dd",Q,d(s.email),1),t[7]||(t[7]=o("dt",null,"Contact Number",-1)),o("dd",Z,d(s.contact_number),1),t[8]||(t[8]=o("dt",null,"Address",-1)),o("dd",H,d(s.address||s.street),1),t[9]||(t[9]=o("dt",null,"Region",-1)),o("dd",J,d(e.region||s.region_id),1),t[10]||(t[10]=o("dt",null,"Province",-1)),o("dd",W,d(e.province||s.province_id),1),t[11]||(t[11]=o("dt",null,"City",-1)),o("dd",X,d(e.city||s.city_id),1),t[12]||(t[12]=o("dt",null,"Barangay",-1)),o("dd",Y,d(e.barangay||s.barangay_id),1),t[13]||(t[13]=o("dt",null,"Zip Code",-1)),o("dd",x,d(s.zip_code),1),t[14]||(t[14]=o("dt",null,"Delivery Instructions",-1)),o("dd",oo,d(s.delivery_instructions),1)])]),o("div",to,[t[25]||(t[25]=o("div",{class:"row"},[o("h3",null,"Status")],-1)),o("div",so,[o("div",eo,[v(o("select",{name:"order_status",id:"order_status",class:"form-control","onUpdate:modelValue":r=>s.order_status=r},[(n(!0),l(D,null,y(e.orderStatusOptions,(r,u)=>
1(n(),l("option",{value:r.id,key:`order-status-option-${u}`},d(r.name),9,no))),128))],8,ro),[[P,s.order_status]]),v(o("input",{type:"hidden",name:"id","onUpdate:modelValue":r=>s.id=r},null,8,io),[[C,s.id]])]),o("div",lo,[o("button",{type:"submit",class:"btn btn-primary",disabled:c}," Update ",8,ao)])]),s.order_status=="DELIVERED"?(n(),l("div",uo,[o("div",mo,[t[15]||(t[15]=o("label",{for:"date_delivered"},"Date delivered: ",-1)),v(o("input",{type:"date",class:"form-control",id:"date_delivered",name:"date_delivered","onUpdate:modelValue":r=>s.date_delivered=r},null,8,po),[[C,s.date_delivered]])])])):p("",!0),m?(n(),l("div",bo,[t[16]||(t[16]=o("i",{class:"fa fa-check"},null,-1)),t[17]||(t[17]=T()),t[18]||(t[18]=o("em",null,"Saved!",-1)),o("button",{type:"button",class:"btn-close","on@click":r=>m=!1,"aria-label":"Close"},null,40,co)])):p("",!0),o("table",_o,[t[19]||(t[19]=o("thead",null,[o("tr",null,[o("th",null,"Products")])],-1)),o("tbody",null,[(n(!0),l(D,null,y(s.items,(r,u)=>(n(),l("tr",{key:u},[r.pivot.quantity>0?(n(),l("td",vo,[o("a",{href:`{{ url('admin/items') }}/${r.item.id}`},d(r.item.name)+" ("+d(r.sku)+") ",9,go),o("p",null,"Price \u20B1"+d(r.pivot.price),1),o("p",null,"Quantity: "+d(r.pivot.quantity),1)])):p("",!0),o("td",fo,[o("p",null,"Total \u20B1"+d(r.pivot.quantity*r.pivot.price),1)])]))),128))])]),o("div",wo,[o("div",ho,[o("table",ko,[o("tbody",null,[o("tr",null,[t[20]||(t[20]=o("td",null,"Total",-1)),o("td",Vo,d(e.formatPrice(s.original_total)),1)]),o("tr",null,[t[21]||(t[21]=o("td",null,"Discount",-1)),o("td",yo,d(e.formatPrice(s.discount||0)),1)]),o("tr",null,[t[22]||(t[22]=o("td",null,"Coupon Discount",-1)),o("td",Do,d(e.formatPrice(s.coupon_discount_total||0)),1)]),o("tr",null,[t[23]||(t[23]=o("td",null,"Shipping",-1)),o("td",Co,d(e.formatPrice(s.shipping_fee)),1)]),o("tr",null,[t[24]||(t[24]=o("td",{class:"grand-total text-primary fw-bold"},[o("strong",null," Grand Total ")],-1)),o("td",So,d(e.formatPrice(s.total)),1)])])])])]),o("div",Uo,[s.id?(n(),l("a",{key:0,href:e.route("invoice",[s.id]),class:"btn btn-secondary mt-3",id:"invoice_download",download:`invoice-${s.number}.pdf`}," Download Invoice ",8,$o)):p("",!0)])])])]),_:1},8,["id","insert-view-link","loading","one2m","m2m","afterGetData"])}const xo=L(N,[["render",Ao]]);export{xo as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.