phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r478 - in tag/rel652: import_doli/include rapport_avance


From: phpcompta-dev
Subject: [Phpcompta-dev] r478 - in tag/rel652: import_doli/include rapport_avance/include
Date: Sat, 30 Mar 2013 21:32:02 +0100 (CET)

Author: danydb
Date: 2013-03-30 21:32:01 +0100 (Sat, 30 Mar 2013)
New Revision: 478

Modified:
   tag/rel652/import_doli/include/class_impdol_operation.php
   tag/rel652/rapport_avance/include/class_formulaire_param.php
Log:
Negative VAT rate

Modified: tag/rel652/import_doli/include/class_impdol_operation.php
===================================================================
--- tag/rel652/import_doli/include/class_impdol_operation.php   2013-03-30 
20:31:51 UTC (rev 477)
+++ tag/rel652/import_doli/include/class_impdol_operation.php   2013-03-30 
20:32:01 UTC (rev 478)
@@ -383,13 +383,14 @@
                                                        break;
                                        }
                                        /* save VAT into an array */
-                                       if (isset($tva[$tva_id]))
+                                       $side=($amount_tva > 0)?1:0;
+                                       if (isset($tva[$tva_id][$side]))
                                        {
-                                               $tva[$tva_id] = 
bcadd($tva[$tva_id], $amount_tva);
+                                               $tva[$tva_id][$side] = 
bcadd($tva[$tva_id][$side], $amount_tva);
                                        }
                                        else
                                        {
-                                               $tva[$tva_id] = $amount_tva;
+                                               $tva[$tva_id][$side] = 
$amount_tva;
                                        }
                                        $sum = bcadd($sum, $amount_tvac);
 
@@ -408,27 +409,28 @@
                                $jtiers->qcode = $oper_tiers->getp("qcode");
                                $jtiers->desc = 
mb_substr($oper_tiers->getp("desc"),0,80,'UTF8');
                                $jtiers->insert_jrnx();
-
                                /* Record the vat 1 */
-                               foreach ($tva as $key => $value)
+                               foreach ($tva as $key => $atva)
                                {
-                                       $tva = new Acc_TVA($cn, $key);
-                                       $tva->load();
-                                       $poste = $tva->get_side($oth_side);
-                                       $op_tva = new Acc_Operation($cn);
-                                       $op_tva->date = $date;
-                                       $op_tva->amount = $value;
-                                       $op_tva->poste = $poste;
-                                       $op_tva->grpt = $grpt;
-                                       $op_tva->type = $oth_side;
-                                       $op_tva->jrn = $jrn;
-                                       $op_tva->user = $_SESSION['g_user'];
-                                       $op_tva->periode = 0;
-                                       $op_tva->qcode = null;
-                                       $op_tva->desc = $tva->tva_label;
-                                       $op_tva->insert_jrnx();
+                                       foreach ($atva as $tvaid=>$tva_value)
+                                       {
+                                               $tva = new Acc_TVA($cn, $key);
+                                               if ( $tva->load() == -1 ) die 
("Code TVA inconnu $tvaid");
+                                               $poste = 
$tva->get_side($oth_side);
+                                               $op_tva = new 
Acc_Operation($cn);
+                                               $op_tva->date = $date;
+                                               $op_tva->amount = $tva_value;
+                                               $op_tva->poste = $poste;
+                                               $op_tva->grpt = $grpt;
+                                               $op_tva->type = $oth_side;
+                                               $op_tva->jrn = $jrn;
+                                               $op_tva->user = 
$_SESSION['g_user'];
+                                               $op_tva->periode = 0;
+                                               $op_tva->qcode = null;
+                                               $op_tva->desc = $tva->tva_label;
+                                               $op_tva->insert_jrnx();
+                                       }
                                }
-
                                /* record into jrn */
                                $acc_jrn = new Acc_Operation($cn);
                                $acc_jrn->jrn = $jrn;

Modified: tag/rel652/rapport_avance/include/class_formulaire_param.php
===================================================================
--- tag/rel652/rapport_avance/include/class_formulaire_param.php        
2013-03-30 20:31:51 UTC (rev 477)
+++ tag/rel652/rapport_avance/include/class_formulaire_param.php        
2013-03-30 20:32:01 UTC (rev 478)
@@ -107,7 +107,6 @@
                        // first line is the title and description
                        $form = new formulaire_sql();
                        $first = fgetcsv($in, 0, ";");
-                       var_dump($first);
                        $form->f_title = $first[0];
                        if (isset($first[1]))
                                $form->f_description = $first[1];



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