Plugins  LAST
 All Data Structures Files Functions Variables Pages
material_display.php
Go to the documentation of this file.
1 <?php
2 /*
3  * Copyright 2010 De Bontridder Dany <dany@alchimerys.be>
4  * This file is part of NOALYSS.
5  *
6  * NOALYSS is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * NOALYSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with NOALYSS; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 ?>
21 <h2 class="info">Détail de matériel</h2>
22 <span style="text-align:center;display:block;font-size:2em" id="p_card_label" ><?php echo $card->strAttribut(ATTR_DEF_NAME)?></span>
23 <table>
24 <tr>
25  <td>Fiche</td>
26  <td><?php echo $card->strAttribut(ATTR_DEF_QUICKCODE)?></td>
27 </tr>
28 
29 <tr>
30  <td>Date d'acquisition</td>
31  <td><?php echo $p_date?></td>
32 </tr>
33 
34 <tr>
35  <td>Montant à amortir</td>
36  <td><?php echo $p_amount?></td>
37 </tr>
38 
39 <tr>
40  <td>Année comptable d'achat</td>
41  <td> <?php echo $p_year;?></td>
42 </tr>
43 
44 <tr id="deb_use_account_tr_id">
45  <td>Poste de charge dotations amortissement (débit)</td>
46  <td><?php echo $p_deb?></td>
47  <td><?php echo $deb_span?></td>
48 </tr>
49 <tr id="cred_use_account_tr_id">
50  <td>Poste amortissement en contrepartie</td>
51  <td><?php echo $p_cred;?></td>
52  <td><?php echo $cred_span;?></td>
53 </tr>
54 <tr id="deb_use_card_tr_id">
55  <td>Fiche de charge pour amortissement (déb) </td>
56  <td><?php echo $p_card_deb->input()?><?php echo $p_card_deb->search()?></td>
57 </tr>
58 <tr id="cred_use_card_tr_id">
59  <td>Fiche amortissement en contrepartie</td>
60  <td><?php echo $p_card_cred->input();?><?php echo $p_card_cred->search()?></td>
61 </tr><tr>
62  <td>Nombre d'années amortissement (non modifiable)</td>
63  <td><?php echo $p_number?></td>
64 </tr>
65 </table>
66 <?php
67  if ( $p_number == 0 ) :
68  echo "Date ".date ('d.m.Y');
69  echo HtmlInput::print_window();
70  return;
71  endif;
72 ?>
73 <fieldset><legend>Annuités</legend>
74 <table class="result">
75 <th>Année</th>
76 <th>Montant</th>
77 <th style="text-align:right" >Amortissement acté</th>
78 <th style="text-align:center">Pièce </th>
79 <th>n° interne</th>
80 
81 
82 <th>Pourcent</th>
83 
84 <?php
85 bcscale(2);
86 $annuite=0;
87 $done=0;
88 for ($i=0;$i<count($array);$i++):
89 ?>
90 <tr>
91  <td>
92  <?php echo $array[$i]->ad_year?>
93  </td>
94  <td>
95  <?php
96  echo nbm($array[$i]->ad_amount);
97  ?>
98 
99 </td>
100  <?php
101  $annuite=bcadd($annuite,$array[$i]->ad_amount);
102 
103  $x=$cn->get_array('select ha_id,h_pj,jr_internal,h_amount from amortissement.amortissement_histo where a_id=$1 and h_year=$2',
104  array($amort->a_id,$array[$i]->ad_year));
105  if ( count ($x) == 1)
106  {
107  $done=bcadd($done,$x[0]['h_amount']);
108 
109  echo td(nbm($x[0]['h_amount']),' class="num"');
110 
111  echo td($x[0]['h_pj'],' style="text-align:center"');
112 
113  if ( $x[0]['jr_internal'] != '' ) {
114  $jr_id=$cn->get_value('select jr_id from jrn where jr_internal=$1',array($x[0]['jr_internal']));
115  echo td(HtmlInput::detail_op($jr_id,$x[0]['jr_internal']));
116  } else {
117  echo td();
118  }
119  }
120  echo td(nbm($array[$i]->ad_percentage).'%');
121  ?>
122 </tr>
123 
124 
125 <?php
126 endfor;
127 ?>
128 </table>
129 <span style="font-size:120%;font-weight:bold;font-family:arial;font-style:italic;margin-right:10%">Total = <?php echo nbm($annuite)?></span>
130 <span style="font-size:120%;font-weight:bold;font-family:arial;font-style:italic;margin-right:10%">Amorti = <?php echo nbm($done)?></span>
131 <span style="font-size:120%;font-weight:bold;font-family:arial;font-style:italic;margin-right:10%">Reste = <?php echo nbm($p_amount-$done)?></span>
132 
133 <?php
134 if ( $annuite != $p_amount)
135  {
136  echo '<h2 class="error">Différence entre le montant à amortir et le montant amorti =';
137  echo nbm($annuite - $p_amount);
138  echo '<h2>';
139  }
140  ?>
141 </fieldset>
142 <?php echo "Date ".date ('d.m.Y');?>
143 <?php echo HtmlInput::print_window()?>
144 
$note style
jr_internal
$p_card_deb
$cred_span
$categorie_appel table
$p_card_cred
if($p_number->value==0) l les annuités seront recalculées et l pct[] ad_year[] select ha_id
if($p_number->value==0) l les annuités seront recalculées et l pct[] ad_year[] select h_amount from amortissement amortissement_histo where a_id