noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 18/26: Task #0002046: Improve COMPTA/MENUACH/


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 18/26: Task #0002046: Improve COMPTA/MENUACH/ACH
Date: Wed, 11 Aug 2021 11:08:15 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 956385be16904b22c64764edbb825b038f48e054
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Jul 31 12:20:01 2021 +0200

    Task #0002046: Improve COMPTA/MENUACH/ACH
---
 include/class/acc_ledger.class.php               | 15 +++++++++++++++
 include/compta_ach.inc.php                       |  5 ++++-
 include/compta_ods.inc.php                       |  8 ++++++--
 include/compta_ven.inc.php                       |  4 ++++
 include/template/acc_ledger-input_extra_info.php | 18 +++++++++++++++---
 5 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/include/class/acc_ledger.class.php 
b/include/class/acc_ledger.class.php
index a60f08d..81d520f 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -3253,6 +3253,21 @@ class Acc_Ledger  extends jrn_def_sql
     {
         require NOALYSS_TEMPLATE."/acc_ledger-input_extra_info.php";
     }
+    /**
+     * @brief attach action-followups to an operation, 
+     * @param string $s_related_action action.ag_id separated by comma
+     * @see Acc_Operation
+     * @return boolean true success ,false nothing inserted
+     */
+    function save_followup($s_related_action)
+    {
+        if ($this->jr_id == 0 || empty ($s_related_action))  { return false;  }
+        
+        $acc_operation=new Acc_Operation($this->cn);
+        $acc_operation->jr_id=$this->jr_id;
+        $acc_operation->insert_related_action($s_related_action);
+        return true;
+    }
 }
 
 ?>
diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php
index eb39c7c..fc7b550 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -123,7 +123,10 @@ if (isset($_POST['record']))
                /* Save the additional information into jrn_info */
                $obj = new Acc_Ledger_Info($cn);
                $obj->save_extra($Ledger->jr_id, $_POST);
-               //printf('<a class="line" style="display:inline" 
href="javascript:modifyOperation(%d,%d)">%s</a><hr>', $jr_id, dossier::id(), 
$internal);
+                
+                /* save followup */
+                
$Ledger->save_followup($http->request("action_gestion","string",""));
+                
                // Feedback
                echo $Ledger->confirm($_POST, true);
                if (isset($Ledger->doc))
diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php
index 7e46aa1..4f5f090 100644
--- a/include/compta_ods.inc.php
+++ b/include/compta_ods.inc.php
@@ -86,8 +86,12 @@ elseif (isset($_POST['save']))
        try
        {
                $ledger->save($array);
-               $jr_id = $cn->get_value('select jr_id from jrn where 
jr_internal=$1', array($ledger->internal));
-
+                $jr_id=$ledger->jr_id;
+                
+                /* save followup */
+                
$ledger->save_followup($http->request("action_gestion","string",""));
+                                
+                
                echo '<h2>'._("Opération enregistrée")._("Piece") . 
h($ledger->pj) . '</h2>';
                if (strcmp($ledger->pj, $_POST['e_pj']) != 0)
                {
diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php
index f563fb9..0e301ab 100644
--- a/include/compta_ven.inc.php
+++ b/include/compta_ven.inc.php
@@ -147,6 +147,10 @@ $post_jrn=$http->post("p_jrn", "string","");
             /* Save the additional information into jrn_info */
             $obj=new Acc_Ledger_Info($cn);
             $obj->save_extra($Ledger->jr_id,$_POST);
+            
+             /* save followup */
+             
$Ledger->save_followup($http->request("action_gestion","string",""));
+             
              // extourne
             if (isset($_POST['reverse_ck']))
             {
diff --git a/include/template/acc_ledger-input_extra_info.php 
b/include/template/acc_ledger-input_extra_info.php
index 900f8e3..5510b73 100644
--- a/include/template/acc_ledger-input_extra_info.php
+++ b/include/template/acc_ledger-input_extra_info.php
@@ -35,16 +35,17 @@ $a_div=["template"=>"modele_div_id",
     "invoice"=>"facturation_div_id",
     "reverse"=>"reverse_div_id",
     "type_operation"=>'operationtype_div_id',
-    "document"=>"document_div_id"];
+    "document"=>"document_div_id",
+    "action_gestion"=>"actiongestion_div_id"];
 
 //-- Define option to display 
 // template : template of operation , invoice : doc. to generate, document : 
document
 // to upload , reverse : reverse operation
  if ( $ledger_type  == 'ACH' || $ledger_type == 'VEN') {
-     $a_show=['template','repo','invoice','reverse'];
+     $a_show=['template','repo','invoice','reverse','action_gestion'];
      $show="facturation_div_id";
  } elseif ($ledger_type=='ODS') {
-     $a_show=['template','document','reverse','type_operation'];
+     
$a_show=['template','document','reverse','type_operation','action_gestion'];
      $show="document_div_id";
  }
  
@@ -81,6 +82,10 @@ $a_div=["template"=>"modele_div_id",
     <?php if (in_array('type_operation',$a_show))       :?>
         <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>
     <?php endif; ?>
+        
+    <?php if (in_array('action_gestion',$a_show))       :?>
+        <li class="tabs" style="float: none"> <a href="javascript:void(0)" 
title="<?php echo _("Action gestion")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'actiongestion_div_id')">
 <?php echo _('Action gestion')?> </a></li>
+    <?php endif; ?>        
 </ul>
 </div>
 <?php
@@ -127,6 +132,13 @@ if (in_array('invoice',$a_show)) {
         ?>
 </div>
                
+<div id="actiongestion_div_id" style="display:none;height:185px;height:10rem">
+    Action gestion
+        <?php
+            $irelated_action=new IRelated_Action("action_gestion");
+            echo $irelated_action->input();
+        ?>
+</div>
                
                
                 



reply via email to

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