feat(v2.0.4): Corrections diverses et tri des tableaux devis
- Correction affichage email contact dans SAP (models/msap.php) - Ajout fonctionnalité tri des tableaux devis (jsap.js, jdevis.js) - Améliorations diverses vues devis et SAP - Mise à jour contrôleurs et modèles export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
183
views/vsap.php
183
views/vsap.php
@@ -5,7 +5,37 @@ $metacss = '<link href="/pub/res/css/schat.css" rel="stylesheet" type="text/css"
|
||||
$barre = "";
|
||||
ob_start();
|
||||
?>
|
||||
<div id="divSAP">
|
||||
<style>
|
||||
.dept-tab a {
|
||||
min-width: 50px !important;
|
||||
padding: 8px 10px !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.table-800 {
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
#tabArchives .table-800 {
|
||||
max-height: 680px !important;
|
||||
}
|
||||
.table-800 thead th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
<div class="row" style="margin-bottom: 20px;">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="searchSAP" placeholder="Rechercher un devis par le nom du client, du contact, ville, opportunité..." maxlength="30">
|
||||
<span class="input-group-addon">
|
||||
<i class="fa fa-times clickable" id="btnResetSearchSAP" style="display:none;"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
</div>
|
||||
<div id="divSAP" style="margin-top: 20px;">
|
||||
<ul class="nav nav-tabs nav-justified" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#tabEnCours" aria-controls="tabEnCours" role="tab" data-toggle="tab">Les devis en cours</a></li>
|
||||
<li role="presentation"><a href="#tabArchives" aria-controls="tabArchives" role="tab" data-toggle="tab">Les devis archivés</a></li>
|
||||
@@ -40,20 +70,22 @@ ob_start();
|
||||
echo '<div class="border cm-scrollbar cm-table-w-scroll table-responsive table-800">';
|
||||
echo '<table class="table table-responsive table-bordered table-fixed" id="tblDos' . $iDos . '">';
|
||||
echo '<thead><tr>';
|
||||
echo '<th class="header text-center" scope="col" width="5%">#</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Date Demande</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Date Remise</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Responsable Régional</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Code Etabliss.</th>';
|
||||
echo '<th class="header text-center" scope="col" width="15%">Etablissement</th>';
|
||||
echo '<th class="header text-center" scope="col" width="7%">CP</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Ville</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Marché</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Montant Total HT</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Marge totale</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="5%" data-sortable="true" data-sort-type="number" data-column-index="0">#</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="date" data-column-index="1">Date Demande</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="date" data-column-index="2">Date Remise</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="text" data-column-index="3">Responsable Régional</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="text" data-column-index="4">Code Etabliss.</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="15%" data-sortable="true" data-sort-type="text" data-column-index="5">Etablissement</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="7%" data-sortable="true" data-sort-type="number" data-column-index="6">CP</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="text" data-column-index="7">Ville</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="text" data-column-index="8">Marché</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="number" data-column-index="9">Montant Total HT</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="number" data-column-index="10">Marge totale</th>';
|
||||
$colIndexActions = 11;
|
||||
if ($dossier["rowid"] == 7) {
|
||||
// Si le dossier est "A envoyer au client", on affiche la colonne "Email"
|
||||
echo '<th class="header text-center" scope="col" width="10%">Email</th>';
|
||||
$colIndexActions = 12;
|
||||
}
|
||||
echo '<th class="header text-center" scope="col" width="20%">Actions <button class="btn btn-info btn-xs btnExportSelectedXML hidden" title="Export XML SAP des devis sélectionnés"><i class="fa fa-scribd fa-lg"></i></button></th>';
|
||||
echo '</tr></thead>';
|
||||
@@ -167,39 +199,118 @@ ob_start();
|
||||
<div role="tabpanel" class="tab-pane" id="tabArchives">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<ul class="nav nav-tabs nav-justified" role="tablist">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($aModel["dossiers"] as $dossier) {
|
||||
if ($i % 15 == 0 && $i > 0) {
|
||||
echo '<div class="spacer"></div>';
|
||||
}
|
||||
$active = ($i == 0) ? "active" : "";
|
||||
$ceDossier = ($dossier["dossier"] == "") ? "?" : $dossier["dossier"];
|
||||
echo '<li role="presentation" class="' . $active . '"><a href="#dosArch' . $i . '" aria-controls="dosArch' . $i . '" role="tab" data-toggle="tab">' . $ceDossier . '</a></li>';
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#dosArchTous" aria-controls="dosArchTous" role="tab" data-toggle="tab">Tous</a></li>
|
||||
</ul>
|
||||
<?php
|
||||
$i = 0;
|
||||
$nbPerLine = 25;
|
||||
$totalDepts = count($aModel["dossiers"]);
|
||||
|
||||
for ($line = 0; $line < 4; $line++) {
|
||||
echo '<ul class="nav nav-tabs" role="tablist">';
|
||||
$start = $line * $nbPerLine;
|
||||
$end = min($start + $nbPerLine, $totalDepts);
|
||||
|
||||
for ($j = $start; $j < $end; $j++) {
|
||||
$dossier = $aModel["dossiers"][$j];
|
||||
$ceDossier = ($dossier["dossier"] == "") ? "?" : $dossier["dossier"];
|
||||
echo '<li role="presentation" class="dept-tab"><a href="#dosArch' . $j . '" aria-controls="dosArch' . $j . '" role="tab" data-toggle="tab">' . $ceDossier . '</a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
?>
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane p-0 active" id="dosArchTous">
|
||||
<div class="border cm-scrollbar cm-table-w-scroll table-responsive table-800">
|
||||
<table class="table table-responsive table-bordered table-fixed" id="tblDosArchTous">
|
||||
<thead><tr>
|
||||
<th class="header text-center clickable" scope="col" width="5%" data-sortable="true" data-sort-type="number" data-column-index="0">#</th>
|
||||
<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="date" data-column-index="1">Date Demande</th>
|
||||
<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="text" data-column-index="2">Resp. Régional</th>
|
||||
<th class="header text-center clickable" scope="col" width="7%" data-sortable="true" data-sort-type="text" data-column-index="3">Code Etabliss.</th>
|
||||
<th class="header text-center clickable" scope="col" width="15%" data-sortable="true" data-sort-type="text" data-column-index="4">Etablissement</th>
|
||||
<th class="header text-center clickable" scope="col" width="5%" data-sortable="true" data-sort-type="number" data-column-index="5">CP</th>
|
||||
<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="text" data-column-index="6">Ville</th>
|
||||
<th class="header text-center clickable" scope="col" width="8%" data-sortable="true" data-sort-type="text" data-column-index="7">Marché</th>
|
||||
<th class="header text-center clickable" scope="col" width="5%" data-sortable="true" data-sort-type="text" data-column-index="8">Dép.</th>
|
||||
<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="number" data-column-index="9">Montant Total HT</th>
|
||||
<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="number" data-column-index="10">Marge totale</th>
|
||||
<th class="header text-center" scope="col" width="10%">Actions</th>
|
||||
</tr></thead>
|
||||
<tbody id="tblBodyDosArchTous">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($aModel["devisArchives"] as $devis) {
|
||||
echo '<tr id="trArchTous_' . $devis["rowid"] . '">';
|
||||
echo '<td class="text-center">' . $devis["rowid"] . '</td>';
|
||||
$dateDem = substr($devis["date_demande"], 8, 2) . '/' . substr($devis["date_demande"], 5, 2) . ' ' . substr($devis["date_demande"], 0, 4);
|
||||
if ($devis["chk_speciaux"] == 1) {
|
||||
$cellDateDem = '<span data-after-text="S" data-after-type="blue circle">' . $dateDem . '</span>';
|
||||
} else {
|
||||
$cellDateDem = $dateDem;
|
||||
}
|
||||
echo '<td class="clickable celArchives" data-rid="' . $devis["rowid"] . '">' . $cellDateDem . '</td>';
|
||||
echo '<td class="clickable celArchives" data-rid="' . $devis["rowid"] . '">' . $devis["prenom"] . " " . $devis["nom"] . '</td>';
|
||||
echo '<td class="clickable celArchives" data-rid="' . $devis["rowid"] . '">' . $devis["code"] . '</td>';
|
||||
|
||||
if ($devis["fk_client"] == 0) {
|
||||
$ville = $devis["ville_new_client"];
|
||||
$libelle = '<span data-after-text="N" data-after-type="red circle">' . $devis["lib_new_client"] . '</span>';
|
||||
} else {
|
||||
$ville = $devis["ville"];
|
||||
$libelle = $devis["libelle"];
|
||||
}
|
||||
echo '<td class="clickable celArchives" data-rid="' . $devis["rowid"] . '">' . $libelle . '</td>';
|
||||
echo '<td class="clickable celArchives" data-rid="' . $devis["rowid"] . '">' . $devis["cp"] . '</td>';
|
||||
echo '<td class="clickable celArchives" data-rid="' . $devis["rowid"] . '">' . $ville . '</td>';
|
||||
echo '<td class="clickable celArchives" data-rid="' . $devis["rowid"] . '">' . $devis["lib_marche"] . '</td>';
|
||||
$dossierLabel = ($devis["dossier"] == "") ? "?" : $devis["dossier"];
|
||||
echo '<td class="clickable celArchives text-center" data-rid="' . $devis["rowid"] . '">' . $dossierLabel . '</td>';
|
||||
$montant = floatval($devis["montant_total_ht_remise"]);
|
||||
echo '<td class="clickable celArchives right" data-rid="' . $devis["rowid"] . '">' . number_format($montant, 2, ',', ' ') . ' €</td>';
|
||||
$margeTotale = floatval($devis["marge_totale"]);
|
||||
echo '<td class="clickable celArchives right" data-rid="' . $devis["rowid"] . '">' . number_format($margeTotale, 2, ',', ' ') . ' %</td>';
|
||||
echo '<td class="text-center">';
|
||||
echo '<div class="btn-group">';
|
||||
echo '<button class="btn btn-primary btn-xs btnViewDevisArchives" title="Consulter le devis" data-rid="' . $devis["rowid"] . '"><i class="fa fa-eye fa-lg"></i></button>';
|
||||
echo '<button class="btn btn-info btn-xs btnExportDevisEnCours" title="Export Excel du devis" data-rid="' . $devis["rowid"] . '" data-libelle="' . $devis["libelle"] . '"><i class="fa fa-file-excel-o fa-lg"></i></button>';
|
||||
$typBtn = "btn-success";
|
||||
foreach ($aModel["medias"] as $media) {
|
||||
if ($media["support_rowid"] == $devis["rowid"]) {
|
||||
$typBtn = "btn-warning";
|
||||
break;
|
||||
}
|
||||
}
|
||||
echo '<button class="btn ' . $typBtn . ' btn-xs btnImportPDFEnCours" title="Consulter le PDF SAP du devis" data-rid="' . $devis["rowid"] . '" data-libelle="' . $devis["libelle"] . '"><i class="fa fa-file-pdf-o fa-lg"></i></button>';
|
||||
echo '</div>';
|
||||
echo '</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
if ($i == 0) echo '<tr><td colspan="12" class="center">Aucun devis archivé trouvé</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$iDos = 0;
|
||||
foreach ($aModel["dossiers"] as $dossier) {
|
||||
$active = ($iDos == 0) ? "active" : "";
|
||||
$active = "";
|
||||
echo '<div role="tabpanel" class="tab-pane p-0 ' . $active . '" id="dosArch' . $iDos . '">';
|
||||
echo '<div class="border cm-scrollbar cm-table-w-scroll table-responsive table-800">';
|
||||
echo '<table class="table table-responsive table-bordered table-fixed" id="tblDosArch' . $iDos . '">';
|
||||
echo '<thead><tr>';
|
||||
echo '<th class="header text-center" scope="col" width="5%">#</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Date Demande</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Resp. Régional</th>';
|
||||
echo '<th class="header text-center" scope="col" width="7%">Code Etabliss.</th>';
|
||||
echo '<th class="header text-center" scope="col" width="20%">Etablissement</th>';
|
||||
echo '<th class="header text-center" scope="col" width="5%">CP</th>';
|
||||
echo '<th class="header text-center" scope="col" width="13%">Ville</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Marché</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Montant Total HT</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Marge totale</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="5%" data-sortable="true" data-sort-type="number" data-column-index="0">#</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="date" data-column-index="1">Date Demande</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="text" data-column-index="2">Resp. Régional</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="7%" data-sortable="true" data-sort-type="text" data-column-index="3">Code Etabliss.</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="20%" data-sortable="true" data-sort-type="text" data-column-index="4">Etablissement</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="5%" data-sortable="true" data-sort-type="number" data-column-index="5">CP</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="13%" data-sortable="true" data-sort-type="text" data-column-index="6">Ville</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="text" data-column-index="7">Marché</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="number" data-column-index="8">Montant Total HT</th>';
|
||||
echo '<th class="header text-center clickable" scope="col" width="10%" data-sortable="true" data-sort-type="number" data-column-index="9">Marge totale</th>';
|
||||
echo '<th class="header text-center" scope="col" width="10%">Actions</th>';
|
||||
echo '</tr></thead>';
|
||||
echo '<tbody id="tblBodyDosArch' . $iDos . '">';
|
||||
|
||||
Reference in New Issue
Block a user