noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 12/26: Code cleaning : extra information are


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 12/26: Code cleaning : extra information are now a fonction
Date: Wed, 11 Aug 2021 11:08:12 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 4e145c212d960a172c9a6425171522417650a23f
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Fri Jul 30 17:08:06 2021 +0200

    Code cleaning : extra information are now a fonction
---
 html/css/style-classic7.css              |  1 +
 include/class/acc_ledger.class.php       |  4 +++
 include/class/acc_operation.class.php    |  4 +--
 include/class/print_ledger_fin.class.php |  2 +-
 include/compta_ach.inc.php               | 48 +++--------------------------
 include/compta_ven.inc.php               | 53 +++++---------------------------
 include/operation_ods_confirm.inc.php    | 51 +-----------------------------
 include/template/form_ledger_detail.php  |  5 ++-
 8 files changed, 26 insertions(+), 142 deletions(-)

diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css
index 498c084..0cf159a 100644
--- a/html/css/style-classic7.css
+++ b/html/css/style-classic7.css
@@ -2596,6 +2596,7 @@ span.warning {
  * Tabs like row
  ****************************************************************************/
  #tab_id {
+     margin-top:1rem;
      margin-bottom: 30px;
      position:static;
  }
diff --git a/include/class/acc_ledger.class.php 
b/include/class/acc_ledger.class.php
index f942bb5..a60f08d 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -3249,6 +3249,10 @@ class Acc_Ledger  extends jrn_def_sql
         }
         return "";
     }
+    function input_extra_info()
+    {
+        require NOALYSS_TEMPLATE."/acc_ledger-input_extra_info.php";
+    }
 }
 
 ?>
diff --git a/include/class/acc_operation.class.php 
b/include/class/acc_operation.class.php
index 9d5701e..ba789ac 100644
--- a/include/class/acc_operation.class.php
+++ b/include/class/acc_operation.class.php
@@ -185,7 +185,7 @@ class Acc_Operation
         {
             $this->type=($this->type=='d')?'c':'d';
         }
