diff --git a/include/class/periode.class.php b/include/class/periode.class.php index 1b6b45e4a..8e4a64c08 100644 --- a/include/class/periode.class.php +++ b/include/class/periode.class.php @@ -264,7 +264,6 @@ class Periode $Res=$this->cn->exec_sql("insert into jrn_periode (jrn_def_id,p_id,status) ". "select jrn_def_id,$p_id,'OP' from jrn_def"); $this->cn->commit(); - return $p_id; } catch (Exception $e) { diff --git a/include/periode.inc.php b/include/periode.inc.php index fb7e62cd9..3feaad465 100644 --- a/include/periode.inc.php +++ b/include/periode.inc.php @@ -44,6 +44,30 @@ $p_ledger_id=$http->request("jrn_def_id", "number", 0); post("p_exercice", "number"); + $p_year=$http->post("p_year", "number"); + $nb_month=$http->post("nb_month", "number"); + $from_month=$http->post("from_month", "number"); + $day_opening=$http->post("day_opening", "string", 0); + $day_closing=$http->post("day_closing", "string", 0); + $exercice=new Periode($cn); + $exercice->insert_exercice($p_exercice, $p_year, $from_month, $nb_month, + $day_opening, $day_closing); + } + catch (Exception $ex) + { + echo_warning($ex->getMessage()); + } +} //------------------------------------------------------------------- // Select a ledger or global //------------------------------------------------------------------- @@ -69,30 +93,7 @@ Periode::filter_exercice($p_exercice); $js_close_selected="jsper.close_selected()"; echo HtmlInput::button_action(_("Fermer les périodes sélectionnées"), $js_close_selected); -//-------------------------------------------------------------------- -// Add an exercice -// receive nb_exercice -//-------------------------------------------------------------------- -if (isset($_POST['add_exercice'])) -{ - $obj=new Periode($cn); - try - { - $p_exercice=$http->post("p_exercice", "number"); - $p_year=$http->post("p_year", "number"); - $nb_month=$http->post("nb_month", "number"); - $from_month=$http->post("from_month", "number"); - $day_opening=$http->post("day_opening", "string", 0); - $day_closing=$http->post("day_closing", "string", 0); - $exercice=new Periode($cn); - $exercice->insert_exercice($p_exercice, $p_year, $from_month, $nb_month, - $day_opening, $day_closing); - } - catch (Exception $ex) - { - echo_warning($ex->getMessage()); - } -} + /* * Display all the periode for all ledgers */