芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/invoicer.pulsehost.co.uk/public/build/assets/Index-Bf0R-klq.js
import{v as j,G as I,H as V,f as k,ab as o,E as L,k as O,z as F,X as E,r as m,o as W,c as H,b as c,a,w as i,l as G,p as q,t as x,q as N,m as A,J as K}from"./main-WS8l16KQ.js";const Z={class:"grid gap-8 md:grid-cols-12 pt-10"},ee={class:"col-span-8 md:col-span-4"},te={class:"flex flex-col my-6 lg:space-x-3 lg:flex-row"},ae=c("div",{class:"hidden w-5 h-0 mx-4 border border-gray-400 border-solid xl:block",style:{"margin-top":"2.5rem"}},null,-1),oe={class:"col-span-8"},re=["src"],se={__name:"SalesReports",setup(U){const{t:_}=j.useI18n(),h=I();h.downloadReport=$;const l=V([{label:_("dateRange.today"),key:"Today"},{label:_("dateRange.this_week"),key:"This Week"},{label:_("dateRange.this_month"),key:"This Month"},{label:_("dateRange.this_quarter"),key:"This Quarter"},{label:_("dateRange.this_year"),key:"This Year"},{label:_("dateRange.previous_week"),key:"Previous Week"},{label:_("dateRange.previous_month"),key:"Previous Month"},{label:_("dateRange.previous_quarter"),key:"Previous Quarter"},{label:_("dateRange.previous_year"),key:"Previous Year"},{label:_("dateRange.custom"),key:"Custom"}]),M=k(l[2]),r=k([{label:_("reports.sales.sort.by_customer"),value:"By Customer"},{label:_("reports.sales.sort.by_item"),value:"By Item"}]),y=k("By Customer");let D=k(new Date),Y=k(null),e=k(null),g=k(null),s=V({from_date:o().startOf("month").format("YYYY-MM-DD").toString(),to_date:o().endOf("month").format("YYYY-MM-DD").toString()});const B=L(),d=O(()=>Y.value),u=O(()=>B.selectedCompany),T=O(()=>`${e.value}?from_date=${o(s.from_date).format("YYYY-MM-DD")}&to_date=${o(s.to_date).format("YYYY-MM-DD")}`),P=O(()=>`${g.value}?from_date=${o(s.from_date).format("YYYY-MM-DD")}&to_date=${o(s.to_date).format("YYYY-MM-DD")}`);F(D,p=>{s.from_date=o(p).startOf("year").toString(),s.to_date=o(p).endOf("year").toString()}),E(()=>{e.value=`/reports/sales/customers/${u.value.unique_hash}`,g.value=`/reports/sales/items/${u.value.unique_hash}`,n()});function f(p,v){return o()[p](v).format("YYYY-MM-DD")}function R(p,v){return o().subtract(1,v)[p](v).format("YYYY-MM-DD")}function t(){switch(M.value.key){case"Today":s.from_date=o().format("YYYY-MM-DD"),s.to_date=o().format("YYYY-MM-DD");break;case"This Week":s.from_date=f("startOf","isoWeek"),s.to_date=f("endOf","isoWeek");break;case"This Month":s.from_date=f("startOf","month"),s.to_date=f("endOf","month");break;case"This Quarter":s.from_date=f("startOf","quarter"),s.to_date=f("endOf","quarter");break;case"This Year":s.from_date=f("startOf","year"),s.to_date=f("endOf","year");break;case"Previous Week":s.from_date=R("startOf","isoWeek"),s.to_date=R("endOf","isoWeek");break;case"Previous Month":s.from_date=R("startOf","month"),s.to_date=R("endOf","month");break;case"Previous Quarter":s.from_date=R("startOf","quarter"),s.to_date=R("endOf","quarter");break;case"Previous Year":s.from_date=R("startOf","year"),s.to_date=R("endOf","year");break}}async function n(){return y.value==="By Customer"?(Y.value=T.value,!0):(Y.value=P.value,!0)}async function S(){let p=await w();return window.open(d.value,"_blank"),p}function w(){return y.value==="By Customer"?(Y.value=T.value,!0):(Y.value=P.value,!0)}function $(){if(!w())return!1;window.open(d.value+"&download=true"),setTimeout(()=>y.value==="By Customer"?(Y.value=T.value,!0):(Y.value=P.value,!0),200)}return(p,v)=>{const b=m("BaseMultiselect"),Q=m("BaseInputGroup"),z=m("BaseDatePicker"),J=m("BaseButton"),X=m("BaseIcon");return W(),H("div",Z,[c("div",ee,[a(Q,{label:p.$t("reports.sales.date_range"),class:"col-span-12 md:col-span-8"},{default:i(()=>[a(b,{modelValue:M.value,"onUpdate:modelValue":[v[0]||(v[0]=C=>M.value=C),t],options:l,"value-prop":"key","track-by":"key",label:"label",object:""},null,8,["modelValue","options"])]),_:1},8,["label"]),c("div",te,[a(Q,{label:p.$t("reports.sales.from_date")},{default:i(()=>[a(z,{modelValue:G(s).from_date,"onUpdate:modelValue":v[1]||(v[1]=C=>G(s).from_date=C)},null,8,["modelValue"])]),_:1},8,["label"]),ae,a(Q,{label:p.$t("reports.sales.to_date")},{default:i(()=>[a(z,{modelValue:G(s).to_date,"onUpdate:modelValue":v[2]||(v[2]=C=>G(s).to_date=C)},null,8,["modelValue"])]),_:1},8,["label"])]),a(Q,{label:p.$t("reports.sales.report_type"),class:"col-span-12 md:col-span-8"},{default:i(()=>[a(b,{modelValue:y.value,"onUpdate:modelValue":[v[3]||(v[3]=C=>y.value=C),n],options:r.value,placeholder:p.$t("reports.sales.report_type"),class:"mt-1"},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),a(J,{variant:"primary-outline",class:"content-center hidden mt-0 w-md md:flex md:mt-8",type:"submit",onClick:N(w,["prevent"])},{default:i(()=>[q(x(p.$t("reports.update_report")),1)]),_:1})]),c("div",oe,[c("iframe",{src:d.value,class:"hidden w-full h-screen border-gray-100 border-solid rounded md:flex"},null,8,re),c("a",{class:"flex items-center justify-center h-10 px-5 py-1 text-sm font-medium leading-none text-center text-white rounded whitespace-nowrap md:hidden bg-primary-500",onClick:S},[a(X,{name:"DocumentTextIcon",class:"h-5 mr-2"}),c("span",null,x(p.$t("reports.view_pdf")),1)])])])}}},ne={class:"grid gap-8 md:grid-cols-12 pt-10"},le={class:"col-span-8 md:col-span-4"},de={class:"flex flex-col mt-6 lg:space-x-3 lg:flex-row"},ue=c("div",{class:"hidden w-5 h-0 mx-4 border border-gray-400 border-solid xl:block",style:{"margin-top":"2.5rem"}},null,-1),ie={class:"col-span-8"},me=["src"],ce={__name:"ExpensesReport",setup(U){const _=I(),h=L(),{t:l}=j.useI18n();_.downloadReport=R;const M=V([{label:l("dateRange.today"),key:"Today"},{label:l("dateRange.this_week"),key:"This Week"},{label:l("dateRange.this_month"),key:"This Month"},{label:l("dateRange.this_quarter"),key:"This Quarter"},{label:l("dateRange.this_year"),key:"This Year"},{label:l("dateRange.previous_week"),key:"Previous Week"},{label:l("dateRange.previous_month"),key:"Previous Month"},{label:l("dateRange.previous_quarter"),key:"Previous Quarter"},{label:l("dateRange.previous_year"),key:"Previous Year"},{label:l("dateRange.custom"),key:"Custom"}]),r=k(M[2]);let y=k(new Date),D=k(null),Y=k(null);const e=V({from_date:o().startOf("month").toString(),to_date:o().endOf("month").toString()}),g=O(()=>D.value),s=O(()=>h.selectedCompany),B=O(()=>`${Y.value}?from_date=${o(e.from_date).format("YYYY-MM-DD")}&to_date=${o(e.to_date).format("YYYY-MM-DD")}`);E(()=>{Y.value=`/reports/expenses/${s.value.unique_hash}`,D.value=B.value}),F(()=>y,t=>{e.from_date=o(t).startOf("year").toString(),e.to_date=o(t).endOf("year").toString()});function d(t,n){return o()[t](n).format("YYYY-MM-DD")}function u(t,n){return o().subtract(1,n)[t](n).format("YYYY-MM-DD")}function T(){switch(r.value.key){case"Today":e.from_date=o().format("YYYY-MM-DD"),e.to_date=o().format("YYYY-MM-DD");break;case"This Week":e.from_date=d("startOf","isoWeek"),e.to_date=d("endOf","isoWeek");break;case"This Month":e.from_date=d("startOf","month"),e.to_date=d("endOf","month");break;case"This Quarter":e.from_date=d("startOf","quarter"),e.to_date=d("endOf","quarter");break;case"This Year":e.from_date=d("startOf","year"),e.to_date=d("endOf","year");break;case"Previous Week":e.from_date=u("startOf","isoWeek"),e.to_date=u("endOf","isoWeek");break;case"Previous Month":e.from_date=u("startOf","month"),e.to_date=u("endOf","month");break;case"Previous Quarter":e.from_date=u("startOf","quarter"),e.to_date=u("endOf","quarter");break;case"Previous Year":e.from_date=u("startOf","year"),e.to_date=u("endOf","year");break}}async function P(){let t=await f();return window.open(g.value,"_blank"),t}function f(){return D.value=B.value,!0}function R(){f(),window.open(g.value+"&download=true"),setTimeout(()=>{D.value=B.value},200)}return(t,n)=>{const S=m("BaseMultiselect"),w=m("BaseInputGroup"),$=m("BaseDatePicker"),p=m("BaseButton"),v=m("BaseIcon");return W(),H("div",ne,[c("div",le,[a(w,{label:t.$t("reports.sales.date_range"),class:"col-span-12 md:col-span-8"},{default:i(()=>[a(S,{modelValue:r.value,"onUpdate:modelValue":[n[0]||(n[0]=b=>r.value=b),T],options:M,"value-prop":"key","track-by":"key",label:"label",object:""},null,8,["modelValue","options"])]),_:1},8,["label"]),c("div",de,[a(w,{label:t.$t("reports.expenses.from_date")},{default:i(()=>[a($,{modelValue:e.from_date,"onUpdate:modelValue":n[1]||(n[1]=b=>e.from_date=b)},null,8,["modelValue"])]),_:1},8,["label"]),ue,a(w,{label:t.$t("reports.expenses.to_date")},{default:i(()=>[a($,{modelValue:e.to_date,"onUpdate:modelValue":n[2]||(n[2]=b=>e.to_date=b)},null,8,["modelValue"])]),_:1},8,["label"])]),a(p,{variant:"primary-outline",class:"content-center hidden mt-0 w-md md:flex md:mt-8",type:"submit",onClick:N(f,["prevent"])},{default:i(()=>[q(x(t.$t("reports.update_report")),1)]),_:1})]),c("div",ie,[c("iframe",{src:g.value,class:"hidden w-full h-screen border-gray-100 border-solid rounded md:flex"},null,8,me),c("a",{class:"flex items-center justify-center h-10 px-5 py-1 text-sm font-medium leading-none text-center text-white rounded whitespace-nowrap md:hidden bg-primary-500 cursor-pointer",onClick:P},[a(v,{name:"DocumentTextIcon",class:"h-5 mr-2"}),c("span",null,x(t.$t("reports.view_pdf")),1)])])])}}},pe={class:"grid gap-8 md:grid-cols-12 pt-10"},_e={class:"col-span-8 md:col-span-4"},fe={class:"flex flex-col mt-6 lg:space-x-3 lg:flex-row"},be=c("div",{class:"hidden w-5 h-0 mx-4 border border-gray-400 border-solid xl:block",style:{"margin-top":"2.5rem"}},null,-1),ye={class:"col-span-8"},ve=["src"],ke={__name:"ProfitLossReport",setup(U){const _=I(),h=L(),{t:l}=j.useI18n();_.downloadReport=R;const M=V([{label:l("dateRange.today"),key:"Today"},{label:l("dateRange.this_week"),key:"This Week"},{label:l("dateRange.this_month"),key:"This Month"},{label:l("dateRange.this_quarter"),key:"This Quarter"},{label:l("dateRange.this_year"),key:"This Year"},{label:l("dateRange.previous_week"),key:"Previous Week"},{label:l("dateRange.previous_month"),key:"Previous Month"},{label:l("dateRange.previous_quarter"),key:"Previous Quarter"},{label:l("dateRange.previous_year"),key:"Previous Year"},{label:l("dateRange.custom"),key:"Custom"}]),r=k(M[2]);let y=k(null),D=k(null),Y=k(new Date);const e=V({from_date:o().startOf("month").toString(),to_date:o().endOf("month").toString()}),g=O(()=>y.value),s=O(()=>h.selectedCompany),B=O(()=>`${D.value}?from_date=${o(e.from_date).format("YYYY-MM-DD")}&to_date=${o(e.to_date).format("YYYY-MM-DD")}`);F(Y,t=>{e.from_date=o(t).startOf("year").toString(),e.to_date=o(t).endOf("year").toString()}),E(()=>{D.value=`/reports/profit-loss/${s.value.unique_hash}`,y.value=B.value});function d(t,n){return o()[t](n).format("YYYY-MM-DD")}function u(t,n){return o().subtract(1,n)[t](n).format("YYYY-MM-DD")}function T(){switch(r.value.key){case"Today":e.from_date=o().format("YYYY-MM-DD"),e.to_date=o().format("YYYY-MM-DD");break;case"This Week":e.from_date=d("startOf","isoWeek"),e.to_date=d("endOf","isoWeek");break;case"This Month":e.from_date=d("startOf","month"),e.to_date=d("endOf","month");break;case"This Quarter":e.from_date=d("startOf","quarter"),e.to_date=d("endOf","quarter");break;case"This Year":e.from_date=d("startOf","year"),e.to_date=d("endOf","year");break;case"Previous Week":e.from_date=u("startOf","isoWeek"),e.to_date=u("endOf","isoWeek");break;case"Previous Month":e.from_date=u("startOf","month"),e.to_date=u("endOf","month");break;case"Previous Quarter":e.from_date=u("startOf","quarter"),e.to_date=u("endOf","quarter");break;case"Previous Year":e.from_date=u("startOf","year"),e.to_date=u("endOf","year");break}}async function P(){let t=await f();return window.open(g.value,"_blank"),t}function f(){return y.value=B.value,!0}function R(){f(),window.open(g.value+"&download=true"),setTimeout(()=>{y.value=B.value},200)}return(t,n)=>{const S=m("BaseMultiselect"),w=m("BaseInputGroup"),$=m("BaseDatePicker"),p=m("BaseButton"),v=m("BaseIcon");return W(),H("div",pe,[c("div",_e,[a(w,{label:t.$t("reports.profit_loss.date_range"),class:"col-span-12 md:col-span-8"},{default:i(()=>[a(S,{modelValue:r.value,"onUpdate:modelValue":[n[0]||(n[0]=b=>r.value=b),T],options:M,"value-prop":"key","track-by":"key",label:"label",object:""},null,8,["modelValue","options"])]),_:1},8,["label"]),c("div",fe,[a(w,{label:t.$t("reports.profit_loss.from_date")},{default:i(()=>[a($,{modelValue:e.from_date,"onUpdate:modelValue":n[1]||(n[1]=b=>e.from_date=b)},null,8,["modelValue"])]),_:1},8,["label"]),be,a(w,{label:t.$t("reports.profit_loss.to_date")},{default:i(()=>[a($,{modelValue:e.to_date,"onUpdate:modelValue":n[2]||(n[2]=b=>e.to_date=b)},null,8,["modelValue"])]),_:1},8,["label"])]),a(p,{variant:"primary-outline",class:"content-center hidden mt-0 w-md md:flex md:mt-8",type:"submit",onClick:N(f,["prevent"])},{default:i(()=>[q(x(t.$t("reports.update_report")),1)]),_:1})]),c("div",ye,[c("iframe",{src:g.value,class:"hidden w-full h-screen border-gray-100 border-solid rounded md:flex"},null,8,ve),c("a",{class:"flex items-center justify-center h-10 px-5 py-1 text-sm font-medium leading-none text-center text-white rounded whitespace-nowrap md:hidden bg-primary-500",onClick:P},[a(v,{name:"DocumentTextIcon",class:"h-5 mr-2"}),c("span",null,x(t.$t("reports.view_pdf")),1)])])])}}},he={class:"grid gap-8 md:grid-cols-12 pt-10"},ge={class:"col-span-8 md:col-span-4"},Ye={class:"flex flex-col mt-6 lg:space-x-3 lg:flex-row"},De=c("div",{class:"hidden w-5 h-0 mx-4 border border-gray-400 border-solid xl:block",style:{"margin-top":"2.5rem"}},null,-1),we={class:"col-span-8"},Me=["src"],Re={__name:"TaxReport",setup(U){const _=I();_.downloadReport=R;const{t:h}=j.useI18n(),l=V([{label:h("dateRange.today"),key:"Today"},{label:h("dateRange.this_week"),key:"This Week"},{label:h("dateRange.this_month"),key:"This Month"},{label:h("dateRange.this_quarter"),key:"This Quarter"},{label:h("dateRange.this_year"),key:"This Year"},{label:h("dateRange.previous_week"),key:"Previous Week"},{label:h("dateRange.previous_month"),key:"Previous Month"},{label:h("dateRange.previous_quarter"),key:"Previous Quarter"},{label:h("dateRange.previous_year"),key:"Previous Year"},{label:h("dateRange.custom"),key:"Custom"}]),M=k(l[2]),r=V({from_date:o().startOf("month").format("YYYY-MM-DD").toString(),to_date:o().endOf("month").format("YYYY-MM-DD").toString()});let y=k(null);const D=O(()=>y.value),Y=L(),e=O(()=>Y.selectedCompany);let g=k(null);E(()=>{g.value=`/reports/tax-summary/${e.value.unique_hash}`,y.value=s.value});const s=O(()=>`${g.value}?from_date=${o(r.from_date).format("YYYY-MM-DD")}&to_date=${o(r.to_date).format("YYYY-MM-DD")}`);let B=k(new Date);F(B.value,t=>{r.from_date=o(t).startOf("year").toString(),r.to_date=o(t).endOf("year").toString()});function d(t,n){return o()[t](n).format("YYYY-MM-DD")}function u(t,n){return o().subtract(1,n)[t](n).format("YYYY-MM-DD")}function T(){switch(M.value.key){case"Today":r.from_date=o().format("YYYY-MM-DD"),r.to_date=o().format("YYYY-MM-DD");break;case"This Week":r.from_date=d("startOf","isoWeek"),r.to_date=d("endOf","isoWeek");break;case"This Month":r.from_date=d("startOf","month"),r.to_date=d("endOf","month");break;case"This Quarter":r.from_date=d("startOf","quarter"),r.to_date=d("endOf","quarter");break;case"This Year":r.from_date=d("startOf","year"),r.to_date=d("endOf","year");break;case"Previous Week":r.from_date=u("startOf","isoWeek"),r.to_date=u("endOf","isoWeek");break;case"Previous Month":r.from_date=u("startOf","month"),r.to_date=u("endOf","month");break;case"Previous Quarter":r.from_date=u("startOf","quarter"),r.to_date=u("endOf","quarter");break;case"Previous Year":r.from_date=u("startOf","year"),r.to_date=u("endOf","year");break}}async function P(){let t=await f();return window.open(D.value,"_blank"),t}function f(){return y.value=s.value,!0}function R(){f(),window.open(D.value+"&download=true"),setTimeout(()=>{y.value=s.value},200)}return(t,n)=>{const S=m("BaseMultiselect"),w=m("BaseInputGroup"),$=m("BaseDatePicker"),p=m("BaseButton"),v=m("BaseIcon");return W(),H("div",he,[c("div",ge,[a(w,{label:t.$t("reports.taxes.date_range"),class:"col-span-12 md:col-span-8"},{default:i(()=>[a(S,{modelValue:M.value,"onUpdate:modelValue":[n[0]||(n[0]=b=>M.value=b),T],options:l,"value-prop":"key","track-by":"key",label:"label",object:""},null,8,["modelValue","options"])]),_:1},8,["label"]),c("div",Ye,[a(w,{label:t.$t("reports.taxes.from_date")},{default:i(()=>[a($,{modelValue:r.from_date,"onUpdate:modelValue":n[1]||(n[1]=b=>r.from_date=b)},null,8,["modelValue"])]),_:1},8,["label"]),De,a(w,{label:t.$t("reports.taxes.to_date")},{default:i(()=>[a($,{modelValue:r.to_date,"onUpdate:modelValue":n[2]||(n[2]=b=>r.to_date=b)},null,8,["modelValue"])]),_:1},8,["label"])]),a(p,{variant:"primary-outline",class:"content-center hidden mt-0 w-md md:flex md:mt-8",type:"submit",onClick:N(f,["prevent"])},{default:i(()=>[q(x(t.$t("reports.update_report")),1)]),_:1})]),c("div",we,[c("iframe",{src:D.value,class:"hidden w-full h-screen border-gray-100 border-solid rounded md:flex"},null,8,Me),c("a",{class:"flex items-center justify-center h-10 px-5 py-1 text-sm font-medium leading-none text-center text-white rounded whitespace-nowrap md:hidden bg-primary-500",onClick:P},[a(v,{name:"DocumentTextIcon",class:"h-5 mr-2"}),c("span",null,x(t.$t("reports.view_pdf")),1)])])])}}},Oe={__name:"Index",setup(U){const _=I();function h(){_.downloadReport()}return(l,M)=>{const r=m("BaseBreadcrumbItem"),y=m("BaseBreadcrumb"),D=m("BaseIcon"),Y=m("BaseButton"),e=m("BasePageHeader"),g=m("BaseTab"),s=m("BaseTabGroup"),B=m("BasePage");return W(),A(B,null,{default:i(()=>[a(e,{title:l.$t("reports.report",2)},{actions:i(()=>[a(Y,{variant:"primary",class:"ml-4",onClick:h},{left:i(d=>[a(D,{name:"DownloadIcon",class:K(d.class)},null,8,["class"])]),default:i(()=>[q(" "+x(l.$t("reports.download_pdf")),1)]),_:1})]),default:i(()=>[a(y,null,{default:i(()=>[a(r,{title:l.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),a(r,{title:l.$t("reports.report",2),to:"/admin/reports",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),a(s,{class:"p-2"},{default:i(()=>[a(g,{title:l.$t("reports.sales.sales"),"tab-panel-container":"px-0 py-0"},{default:i(()=>[a(se,{ref:"report"},null,512)]),_:1},8,["title"]),a(g,{title:l.$t("reports.profit_loss.profit_loss"),"tab-panel-container":"px-0 py-0"},{default:i(()=>[a(ke,{ref:"report"},null,512)]),_:1},8,["title"]),a(g,{title:l.$t("reports.expenses.expenses"),"tab-panel-container":"px-0 py-0"},{default:i(()=>[a(ce,{ref:"report"},null,512)]),_:1},8,["title"]),a(g,{title:l.$t("reports.taxes.taxes"),"tab-panel-container":"px-0 py-0"},{default:i(()=>[a(Re,{ref:"report"},null,512)]),_:1},8,["title"])]),_:1})]),_:1})}}};export{Oe as default};