Plugins  LAST
 All Data Structures Files Functions Variables Pages
material_listing.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 <br>
22 Cherche <?php echo HtmlInput::infobulle(400)?> <?php echo HtmlInput::filter_table("list_amortissement","0,1,2,3,4",1)?>
23 
24 <table id="list_amortissement" class="sortable" style="width:99%;margin-left:0.5%">
25 <tr>
26 <th>Quickcode</th>
27 <th class=" sorttable_sorted">
28  Nom
29 <span id="sorttable_sortfwdind">&nbsp;&nbsp;&#x25BE;</span>
30 </th>
31 <th>Date acquisition</th>
32 <th>AnnĂ©e achat</th>
33 <th style="text-align:right">Montant Initial</th>
34 <th style="text-align:right">Montant Amorti</th>
35 <th style="text-align:right">Valeur Net Comptable</th>
36 
37 </tr>
38 
39 <?php
40 bcscale(2);
42 
43 for ($i =0 ;$i < Database::num_row($ret);$i++) :
44  echo '<tr>';
45  $row=$amort->next($ret,$i);
46  $fiche=new Fiche($cn,$row->f_id);
47 
48  $detail=detail_material($row->f_id,$fiche->strAttribut(ATTR_DEF_QUICKCODE));
49  echo td($detail);
50  echo td($fiche->strAttribut(ATTR_DEF_NAME));
51  // <td sorttable_customkey="<?php echo $row_bank['b_date']
52  echo '<td sorttable_customkey="'.$row->a_date.'">'.format_date($row->a_date).'</td>';
53  echo td($row->a_start);
54  echo td(nbm($row->a_amount),' sorttable_customkey="'.$row->a_amount.'" style="text-align:right"');
55  $amortized=$cn->get_value("select coalesce(sum(h_amount),0) from amortissement.amortissement_histo where a_id=$1",array($row->a_id));
56  $remain=bcsub($row->a_amount,$amortized);
57  echo td(nbm($amortized),'sorttable_customkey="'.$amortized.'" style="text-align:right"');
58  echo td(nbm($remain),'sorttable_customkey="'.$remain.'" style="text-align:right"');
59  // Compute tot
60  $tot_purchase=bcadd($tot_purchase,$row->a_amount);
63  echo '</tr>';
64 endfor;
65 ?>
66 <tfoot>
67 <tr class="highlight">
68 <td></td>
69 <td></td>
70 <td></td>
71 <td></td>
72 <td style="text-align:right">
73  <?php echo nbm($tot_purchase)?>
74 </td>
75 <td style="text-align:right">
76  <?php echo nbm($tot_amorti)?>
77 </td>
78 <td style="text-align:right">
79  <?php echo nbm($tot_remain)?>
80 </td>
81 </tr>
82 </tfoot>
83 </table>
84 
$tot_amorti
$amortized
$note style
$ret
for($i=0;$i< Database::num_row($ret);$i++) $row
$tot_purchase
$tot_remain
detail_material($f_id, $p_label)
& nbsp
$categorie_appel table
global $cn