phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5248 - in phpcompta/trunk: html/js include


From: phpcompta-dev
Subject: [Phpcompta-dev] r5248 - in phpcompta/trunk: html/js include
Date: Sun, 12 May 2013 00:19:54 +0200 (CEST)

Author: danydb
Date: 2013-05-12 00:19:53 +0200 (Sun, 12 May 2013)
New Revision: 5248

Modified:
   phpcompta/trunk/html/js/infobulle.js
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
Log:
Task #0000809: Journaux achat/vente : TVA diff?\195?\169rente de celle 
calcul?\195?\169e

Modified: phpcompta/trunk/html/js/infobulle.js
===================================================================
--- phpcompta/trunk/html/js/infobulle.js        2013-05-11 22:00:42 UTC (rev 
5247)
+++ phpcompta/trunk/html/js/infobulle.js        2013-05-11 22:19:53 UTC (rev 
5248)
@@ -55,6 +55,7 @@
 content[25]="Donnez une partie du libellé, la date, le montant ou le numéro 
d'opération pour filtrer, cela n'efface pas ce qui a déjà été sélectionné";
 content[26]="Donnez une partie du quickcode, nom, description... pour filtrer";
 content[27]="Attention, <b>SI</b> la fiche a changé de poste comptable, c'est 
seulement le dernier qui est affiché";
+content[28]="Attention Différence entre TVA calculée et donnée";
 function showBulle(p_ctl)
 {
     d=document.getElementById('bulle');

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger_purchase.php       2013-05-11 
22:00:42 UTC (rev 5247)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php       2013-05-11 
22:19:53 UTC (rev 5248)
@@ -1353,21 +1353,19 @@
 
             if ( $g_parameter->MY_TVA_USE=='Y')
             {
+                               $op=new Acc_Compute();
+
+                               $op->set_parameter("amount",$amount);
+                               
$op->set_parameter('amount_vat_rate',$oTva->get_parameter('rate'));
+                               $op->compute_vat();
+                                $tva_computed=$op->get_parameter('amount_vat');
                 //----- if tva_amount is not given we compute the vat ----
                 if ( strlen (trim (${'e_march'.$i.'_tva_amount'})) == 0)
                 {
-                    $op=new Acc_Compute();
-
-                    $op->set_parameter("amount",$amount);
-                    
$op->set_parameter('amount_vat_rate',$oTva->get_parameter('rate'));
-                    $op->compute_vat();
                     $tva_item=$op->get_parameter('amount_vat');
                 }
                 else
-                    $tva_item=round($
-                                    {'e_march'.$i.'_tva_amount'
-                                    }
-                                    ,2);
+                    $tva_item=round(${'e_march'.$i.'_tva_amount'},2);
 
                 if (isset($tva[$idx_tva] ) )
                     $tva[$idx_tva]+=$tva_item;
@@ -1396,8 +1394,21 @@
                 $r.='<td class="num">';
                 $r.=$oTva->get_parameter('label');
                 $r.='</td>';
-                $r.='<td class="num">';
-                $r.=nbm($tva_item);
+                /* warning if tva_computed and given are not the
+                   same */
+                               bcscale(2);
+                if ( bcsub($tva_item,$tva_computed) != 0)
+                {
+
+                                        $r.='<td style="background-color:red" 
class="num">';
+                                        $r.=HtmlInput::infobulle(28);
+                    $r.='<a href="#" class="error" style="display:inline" 
title="'. _("Attention Différence entre TVA calculée et donnée").'">'
+                                                       .nbm($tva_item).'<a>';
+                }
+                               else{
+                                        $r.='<td  class="num">';
+                                       $r.=nbm($tva_item);
+                               }
                 $r.='</td>';
                                $r.='<td class="num">';
                                $r.=nbm(round($amount,2));

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger_sold.php   2013-05-11 22:00:42 UTC 
(rev 5247)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php   2013-05-11 22:19:53 UTC 
(rev 5248)
@@ -625,7 +625,8 @@
     }
 
 
-    /address@hidden show the summary of the operation and propose to save it
+    /*!
+        address@hidden show the summary of the operation and propose to save it
      address@hidden array contains normally $_POST. It proposes also to save
      * the Analytic accountancy
         address@hidden $p_summary false for the feedback, true to show the 
summary
@@ -772,16 +773,20 @@
                 $r.='<td class="num">';
                 $r.=$oTva->get_parameter('label');
                 $r.='</td>';
-                $r.='<td class="num">';
+
                 /* warning if tva_computed and given are not the
                    same */
                 if ( bcsub($tva_item,$tva_computed) != 0)
                 {
+                                        $r.='<td style="background-color:red" 
class="num">';
+                                        $r.=HtmlInput::infobulle(28);
                     $r.='<a href="#" class="error" style="display:inline" 
title="'. _("Attention Différence entre TVA calculée et donnée").'">'
                                                        .nbm($tva_item).'<a>';
                 }
-                               else
+                               else{
+                                        $r.='<td  class="num">';
                                        $r.=nbm($tva_item);
+                               }
                 $r.='</td>';
                                $r.='<td class="num">';
                                $r.=nbm($amount);



---
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]