-        if ( DEBUGNOALYSS > 0 ) {
+        if ( DEBUGNOALYSS > 1 ) {
             echo "insert_jrnx = [{ $this->poste}]  {$this->amount}  rounded 
".round($this->amount,2)." type {$this->type}<br>";
         }
         $this->amount=abs($this->amount);
@@ -282,7 +282,7 @@ class Acc_Operation
     function insert_jrn()
     {
         $p_comment=$this->desc;
-        if ( DEBUGNOALYSS > 0 ) {
+        if ( DEBUGNOALYSS > 1 ) {
              echo "insert_jrn = {$this->amount}  <br>";
         }
         $diff=$this->db->get_value("select check_balance 
($1)",array($this->grpt));
diff --git a/include/class/print_ledger_fin.class.php 
b/include/class/print_ledger_fin.class.php
index 605fb8b..cf4827b 100644
--- a/include/class/print_ledger_fin.class.php
+++ b/include/class/print_ledger_fin.class.php
@@ -65,7 +65,7 @@ class Print_Ledger_Financial extends Print_Ledger
         $this->Cell(10,6,_('Interne'));
         $this->Cell(40,6,_('Dest/Orig'));
         $this->Cell(60,6,_('Commentaire'));
-        $this->Cell(20,6,_('Device'),0,0,'R');
+        $this->Cell(20,6,_('Devise'),0,0,'R');
         $this->Cell(20,6,_('Montant'),0,0,'R');
         $this->Ln(6);
         
diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php
index 22c3e8b..eb39c7c 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -22,7 +22,7 @@
 
 /**
  *\file
- * \brief file included to manage all the sold operation
+ * \brief file included include the purchase operation
  */
 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
 $gDossier = dossier::id();
@@ -73,50 +73,12 @@ if (isset($_POST['view_invoice']))
 
                echo $Ledger->confirm($_POST);
                echo HtmlInput::hidden('ac', $ac);
-                            ?>
-<div id="tab_id" >
-    <script>
-        var a_tab = 
['modele_div_id','repo_div_id','facturation_div_id','reverse_div_id'];
-    </script>
-<ul class="tabs">
-    <li class="tabs_selected" style="float: none"><a href="javascript:void(0)" 
title="<?php echo _("Générer une facture ou charger un document")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'facturation_div_id')"><?php
 echo _('Facture')?></a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Choix du dépôt")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'repo_div_id')">
 <?php echo _('Dépôt')?> </a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Modèle à sauver")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'modele_div_id')">
 <?php echo _('Modèle')?> </a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Extourne")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'reverse_div_id')">
 <?php echo _('Extourne')?> </a></li>
-</ul>
-</div>
-<?php
-               echo $Ledger->select_depot(false, -1);
-                echo $Ledger->extra_info();
-                
-                echo '<div id="modele_div_id" 
style="display:none;height:185px;height:10rem">';
-                echo Pre_operation::save_propose();
-                echo '</div>';
-
-               
-                echo '<div id="reverse_div_id" 
style="display:none;height:185px;height:10rem">';
-                $reverse_date=new IDate('reverse_date');
-                $reverse_ck=new ICheckBox('reverse_ck');
-                echo _('Extourne opération')." ".$reverse_ck->input()." ";
-                echo $reverse_date->input();
-                $msg_reverse=new IText("ext_label");
-                $msg_reverse->placeholder=_("Message extourne");
-                $msg_reverse->size=60;
-                echo _("Message")." ".$msg_reverse->input();
-                echo '</div>';
-                
-                 echo HtmlInput::submit("record", _("Enregistrement"), 
'onClick="return verify_ca(\'\');"');
+                $Ledger->input_extra_info();
+                echo HtmlInput::submit("record", _("Enregistrement"), 
'onClick="return verify_ca(\'\');"');
                echo HtmlInput::submit('correct', _("Corriger"));
                echo '</form>';
-               echo '</div>'; /* tab_id */
-               echo '</div>';
-                ?>
-<script>
-     $('repo_div_id').hide();
-    $('modele_div_id').hide();
-show_tabs(a_tab,'facturation_div_id');
-</script>
-<?php
+                echo '</div>';
+                if (DEBUGNOALYSS>1) { echo "<!-- confirm_div_id -->";}
             return;
        }
 }
diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php
index 6e52c11..f563fb9 100644
--- a/include/compta_ven.inc.php
+++ b/include/compta_ven.inc.php
@@ -33,6 +33,7 @@ $http=new HttpInput();
 $strac=$http->request('ac');
 $ac="ac=".$strac;
 $p_msg="";
+$post_jrn=$http->post("p_jrn", "string","");
 //----------------------------------------------------------------------
 // Encode a new invoice
 // empty form for encoding
@@ -78,51 +79,13 @@ $p_msg="";
             echo '<form class="print" enctype="multipart/form-data" 
method="post">';
             echo dossier::hidden();
             echo $Ledger->confirm($_POST );
-            echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-            ?>
-<div id="tab_id" >
- <script>
-        var a_tab = 
['modele_div_id','repo_div_id','facturation_div_id','reverse_div_id'];
-    </script>
-<ul class="tabs">
-    <li class="tabs_selected" style="float: none"><a href="javascript:void(0)" 
title="<?php echo _("Générer une facture ou charger un document")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'facturation_div_id')"><?php
 echo _('Facture')?></a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Choix du dépôt")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'repo_div_id')">
 <?php echo _('Dépôt')?> </a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Modèle à sauver")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'modele_div_id')">
 <?php echo _('Modèle')?> </a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Extourne")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'reverse_div_id')">
 <?php echo _('Extourne')?> </a></li>
-</ul>
-</div>   
-<?php
-            echo $Ledger->select_depot(false, -1);
-            echo $Ledger->extra_info();
-           echo '<div id="modele_div_id" 
style="display:none;height:185px;height:10rem">';
-            echo Pre_operation::save_propose();
-           echo '</div>';
-            
-                    
-            echo '<div id="reverse_div_id" 
style="display:none;height:185px;height:10rem">';
-            $reverse_date=new IDate('reverse_date');
-            $reverse_ck=new ICheckBox('reverse_ck');
-            echo _('Extourne opération')." ".$reverse_ck->input()." ";
-            echo $reverse_date->input();
-            $msg_reverse=new IText("ext_label");
-            $msg_reverse->placeholder=_("Message extourne");
-            $msg_reverse->size=60;
-            echo _("Message")." ".$msg_reverse->input();
-            echo '</div>';
-            
-           echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-            echo 
HtmlInput::submit("record",_("Enregistrement"),'onClick="return 
verify_ca(\'\');"');
-            echo HtmlInput::submit('correct',_("Corriger"));
+            echo HtmlInput::hidden('ac',$strac);
+            $Ledger->input_extra_info();
+            echo HtmlInput::submit("record", _("Enregistrement"), 
'onClick="return verify_ca(\'\');"');
+            echo HtmlInput::submit('correct', _("Corriger"));
             echo '</form>';
             echo '</div>';
-            echo '</div>'; /* tab_id */
-?>
-<script>
-     $('repo_div_id').hide();
-    $('modele_div_id').hide();
-show_tabs(a_tab,'facturation_div_id');
-</script>
-<?php
+            if (DEBUGNOALYSS>1) { echo "<!-- confirm_div_id -->";}
             return;
         }
     }
@@ -133,14 +96,14 @@ show_tabs(a_tab,'facturation_div_id');
     if ( isset($_POST['record']) )
     {
 // Check privilege
-        if ( $g_user->check_jrn($_REQUEST['p_jrn']) != 'W' )
+        if ( $g_user->check_jrn($post_jrn) != 'W' )
         {
 
             NoAccess();
             exit -1;
         }
 
-        $Ledger=new Acc_Ledger_Sold($cn,$_POST['p_jrn']);
+        $Ledger=new Acc_Ledger_Sold($cn,$post_jrn);
         try
         {
             $Ledger->verify_operation($_POST);
diff --git a/include/operation_ods_confirm.inc.php 
b/include/operation_ods_confirm.inc.php
index 1bc569e..fff8de6 100644
--- a/include/operation_ods_confirm.inc.php
+++ b/include/operation_ods_confirm.inc.php
@@ -40,56 +40,7 @@ echo '</div>';
 echo '<FORM METHOD="POST" enctype="multipart/form-data" class="print">';
 echo 
HtmlInput::request_to_hidden(array('ac','p_currency_code','p_currency_rate'));
 echo $ledger->confirm($_POST,false);
-
-
-?>
-<div id="tab_id" >
-    <script>
-        var a_tab = 
['modele_div_id','reverse_div_id','document_div_id','operationtype_div_id'];
-    </script>
-<ul class="tabs">
-    <li class="tabs_selected" style="float: none"> <a 
href="javascript:void(0)" title="<?php echo _("Modèle à sauver")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'modele_div_id')">
 <?php echo _('Modèle')?> </a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Document")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'document_div_id')">
 <?php echo _('Document')?> </a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Extourne")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'reverse_div_id')">
 <?php echo _('Extourne')?> </a></li>
-    <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Type opération")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'operationtype_div_id')">
 <?php echo _('Type opération')?> </a></li>
-</ul>
-</div>
-<div >
-    <div id="modele_div_id">
-        <?php echo Pre_operation::save_propose(); ?>
-    </div>
-    <div id="reverse_div_id" style="display:none;height:185px;height:10rem">
-    <?php
-        $reverse_ck=new ICheckBox('reverse_ck');
-        echo _('Extourne opération')." ".$reverse_ck->input()." ";
-        $reverse_date=new IDate('reverse_date');
-        echo $reverse_date->input();
-        $msg_reverse=new IText("ext_label");
-        $msg_reverse->size=60;
-        $msg_reverse->placeholder=_("Message extourne");
-        echo _("Message")." ".$msg_reverse->input();
-    ?>
-    </div>
-    <div id="document_div_id" style="display:none;height:185px;height:10rem">
-      <?php
-      $file = new IFile();
-      $file->setAlertOnSize(true);
-        $file->table = 0;
-        echo '<p class="decale">';
-        echo _("Ajoutez une pièce justificative ");
-        echo $file->input("pj", "");
-        echo '</p>';
-        ?>
-    </div>
-    <div id="operationtype_div_id" 
style="display:none;height:185px;height:10rem">
-        <?php
-            $status=$http->request("jr_optype","string","NOR");
-            echo Acc_Operation::select_operation_type($status)->input();
-        ?>
-    </div>
-</div>
-
-<?php
+echo $ledger->input_extra_info();
 echo HtmlInput::submit("save",_("Confirmer"));
 echo HtmlInput::submit("correct",_("Corriger"));
 
diff --git a/include/template/form_ledger_detail.php 
b/include/template/form_ledger_detail.php
index 84bbf05..4e12bd6 100644
--- a/include/template/form_ledger_detail.php
+++ b/include/template/form_ledger_detail.php
@@ -1,7 +1,10 @@
 <?php
 //This file is part of NOALYSS and is under GPL 
 //see licence.txt
-
+/**
+ * @file
+ * @brief Display a form to enter an operation Sale or Purchase 
+ */
 ?>
        <div id="jrn_name_div">
        <h1 id="jrn_name"> <?php echo $this->get_name()?></h1>



reply via email to

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