import{f as V,g as I,o as M,c as y,b as t,a as n,z as G,av as B,q as L,ax as z,aw as $,F as q,r as a}from"./vendor-0kGcmQpG.js";import{_ as A}from"./ComboDynamique-CzrtYPe1.js";import{S as E,k as J,h as i}from"./index-Bn9WoKhP.js";const U={class:"flex flex-row justify-start gap-3 mt-2 mb-2"},P={class:"grid grid-cols-1 md:grid-cols-3 gap-4 w-full"},j={class:"p-float-label"},H={class:"flex items-center"},K={style:"height: calc(100vh - 240px)",class:"ag-theme-quartz"},Y={__name:"ImportationSpecialeEcritures",setup(O){const g=[{Id:"1",Libelle:"Debit"},{Id:"2",Libelle:"Credit"}],s=a("1"),u=a(null),d=a(!1),p=a([]),r=a(null),c=a(),f=a(),C=a(),v=()=>{},b=()=>{},h=a([{field:"nfacture",headerName:"N°Facture",sortable:!0,filter:"agTextColumnFilter",width:120,cellClass:"ag-center-aligned-cell"},{field:"Date",headerName:"Date",sortable:!0,filter:"agDateColumnFilter",width:120,cellRenderer:e=>e.value?J(e.value):"",cellClass:"ag-center-aligned-cell"},{field:"compte1",headerName:"Compte 1",sortable:!0,filter:"agTextColumnFilter",width:120,cellClass:"ag-center-aligned-cell"},{field:"compte2",headerName:"Compte 2",sortable:!0,filter:"agTextColumnFilter",width:120,cellClass:"ag-center-aligned-cell"},{field:"libelle",headerName:"Libellé d'écriture",sortable:!0,filter:"agTextColumnFilter",width:300,cellClass:"ag-center-aligned-cell"},{field:"ttc",headerName:"Montant ttc",sortable:!0,filter:"agNumberColumnFilter",width:120,cellRenderer:e=>e.value?i(e.value):"",cellClass:"ag-right-aligned-cell"},{field:"tauxTva",headerName:"Taux Tva",sortable:!0,filter:"agNumberColumnFilter",width:120,cellRenderer:e=>e.value?i(e.value):"",cellClass:"ag-right-aligned-cell"},{field:"montantTva",headerName:"Montant TVA",sortable:!0,filter:"agNumberColumnFilter",width:120,cellRenderer:e=>e.value?i(e.value):"",cellClass:"ag-right-aligned-cell"},{field:"Pièce",headerName:"Pièce",sortable:!0,filter:"agTextColumnFilter",width:120,cellClass:"ag-center-aligned-cell"}]),w=a({resizable:!0,sortable:!0,filter:"agTextColumnFilter",suppressHeaderMenuButton:!0}),F=a({mode:"singleRow",checkboxes:!1,enableClickSelection:!0}),_=e=>{C.value=e.api,e.api.sizeColumnsToFit()},x=e=>{const l=e.api.getSelectedRows();r.value=l.length>0?l[0]:null,r.value&&D({data:r.value})},D=e=>{};return V(()=>{}),(e,l)=>{const m=G,R=B,S=z,N=A,T=$,k=I("ag-grid-vue");return M(),y(q,null,[t("div",null,[n(m,{icon:"pi pi-cog",label:"Actions",text:"",onClick:l[0]||(l[0]=o=>c.value.toggle(o))}),n(R,{ref_key:"actionsMenu",ref:c,model:[{label:"Importer",icon:"pi pi-file-import",command:()=>v()},{label:"Générer les Écritures",icon:"pi pi-cog",command:()=>b()}],popup:!0},null,8,["model"]),n(m,{icon:"pi pi-times",label:"Fermer",text:"",onClick:l[1]||(l[1]=o=>L(E)("ImportationSpecialeEcritures"))})]),t("div",null,[t("div",U,[t("div",P,[t("div",null,[t("span",j,[n(S,{size:"small",modelValue:s.value,"onUpdate:modelValue":l[2]||(l[2]=o=>s.value=o),options:g,optionLabel:"Libelle",optionValue:"Id",placeholder:"Compte 1 dans le",class:"w-full"},null,8,["modelValue"]),l[5]||(l[5]=t("label",{for:"dropdown"},"Compte 1 dans le",-1))])]),t("div",null,[n(N,{placeholder:"Journal",table:"Journal",modelValue:u.value,"onUpdate:modelValue":l[3]||(l[3]=o=>u.value=o),class:"w-full"},null,8,["modelValue"])]),t("div",H,[n(T,{modelValue:d.value,"onUpdate:modelValue":l[4]||(l[4]=o=>d.value=o),binary:"",inputId:"genererFactures"},null,8,["modelValue"]),l[6]||(l[6]=t("label",{for:"genererFactures"},"Générer les factures dans la saisie - tva",-1))])])]),t("div",K,[n(k,{ref_key:"agGrid",ref:f,localeText:e.$agGridLocale,rowData:p.value,columnDefs:h.value,defaultColDef:w.value,theme:e.$agGridTheme,rowSelection:F.value,suppressRowClickSelection:!1,pinnedBottomRowData:e.pinnedBottomRowData,getContextMenuItems:e.getContextMenuItems,onGridReady:_,onRowClicked:e.onRowClick,onSelectionChanged:x,onFilterChanged:e.onFilterChanged,onSortChanged:e.onFilterChanged,class:"ag-theme-quartz",style:{height:"100%",width:"100%"}},null,8,["localeText","rowData","columnDefs","defaultColDef","theme","rowSelection","pinnedBottomRowData","getContextMenuItems","onRowClicked","onFilterChanged","onSortChanged"])])])],64)}}};export{Y as default};
