From 956385be16904b22c64764edbb825b038f48e054 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sat, 31 Jul 2021 12:20:01 +0200 Subject: [PATCH] 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 ++++ .../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 a60f08d2c..81d520ff0 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 eb39c7c33..fc7b55081 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('%s
', $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 7e46aa17c..4f5f0908e 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 '

'._("Opération enregistrée")._("Piece") . h($ledger->pj) . '

'; if (strcmp($ledger->pj, $_POST['e_pj']) != 0) { diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index f563fb9a0..0e301ab70 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 900f8e33b..5510b7334 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",
  • " onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'operationtype_div_id')">
  • + + +
  • " onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'actiongestion_div_id')">
  • + +