phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r398 - trunk/coprop/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r398 - trunk/coprop/include
Date: Mon, 27 Aug 2012 14:00:54 +0200 (CEST)

Author: danydb
Date: 2012-08-27 14:00:54 +0200 (Mon, 27 Aug 2012)
New Revision: 398

Modified:
   trunk/coprop/include/key.inc.php
Log:
Clef de repartition ajout diff?\195?\169rence entre tanti?\195?\168me et total 
tanti?\195?\168me des coprop

Modified: trunk/coprop/include/key.inc.php
===================================================================
--- trunk/coprop/include/key.inc.php    2012-08-27 11:50:40 UTC (rev 397)
+++ trunk/coprop/include/key.inc.php    2012-08-27 12:00:54 UTC (rev 398)
@@ -32,6 +32,9 @@
 // ajout nouvelle clef
 if ( isset($_POST['add_key']))
 {
+    /**
+     * @todo ajout verification double chargement
+     */
        $a=new Copro_key();
        $a->insert($_POST);
 }
@@ -45,10 +48,17 @@
 }
 
 
-$sql="select cr_id,cr_name,cr_note,cr_tantieme from coprop.clef_repartition 
order by cr_name";
+$sql="select cr_id,cr_name,cr_note,cr_tantieme,
+    coalesce(  (select sum(crd_amount) from
+               coprop.clef_repartition_detail as crd
+               where crd.cr_id=cr.cr_id) ,0) as delta
+    from 
+    coprop.clef_repartition as cr
+    order by cr_name";
 
 $a_key=$cn->get_array($sql);
 ?>
+<div id="key_list">
 <table class="result">
        <tr>
                <th>
@@ -60,7 +70,12 @@
                 <th>
                     Tantième
                 </th>
-                <th></th>
+                <th>
+                    Différence
+                </th>
+                <th>
+                    
+                </th>
        </tr>
 <?
 for ($i=0;$i < count($a_key);$i++):
@@ -69,14 +84,17 @@
 ?>
        <tr id="row<?=$a_key[$i]['cr_id']?>">
                <td>
-                       <?=$mod_key?>
+                       <?=h($mod_key)?>
                </td>
                <td>
-                       <?=$a_key[$i]['cr_note']?>
+                       <?=h($a_key[$i]['cr_note'])?>
                </td>
-                <td>
-                    <?=round($a_key[$i]['cr_tantieme'])?>
+                <td class="num">
+                    <?=nbm($a_key[$i]['cr_tantieme'])?>
                 </td>
+                <td class="num">
+                    <?=nbm($a_key[$i]['delta'])?>
+                </td>
                <td id="col<?=$a_key[$i]['cr_id']?>">
                     <?
                     
$js="onclick=remove_key('".$_REQUEST['plugin_code']."','".$_REQUEST['ac']."','".$_REQUEST['gDossier']."','".$a_key[$i]['cr_id']."')";
@@ -89,6 +107,7 @@
 endfor;
 ?>
 </table>
+ </div>
 <? 
$js=sprintf("add_key('%s','%s','%s')",$gDossier,$_REQUEST['plugin_code'],$_REQUEST['ac']);
  echo HtmlInput::button("add_key","Ajout clef","onclick=\"$js\"");
        ?>



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]