import "@nextcloud/dialogs/dist/index.css"; import "datatables.net-dt/css/jquery.dataTables.css"; import "../css/mycss.css"; import { globalConfiguration } from "./modules/mainFunction.mjs"; import "./listener/main_listener"; import "./listener/devisListener"; import { exportClientDevisByMonthAndYearToPdf, exportClientDevisRecap } from "./modules/ajaxRequest.mjs"; import 'select2/dist/css/select2.css'; import 'select2'; import '../css/mycss.css'; window.addEventListener("DOMContentLoaded", function () { globalConfiguration(); $('#clientselector').select2(); const urlParams = new URLSearchParams(window.location.search); const clientId = urlParams.get('cli'); const year = urlParams.get('annee'); const month = urlParams.get('mois'); const filterType = urlParams.get('filterType'); var exportMultipleDevisToPdfButton = this.document.getElementById("exportMultipleDevisToPdf"); exportMultipleDevisToPdfButton.addEventListener("click",function(){ exportClientDevisByMonthAndYearToPdf(clientId,year,month,filterType); }); }); document.onchange = function(event) { if (event.target && event.target.id === 'clientselector') { let selectedOption = event.target.options[event.target.selectedIndex]; let filterType = selectedOption.getAttribute('data-type'); let filterTypeInput = document.getElementById('filterType'); if (filterTypeInput) { filterTypeInput.value = filterType; } } };