Merge branch 'staging' into 'production'

HOTFIXESdevis list group facturation redirect

See merge request sottye/hytha35!6
This commit is contained in:
Tiavina Handrianina 2025-04-15 12:27:05 +00:00
commit 459fda7106
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 { Devis } from "../objects/devis.mjs";
import DataTable from "datatables.net";
import { FactureTypeGroup } from "../constants/invoiceConstant";
import { generateUrl } from "@nextcloud/router";
window.addEventListener("DOMContentLoaded", function () {
const today = new Date();
@ -33,6 +35,12 @@ $('body').on('click', '#closeDevisModal', 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 oTable = $('.tabledt').dataTable();
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"));
return;
}
var factureTypeSelect = document.getElementById("factureTypeSelect");
var selectedValue = factureTypeSelect.value;
let devisToFacturePayload = {
devisToFacture: devisToFacture,
paymentDate: dateValue,