Merge branch 'hotfixes/hotfix-facture-groupe-on-list-devis' into staging

This commit is contained in:
Tiavina 2025-04-15 15:23:42 +03:00
commit d4724a0e4a
3 changed files with 10 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,8 @@ import {showError, showSuccess } from "@nextcloud/dialogs";
import {baseUrl, hideLoader, showLoader} from "../modules/mainFunction.mjs"; import {baseUrl, hideLoader, showLoader} from "../modules/mainFunction.mjs";
import { Devis } from "../objects/devis.mjs"; import { Devis } from "../objects/devis.mjs";
import DataTable from "datatables.net"; import DataTable from "datatables.net";
import { FactureTypeGroup } from "../constants/invoiceConstant";
import { generateUrl } from "@nextcloud/router";
window.addEventListener("DOMContentLoaded", function () { window.addEventListener("DOMContentLoaded", function () {
const today = new Date(); const today = new Date();
@ -33,6 +35,12 @@ $('body').on('click', '#closeDevisModal', function () {
$('body').on('click', '#invoiceQuote', function () { $('body').on('click', '#invoiceQuote', function () {
var factureTypeSelect = document.getElementById("factureTypeSelect");
var selectedValue = factureTypeSelect.value;
if(selectedValue == FactureTypeGroup){
window.location.replace(generateUrl(`/apps/gestion/devis/apercus?cli=&annee=${(new Date()).getFullYear()}&mois=${(new Date()).getMonth()}&filterType=group`));
return;
}
var dateValue = document.getElementById("facturationDate").value; var dateValue = document.getElementById("facturationDate").value;
var oTable = $('.tabledt').dataTable(); var oTable = $('.tabledt').dataTable();
var rowcollection = oTable.$(".devisToFacture:checked", {"page": "all"}); var rowcollection = oTable.$(".devisToFacture:checked", {"page": "all"});
@ -47,9 +55,6 @@ $('body').on('click', '#invoiceQuote', function () {
showError(t('gestion', "Veuillez choisir une ligne de devis à facturer")); showError(t('gestion', "Veuillez choisir une ligne de devis à facturer"));
return; return;
} }
var factureTypeSelect = document.getElementById("factureTypeSelect");
var selectedValue = factureTypeSelect.value;
let devisToFacturePayload = { let devisToFacturePayload = {
devisToFacture: devisToFacture, devisToFacture: devisToFacture,
paymentDate: dateValue, paymentDate: dateValue,