37 lines
1.5 KiB
JavaScript
37 lines
1.5 KiB
JavaScript
import "@nextcloud/dialogs/dist/index.css";
|
|
import "datatables.net-dt/css/jquery.dataTables.css";
|
|
import "../css/mycss.css";
|
|
|
|
import { getArticlesById, getMailServerFrom, getProduitsById, savePdfToNextcloud,exportDevisToPdf} from "./modules/ajaxRequest.mjs";
|
|
import { globalConfiguration } from "./modules/mainFunction.mjs";
|
|
import "./listener/main_listener";
|
|
import { Client } from "./objects/client.mjs";
|
|
import { capture, sendMail, captureDevisFacture } from "./pdf";
|
|
import { showError } from "@nextcloud/dialogs";
|
|
|
|
window.addEventListener("DOMContentLoaded", function () {
|
|
globalConfiguration();
|
|
|
|
const devisId = $("#devisid").data("id");
|
|
Client.getClientByIdDevis($("#devisid").data("id"));
|
|
getProduitsById();
|
|
getArticlesById();
|
|
|
|
var exportDevisToPdfButton = this.document.getElementById("exportDevisToPdf");
|
|
exportDevisToPdfButton.addEventListener("click",function(){
|
|
exportDevisToPdf(devisId);
|
|
});
|
|
|
|
var mail = document.getElementById("mailGestion");
|
|
mail.addEventListener("click", function(){
|
|
document.getElementById("to").value = document.getElementById("mail").innerText;
|
|
getMailServerFrom(document.getElementById("from"));
|
|
(document.getElementById("modalMail")).style.display = "block";
|
|
});
|
|
|
|
var sendmail = document.getElementById("sendmail");
|
|
sendmail.addEventListener("click", function () {
|
|
capture(sendMail);
|
|
(document.getElementById("modalMail")).style.display = "none";
|
|
});
|
|
}); |