import{_ as w,x as N,a as A,E as R,G as C,o as c,f as k,w as a,c as t,j as L,i as l,t as _,J as b,g as x,F as y,A as z,aL as F,aw as H,n as V,v as I,aR as M,ad as U,aX as j,e as p,az as q,aD as G,aE as J}from"./app-DGDivIsO.js";import{d as P}from"./datatable-Cnt5bvOi.js";import{A as W}from"./AdminPageHeader-ff2SFNbk.js";import{U as X}from"./UserInfo-u_wyRiK9.js";import{d as K,E as O}from"./ExportTable-DVHni2a8.js";import{P as Q}from"./PaymentStatus-DFh8-zEw.js";import{P as Y}from"./ProductSearchInput-DOAaszRn.js";import"./filter-_TPdNMe8.js";import"./index-C2QBqMxH.js";import"./FilePdfOutlined-sFW7F47J.js";import"./PrinterOutlined-zjsA7tiW.js";import"./fields-DMP5eaRW.js";import"./FileExcelOutlined-Cuxlntse.js";const Z=N({props:{product_id:null},components:{UserInfo:X,PaymentStatus:Q},setup(e){const{columns:d,hashableColumns:f}=K(),{formatDateTime:u,formatAmountCurrency:g,selectedWarehouse:h}=A(),r=P();R(()=>{m(e)});const m=o=>{const s={};o.product_id&&o.product_id!=null&&(s.x_id=o.product_id),r.tableUrl.value={url:"products?fields=id,xid,name,,item_code,image,image_url,category_id,x_category_id,category{id,xid,name},brand_id,x_brand_id,brand{id,xid,name},unit_id,x_unit_id,unit{id,xid,name,short_name},details{mrp,sales_price,tax_id,x_tax_id,purchase_tax_type,sales_tax_type},details:tax{id,xid,name,rate}",extraFilters:s},r.hashable.value=[...f],r.table.sorter={field:"name",order:"asc"},r.exportDetails.value={allowExport:!0,exportType:"rate_list_reports"},r.fetch({page:1})};return C(e,(o,s)=>{m(o)}),C(h,(o,s)=>{m(e)}),{columns:d,...r,formatDateTime:u,formatAmountCurrency:g}}}),ee={class:"table-responsive"};function te(e,d,f,u,g,h){const r=z,m=F,o=H,s=V,$=I;return c(),k($,null,{default:a(()=>[t(s,{span:24},{default:a(()=>[L("div",ee,[t(o,{columns:e.columns,"row-key":i=>i.xid,"data-source":e.table.data,pagination:e.table.pagination,loading:e.table.loading,onChange:e.handleTableChange,id:"rate-list-reports-table",bordered:"",size:"middle"},{bodyCell:a(({column:i,record:n})=>[i.dataIndex==="name"?(c(),k(m,{key:0},{default:a(()=>[t(r,{shape:"square",src:n.image_url},null,8,["src"]),l(" "+_(n.name),1)]),_:2},1024)):b("",!0),i.dataIndex==="category_id"?(c(),x(y,{key:1},[l(_(n.category&&n.category.name?n.category.name:"-"),1)],64)):b("",!0),i.dataIndex==="brand_id"?(c(),x(y,{key:2},[l(_(n.brand&&n.brand.name?n.brand.name:"-"),1)],64)):b("",!0),i.dataIndex==="mrp"?(c(),x(y,{key:3},[l(_(n.details.mrp?e.formatAmountCurrency(n.details.mrp):"-"),1)],64)):b("",!0),i.dataIndex==="sales_price"?(c(),x(y,{key:4},[l(_(e.formatAmountCurrency(n.details.sales_price)),1)],64)):b("",!0)]),_:1},8,["columns","row-key","data-source","pagination","loading","onChange"])])]),_:1})]),_:1})}const ae=w(Z,[["render",te]]),ne={components:{AdminPageHeader:W,RateList:ae,ProductSearchInput:Y,ExprotTable:O},setup(){const e=P(),{permsArray:d,willSubscriptionModuleVisible:f}=A(),u=M(),g=U({product_id:void 0});return j(()=>{(!(d.value.includes("products_view")||d.value.includes("admin"))||!f("reports"))&&u.push("admin.dashboard.index")}),{...e,permsArray:d,filters:g}}};function oe(e,d,f,u,g,h){const r=p("ExprotTable"),m=q,o=p("router-link"),s=G,$=J,i=p("AdminPageHeader"),n=V,E=p("ProductSearchInput"),v=I,T=p("admin-page-filters"),B=p("RateList"),S=p("admin-page-table-content");return c(),x(y,null,[t(i,null,{header:a(()=>[t(m,{title:e.$t("menu.rate_list"),class:"p-0"},{extra:a(()=>[t(r,{exportType:"rate_list_reports",tableName:"rate-list-reports-table",title:`${e.$t("menu.rate_list")} ${e.$t("menu.reports")}`},null,8,["title"])]),_:1},8,["title"])]),breadcrumb:a(()=>[t($,{separator:"-",style:{"font-size":"12px"}},{default:a(()=>[t(s,null,{default:a(()=>[t(o,{to:{name:"admin.dashboard.index"}},{default:a(()=>[l(_(e.$t("menu.dashboard")),1)]),_:1})]),_:1}),t(s,null,{default:a(()=>[l(_(e.$t("menu.reports")),1)]),_:1}),t(s,null,{default:a(()=>[l(_(e.$t("menu.rate_list")),1)]),_:1})]),_:1})]),_:1}),t(T,null,{default:a(()=>[t(v,{gutter:[16,16]},{default:a(()=>[t(n,{xs:24,sm:24,md:12,lg:10,xl:10}),t(n,{xs:24,sm:24,md:12,lg:14,xl:14},{default:a(()=>[t(v,{gutter:[16,16],justify:"end"},{default:a(()=>[t(n,{xs:24,sm:24,md:12,lg:8,xl:6},{default:a(()=>[t(E,{onValueChanged:d[0]||(d[0]=D=>{u.filters.product_id=D})})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),t(S,null,{default:a(()=>[t(B,{product_id:u.filters.product_id},null,8,["product_id"])]),_:1})],64)}const xe=w(ne,[["render",oe]]);export{xe as default};
