Debug divers

Ajout ignore warning contrats
This commit is contained in:
Adrien RENARD 2024-01-24 04:05:32 +01:00
parent 66ee8c8ec6
commit f3eea65953
7 changed files with 15 additions and 3 deletions

View File

@ -145,6 +145,7 @@ define('CONTRATS_TABLE_STRUCT', array(
"nb_cheque" => array( "type" => "int", "min" => 1, "max" => 99, "default" => 0, "force_default_under_min" => true ),
"np_paniers_distrib_avt_saisie" => array( "type" => "int", "min" => 1, "max" => 99, "default" => 0, "force_default_under_min" => true ),
"force_eligible" => array( "type" => "bool", "default" => 0 ),
"ignore_warning" => array( "type" => "bool", "default" => 0 ),
"archive" => array( "type" => "bool", "default" => 0 ),
"force_not_archive" => array( "type" => "bool", "default" => 0 ),
"del" => array( "type" => "bool", "default" => 0 )
@ -189,6 +190,7 @@ function getContratsTableSelectBaseSQL() {
.CONTRATS_TABLE.".`nb_cheque`,"
.CONTRATS_TABLE.".`np_paniers_distrib_avt_saisie`,"
.CONTRATS_TABLE.".`force_eligible`,"
.CONTRATS_TABLE.".`ignore_warning`,"
.CONTRATS_TABLE.".`archive`,"
.COMPLEMENTS_CONTRATS_STATUS_VIEW.".`complements`,"
.COMPLEMENTS_CONTRATS_STATUS_VIEW.".`complements_regles`,"

View File

@ -74,7 +74,7 @@ function getContratsList($order='id', $sens='ASC', $filtres=array(), $search=fal
if(!$r['erreur']) {
foreach($r['datas'] as $i) {
if(!$i["type_ref"]>0) $i["type_nom"] = "personnalisé <small>(".$i["groupe_nom"]." - ".$i["nb_paniers"]." x ".$i["panier_type_nom"]." - ".CONTRATS_FREQUENCES[$i["frequence"]].")</small>";
if(!$i["type_ref"]>0) $i["type_nom"] = "personnalisé";
$i["date_print"] = formatDate($i["date"], "mysql_date", "date");

View File

@ -122,6 +122,7 @@ CREATE TABLE `contrats` (
`nb_cheque` int(2) UNSIGNED NOT NULL DEFAULT '0',
`np_paniers_distrib_avt_saisie` int(2) UNSIGNED NOT NULL DEFAULT '0',
`force_eligible` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`ignore_warning` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`force_not_archive` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`archive` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`del` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',

View File

@ -283,6 +283,7 @@ function modalFormContrat_loadDatas(modal,id) {
modal.find("input[name=nb_cheque]").val(datas.nb_cheque);
modal.find("input[name=np_paniers_distrib_avt_saisie]").val(datas.np_paniers_distrib_avt_saisie);
modal.find("input[type=checkbox][name=force_eligible]").prop("checked",datas.force_eligible>0);
modal.find("input[type=checkbox][name=ignore_warning]").prop("checked",datas.ignore_warning>0);
if(modal) modal.modal('show');
}).fail(function() { alert("("+contratsConf.type+" - load datas in modal form)"); });
@ -321,6 +322,7 @@ function modalFormContrat_clear(modal) {
modal.find("input[name=nb_cheque]").val("");
modal.find("input[name=np_paniers_distrib_avt_saisie]").val("");
modal.find("input[type=checkbox][name=force_eligible]").prop("checked",false);
modal.find("input[type=checkbox][name=ignore_warning]").prop("checked",false);
}
function modalFormContrat_getDatas(modal) {
@ -336,7 +338,8 @@ function modalFormContrat_getDatas(modal) {
'lieu_depot' : parseInt( modal.find("select[name=lieu_depot]").val() ),
'nb_cheque' : parseInt( modal.find("input[name=nb_cheque]").val() ),
'np_paniers_distrib_avt_saisie' : modal.find("input[name=np_paniers_distrib_avt_saisie]").val(),
'force_eligible' : modal.find("input[type=checkbox][name=force_eligible]").prop("checked") ? 1 : 0
'force_eligible' : modal.find("input[type=checkbox][name=force_eligible]").prop("checked") ? 1 : 0,
'ignore_warning' : modal.find("input[type=checkbox][name=ignore_warning]").prop("checked") ? 1 : 0
};
// CHECK TYPE_EXIST

View File

@ -555,6 +555,7 @@ function initListProgressLoad(list, url, listName) {
if(isDefined(list)) {
var contentH = list.innerHeight();
list.listProgressLoad_resize();
$(window).resize( function() { list.listProgressLoad_resize(); } );
list.scroll(function(e) {

View File

@ -78,5 +78,10 @@
<input type="checkbox" name="force_eligible"> forcer le contrat une fois le nombre de paniers livrés dépassé
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="ignore_warning"> ignore les alertes liées au nombre de paniers livrés dépassé
</label>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
{foreach from=$list item=i}
<tr class="{if $i.archive>0}archive{/if}{if $i.warning_nb_paniers} warning{/if}{if $i.nb_paniers_restants<=0} danger{/if}">
<tr class="{if $i.archive>0}archive{/if}{if $i.warning_nb_paniers && $i.ignore_warning==0} warning{/if}{if $i.nb_paniers_restants<=0 && $i.ignore_warning==0} danger{/if}">
<td class="center visible-lg id">{$i.ref}</td>
<td class="name"><a href="#" class="btnViewContrat" ref={$i.ref}>{$i.client_prenom} {$i.client_nom}</a></td>
<td class="visible-lg groupe">{$i.groupe_nom}</td>