phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r338 - trunk/import_doli/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r338 - trunk/import_doli/include
Date: Tue, 3 Apr 2012 14:54:45 +0200 (CEST)

Author: danydb
Date: 2012-04-03 14:54:45 +0200 (Tue, 03 Apr 2012)
New Revision: 338

Modified:
   trunk/import_doli/include/class_import_card.php
Log:
accounting cannot change, but can be inserted

Modified: trunk/import_doli/include/class_import_card.php
===================================================================
--- trunk/import_doli/include/class_import_card.php     2012-04-03 12:50:00 UTC 
(rev 337)
+++ trunk/import_doli/include/class_import_card.php     2012-04-03 12:54:45 UTC 
(rev 338)
@@ -190,25 +190,29 @@
                                $attr = sprintf('av_text%d', $head_col[$i]);
                                $array[$attr] = $row[$i];
                        }
-                       /*
-                        * Force the creating of an accounting
-                        */
-                       if ($valid_accounting == 0)
-                       {
-                               $attr = sprintf('av_text%d', ATTR_DEF_ACCOUNT);
-                               $array[$attr] = '';
-                       }
+
                        try
                        {
                                // If quick_code already exists then update 
otherwise insert
                                $quick_code= 
sprintf('av_text%d',ATTR_DEF_QUICKCODE);
                                if ( 
$fiche->get_by_qcode($array[$quick_code],false)==0 )
                                {
+                                    // accounting cannot change
+                                        $attr = sprintf('av_text%d', 
ATTR_DEF_ACCOUNT);
+                                        $array[$attr] = 
$fiche->strAttribut(ATTR_DEF_ACCOUNT);
                                        $fiche->update($array);
                                }
                                else
                                {
-                                       $fiche->insert($rfichedef, $array);
+                                   /*
+                                    * Force the creating of an accounting
+                                    */
+                                    if ($valid_accounting == 0)
+                                    {
+                                            $attr = sprintf('av_text%d', 
ATTR_DEF_ACCOUNT);
+                                            $array[$attr] = '';
+                                    }
+                                   $fiche->insert($rfichedef, $array);
                                }
                                echo td($g_succeed);
                        }



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