phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r697 - in trunk/transform/include: . template


From: phpcompta-dev
Subject: [Phpcompta-dev] r697 - in trunk/transform/include: . template
Date: Fri, 7 Feb 2014 22:07:52 +0100 (CET)

Author: danydb
Date: 2014-02-07 22:07:52 +0100 (Fri, 07 Feb 2014)
New Revision: 697

Modified:
   trunk/transform/include/class_transform_representative.php
   trunk/transform/include/intervat_listing_assujetti_step_1.inc.php
   trunk/transform/include/intervat_listing_assujetti_step_2.inc.php
   trunk/transform/include/template/listing_assujetti_representative.php
Log:
More check on representative and errors display better

Modified: trunk/transform/include/class_transform_representative.php
===================================================================
--- trunk/transform/include/class_transform_representative.php  2014-02-07 
21:07:07 UTC (rev 696)
+++ trunk/transform/include/class_transform_representative.php  2014-02-07 
21:07:52 UTC (rev 697)
@@ -191,6 +191,7 @@
     }
     function verify()
     {
+        if ( trim($this->name) == "") return;
         /* -- email must be valide */
         if (!preg_match( 
'/^[_a-z0-9-]+(\.[_a-z0-9-]+)address@hidden(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/',$this->email))
         {
@@ -203,6 +204,15 @@
         if ( ! preg_match('/^[0-9]+/',$this->phone)) {
             throw new Exception(_('Numéro de téléphone incorrect'),22);
         }
+        if (trim($this->street) == "" ) {
+            throw new Exception(_('Obligatoire'),31 );
+        }
+        if (trim($this->postcode) == "" ) {
+            throw new Exception(_('Obligatoire'),32 );
+        }
+        if (trim($this->city) == "" ) {
+            throw new Exception(_('Obligatoire'),33 );
+        }
     }
 
 }

Modified: trunk/transform/include/intervat_listing_assujetti_step_1.inc.php
===================================================================
--- trunk/transform/include/intervat_listing_assujetti_step_1.inc.php   
2014-02-07 21:07:07 UTC (rev 696)
+++ trunk/transform/include/intervat_listing_assujetti_step_1.inc.php   
2014-02-07 21:07:52 UTC (rev 697)
@@ -45,31 +45,36 @@
 <h2> <?php echo _('Etape 1/3') ?></h2>
 <form method="post" enctype="multipart/form-data" onsubmit="return 
check_form()">
     <div style="width:45%;padding: 15px;float:left">
-    
-    <h3><?php echo _('Mandataire'); ?></h3>
-    <?php
-    $representative->input($error, $errmsg);
-    ?>
+
+        <h3><?php echo _('Mandataire'); ?></h3>
+        <span class="notice">
+            <?php
+            echo _("Ne remplissez pas s'il n'y a pas de mandataire");
+            ?>
+        </span>
+        <?php
+        $representative->input($error, $errmsg);
+        ?>
     </div>
     <div style="width:45%;padding: 15px;float:left">
-    <h3><?php echo _('Déclarant'); ?></h3>
-    <?php
-    $declarant->input($error, $errmsg);
-    ?>
+        <h3><?php echo _('Déclarant'); ?></h3>
+        <?php
+        $declarant->input($error, $errmsg);
+        ?>
     </div>
     <div style="clear:both;"></div>
     <p>
         <?php echo _('Période'), $h_year->input(); ?>
         <span class="notice"><?php
-        if ($error == 6)
-        {
-            echo $errmsg;
-        }
-        ?></span>
+            if ($error == 6)
+            {
+                echo $errmsg;
+            }
+            ?></span>
     </p>
 
     <p>
-        <?php $checked=($inputtype==2)?' checked ':""; ?>
+        <?php $checked = ($inputtype == 1) ? ' checked ' : ""; ?>
         <input type="radio" name="p_inputtype" id="file_radio"  <?php echo 
$checked; ?>  value="1" onclick="show_file();">
         <?php
         echo _('Par fichier');
@@ -83,8 +88,7 @@
         </span>
     </p>
     <p>
-        <?php
-        $checked=($inputtype==2)?' checked ':""; ?>
+        <?php $checked = ($inputtype == 2) ? ' checked ' : ""; ?>
         <input type="radio" name="p_inputtype" <?php echo $checked; ?> 
id="calc_radio" value="2" onclick="show_calc()">
         <?php
         echo _('Par calcul');
@@ -92,23 +96,29 @@
         ?>
     <div id="sp_calcul" style="display:<?php echo $display; ?>">
         <p style="margin-left:30px">
