39 lines
1.6 KiB
JavaScript
39 lines
1.6 KiB
JavaScript
import "@nextcloud/dialogs/dist/index.css";
|
|
import "datatables.net-dt/css/jquery.dataTables.css";
|
|
import "../css/mycss.css";
|
|
|
|
import { getArticlesById, getMailServerFrom, getProduitsById, saveNextcloud, savePdfToNextcloud} from "./modules/ajaxRequest.mjs";
|
|
import { globalConfiguration } from "./modules/mainFunction.mjs";
|
|
import "./listener/main_listener";
|
|
import "./listener/factureSendMailListener";
|
|
import { Client } from "./objects/client.mjs";
|
|
import { capture, captureDevisFacture, sendMail } from "./pdf";
|
|
|
|
window.addEventListener("DOMContentLoaded", function () {
|
|
globalConfiguration();
|
|
|
|
Client.getClientByIdDevis($("#devisid").data("id"));
|
|
getProduitsById();
|
|
getArticlesById();
|
|
|
|
var pdf = document.getElementById("pdf");
|
|
pdf.addEventListener("click",function(){
|
|
let defunt = document.getElementById("nomdefunt").innerText;
|
|
let lieusoin = document.getElementById("lieusoin").innerText;
|
|
let etp = document.getElementById("etp").innerText;
|
|
captureDevisFacture(savePdfToNextcloud, document.getElementById("dateContext").innerText, defunt, lieusoin, etp);
|
|
});
|
|
|
|
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";
|
|
});
|
|
}); |