noalyss Version-9
operation_exercice-input_source.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19// Copyright Author Dany De Bontridder danydb@aevalys.eu 6/01/24
20
21/*!
22 * \file
23 * \brief input the source of the opening / closing operation
24 */
25
27
28global $cn;
29global $g_user;
31
32//-------------------------------------------------------------------------------------------
33//
34// Show opening
35//-------------------------------------------------------------------------------------------
36
37?>
38<div class="content">
39
40 <div class="row">
41 <div class="col-lg">
42 <FORM method="POST">
43
44 <div class="" id="opening_div">
45 <h2><?= _("Ouverture") ?></h2>
46 <div class="text-muted">
47 <?= _("Ouverture des comptes pour l'exercice qui débute pour les comptes 0 à 5.") ?>
48 <?= ("Choisissez l'exercice clôturé (exercice N-1) du dossier à reporter pour les a-nouveaux (exercice N)") ?>
49 </div>
50 <?php
51 /**************************************************************************
52 * Needed information :
53 * - Date of the first day of exercice
54 * - Folder
55 * - Exercice N-1
56 *************************************************************************/
57 $date = new IDate("date_opening");
58 $avail = $g_user->get_available_folder();
59
60
61 $array = array();
62 $i = 0;
63 foreach ($avail as $r) {
64 $array[$i]['value'] = $r['dos_id'];
65 $array[$i]['label'] = sprintf("%s %s (%s)",$r['dos_id'],$r['dos_name'],substr($r['dos_description']??"",0,50));
66 $i++;
67 }
68 $sAvail = new ISelect('dos_id');
69 $sAvail->id = "dos_id";
70 $sAvail->selected = Dossier::id();
71 $sAvail->value = $array;
72 $sAvail->javascript = sprintf('onchange="operation_exercice.update_periode(%d)"',Dossier::id());
73
74 $exercice = $cn->make_array("select distinct p_exercice,p_exercice_label from parm_periode order by p_exercice desc");
75 $sExercice = new ISelect("exercice");
76 $sExercice->id = "select_exercice_id";
77 $sExercice->value = $exercice;
78
79 echo HtmlInput::array_to_hidden(["gDossier","ac"],$_REQUEST);
80 echo HtmlInput::hidden("sa","opening");
81 ?>
82 <div class="form-group">
83 <label for="dos_id"><?= _("Depuis le dossier") ?></label>
84 <?= $sAvail->input() ?>
85 </div>
86 <div class="form-group">
87 <label for="dos_id"><?= _("Exercice N-1") ?></label>
88 <?= $sExercice->input() ?>
89 </div>
90 <?= \HtmlInput::submit("ope_submit", _("Valider")) ?>
91 </div>
92 </FORM>
93<?php
94
95//-------------------------------------------------------------------------------------------
96// Show closing
97//-------------------------------------------------------------------------------------------
98
99?>
100 </div>
101 <div class="col-lg">
102
103 <FORM method="POST">
104 <div class="" id="closing_div" style="display:grid">
105 <h2>Clôture</h2>
106 <div class="text-muted">Clôture de l'exercice pour les comptes 6 à 7</div>
107
108 </div>
109 <?php
110 echo HtmlInput::array_to_hidden(["gDossier","ac"],$_REQUEST);
111 echo HtmlInput::hidden("sa","closing");
112 $cl_exercice = $cn->make_array("select distinct p_exercice,p_exercice_label from parm_periode order by p_exercice desc");
113 $sclExercice = new ISelect("exercice_cl");
114 $sclExercice->id = "select_exercice_cl_id";
115 $sclExercice->value = $cl_exercice;
116 ?>
117 <div class="form-group">
118 <label for="exercice_cl"><?= _("Exercice à clôturer") ?></label>
119 <?php echo $sclExercice->input(); ?>
120 </div>
121 <?= \HtmlInput::submit("ope_submit", _("Valider")) ?>
122 </FORM>
123 </div>
124
125 </div>
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$ret label
$opd_description style
$_REQUEST['ac']
static id()
return the 'gDossier' value after a check
static hidden($p_name, $p_value, $p_id="")
static array_to_hidden($array, $global_array)
transform request data to hidden
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Definition: idate.class.php:34
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
static echo_file($msg, $print=true)
display the file
Definition: dbg.php:88
foreach($avail as $r) $sAvail