-        <?php printf(_('Entre les date %s et %s'), $start_date->input(), 
$end_date->input()); ?>
-            <span class="notice"><?php if ($error==9|| $error ==9.1) {echo 
$errmsg;}?></span>
+            <?php printf(_('Entre les date %s et %s'), $start_date->input(), 
$end_date->input()); ?>
+            <span class="notice"><?php if ($error == 9 || $error == 9.1)
+            {
+                echo $errmsg;
+            } ?></span>
         </p>
         <?php
         $atva = $cn->get_array('select tva_id,tva_rate,tva_comment from 
tva_rate order by 2');
         $count_atva = count($atva);
         ?>
-        <span class="notice"><?php if ($error==5|| $error ==5.1) {echo 
$errmsg;}?></span>
+        <span class="notice"><?php if ($error == 5 || $error == 5.1)
+        {
+            echo $errmsg;
+        } ?></span>
         <ul style="list-style: none">
-            <?php
-            for ($i = 0; $i < $count_atva; $i++):
+                <?php
+                for ($i = 0; $i < $count_atva; $i++):
+                    ?>
+                <li>
+                <?php
+                $h_tva->value = $atva[$i]['tva_id'];
+                echo $h_tva->input() . h($atva[$i]['tva_rate']) . " " . 
h($atva[$i]['tva_comment']);
                 ?>
-                <li>
-                    <?php
-                    $h_tva->value = $atva[$i]['tva_id'];
-                    echo $h_tva->input() . h($atva[$i]['tva_rate']) . " " . 
h($atva[$i]['tva_comment']);
-                    ?>
                 </li>
                 <?php
             endfor;
@@ -116,16 +126,16 @@
         </ul>
 
         <span style="margin-left:30px">
-<?php echo _('Opération de vente'), $h_tva_compute_date->input(); ?>
+    <?php echo _('Opération de vente'), $h_tva_compute_date->input(); ?>
         </span>
     </div>
 </p>    
 <p>
-    <?php
-    echo HtmlInput::request_to_hidden(array('gDossier', 'ac', 'plugin_code', 
'sa'));
-    echo HtmlInput::hidden('st_transf', 1);
-    echo HtmlInput::submit('send_list', 'Valider');
-    ?>
+<?php
+echo HtmlInput::request_to_hidden(array('gDossier', 'ac', 'plugin_code', 
'sa'));
+echo HtmlInput::hidden('st_transf', 1);
+echo HtmlInput::submit('send_list', 'Valider');
+?>
 </p>
 </form>    
 <script>

Modified: trunk/transform/include/intervat_listing_assujetti_step_2.inc.php
===================================================================
--- trunk/transform/include/intervat_listing_assujetti_step_2.inc.php   
2014-02-07 21:07:07 UTC (rev 696)
+++ trunk/transform/include/intervat_listing_assujetti_step_2.inc.php   
2014-02-07 21:07:52 UTC (rev 697)
@@ -112,7 +112,7 @@
     if (strlen($_FILES['client_assujetti']['tmp_name'][0]) != 0)
     {
         $new_name = tempnam($_ENV['TMP'], 'client_assujetti');
-        if (!move_uploaded_file($_FILES['file_upload']['tmp_name'][$i], 
$new_name))
+        if (!move_uploaded_file($_FILES['client_assujetti']['tmp_name'], 
$new_name))
         {
             throw new Exception(_('Impossible de sauver ce fichier'), 2);
         }
@@ -125,7 +125,7 @@
             while ($data = fgetcsv($file, 0, ";"))
             {
                 $i++;
-                if (count($data) != 4 || $i == 1)
+                if (count($data) != 4 )
                 {
                     $rejected[] = _('Ligne non importée') . join(' - ', $data);
                     continue;
@@ -249,6 +249,8 @@
             $o_data[$i]->set_comment();
             $o_data[$i]->insert();
         }
+        $correct=new Transform_Client;
+
         $cn->commit();
     } catch (Exception $ex)
     {
@@ -256,6 +258,7 @@
         throw new Exception(_('Ne peut pas ajouter ') . h($o_data[$i]->c_name) 
. '-' . h($o_data[$i]->c_vatnumber), 3);
     }
 }
+
 ?>
 <h2> <?php echo _('Etape 2/3') ?></h2>
 <h3><?php echo _('Mandataire'); ?></h3>

Modified: trunk/transform/include/template/listing_assujetti_representative.php
===================================================================
--- trunk/transform/include/template/listing_assujetti_representative.php       
2014-02-07 21:07:07 UTC (rev 696)
+++ trunk/transform/include/template/listing_assujetti_representative.php       
2014-02-07 21:07:52 UTC (rev 697)
@@ -28,16 +28,19 @@
     <tr>
         <td>
             <?php echo _('Rue') . "</td><td>" . $h_street->input(); ?>
+             <span class="notice"><?php if ($error==31) {echo 
$errmsg;}?></span>
         </td>
     <tr>
     <tr>
         <td>
             <?php echo _('Code postal') . "</td><td>" . $h_postcode->input(); 
?>
+             <span class="notice"><?php if ($error==32) {echo 
$errmsg;}?></span>
         </td>
     <tr>
     <tr>
         <td>
             <?php echo _('Ville') . "</td><td>" . $h_city->input(); ?>
+             <span class="notice"><?php if ($error==33) {echo 
$errmsg;}?></span>
         </td>
     <tr>
     <tr>



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