Plugins  LAST
 All Data Structures Files Functions Variables Pages
search_view.php
Go to the documentation of this file.
1 <?php
2 //This file is part of NOALYSS and is under GPL
3 //see licence.txt
4 
5 $ret=$cn->exec_sql($sql);
6 $nb_row=$cn->size();
7 if ( $nb_row == 0 ) exit();
8 $checkbox=new ICheckBox('jr_id[]');
9 
10 ?>
11 <form method="POST" id="form1" onsubmit="return confirm('Vous confirmez?')">
12 <?php
13  echo HtmlInput::extension();
14  echo HtmlInput::get_to_hidden(array('sa','ac'));
15  echo Dossier::hidden();
16 ?>
17 
18 <div id="div_poste" class="inner_box" style="top:230;margin:5;overflow:visible;display:none;">
19  <h2 class="info">Poste comptable </h2>
20  <p class="notice">Changera dans les opérations sélectionnées le poste comptable.Attention, cela ne changera pas la fiche, soyez prudent</p>
21 <?php
22  $target=new IPoste('tposte');
23  $source=new IPoste('sposte');
24  $target->set_attribute('gDossier',Dossier::id());
25  $target->set_attribute('jrn',0);
26  $target->set_attribute('account','tposte');
27  $target->set_attribute('label','tposte_label');
28  $target->table=0;
29 
30  $source->set_attribute('gDossier',Dossier::id());
31  $source->set_attribute('jrn',0);
32  $source->set_attribute('account','sposte');
33  $source->set_attribute('label','sposte_label');
34  $source->table=0;
35 ?>
36 <table>
37  <TR><TD>Changer le poste comptable </TD>
38  <TD>
39  <?php echo $source->input()?>
40  <td> <span id="sposte_label"></span></td>
41  <td>Par le poste comptable</td>
42  <td><?php echo $target->input()?></td>
43  <td> <span id="tposte_label"></span>'</td>
44  </TR>
45  <tr><TD><?php echo HtmlInput::submit('chg_poste','Changer le poste comptable')?></TD>
46 <td><?php
47 echo HtmlInput::button('accounting_hide_bt','Annuler','onclick="$(\'div_poste\').hide();"');
48 ?>
49 </TD>
50 </tr>
51 </table>
52 </div>
53 
54 <div id="div_card" class="inner_box" style="top:230;margin:5;overflow:visible;display:none;">
55 <h2 class="info">Changer la fiche </h2>
56  <p class="notice">Attention, dans les opérations sélectionnées cela changera la fiche et le poste comptable: ce sera celui de la fiche qui sera utilisé, soyez prudent</p>
57 <?php
58  $csource=new ICard('csource');
59  $csource->set_attribute('label','csource_label');
60  $csource->set_dblclick("fill_ipopcard(this);");
61  $csource->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ',
62  $csource->name);
63  $csource->set_function('fill_data');
64  $csource->set_attribute("typecard",'all');
65 
66  $ctarget=new ICard('ctarget');
67  $ctarget->typecard='all';
68  $ctarget->set_attribute('label','ctarget_label');
69  $ctarget->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ',
70  $ctarget->name);
71  $ctarget->set_function('fill_data');
72  $ctarget->set_dblclick("fill_ipopcard(this);");
73  $ctarget->set_attribute("typecard",'all');
74 
75 
76 ?>
77 <table>
78 <TR>
79  <TD>Changer</TD>
80  <TD><?php echo $csource->input();?></TD>
81  <td><?php echo $csource->search()?></td>
82  <td><span id="csource_label"></span></td>
83 </tr>
84 <tr>
85  <TD>par </TD>
86 
87  <TD><?php echo $ctarget->input()?></TD>
88  <td><?php echo $ctarget->search()?></td>
89  <td><span id="ctarget_label"></span></td>
90 </tr>
91 </table>
92  <?php echo HtmlInput::submit('chg_card','Changer la fiche'); ?>
93 <?php
94 echo HtmlInput::button('card_hide_bt','Annuler','onclick="$(\'div_card\').hide();"');
95 ?>
96 
97 </div>
98 <div id="div_card_account" class="inner_box" style="top:230;margin:5;overflow:visible;display:none;">
99 <h2 class="info">Changer un poste comptable par une fiche</h2>
100  <p class="notice">Attention, dans les opérations sélectionnées, le poste comptable sera changé par une fiche et par son poste comptable, soyez prudent</p>
101 <?php
102  $csource=new IPoste('csource1');
103  $csource->set_attribute('gDossier',Dossier::id());
104  $csource->set_attribute('jrn',0);
105  $csource->set_attribute('label','csource1_label');
106  $csource->set_attribute('account','csource1');
107  $csource->table=0;
108 
109  $ctarget=new ICard('ctarget1');
110  $ctarget->typecard='all';
111  $ctarget->set_attribute('label','ctarget1_label');
112  $ctarget->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ',
113  $ctarget->name);
114  $ctarget->set_dblclick("fill_ipopcard(this);");
115  $ctarget->set_attribute("typecard",'all');
116  $ctarget->set_function('fill_data');
117 
118 
119 ?>
120 <table>
121 <TR>
122  <TD>Changer</TD>
123  <TD><?php echo $csource->input();?></TD>
124  <td><span id="csource1_label"></span></td>
125 </tr>
126 <tr>
127  <TD>par </TD>
128 
129  <TD><?php echo $ctarget->input()?></TD>
130  <td><?php echo $ctarget->search()?></td>
131  <td><span id="ctarget1_label"></span></td>
132 </tr>
133 </table>
134  <?php echo HtmlInput::submit('chg_card_account','Changer le poste comptable par la fiche'); ?>
135 <?php
136 echo HtmlInput::button('card_hide_bt','Annuler','onclick="$(\'div_card_account\').hide();"');
137 ?>
138 
139 </div>
140 <div id="div_ledger" class="inner_box" style="top:230;margin:5;overflow:visible;display:none;">
141 <h2 class="info">Déplacer dans un autre journal </h2>
142  <p class="notice">Attention, pour les opérations sélectionnées,cela transfèrera les opérations vers le journal choisi mais il faut que ce journal soit de même type (achat vers achat, vente vers vente...), les pièces justificatives ne seront pas mises à jour, soyez prudent</p>
143 
144 <?php
145  $sql="select jrn_def_id, '('||jrn_def_type||') '||jrn_def_name from jrn_def order by jrn_def_name asc";
146 $aledger=$cn->make_array($sql);
147 $sledger=new ISelect('sledger');
148 $sledger->value=$aledger;
149 $tledger=new ISelect('tledger');
150 $tledger->value=$aledger;
151 ?>
152 <p>
153 Les opérations appartenant au journal <?php echo $sledger->input()?> vers le journal <?php echo $tledger->input()?>
154 </p>
155  <?php echo HtmlInput::submit('chg_ledger','Déplacer dans le journal'); ?>
156 <?php
157 echo HtmlInput::button('ledger_hide_bt','Annuler','onclick="$(\'div_ledger\').hide();"');
158 ?>
159 
160 </div>
161 <table class="result">
162 <?php
163 echo HtmlInput::extension();
164 echo Dossier::hidden();
165 echo HtmlInput::hidden('sa',$_REQUEST['sa']);
166 ?>
167 <TR>
168  <TH>Date</TH>
169  <TH>interne</TH>
170  <TH>N°pièce</TH>
171  <TH>Journal</TH>
172  <TH>Libellé</TH>
173  <TH class="num">Montant</TH>
174  <TH><INPUT TYPE="CHECKBOX" onclick="toggle_checkbox('form1')"></TH>
175 </TR>
176 <?php
177 for ($i = 0;$i < $nb_row;$i++) :
178  $row=$cn->fetch_array($ret,$i);
179  $odd=($i%2==0)?' class="odd"':' class="even"';
180  $checkbox->value=$row['jr_id'];
181 ?>
182 
183 
184 
185 
186  <TR <?php echo $odd?> >
187  <TD><?php echo $row['str_jr_date']?></TD>
188  <td><?php echo HtmlInput::detail_op($row['jr_id'],$row['jr_internal'])?></td>
189  <td><?php echo $row['jr_pj_number']?></td>
190  <td><?php echo $row['jrn_def_name']?></td>
191  <td><?php echo $row['jr_comment']?></td>
192 
193 <?php
194 $positive=0;
195 // check sign for fin
196  if ( $row['jrn_def_type'] == 'FIN' )
197  {
198  $positive = $cn->get_value("select qf_amount from quant_fin where jr_id=$1",
199  array($row['jr_id']));
200  if ( $cn->count() != 0)
201  $positive=($positive < 0)?1:0;
202  }
203 
204 ?>
205  <td class="num"><?php echo ( $positive != 0 )?"<font color=\"red\"> - ".nbm($row['jr_montant'])."</font>":nbm($row['jr_montant'])?> </td>
206  <td><?php echo $checkbox->input();?></td>
207  </TR>
208 <?php
209 endfor;
210 ?>
211 </table>
212 </form>
213 <script type="text/javascript">
214 new Draggable('div_card',{zindex:2});
215 new Draggable('div_ledger',{zindex:2});
216 new Draggable('div_poste',{zindex:2});
217 new Draggable('div_card_account',{zindex:2});
218 </script>
$note style
$select_type id
$categorie_appel label
$ret
Definition: search_view.php:5
$checkbox
Definition: search_view.php:8
$target
Definition: search_view.php:22
$nb_row
Definition: search_view.php:6
$target table
Definition: search_view.php:28
$source
Definition: search_view.php:23
$sql
if($p_number->value==0) l les annuités seront recalculées et l pct[] ad_year[] select jr_internal
global $cn