diff --git a/frontend/src/pages/SupplierInvoiceList.vue b/frontend/src/pages/SupplierInvoiceList.vue index 3867a43..2093cb1 100644 --- a/frontend/src/pages/SupplierInvoiceList.vue +++ b/frontend/src/pages/SupplierInvoiceList.vue @@ -71,7 +71,7 @@ import { onBeforeMount } from 'vue' onBeforeMount(() => { if (window.location.origin === 'https://accounting.seahavenind.com') { - window.location.replace('https://accounting.seahavenind.com/login#login') + window.location.replace('https://accounting.seahavenind.com/app') } }) diff --git a/frontend/src/router.js b/frontend/src/router.js index 7a6587c..039b308 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -27,7 +27,7 @@ const routes = [ ] let router = createRouter({ - history: createWebHistory('/supplier-portal'), + history: createWebHistory('/frontend'), routes, }) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 67e1b90..3816925 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -1,24 +1,11 @@ +import path from 'path' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' -import path from 'path' -import { webserver_port } from '../../../sites/common_site_config.json' +import frappeui from 'frappe-ui/vite' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], - server: { - port: 8000, - proxy: { - '^/(app|login|api|assets|files)': { - target: `http://127.0.0.1:${webserver_port}`, - ws: true, - router: function (req) { - const site_name = req.headers.host.split(':')[0] - return `http://${site_name}:${webserver_port}` - }, - }, - }, - }, + plugins: [frappeui(), vue()], resolve: { alias: { '@': path.resolve(__dirname, 'src'), diff --git a/suppliers_portal/hooks.py b/suppliers_portal/hooks.py index e4dd197..4b730d4 100644 --- a/suppliers_portal/hooks.py +++ b/suppliers_portal/hooks.py @@ -245,5 +245,12 @@ app_license = "mit" website_route_rules = [ {"from_route": "/erpnext", "to_route": "/login"}, - {"from_route": "/supplier-portal/", "to_route": "/frontend"}, + {"from_route": "/frontend/", "to_route": "frontend"}, + {"from_route": "/supplier-portal", "to_route": "frontend"}, + {"from_route": "/supplier-portal/", "to_route": "frontend"}, +] + + +website_redirects = [ + {"source": "/supplier-portal", "target": "frontend"}, ] diff --git a/suppliers_portal/public/frontend/assets/Login.24b835cc.js b/suppliers_portal/public/frontend/assets/Login.80913e45.js similarity index 95% rename from suppliers_portal/public/frontend/assets/Login.24b835cc.js rename to suppliers_portal/public/frontend/assets/Login.80913e45.js index 00ff901..f7024a8 100644 --- a/suppliers_portal/public/frontend/assets/Login.24b835cc.js +++ b/suppliers_portal/public/frontend/assets/Login.80913e45.js @@ -1 +1 @@ -import{l as f,r as g,e as r,f as o,w as m,g as i,o as n,m as w,n as x,u as t,t as b,p as h,q as y,v}from"./vendor.3e69a9be.js";import{s}from"./index.ddd4919b.js";const V={class:"m-3 flex flex-row items-center justify-center"},A=["onSubmit"],C={key:0},D={key:1},S=v("Login"),k={key:2,class:"text-red-500"},N=f({setup(B){const a=g({forAdmin:!1});function p(d){let e=new FormData(d.target);a.forAdmin?s.login.submit({email:e.get("email"),password:e.get("password")}):s.supplier_login.submit({supplier_id:e.get("supplier_id")})}return(d,e)=>{const l=i("Input"),u=i("Button"),c=i("Card");return n(),r("div",V,[o(c,{title:"Welcome to Supplier Portal!",class:"w-full max-w-md mt-4"},{default:m(()=>[w("form",{class:"flex flex-col space-y-2 w-full",onSubmit:y(p,["prevent"])},[o(x,{modelValue:t(a).forAdmin,"onUpdate:modelValue":e[0]||(e[0]=_=>t(a).forAdmin=_),label:"Login as Admin"},null,8,["modelValue"]),t(a).forAdmin?(n(),r("div",C,[o(l,{required:"",name:"email",type:"text",placeholder:"username@email.com",label:"User ID"}),o(l,{required:"",name:"password",type:"password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022",label:"Password"})])):(n(),r("div",D,[o(l,{required:"",name:"supplier_id",type:"text",placeholder:"Supplier ID",label:"Supplier ID"})])),o(u,{loading:t(s).login.loading,appearance:"primary"},{default:m(()=>[S]),_:1},8,["loading"]),t(s).login.error?(n(),r("div",k,b(t(s).login.error),1)):h("",!0)],40,A)]),_:1})])}}});export{N as default}; +import{l as f,r as g,e as r,f as o,w as m,g as i,o as n,m as w,n as x,u as t,t as b,p as h,q as y,v}from"./vendor.3e69a9be.js";import{s}from"./index.c142ad70.js";const V={class:"m-3 flex flex-row items-center justify-center"},A=["onSubmit"],C={key:0},D={key:1},S=v("Login"),k={key:2,class:"text-red-500"},N=f({setup(B){const a=g({forAdmin:!1});function p(d){let e=new FormData(d.target);a.forAdmin?s.login.submit({email:e.get("email"),password:e.get("password")}):s.supplier_login.submit({supplier_id:e.get("supplier_id")})}return(d,e)=>{const l=i("Input"),u=i("Button"),c=i("Card");return n(),r("div",V,[o(c,{title:"Welcome to Supplier Portal!",class:"w-full max-w-md mt-4"},{default:m(()=>[w("form",{class:"flex flex-col space-y-2 w-full",onSubmit:y(p,["prevent"])},[o(x,{modelValue:t(a).forAdmin,"onUpdate:modelValue":e[0]||(e[0]=_=>t(a).forAdmin=_),label:"Login as Admin"},null,8,["modelValue"]),t(a).forAdmin?(n(),r("div",C,[o(l,{required:"",name:"email",type:"text",placeholder:"username@email.com",label:"User ID"}),o(l,{required:"",name:"password",type:"password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022",label:"Password"})])):(n(),r("div",D,[o(l,{required:"",name:"supplier_id",type:"text",placeholder:"Supplier ID",label:"Supplier ID"})])),o(u,{loading:t(s).login.loading,appearance:"primary"},{default:m(()=>[S]),_:1},8,["loading"]),t(s).login.error?(n(),r("div",k,b(t(s).login.error),1)):h("",!0)],40,A)]),_:1})])}}});export{N as default}; diff --git a/suppliers_portal/public/frontend/assets/NewInvoice.b62c41f3.js b/suppliers_portal/public/frontend/assets/NewInvoice.1228f5fc.js similarity index 99% rename from suppliers_portal/public/frontend/assets/NewInvoice.b62c41f3.js rename to suppliers_portal/public/frontend/assets/NewInvoice.1228f5fc.js index 44d4a1a..b6fc4d5 100644 --- a/suppliers_portal/public/frontend/assets/NewInvoice.b62c41f3.js +++ b/suppliers_portal/public/frontend/assets/NewInvoice.1228f5fc.js @@ -1 +1 @@ -import{_ as B,y as I,r as g,a as S,M as q,e as _,m as e,f as m,w as A,K as i,L as d,u as o,H as h,N as P,O as M,P as U,F as x,z as N,Q as L,t as y,p as T,J as j,G as F,q as H,A as Q,B as $,g as G,o as r,v as J}from"./vendor.3e69a9be.js";import{a as K,b as f,c as Z,r as W}from"./index.ddd4919b.js";const X=(u,w)=>{const v=new Date(u);return v.setDate(v.getDate()+w),v},Y=u=>{switch(u){case"NET 10":return 10;case"NET 15":return 15;case"NET 30":return 30;case"NET 45":return 45;case"NET 60":return 60;default:return 0}};const a=u=>(Q("data-v-7312333a"),u=u(),$(),u),ee={class:"container mt-5 py-3 border"},se={class:"row mb-3"},te=a(()=>e("div",{class:"col-6"},[e("h1",{class:"text-gray-900 font-bold text-[32px]"},"New Invoice")],-1)),oe={class:"col-6"},le={class:"d-flex"},ae={class:"ms-auto"},ne={class:"btn-group",role:"group","aria-label":"Basic example"},ie={type:"button",class:"btn btn-primary btn-light"},ce=J("Cancel"),de={class:"container border-bottom pb-3"},re={class:"mb-2 row"},_e={class:"col"},ue={class:"row"},pe=a(()=>e("label",{for:"supplier_invoice_number",class:"col-sm-3 col-form-label"},"Invoice Number",-1)),me={class:"col-sm-8"},ve={class:"col"},be={class:"row"},he=a(()=>e("label",{for:"service_date",class:"col-sm-3 col-form-label"},"Service Date",-1)),ye={class:"col-sm-8"},fe={class:"mb-2 row"},we={class:"col"},Ve={class:"row"},ge=a(()=>e("label",{for:"supplier_id",class:"col-sm-3 col-form-label"},"Supplier ID",-1)),Se={class:"col-sm-8"},xe={class:"col"},Ne={class:"row"},Te=a(()=>e("label",{for:"invoice_date",class:"col-sm-3 col-form-label"},"Invoice Date",-1)),De={class:"col-sm-8"},Ie={class:"mb-2 row"},Ue={class:"col"},ke={class:"row"},Ee=a(()=>e("label",{for:"supplier_name",class:"col-sm-3 col-form-label"},"Supplier Name",-1)),ze={class:"col-sm-8"},Ce=["value"],Oe={class:"col"},Re={class:"row"},Be=a(()=>e("label",{for:"invoice_terms",class:"col-sm-3 col-form-label"},"Invoice Terms",-1)),qe={class:"col-sm-8"},Ae=a(()=>e("option",{readonly:""},null,-1)),Pe=["value"],Me={class:"mb-2 row"},Le=a(()=>e("div",{class:"col"},null,-1)),je={class:"col"},Fe={class:"row"},He=a(()=>e("label",{for:"invoice_date",class:"col-sm-3 col-form-label"},"Due Date",-1)),Qe={class:"col-sm-8"},$e={class:"mb-2 row"},Ge={class:"col"},Je={class:"accordion accordion-flush",id:"service-address-accordion"},Ke={class:"accordion-item"},Ze=a(()=>e("h2",{class:"accordion-header ps-0"},[e("button",{class:"accordion-button",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapseOne","aria-expanded":"true","aria-controls":"collapseOne"}," Service Address ")],-1)),We={id:"collapseOne",class:"accordion-collapse collapse show","data-bs-parent":"#service-address-accordion"},Xe={class:"accordion-body"},Ye={class:"row mb-1"},es=a(()=>e("label",{for:"street",class:"col-sm-3 col-form-label"},"Street",-1)),ss={class:"col-sm-8"},ts={class:"row mb-1"},os=a(()=>e("label",{for:"city",class:"col-sm-3 col-form-label"},"City",-1)),ls={class:"col-sm-8"},as={class:"row mb-1"},ns=a(()=>e("label",{for:"state",class:"col-sm-3 col-form-label"},"State",-1)),is={class:"col-sm-8"},cs={class:"row mb-1"},ds=a(()=>e("label",{for:"zip_code",class:"col-sm-3 col-form-label"},"Zip Code",-1)),rs={class:"col-sm-8"},_s={class:"col"},us={class:"accordion accordion-flush",id:"address-accordion"},ps={class:"accordion-item"},ms={class:"accordion-header ps-0"},vs={class:"accordion-button",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse-2","aria-expanded":"true","aria-controls":"collapse-2"},bs={id:"collapse-2",class:"accordion-collapse collapse show","data-bs-parent":"#address-accordion"},hs={class:"accordion-body"},ys={key:0,class:"row mb-1"},fs=a(()=>e("label",{for:"payment_reference_no",class:"col-sm-3 col-form-label"},"Payment Reference",-1)),ws={class:"col-sm-5"},Vs={key:1,class:"row mb-1"},gs=a(()=>e("label",{for:"payment_reference_date",class:"col-sm-3 col-form-label"},"Payment Date",-1)),Ss={class:"col-sm-5"},xs={class:"row mb-1"},Ns=a(()=>e("label",{for:"notes",class:"col-sm-3 col-form-label"},"Notes",-1)),Ts={class:"col-md-8"},Ds={class:"container"},Is=a(()=>e("h4",null,"Line Items",-1)),Us={key:0,class:"table"},ks=a(()=>e("thead",null,[e("tr",null,[e("th",{scope:"col"},"#"),e("th",{scope:"col",width:"30%"},"Service Type"),e("th",{scope:"col"},"Quantity"),e("th",{scope:"col"},"Rate"),e("th",{scope:"col"},"Amount")])],-1)),Es={class:"table-group-divider"},zs={scope:"row"},Cs={class:"col-mb-12"},Os=["onUpdate:modelValue"],Rs=a(()=>e("option",{readonly:""},null,-1)),Bs=["value"],qs=["onUpdate:modelValue"],As={class:"input-group"},Ps=a(()=>e("span",{class:"input-group-text"},[e("i",{class:"bi bi-currency-dollar"})],-1)),Ms=["onUpdate:modelValue"],Ls={class:"input-group"},js=a(()=>e("span",{class:"input-group-text"},[e("i",{class:"bi bi-currency-dollar"})],-1)),Fs=["onUpdate:modelValue"],Hs={type:"button",class:"btn btn-dark btn-sm"},Qs=["onClick"],$s={class:"d-flex"},Gs=a(()=>e("i",{class:"bi bi-plus"},null,-1)),Js=[Gs],Ks={class:"container"},Zs={class:"mb-2 row"},Ws=a(()=>e("div",{class:"col"},null,-1)),Xs={class:"col"},Ys={class:"input-group"},et=a(()=>e("label",{for:"total_amount",class:"col-sm-3 col-form-label"},"Total Amount",-1)),st={class:"cols-sm-5"},tt={class:"input-group"},ot=a(()=>e("span",{class:"input-group-text currency-fmt"},[e("i",{class:"bi bi-currency-dollar"})],-1)),lt={setup(u){const w=K()==="Administrator",v=I({doctype:"Invoices",insert:{onSuccess(){W.push({name:"SupplierInvoiceList"})}}}),k=[{label:"NET 10",value:"NET 10"},{label:"NET 15",value:"NET 15"},{label:"NET 30",value:"NET 30"},{label:"NET 45",value:"NET 45"},{label:"NET 60",value:"NET 60"},{label:"Due on Receipt",value:"Due on Receipt"}],E=[{label:"Repair",value:"Repair"},{label:"Preventive Maintenance",value:"Preventive Maintenance"}],s=g({supplier_invoice_number:"",supplier:f(),service_date:new Date().toISOString().split("T")[0],invoice_date:new Date().toISOString().split("T")[0],supplier_name:Z(),invoice_terms:"",total_amount:0,street:"",city:"",state:"",zip_code:"",payment_reference_no:"",payment_reference_date:new Date().toISOString().split("T")[0],notes:""}),p=g([]);let b=S(()=>s.invoice_terms?X(s.invoice_date,Y(s.invoice_terms)).toISOString().split("T")[0]:"");const z=()=>{const n=g({service_type:"",quantity:0,rate:0,amount:0});n.amount=S(()=>n.quantity*n.rate),p.push(n)},C=n=>{p.splice(n,1)};s.total_amount=S(()=>p.reduce((n,l)=>n+l.amount,0));const O=()=>{v.insert.submit({supplier_invoice_number:s.supplier_invoice_number,supplier:s.supplier,service_date:s.service_date,invoice_date:s.invoice_date,supplier_name:s.supplier_name,invoice_terms:s.invoice_terms,street:s.street,city:s.city,state:s.state,zip_code:s.zip_code,payment_reference_date:s.payment_reference_date,payment_reference_no:s.payment_reference_no,notes:s.notes,supplier_invoice_items:p.map(n=>({service_type:n.service_type,quantity:n.quantity,rate:n.rate}))})},D=I({doctype:"Supplier",fields:["name as value","company_name as label"],orderBy:"creation desc"});return D.fetch(),q(()=>s.supplier_name,n=>{n&&(s.supplier=n.value)}),(n,l)=>{const R=G("router-link");return r(),_("form",{onSubmit:l[15]||(l[15]=H(()=>{},["prevent"]))},[e("div",ee,[e("div",se,[te,e("div",oe,[e("div",le,[e("div",ae,[e("div",ne,[e("button",ie,[m(R,{to:"/"},{default:A(()=>[ce]),_:1})]),e("button",{type:"button",class:"btn btn-primary btn-dark",onClick:O}," Save ")])])])])]),e("div",de,[e("div",re,[e("div",_e,[e("div",ue,[pe,e("div",me,[i(e("input",{type:"text",class:"form-control",id:"supplier_invoice_number","onUpdate:modelValue":l[0]||(l[0]=t=>o(s).supplier_invoice_number=t)},null,512),[[d,o(s).supplier_invoice_number,void 0,{number:!0}]])])])]),e("div",ve,[e("div",be,[he,e("div",ye,[m(h,{type:"date",size:"lg",variant:"outline",placeholder:"Service Date",id:"service_date",disabled:!1,modelValue:o(s).service_date,"onUpdate:modelValue":l[1]||(l[1]=t=>o(s).service_date=t)},null,8,["modelValue"])])])])]),e("div",fe,[e("div",we,[e("div",Ve,[ge,e("div",Se,[i(e("input",{type:"text",readonly:"",class:"form-control-plaintext",id:"supplier_id","onUpdate:modelValue":l[2]||(l[2]=t=>o(s).supplier=t)},null,512),[[d,o(s).supplier]])])])]),e("div",xe,[e("div",Ne,[Te,e("div",De,[m(h,{type:"date",size:"lg",variant:"outline",placeholder:"Invoice Date",id:"invoice_date",disabled:!1,modelValue:o(s).invoice_date,"onUpdate:modelValue":l[3]||(l[3]=t=>o(s).invoice_date=t)},null,8,["modelValue"])])])])]),e("div",Ie,[e("div",Ue,[e("div",ke,[Ee,e("div",ze,[w?(r(),P(M,{key:1,id:"supplier_name",options:o(D).data,placeholder:"Supplier Name",hideSearch:!o(s).supplier_invoice_number,label:"company_name",modelValue:o(s).supplier_name,"onUpdate:modelValue":l[4]||(l[4]=t=>o(s).supplier_name=t)},null,8,["options","hideSearch","modelValue"])):(r(),_("input",{key:0,type:"text",readonly:"",class:"form-control-plaintext",id:"supplier_name",value:o(s).supplier_name},null,8,Ce))])])]),e("div",Oe,[e("div",Re,[Be,e("div",qe,[i(e("select",{class:"form-select form-select-mb h-100 d-inline-block","aria-label":"Invoice Terms","onUpdate:modelValue":l[5]||(l[5]=t=>o(s).invoice_terms=t)},[Ae,(r(),_(x,null,N(k,t=>e("option",{value:t.value},y(t.label),9,Pe)),64))],512),[[U,o(s).invoice_terms]])])])])]),e("div",Me,[Le,e("div",je,[e("div",Fe,[He,e("div",Qe,[m(h,{type:"date",size:"lg",variant:"outline",placeholder:"Due Date",id:"due_date",disabled:!0,modelValue:o(b),"onUpdate:modelValue":l[6]||(l[6]=t=>L(b)?b.value=t:b=t)},null,8,["modelValue"])])])])]),e("div",$e,[e("div",Ge,[e("div",Je,[e("div",Ke,[Ze,e("div",We,[e("div",Xe,[e("div",Ye,[es,e("div",ss,[i(e("input",{type:"text",class:"form-control",id:"street","onUpdate:modelValue":l[7]||(l[7]=t=>o(s).street=t)},null,512),[[d,o(s).street]])])]),e("div",ts,[os,e("div",ls,[i(e("input",{type:"text",class:"form-control",id:"city","onUpdate:modelValue":l[8]||(l[8]=t=>o(s).city=t)},null,512),[[d,o(s).city]])])]),e("div",as,[ns,e("div",is,[i(e("input",{type:"text",class:"form-control",id:"state","onUpdate:modelValue":l[9]||(l[9]=t=>o(s).state=t)},null,512),[[d,o(s).state]])])]),e("div",cs,[ds,e("div",rs,[i(e("input",{type:"text",class:"form-control",id:"zip_code","onUpdate:modelValue":l[10]||(l[10]=t=>o(s).zip_code=t)},null,512),[[d,o(s).zip_code]])])])])])])])]),e("div",_s,[e("div",us,[e("div",ps,[e("h2",ms,[e("button",vs,y(o(f)()?"Notes":"Payment Reference and Notes"),1)]),e("div",bs,[e("div",hs,[o(f)()?T("",!0):(r(),_("div",ys,[fs,e("div",ws,[i(e("input",{type:"text",class:"form-control",id:"payment_reference_no","onUpdate:modelValue":l[11]||(l[11]=t=>o(s).payment_reference_no=t)},null,512),[[d,o(s).payment_reference_no]])])])),o(f)()?T("",!0):(r(),_("div",Vs,[gs,e("div",Ss,[m(h,{type:"date",size:"lg",variant:"outline",placeholder:"Payment Date",id:"payment_reference_date",disabled:!1,modelValue:o(s).payment_reference_date,"onUpdate:modelValue":l[12]||(l[12]=t=>o(s).payment_reference_date=t)},null,8,["modelValue"])])])),e("div",xs,[Ns,e("div",Ts,[m(j,{variant:"subtle",size:"md",placeholder:"Enter Notes Here",disabled:!1,modelValue:o(s).notes,"onUpdate:modelValue":l[13]||(l[13]=t=>o(s).notes=t),id:"notes"},null,8,["modelValue"])])])])])])])])])]),e("div",Ds,[Is,o(p).length!==0?(r(),_("table",Us,[ks,e("tbody",Es,[(r(!0),_(x,null,N(o(p),(t,V)=>(r(),_("tr",{key:V},[e("th",zs,y(V+1),1),e("td",null,[e("div",Cs,[i(e("select",{class:"form-select form-select-mb h-100 d-inline-block","aria-label":"Service Types","onUpdate:modelValue":c=>t.service_type=c},[Rs,(r(),_(x,null,N(E,c=>e("option",{value:c.value},y(c.label),9,Bs)),64))],8,Os),[[U,t.service_type]])])]),e("td",null,[i(e("input",{type:"text",class:"form-control","onUpdate:modelValue":c=>t.quantity=c},null,8,qs),[[d,t.quantity]])]),e("td",null,[e("div",As,[Ps,i(e("input",{type:"text",class:"form-control","onUpdate:modelValue":c=>t.rate=c},null,8,Ms),[[d,t.rate,void 0,{number:!0}]])])]),e("td",null,[e("div",Ls,[js,i(e("input",{type:"text",readonly:"",class:"form-control","onUpdate:modelValue":c=>t.amount=c},null,8,Fs),[[d,t.amount,void 0,{number:!0}]])])]),e("td",null,[e("button",Hs,[e("i",{onClick:c=>C(V),class:"bi bi-trash"},null,8,Qs)])])]))),128))])])):T("",!0),e("div",$s,[e("div",{class:F(o(p).length===0?"ms-auto pt-3":"ms-auto")},[e("div",{class:"btn-group",role:"group","aria-label":"Basic example"},[e("button",{type:"button",class:"btn btn-dark btn-sm",onClick:z},Js)])],2)])]),e("div",Ks,[e("div",Zs,[Ws,e("div",Xs,[e("div",Ys,[et,e("div",st,[e("div",tt,[ot,i(e("input",{type:"text",readonly:"",class:"form-control","onUpdate:modelValue":l[14]||(l[14]=t=>o(s).total_amount=t)},null,512),[[d,o(s).total_amount,void 0,{number:!0}]])])])])])])])])],32)}}};var it=B(lt,[["__scopeId","data-v-7312333a"]]);export{it as default}; +import{_ as B,y as I,r as g,a as S,M as q,e as _,m as e,f as m,w as A,K as i,L as d,u as o,H as h,N as P,O as M,P as U,F as x,z as N,Q as L,t as y,p as T,J as j,G as F,q as H,A as Q,B as $,g as G,o as r,v as J}from"./vendor.3e69a9be.js";import{a as K,b as f,c as Z,r as W}from"./index.c142ad70.js";const X=(u,w)=>{const v=new Date(u);return v.setDate(v.getDate()+w),v},Y=u=>{switch(u){case"NET 10":return 10;case"NET 15":return 15;case"NET 30":return 30;case"NET 45":return 45;case"NET 60":return 60;default:return 0}};const a=u=>(Q("data-v-7312333a"),u=u(),$(),u),ee={class:"container mt-5 py-3 border"},se={class:"row mb-3"},te=a(()=>e("div",{class:"col-6"},[e("h1",{class:"text-gray-900 font-bold text-[32px]"},"New Invoice")],-1)),oe={class:"col-6"},le={class:"d-flex"},ae={class:"ms-auto"},ne={class:"btn-group",role:"group","aria-label":"Basic example"},ie={type:"button",class:"btn btn-primary btn-light"},ce=J("Cancel"),de={class:"container border-bottom pb-3"},re={class:"mb-2 row"},_e={class:"col"},ue={class:"row"},pe=a(()=>e("label",{for:"supplier_invoice_number",class:"col-sm-3 col-form-label"},"Invoice Number",-1)),me={class:"col-sm-8"},ve={class:"col"},be={class:"row"},he=a(()=>e("label",{for:"service_date",class:"col-sm-3 col-form-label"},"Service Date",-1)),ye={class:"col-sm-8"},fe={class:"mb-2 row"},we={class:"col"},Ve={class:"row"},ge=a(()=>e("label",{for:"supplier_id",class:"col-sm-3 col-form-label"},"Supplier ID",-1)),Se={class:"col-sm-8"},xe={class:"col"},Ne={class:"row"},Te=a(()=>e("label",{for:"invoice_date",class:"col-sm-3 col-form-label"},"Invoice Date",-1)),De={class:"col-sm-8"},Ie={class:"mb-2 row"},Ue={class:"col"},ke={class:"row"},Ee=a(()=>e("label",{for:"supplier_name",class:"col-sm-3 col-form-label"},"Supplier Name",-1)),ze={class:"col-sm-8"},Ce=["value"],Oe={class:"col"},Re={class:"row"},Be=a(()=>e("label",{for:"invoice_terms",class:"col-sm-3 col-form-label"},"Invoice Terms",-1)),qe={class:"col-sm-8"},Ae=a(()=>e("option",{readonly:""},null,-1)),Pe=["value"],Me={class:"mb-2 row"},Le=a(()=>e("div",{class:"col"},null,-1)),je={class:"col"},Fe={class:"row"},He=a(()=>e("label",{for:"invoice_date",class:"col-sm-3 col-form-label"},"Due Date",-1)),Qe={class:"col-sm-8"},$e={class:"mb-2 row"},Ge={class:"col"},Je={class:"accordion accordion-flush",id:"service-address-accordion"},Ke={class:"accordion-item"},Ze=a(()=>e("h2",{class:"accordion-header ps-0"},[e("button",{class:"accordion-button",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapseOne","aria-expanded":"true","aria-controls":"collapseOne"}," Service Address ")],-1)),We={id:"collapseOne",class:"accordion-collapse collapse show","data-bs-parent":"#service-address-accordion"},Xe={class:"accordion-body"},Ye={class:"row mb-1"},es=a(()=>e("label",{for:"street",class:"col-sm-3 col-form-label"},"Street",-1)),ss={class:"col-sm-8"},ts={class:"row mb-1"},os=a(()=>e("label",{for:"city",class:"col-sm-3 col-form-label"},"City",-1)),ls={class:"col-sm-8"},as={class:"row mb-1"},ns=a(()=>e("label",{for:"state",class:"col-sm-3 col-form-label"},"State",-1)),is={class:"col-sm-8"},cs={class:"row mb-1"},ds=a(()=>e("label",{for:"zip_code",class:"col-sm-3 col-form-label"},"Zip Code",-1)),rs={class:"col-sm-8"},_s={class:"col"},us={class:"accordion accordion-flush",id:"address-accordion"},ps={class:"accordion-item"},ms={class:"accordion-header ps-0"},vs={class:"accordion-button",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse-2","aria-expanded":"true","aria-controls":"collapse-2"},bs={id:"collapse-2",class:"accordion-collapse collapse show","data-bs-parent":"#address-accordion"},hs={class:"accordion-body"},ys={key:0,class:"row mb-1"},fs=a(()=>e("label",{for:"payment_reference_no",class:"col-sm-3 col-form-label"},"Payment Reference",-1)),ws={class:"col-sm-5"},Vs={key:1,class:"row mb-1"},gs=a(()=>e("label",{for:"payment_reference_date",class:"col-sm-3 col-form-label"},"Payment Date",-1)),Ss={class:"col-sm-5"},xs={class:"row mb-1"},Ns=a(()=>e("label",{for:"notes",class:"col-sm-3 col-form-label"},"Notes",-1)),Ts={class:"col-md-8"},Ds={class:"container"},Is=a(()=>e("h4",null,"Line Items",-1)),Us={key:0,class:"table"},ks=a(()=>e("thead",null,[e("tr",null,[e("th",{scope:"col"},"#"),e("th",{scope:"col",width:"30%"},"Service Type"),e("th",{scope:"col"},"Quantity"),e("th",{scope:"col"},"Rate"),e("th",{scope:"col"},"Amount")])],-1)),Es={class:"table-group-divider"},zs={scope:"row"},Cs={class:"col-mb-12"},Os=["onUpdate:modelValue"],Rs=a(()=>e("option",{readonly:""},null,-1)),Bs=["value"],qs=["onUpdate:modelValue"],As={class:"input-group"},Ps=a(()=>e("span",{class:"input-group-text"},[e("i",{class:"bi bi-currency-dollar"})],-1)),Ms=["onUpdate:modelValue"],Ls={class:"input-group"},js=a(()=>e("span",{class:"input-group-text"},[e("i",{class:"bi bi-currency-dollar"})],-1)),Fs=["onUpdate:modelValue"],Hs={type:"button",class:"btn btn-dark btn-sm"},Qs=["onClick"],$s={class:"d-flex"},Gs=a(()=>e("i",{class:"bi bi-plus"},null,-1)),Js=[Gs],Ks={class:"container"},Zs={class:"mb-2 row"},Ws=a(()=>e("div",{class:"col"},null,-1)),Xs={class:"col"},Ys={class:"input-group"},et=a(()=>e("label",{for:"total_amount",class:"col-sm-3 col-form-label"},"Total Amount",-1)),st={class:"cols-sm-5"},tt={class:"input-group"},ot=a(()=>e("span",{class:"input-group-text currency-fmt"},[e("i",{class:"bi bi-currency-dollar"})],-1)),lt={setup(u){const w=K()==="Administrator",v=I({doctype:"Invoices",insert:{onSuccess(){W.push({name:"SupplierInvoiceList"})}}}),k=[{label:"NET 10",value:"NET 10"},{label:"NET 15",value:"NET 15"},{label:"NET 30",value:"NET 30"},{label:"NET 45",value:"NET 45"},{label:"NET 60",value:"NET 60"},{label:"Due on Receipt",value:"Due on Receipt"}],E=[{label:"Repair",value:"Repair"},{label:"Preventive Maintenance",value:"Preventive Maintenance"}],s=g({supplier_invoice_number:"",supplier:f(),service_date:new Date().toISOString().split("T")[0],invoice_date:new Date().toISOString().split("T")[0],supplier_name:Z(),invoice_terms:"",total_amount:0,street:"",city:"",state:"",zip_code:"",payment_reference_no:"",payment_reference_date:new Date().toISOString().split("T")[0],notes:""}),p=g([]);let b=S(()=>s.invoice_terms?X(s.invoice_date,Y(s.invoice_terms)).toISOString().split("T")[0]:"");const z=()=>{const n=g({service_type:"",quantity:0,rate:0,amount:0});n.amount=S(()=>n.quantity*n.rate),p.push(n)},C=n=>{p.splice(n,1)};s.total_amount=S(()=>p.reduce((n,l)=>n+l.amount,0));const O=()=>{v.insert.submit({supplier_invoice_number:s.supplier_invoice_number,supplier:s.supplier,service_date:s.service_date,invoice_date:s.invoice_date,supplier_name:s.supplier_name,invoice_terms:s.invoice_terms,street:s.street,city:s.city,state:s.state,zip_code:s.zip_code,payment_reference_date:s.payment_reference_date,payment_reference_no:s.payment_reference_no,notes:s.notes,supplier_invoice_items:p.map(n=>({service_type:n.service_type,quantity:n.quantity,rate:n.rate}))})},D=I({doctype:"Supplier",fields:["name as value","company_name as label"],orderBy:"creation desc"});return D.fetch(),q(()=>s.supplier_name,n=>{n&&(s.supplier=n.value)}),(n,l)=>{const R=G("router-link");return r(),_("form",{onSubmit:l[15]||(l[15]=H(()=>{},["prevent"]))},[e("div",ee,[e("div",se,[te,e("div",oe,[e("div",le,[e("div",ae,[e("div",ne,[e("button",ie,[m(R,{to:"/"},{default:A(()=>[ce]),_:1})]),e("button",{type:"button",class:"btn btn-primary btn-dark",onClick:O}," Save ")])])])])]),e("div",de,[e("div",re,[e("div",_e,[e("div",ue,[pe,e("div",me,[i(e("input",{type:"text",class:"form-control",id:"supplier_invoice_number","onUpdate:modelValue":l[0]||(l[0]=t=>o(s).supplier_invoice_number=t)},null,512),[[d,o(s).supplier_invoice_number,void 0,{number:!0}]])])])]),e("div",ve,[e("div",be,[he,e("div",ye,[m(h,{type:"date",size:"lg",variant:"outline",placeholder:"Service Date",id:"service_date",disabled:!1,modelValue:o(s).service_date,"onUpdate:modelValue":l[1]||(l[1]=t=>o(s).service_date=t)},null,8,["modelValue"])])])])]),e("div",fe,[e("div",we,[e("div",Ve,[ge,e("div",Se,[i(e("input",{type:"text",readonly:"",class:"form-control-plaintext",id:"supplier_id","onUpdate:modelValue":l[2]||(l[2]=t=>o(s).supplier=t)},null,512),[[d,o(s).supplier]])])])]),e("div",xe,[e("div",Ne,[Te,e("div",De,[m(h,{type:"date",size:"lg",variant:"outline",placeholder:"Invoice Date",id:"invoice_date",disabled:!1,modelValue:o(s).invoice_date,"onUpdate:modelValue":l[3]||(l[3]=t=>o(s).invoice_date=t)},null,8,["modelValue"])])])])]),e("div",Ie,[e("div",Ue,[e("div",ke,[Ee,e("div",ze,[w?(r(),P(M,{key:1,id:"supplier_name",options:o(D).data,placeholder:"Supplier Name",hideSearch:!o(s).supplier_invoice_number,label:"company_name",modelValue:o(s).supplier_name,"onUpdate:modelValue":l[4]||(l[4]=t=>o(s).supplier_name=t)},null,8,["options","hideSearch","modelValue"])):(r(),_("input",{key:0,type:"text",readonly:"",class:"form-control-plaintext",id:"supplier_name",value:o(s).supplier_name},null,8,Ce))])])]),e("div",Oe,[e("div",Re,[Be,e("div",qe,[i(e("select",{class:"form-select form-select-mb h-100 d-inline-block","aria-label":"Invoice Terms","onUpdate:modelValue":l[5]||(l[5]=t=>o(s).invoice_terms=t)},[Ae,(r(),_(x,null,N(k,t=>e("option",{value:t.value},y(t.label),9,Pe)),64))],512),[[U,o(s).invoice_terms]])])])])]),e("div",Me,[Le,e("div",je,[e("div",Fe,[He,e("div",Qe,[m(h,{type:"date",size:"lg",variant:"outline",placeholder:"Due Date",id:"due_date",disabled:!0,modelValue:o(b),"onUpdate:modelValue":l[6]||(l[6]=t=>L(b)?b.value=t:b=t)},null,8,["modelValue"])])])])]),e("div",$e,[e("div",Ge,[e("div",Je,[e("div",Ke,[Ze,e("div",We,[e("div",Xe,[e("div",Ye,[es,e("div",ss,[i(e("input",{type:"text",class:"form-control",id:"street","onUpdate:modelValue":l[7]||(l[7]=t=>o(s).street=t)},null,512),[[d,o(s).street]])])]),e("div",ts,[os,e("div",ls,[i(e("input",{type:"text",class:"form-control",id:"city","onUpdate:modelValue":l[8]||(l[8]=t=>o(s).city=t)},null,512),[[d,o(s).city]])])]),e("div",as,[ns,e("div",is,[i(e("input",{type:"text",class:"form-control",id:"state","onUpdate:modelValue":l[9]||(l[9]=t=>o(s).state=t)},null,512),[[d,o(s).state]])])]),e("div",cs,[ds,e("div",rs,[i(e("input",{type:"text",class:"form-control",id:"zip_code","onUpdate:modelValue":l[10]||(l[10]=t=>o(s).zip_code=t)},null,512),[[d,o(s).zip_code]])])])])])])])]),e("div",_s,[e("div",us,[e("div",ps,[e("h2",ms,[e("button",vs,y(o(f)()?"Notes":"Payment Reference and Notes"),1)]),e("div",bs,[e("div",hs,[o(f)()?T("",!0):(r(),_("div",ys,[fs,e("div",ws,[i(e("input",{type:"text",class:"form-control",id:"payment_reference_no","onUpdate:modelValue":l[11]||(l[11]=t=>o(s).payment_reference_no=t)},null,512),[[d,o(s).payment_reference_no]])])])),o(f)()?T("",!0):(r(),_("div",Vs,[gs,e("div",Ss,[m(h,{type:"date",size:"lg",variant:"outline",placeholder:"Payment Date",id:"payment_reference_date",disabled:!1,modelValue:o(s).payment_reference_date,"onUpdate:modelValue":l[12]||(l[12]=t=>o(s).payment_reference_date=t)},null,8,["modelValue"])])])),e("div",xs,[Ns,e("div",Ts,[m(j,{variant:"subtle",size:"md",placeholder:"Enter Notes Here",disabled:!1,modelValue:o(s).notes,"onUpdate:modelValue":l[13]||(l[13]=t=>o(s).notes=t),id:"notes"},null,8,["modelValue"])])])])])])])])])]),e("div",Ds,[Is,o(p).length!==0?(r(),_("table",Us,[ks,e("tbody",Es,[(r(!0),_(x,null,N(o(p),(t,V)=>(r(),_("tr",{key:V},[e("th",zs,y(V+1),1),e("td",null,[e("div",Cs,[i(e("select",{class:"form-select form-select-mb h-100 d-inline-block","aria-label":"Service Types","onUpdate:modelValue":c=>t.service_type=c},[Rs,(r(),_(x,null,N(E,c=>e("option",{value:c.value},y(c.label),9,Bs)),64))],8,Os),[[U,t.service_type]])])]),e("td",null,[i(e("input",{type:"text",class:"form-control","onUpdate:modelValue":c=>t.quantity=c},null,8,qs),[[d,t.quantity]])]),e("td",null,[e("div",As,[Ps,i(e("input",{type:"text",class:"form-control","onUpdate:modelValue":c=>t.rate=c},null,8,Ms),[[d,t.rate,void 0,{number:!0}]])])]),e("td",null,[e("div",Ls,[js,i(e("input",{type:"text",readonly:"",class:"form-control","onUpdate:modelValue":c=>t.amount=c},null,8,Fs),[[d,t.amount,void 0,{number:!0}]])])]),e("td",null,[e("button",Hs,[e("i",{onClick:c=>C(V),class:"bi bi-trash"},null,8,Qs)])])]))),128))])])):T("",!0),e("div",$s,[e("div",{class:F(o(p).length===0?"ms-auto pt-3":"ms-auto")},[e("div",{class:"btn-group",role:"group","aria-label":"Basic example"},[e("button",{type:"button",class:"btn btn-dark btn-sm",onClick:z},Js)])],2)])]),e("div",Ks,[e("div",Zs,[Ws,e("div",Xs,[e("div",Ys,[et,e("div",st,[e("div",tt,[ot,i(e("input",{type:"text",readonly:"",class:"form-control","onUpdate:modelValue":l[14]||(l[14]=t=>o(s).total_amount=t)},null,512),[[d,o(s).total_amount,void 0,{number:!0}]])])])])])])])])],32)}}};var it=B(lt,[["__scopeId","data-v-7312333a"]]);export{it as default}; diff --git a/suppliers_portal/public/frontend/assets/SupplierInvoiceList.55bab896.js b/suppliers_portal/public/frontend/assets/SupplierInvoiceList.55bab896.js new file mode 100644 index 0000000..fd491ba --- /dev/null +++ b/suppliers_portal/public/frontend/assets/SupplierInvoiceList.55bab896.js @@ -0,0 +1 @@ +import{_ as y,x as k,y as h,e as a,m as t,f as i,w as l,u as s,F as I,z as w,p as b,A as B,B as S,g,o as c,v as r,t as p,D as N}from"./vendor.3e69a9be.js";import{s as d}from"./index.c142ad70.js";const _=u=>(B("data-v-6f6873f7"),u=u(),S(),u),L={class:"container-fluid"},C={class:"container mx-auto mt-5"},P={class:"row"},V=_(()=>t("div",{class:"col"},[t("h1",{class:"text-gray-900 font-bold text-[32px]"},"Invoices"),t("div",{class:"d-flex"},[t("div",null,[t("div",{class:"btn-group",role:"group","aria-label":"Basic example"})])])],-1)),j={class:"col"},$={class:"d-flex"},A={class:"ms-auto d-flex",style:{gap:"2px"}},D=_(()=>t("button",{type:"button",class:"btn btn-primary btn-dark"},"New",-1)),F={key:0,class:"container mx-auto mb-3 mt-5"},z={class:"table"},E=_(()=>t("thead",null,[t("tr",null,[t("th",{scope:"col"},"Invoice Number"),t("th",{scope:"col"},"Supplier"),t("th",{scope:"col"},"Status"),t("th",{scope:"col"},"Amount")])],-1)),M={class:"table-group-divider"},R=_(()=>t("i",{class:"bi bi-currency-dollar"},null,-1)),T={key:0,class:"flex justify-between mt-4"},q=r(" Previous Page "),G=r(" Next Page "),H={setup(u){k(()=>{window.location.origin==="https://accounting.seahavenind.com"&&window.location.replace("https://accounting.seahavenind.com/app")});let v={doctype:"Invoices",fields:["*"],orderBy:"creation desc",start:0,pageLength:5,auto:!0},o=null;return d.supplier_id&&d.isLoggedIn?(v.filters=[["supplier","=",d.supplier_id]],o=h(v)):o=h(v),o.fetch(),(J,n)=>{const m=g("router-link"),f=g("Button");return c(),a("div",L,[t("div",C,[t("div",P,[V,t("div",j,[t("div",$,[t("div",A,[i(m,{to:"/invoices/new"},{default:l(()=>[D]),_:1}),t("button",{type:"button",class:"btn btn-primary btn-dark",onClick:n[0]||(n[0]=(...e)=>s(d).logout.submit&&s(d).logout.submit(...e))}," Logout ")])])])]),s(o).data?(c(),a("div",F,[t("table",z,[E,t("tbody",M,[(c(!0),a(I,null,w(s(o).data,(e,x)=>(c(),a("tr",{key:x},[t("td",null,[i(m,{to:{name:"SupplierInvoice",params:{supplierInvoiceNumber:e.name}}},{default:l(()=>[r(p(e.name),1)]),_:2},1032,["to"])]),t("td",null,p(e.supplier),1),t("td",null,[i(s(N),null,{default:l(()=>[r(p(e.status),1)]),_:2},1024)]),t("td",null,[R,r(" "+p(e.total_amount),1)])]))),128))])])])):b("",!0)]),s(o).length>10?(c(),a("div",T,[i(f,{onClick:n[1]||(n[1]=e=>s(o).previous())},{default:l(()=>[q]),_:1}),i(f,{onClick:n[2]||(n[2]=e=>s(o).next())},{default:l(()=>[G]),_:1})])):b("",!0)])}}};var Q=y(H,[["__scopeId","data-v-6f6873f7"]]);export{Q as default}; diff --git a/suppliers_portal/public/frontend/assets/SupplierInvoiceList.b9274e01.css b/suppliers_portal/public/frontend/assets/SupplierInvoiceList.b9274e01.css deleted file mode 100644 index d370c4c..0000000 --- a/suppliers_portal/public/frontend/assets/SupplierInvoiceList.b9274e01.css +++ /dev/null @@ -1 +0,0 @@ -a[data-v-cd0c18b6]{text-decoration:none;color:inherit} diff --git a/suppliers_portal/public/frontend/assets/SupplierInvoiceList.bb721f49.js b/suppliers_portal/public/frontend/assets/SupplierInvoiceList.bb721f49.js deleted file mode 100644 index 604f33f..0000000 --- a/suppliers_portal/public/frontend/assets/SupplierInvoiceList.bb721f49.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as y,x as k,y as h,e as a,m as t,f as i,w as l,u as s,F as I,z as w,p as f,A as B,B as S,g,o as c,v as d,t as p,D as N}from"./vendor.3e69a9be.js";import{s as r}from"./index.ddd4919b.js";const _=u=>(B("data-v-cd0c18b6"),u=u(),S(),u),L={class:"container-fluid"},C={class:"container mx-auto mt-5"},P={class:"row"},V=_(()=>t("div",{class:"col"},[t("h1",{class:"text-gray-900 font-bold text-[32px]"},"Invoices"),t("div",{class:"d-flex"},[t("div",null,[t("div",{class:"btn-group",role:"group","aria-label":"Basic example"})])])],-1)),j={class:"col"},$={class:"d-flex"},A={class:"ms-auto d-flex",style:{gap:"2px"}},D=_(()=>t("button",{type:"button",class:"btn btn-primary btn-dark"},"New",-1)),F={key:0,class:"container mx-auto mb-3 mt-5"},z={class:"table"},E=_(()=>t("thead",null,[t("tr",null,[t("th",{scope:"col"},"Invoice Number"),t("th",{scope:"col"},"Supplier"),t("th",{scope:"col"},"Status"),t("th",{scope:"col"},"Amount")])],-1)),M={class:"table-group-divider"},R=_(()=>t("i",{class:"bi bi-currency-dollar"},null,-1)),T={key:0,class:"flex justify-between mt-4"},q=d(" Previous Page "),G=d(" Next Page "),H={setup(u){k(()=>{window.location.origin==="https://accounting.seahavenind.com"&&window.location.replace("https://accounting.seahavenind.com/login#login")});let v={doctype:"Invoices",fields:["*"],orderBy:"creation desc",start:0,pageLength:5,auto:!0},o=null;return r.supplier_id&&r.isLoggedIn?(v.filters=[["supplier","=",r.supplier_id]],o=h(v)):o=h(v),o.fetch(),(J,n)=>{const m=g("router-link"),b=g("Button");return c(),a("div",L,[t("div",C,[t("div",P,[V,t("div",j,[t("div",$,[t("div",A,[i(m,{to:"/invoices/new"},{default:l(()=>[D]),_:1}),t("button",{type:"button",class:"btn btn-primary btn-dark",onClick:n[0]||(n[0]=(...e)=>s(r).logout.submit&&s(r).logout.submit(...e))}," Logout ")])])])]),s(o).data?(c(),a("div",F,[t("table",z,[E,t("tbody",M,[(c(!0),a(I,null,w(s(o).data,(e,x)=>(c(),a("tr",{key:x},[t("td",null,[i(m,{to:{name:"SupplierInvoice",params:{supplierInvoiceNumber:e.name}}},{default:l(()=>[d(p(e.name),1)]),_:2},1032,["to"])]),t("td",null,p(e.supplier),1),t("td",null,[i(s(N),null,{default:l(()=>[d(p(e.status),1)]),_:2},1024)]),t("td",null,[R,d(" "+p(e.total_amount),1)])]))),128))])])])):f("",!0)]),s(o).length>10?(c(),a("div",T,[i(b,{onClick:n[1]||(n[1]=e=>s(o).previous())},{default:l(()=>[q]),_:1}),i(b,{onClick:n[2]||(n[2]=e=>s(o).next())},{default:l(()=>[G]),_:1})])):f("",!0)])}}};var Q=y(H,[["__scopeId","data-v-cd0c18b6"]]);export{Q as default}; diff --git a/suppliers_portal/public/frontend/assets/SupplierInvoiceList.e8de1e21.css b/suppliers_portal/public/frontend/assets/SupplierInvoiceList.e8de1e21.css new file mode 100644 index 0000000..03ba658 --- /dev/null +++ b/suppliers_portal/public/frontend/assets/SupplierInvoiceList.e8de1e21.css @@ -0,0 +1 @@ +a[data-v-6f6873f7]{text-decoration:none;color:inherit} diff --git a/suppliers_portal/public/frontend/assets/index.ddd4919b.js b/suppliers_portal/public/frontend/assets/index.c142ad70.js similarity index 69% rename from suppliers_portal/public/frontend/assets/index.ddd4919b.js rename to suppliers_portal/public/frontend/assets/index.c142ad70.js index 138a7f0..a213960 100644 --- a/suppliers_portal/public/frontend/assets/index.ddd4919b.js +++ b/suppliers_portal/public/frontend/assets/index.c142ad70.js @@ -1 +1 @@ -var h=(e,s,i)=>new Promise((n,r)=>{var t=p=>{try{l(i.next(p))}catch(g){r(g)}},c=p=>{try{l(i.throw(p))}catch(g){r(g)}},l=p=>p.done?n(p.value):Promise.resolve(p.value).then(t,c);l((i=i.apply(e,s)).next())});import{c as m,r as L,a as k,b as I,d as S,_ as y,e as E,f as b,g as P,o as C,h as R,s as T,i as w,j as $,C as U,I as j,k as O}from"./vendor.3e69a9be.js";const A=function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const t of r)if(t.type==="childList")for(const c of t.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function i(r){const t={};return r.integrity&&(t.integrity=r.integrity),r.referrerpolicy&&(t.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?t.credentials="include":r.crossorigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function n(r){if(r.ep)return;r.ep=!0;const t=i(r);fetch(r.href,t)}};A();const x="modulepreload",v={},N="/assets/suppliers_portal/frontend/",d=function(s,i){return!i||i.length===0?s():Promise.all(i.map(n=>{if(n=`${N}${n}`,n in v)return;v[n]=!0;const r=n.endsWith(".css"),t=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${t}`))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":x,r||(c.as="script",c.crossOrigin=""),c.href=n,document.head.appendChild(c),r)return new Promise((l,p)=>{c.addEventListener("load",l),c.addEventListener("error",p)})})).then(()=>s())},_=m({url:"frappe.auth.get_logged_user",cache:"User",onError(e){e&&e.exc_type==="AuthenticationError"&&u.push({name:"LoginPage"})}});function f(){let s=new URLSearchParams(document.cookie.split("; ").join("&")).get("user_id");return s==="Guest"&&(s=null),s}function V(){return new URLSearchParams(document.cookie.split("; ").join("&")).get("supplier_id")}function D(){return new URLSearchParams(document.cookie.split("; ").join("&")).get("supplier_name")}const o=L({supplier_login:m({url:"suppliers_portal.suppliers_portal.api.validate_supplier_id",makeParams({supplier_id:e}){return{supplier_id:e}},onSuccess(e){e&&e.status==="success"&&(_.reload(),o.user=f(),document.cookie=`supplier_id=${e.supplier_id}`,document.cookie=`supplier_name=${e.supplier_name}`,o.supplier_id=e.supplier_id,o.supplier_name=e.supplier_name,o.login.reset(),u.replace({name:"SupplierInvoiceList"}))},onError(e){console.error("Login failed",e)}}),login:m({url:"login",makeParams({email:e,password:s}){return{usr:e,pwd:s}},onSuccess(e){e&&(_.reload(),o.user=f(),document.cookie=`supplier_id=${o.supplier_id}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,document.cookie=`supplier_id=${o.supplier_name}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,o.supplier_id="",o.supplier_name="",o.login.reset(),u.replace({name:"SupplierInvoiceList"}))},onError(e){console.error("Login failed",e)}}),logout:m({url:"logout",onSuccess(){document.cookie=`supplier_id=${o.supplier_id}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,document.cookie=`supplier_id=${o.supplier_name}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,o.supplier_id="",o.supplier_name="",_.reset(),o.user=f(),u.replace({name:"Login"})}}),user:f(),supplier_id:V(),supplier_name:D(),isLoggedIn:k(()=>!!o.user)}),J=[{name:"Login",path:"/login",component:()=>d(()=>import("./Login.24b835cc.js"),["assets/Login.24b835cc.js","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])},{name:"SupplierInvoiceList",path:"/",component:()=>d(()=>import("./SupplierInvoiceList.bb721f49.js"),["assets/SupplierInvoiceList.bb721f49.js","assets/SupplierInvoiceList.b9274e01.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])},{name:"SupplierInvoice",path:"/invoices/:supplierInvoiceNumber",component:()=>d(()=>import("./SupplierInvoice.beb0f4cf.js"),["assets/SupplierInvoice.beb0f4cf.js","assets/SupplierInvoice.9dfb3ca8.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"]),props:!0},{name:"SupplierInvoiceCreate",path:"/invoices/new",component:()=>d(()=>import("./NewInvoice.b62c41f3.js"),["assets/NewInvoice.b62c41f3.js","assets/NewInvoice.67c196f0.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])}];let u=I({history:S("/supplier-portal"),routes:J});u.beforeEach((e,s,i)=>h(void 0,null,function*(){let n=o.isLoggedIn;try{yield _.promise}catch(r){n=!1}e.name==="Login"&&n?i({name:"SupplierInvoiceList"}):e.name!=="Login"&&!n?i({name:"Login"}):i()}));const q={};function B(e,s){const i=P("router-view");return C(),E("div",null,[b(i)])}var F=y(q,[["render",B]]);let a=R(F);T("resourceFetcher",O);a.use(u);a.use(w);a.component("Button",$);a.component("Card",U);a.component("Input",j);a.mount("#app");export{f as a,V as b,D as c,u as r,o as s}; +var h=(e,s,i)=>new Promise((n,r)=>{var t=u=>{try{l(i.next(u))}catch(g){r(g)}},c=u=>{try{l(i.throw(u))}catch(g){r(g)}},l=u=>u.done?n(u.value):Promise.resolve(u.value).then(t,c);l((i=i.apply(e,s)).next())});import{c as m,r as L,a as k,b as I,d as S,_ as y,e as E,f as P,g as b,o as C,h as R,s as T,i as w,j as $,C as U,I as j,k as O}from"./vendor.3e69a9be.js";const A=function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const t of r)if(t.type==="childList")for(const c of t.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function i(r){const t={};return r.integrity&&(t.integrity=r.integrity),r.referrerpolicy&&(t.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?t.credentials="include":r.crossorigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function n(r){if(r.ep)return;r.ep=!0;const t=i(r);fetch(r.href,t)}};A();const x="modulepreload",v={},N="/assets/suppliers_portal/frontend/",d=function(s,i){return!i||i.length===0?s():Promise.all(i.map(n=>{if(n=`${N}${n}`,n in v)return;v[n]=!0;const r=n.endsWith(".css"),t=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${t}`))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":x,r||(c.as="script",c.crossOrigin=""),c.href=n,document.head.appendChild(c),r)return new Promise((l,u)=>{c.addEventListener("load",l),c.addEventListener("error",u)})})).then(()=>s())},_=m({url:"frappe.auth.get_logged_user",cache:"User",onError(e){e&&e.exc_type==="AuthenticationError"&&p.push({name:"LoginPage"})}});function f(){let s=new URLSearchParams(document.cookie.split("; ").join("&")).get("user_id");return s==="Guest"&&(s=null),s}function V(){return new URLSearchParams(document.cookie.split("; ").join("&")).get("supplier_id")}function D(){return new URLSearchParams(document.cookie.split("; ").join("&")).get("supplier_name")}const o=L({supplier_login:m({url:"suppliers_portal.suppliers_portal.api.validate_supplier_id",makeParams({supplier_id:e}){return{supplier_id:e}},onSuccess(e){e&&e.status==="success"&&(_.reload(),o.user=f(),document.cookie=`supplier_id=${e.supplier_id}`,document.cookie=`supplier_name=${e.supplier_name}`,o.supplier_id=e.supplier_id,o.supplier_name=e.supplier_name,o.login.reset(),p.replace({name:"SupplierInvoiceList"}))},onError(e){console.error("Login failed",e)}}),login:m({url:"login",makeParams({email:e,password:s}){return{usr:e,pwd:s}},onSuccess(e){e&&(_.reload(),o.user=f(),document.cookie=`supplier_id=${o.supplier_id}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,document.cookie=`supplier_id=${o.supplier_name}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,o.supplier_id="",o.supplier_name="",o.login.reset(),p.replace({name:"SupplierInvoiceList"}))},onError(e){console.error("Login failed",e)}}),logout:m({url:"logout",onSuccess(){document.cookie=`supplier_id=${o.supplier_id}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,document.cookie=`supplier_id=${o.supplier_name}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,o.supplier_id="",o.supplier_name="",_.reset(),o.user=f(),p.replace({name:"Login"})}}),user:f(),supplier_id:V(),supplier_name:D(),isLoggedIn:k(()=>!!o.user)}),J=[{name:"Login",path:"/login",component:()=>d(()=>import("./Login.80913e45.js"),["assets/Login.80913e45.js","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])},{name:"SupplierInvoiceList",path:"/",component:()=>d(()=>import("./SupplierInvoiceList.55bab896.js"),["assets/SupplierInvoiceList.55bab896.js","assets/SupplierInvoiceList.e8de1e21.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])},{name:"SupplierInvoice",path:"/invoices/:supplierInvoiceNumber",component:()=>d(()=>import("./SupplierInvoice.beb0f4cf.js"),["assets/SupplierInvoice.beb0f4cf.js","assets/SupplierInvoice.9dfb3ca8.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"]),props:!0},{name:"SupplierInvoiceCreate",path:"/invoices/new",component:()=>d(()=>import("./NewInvoice.1228f5fc.js"),["assets/NewInvoice.1228f5fc.js","assets/NewInvoice.67c196f0.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])}];let p=I({history:S("/frontend"),routes:J});p.beforeEach((e,s,i)=>h(void 0,null,function*(){let n=o.isLoggedIn;try{yield _.promise}catch(r){n=!1}e.name==="Login"&&n?i({name:"SupplierInvoiceList"}):e.name!=="Login"&&!n?i({name:"Login"}):i()}));const q={};function B(e,s){const i=b("router-view");return C(),E("div",null,[P(i)])}var F=y(q,[["render",B]]);let a=R(F);T("resourceFetcher",O);a.use(p);a.use(w);a.component("Button",$);a.component("Card",U);a.component("Input",j);a.mount("#app");export{f as a,V as b,D as c,p as r,o as s}; diff --git a/suppliers_portal/public/frontend/index.html b/suppliers_portal/public/frontend/index.html index ded35f6..8a55153 100644 --- a/suppliers_portal/public/frontend/index.html +++ b/suppliers_portal/public/frontend/index.html @@ -5,7 +5,7 @@ Supplier Portal - + diff --git a/suppliers_portal/www/frontend.html b/suppliers_portal/www/frontend.html index ded35f6..8a55153 100644 --- a/suppliers_portal/www/frontend.html +++ b/suppliers_portal/www/frontend.html @@ -5,7 +5,7 @@ Supplier Portal - +