From 2d993c0a64d659193416a27bb8780f4d65cd2723 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Tue, 28 May 2024 23:39:07 +0200 Subject: [PATCH] =?UTF-8?q?0002359:=20Permettre=20aux=20utilisateurs=20d?= =?UTF-8?q?=E2=80=99identifier=20que=20la=20Date=20de=20l=E2=80=99op=C3=A9?= =?UTF-8?q?ration=20et=20la=20P=C3=A9riode=20de=20l'op=C3=A9ration=20ne=20?= =?UTF-8?q?sont=20pas=20align=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/ajax/ajax_ledger.php | 6 ++++-- sql/upgrade.sql | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/ajax/ajax_ledger.php b/include/ajax/ajax_ledger.php index f866c664d..d130998ee 100644 --- a/include/ajax/ajax_ledger.php +++ b/include/ajax/ajax_ledger.php @@ -384,8 +384,10 @@ switch ($action) { } $cn->exec_sql("update jrn set jr_comment=$1,jr_pj_number=$2,jr_date=to_date($4,'DD.MM.YYYY'),jr_optype=$5 where jr_id=$3", array($http->post('lib'), $npj, $jr_id,$date, $http->post('jr_optype'))); - $cn->exec_sql("update jrnx set j_date=to_date($1,'DD.MM.YYYY') where j_grpt in (select jr_grpt_id from jrn where jr_id=$2)", - array($date, $jr_id)); + $find_periode = $cn->get_value("select comptaproc.find_periode($1)",[$date]); + + $cn->exec_sql("update jrnx set j_date=to_date($1,'DD.MM.YYYY'),j_tech_per=$3 where j_grpt in (select jr_grpt_id from jrn where jr_id=$2)", + array($date, $jr_id,$find_periode)); $cn->exec_sql('update operation_analytique set oa_date=j_date from jrnx where operation_analytique.j_id=jrnx.j_id and diff --git a/sql/upgrade.sql b/sql/upgrade.sql index 8b1378917..1c160ec67 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -1 +1,2 @@ - +with correct_periode as (select jr_tech_per, jr_grpt_id from jrn) +update jrnx set j_tech_per = jr_tech_per from correct_periode where correct_periode.jr_grpt_id=j_grpt and correct_periode.jr_tech_per != j_tech_per; \ No newline at end of file