[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 19/33: ACH-13 : extourne also analytic
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 19/33: ACH-13 : extourne also analytic |
Date: |
Thu, 18 Jul 2024 12:24:47 -0400 (EDT) |
sparkyx pushed a commit to branch unstable
in repository noalyss.
commit ba29e0f65c6d24d57b25e7394c79639da587eee5
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Jun 30 19:06:37 2024 +0200
ACH-13 : extourne also analytic
---
include/class/acc_ledger.class.php | 40 +++++++++++++++++++++++++++++++++++++-
include/compta_ach.inc.php | 3 ++-
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/include/class/acc_ledger.class.php
b/include/class/acc_ledger.class.php
index 42090038e..e3e5b9f99 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -223,6 +223,7 @@ class Acc_Ledger extends jrn_def_sql
function reverse($p_date,$p_label)
{
global $g_user;
+ global $g_parameter;
try
{
$this->db->start();
@@ -282,6 +283,8 @@ class Acc_Ledger extends jrn_def_sql
//////////////////////////////////////////////////
$a_jid=$this->db->get_array("select j_id,j_debit from jrnx where
j_grpt=$1",
array($this->jr_grpt_id));
+ $anc_group_id=0;
+ // for each item in JRNX
for ($l=0; $l<count($a_jid); $l++)
{
// jrnx.j_id to reverse
@@ -350,9 +353,40 @@ class Acc_Ledger extends jrn_def_sql
select $j_id,pcm_val,ac_id from jrn_tax where
j_id=$1 returning jt_id",
[$row]);
+ // if we use analytic , extourne also in operation_analytic
+ if ($g_parameter->MY_ANALYTIC != 'nu') {
+ // if there is the first operation_analytic to insert ,
compute the group_id (operation_analytic.oa_group)
+ if ($anc_group_id == 0 )
$anc_group_id=$this->db->get_next_seq('s_oa_group');
+ $this->db->exec_sql("
+ insert into operation_analytique (po_id,oa_amount
+ ,oa_description
+ ,oa_debit
+ ,j_id
+ , oa_date
+ , oa_row
+ , oa_positive
+ , f_id
+ ,oa_jrnx_id_source
+ ,oa_group)
+ select po_id
+ ,oa_amount
+ ,oa_description
+ ,case oa_debit when true then false else true end
+ , $j_id
+ , to_date($2,'DD.MM.YYYY')
+ , oa_row
+ , oa_positive
+ , f_id
+ ,oa_jrnx_id_source
+ ,$anc_group_id from operation_analytique
+ where
+ j_id=$1
+ ",[$row, $p_date]);
+
+ }
- }
+ } // end for each item in JRNX
$old_receipt=$this->db->get_row("select jr_pj_number,jr_def_id
from jrn where jr_id=$1",[$this->jr_id]);
$sql="insert into jrn (
jr_id,
@@ -426,6 +460,10 @@ class Acc_Ledger extends jrn_def_sql
{
throw (new Exception(__FILE__.__LINE__."SQL ERROR [ $sql ]"));
}
+ /**
+ * reverse also in analytic account;
+ */
+
$this->db->commit();
}
catch (Exception $e)
diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php
index 83e645191..7b60dc67b 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -151,8 +151,9 @@ if (isset($_POST['record']))
}
catch (Exception $e)
{
- echo '<p class="notice">'.
+ echo '<p class="error">'.
_('Opération non extournée').
+ " ".
$e->getMessage().
'</p>';
}
- [Noalyss-commit] [noalyss] 22/33: REPORT Put the amount in red if negative, (continued)
- [Noalyss-commit] [noalyss] 22/33: REPORT Put the amount in red if negative, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 31/33: Database upgrade, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 18/33: Fix Bug : tva_code not retrieve from search, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 17/33: PHPUNIT Acc_TVA : tva_code must contains at least one letter Acc_Ledger : input_new PDF_Anc_Acc_ListTest:testPdf_Card Fix bug sizIe, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 28/33: VEN - ACH fix default currency, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 32/33: test unit : pdf activity, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 33/33: Merge branch 'pre-stable' into unstable, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 29/33: ODS : cosmetic detail operation, not aligned, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 07/33: remove euro symbole, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 16/33: cosmetic : improve appearance, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 19/33: ACH-13 : extourne also analytic,
dwm <=
- [Noalyss-commit] [noalyss] 23/33: Bug : ven-3 duplicate does not work with currency : incorrect amount, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 24/33: allow many-to-many lettering + cosmetic, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 20/33: Fix cosmetic : export Operation PDF: anc not printed properly, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 21/33: Fix Bug Cosmetic: appearance : color of menu1, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 03/33: IMPROVE #0002362: CCARDAT : Attribut de fiche Add control for element (choice) and allow to use VALUE(1, 1), (2, 2), dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 01/33: tag 9206, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 05/33: IMPROVE #0002362: CCARDAT : Attribut de fiche Add control for element (choice) and allow to use VALUE(1, 1), (2, 2), dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 26/33: PRINTJRN Cosmetic : 2 columns reversed, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 27/33: SQL : menu cosmetic, dwm, 2024/07/18
- [Noalyss-commit] [noalyss] 12/33: Menu not printable, dwm, 2024/07/18