From 18cb87d9bf51786199a047a7f63eb18c4186fa80 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 24 Jan 2019 17:27:21 +0100 Subject: [PATCH 1/3] Mantis #0001666: Export CSV depuis histo ne filtre pas par journal --- include/history_operation.inc.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/include/history_operation.inc.php b/include/history_operation.inc.php index 20113ba9f..3a0ceb77d 100644 --- a/include/history_operation.inc.php +++ b/include/history_operation.inc.php @@ -94,7 +94,7 @@ if (!isset($p_array['date_start'])) list($date_start, $date_end) = $per->get_date_limit(); $p_array['date_start'] = $date_start; $p_array['date_end'] = $date_end; - $msg='

'._("Période ").$date_start._(" au ").$date_end.'

'; + $msg='

'.sprintf(_("Période %s au %s "),$date_start,$date_end).'

'; } else { @@ -138,11 +138,17 @@ $r = HtmlInput::get_to_hidden(array('search_opnb_jrn', 'unpaid', 'gDossier', 'ledger_type', - 'p_action')); + 'p_action', + 'search_opr_jrn')); if (isset($_GET['r_jrn'])) { - foreach ($_GET['r_jrn'] as $k => $v) - $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v); + foreach ($_GET['r_jrn'] as $k => $v) + $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v); +} +if (isset($_GET['search_opr_jrn'])) +{ + foreach ($_GET['search_opr_jrn'] as $k => $v) + $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v); } echo $r; @@ -156,6 +162,11 @@ echo ''; $r = HtmlInput::get_to_hidden(array('l', 'date_paid_start','date_paid_end', 'date_start', 'date_end', 'desc', 'amount_min', 'amount_max', 'qcode', 'accounting', 'unpaid', 'gDossier', 'ledger_type', 'p_action')); +if (isset($_GET['search_opr_jrn'])) +{ + foreach ($_GET['search_opr_jrn'] as $k => $v) + $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v); +} if (isset($_GET['r_jrn'])) { foreach ($_GET['r_jrn'] as $k => $v) From d78acab7a735a1d3447267398421d10ed7672523 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 25 Jan 2019 21:33:41 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Mantis=20#0001682:=20CA=20-=20ajouter=20pos?= =?UTF-8?q?sibilit=C3=A9=20d'exporter=20le=20plan=20analytique,=20add=20ac?= =?UTF-8?q?tion=20CSV:Analytic=5FAxis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 0d0ce3647f170a22463b1639efa15ab767336c95) --- include/anc_pa.inc.php | 31 +++++++++++++------------------ include/constant.php | 2 +- include/sql/patch/upgrade132.sql | 2 +- include/sql/patch/upgrade133.sql | 13 +++++++++++++ 4 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 include/sql/patch/upgrade133.sql diff --git a/include/anc_pa.inc.php b/include/anc_pa.inc.php index a5461e083..a795c35fd 100644 --- a/include/anc_pa.inc.php +++ b/include/anc_pa.inc.php @@ -83,24 +83,13 @@ if ($sa=="pa_write") else { $new=new Anc_Plan($cn); - $new->name=$_POST['pa_name']; - $new->description=$_POST['pa_description']; + $new->name=$http->post("pa_name"); + $new->description=$http->post("pa_description"); $new->add(); } $sa="anc_menu"; } -// Update the PA -if ($sa=="pa_update") -{ - $pa_id=$http->get("pa_id","number"); - - $new=new Anc_Plan($cn, $pa_id); - $new->name=$_POST['pa_name']; - $new->description=$_POST['pa_description']; - $new->update(); - $sa="anc_menu"; -} /* delete pa */ if ($sa=="pa_delete") @@ -120,19 +109,25 @@ if ($sa=="pa_detail") $pa_id=$http->get("pa_id","number"); $new=new Anc_Plan($cn, $pa_id); - $wSa=HtmlInput::hidden("sa", "pa_update"); $new->get(); $ret.= '
'; $ret.= $new->form(); - $ret.= $wSa; - $ret.="

"; + // Export in CSV + $ret.='

'; + $ret.=Dossier::hidden(); + $ret.=HtmlInput::hidden("act",'CSV:Analytic_Axis'); + $ret.=HtmlInput::hidden("pa_id",$pa_id); + $ret.=HtmlInput::submit('export_analytic_axis',_("Export CSV")); + $ret.='
'; $ret.=HtmlInput::button_anchor(_('Efface ce plan'), '', 'remove_analytic_plan', 'onclick="return confirm_box(\'remove_analytic_plan\',\'Effacer ?\',function () {window.location=\'do.php?ac='.$_REQUEST['ac'].'&pa_id='.$_GET['pa_id'].'&sa=pa_delete&'.$str_dossier.'\';})"', 'smallbutton'); - $ret.="

"; + + $ret.='
'; + //--------------------------------------------------------------------- // Detail now // Use Manage_Table @@ -141,7 +136,7 @@ if ($sa=="pa_detail") $new=new Anc_Plan($cn, $pa_id); $new->get(); - $ret.='
'; + $ret.='
'; $anc=new Poste_analytique_SQL($cn); $anc->pa_id=$pa_id; $accounting=new Anc_Account_Table($anc); diff --git a/include/constant.php b/include/constant.php index c6bea47ef..78762eed0 100644 --- a/include/constant.php +++ b/include/constant.php @@ -108,7 +108,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) { if ( ! defined ("SYSINFO_DISPLAY")) { define ("SYSINFO_DISPLAY",TRUE); } -define ("DBVERSION",133); +define ("DBVERSION",134); define ("MONO_DATABASE",25); define ("DBVERSIONREPO",18); define ('NOTFOUND','--not found--'); diff --git a/include/sql/patch/upgrade132.sql b/include/sql/patch/upgrade132.sql index 4565200de..255c7a2d6 100644 --- a/include/sql/patch/upgrade132.sql +++ b/include/sql/patch/upgrade132.sql @@ -10,6 +10,6 @@ operation_currency join jrnx using (j_id) group by f_id,j_id; -commit ; + insert into version (val,v_description) values (133,'Currency : default accounting for currency difference '); commit ; \ No newline at end of file diff --git a/include/sql/patch/upgrade133.sql b/include/sql/patch/upgrade133.sql new file mode 100644 index 000000000..fc756c694 --- /dev/null +++ b/include/sql/patch/upgrade133.sql @@ -0,0 +1,13 @@ +begin; + +INSERT INTO public.menu_ref +(me_code, me_menu, me_file, me_url, me_description, me_parameter, me_javascript, me_type, me_description_etendue) +VALUES('CSV:Analytic_Axis', 'Export ANC', 'export_anc_axis_csv.php', NULL, 'Export ANC Liste comptes', NULL, NULL, 'PR', NULL); + + +insert into profile_menu (me_code,p_id,p_type_display) select distinct 'CSV:Analytic_Axis', p_id, 'P' from profile_menu +where + p_id in (select distinct p_id from profile_menu where me_code='PLANANC'); + +insert into version (val,v_description) values (134,'Export CSV:Analytic_Axis'); +commit ; \ No newline at end of file From 3d9693029d9f7cd2ec0d8a8ecb711ff27f801f00 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 25 Jan 2019 21:41:44 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Mantis=20#0001682:=20CA=20-=20ajouter=20pos?= =?UTF-8?q?sibilit=C3=A9=20d'exporter=20le=20plan=20analytique,=20missing?= =?UTF-8?q?=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit a7ab86adc327ade448e984717f41f97bed75f152) --- include/export/export_anc_axis_csv.php | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 include/export/export_anc_axis_csv.php diff --git a/include/export/export_anc_axis_csv.php b/include/export/export_anc_axis_csv.php new file mode 100644 index 000000000..81dfd8b44 --- /dev/null +++ b/include/export/export_anc_axis_csv.php @@ -0,0 +1,60 @@ +get("pa_id","number"); +$name=$cn->get_value("select pa_name from plan_analytique where pa_id=$1", + [$pa_id]); +$array=$cn->get_array(" select + po_name, + po_amount, + po_description, + ga_description + from + poste_analytique + left join groupe_analytique using (ga_id) + where poste_analytique.pa_id=$1 order by po_name asc ",[$pa_id]); +$output=new Noalyss_Csv($name); +$output->send_header(); +$output->write_header([ + _("Nom"), + _("Description"), + _("Montant"), + _("Groupe"), +]); +if ($array != FALSE ) +{ + $nb_array=count($array); + for ($i=0;$i<$nb_array;$i++) { + $output->add($array[$i]['po_name']); + $output->add($array[$i]['po_description']); + $output->add($array[$i]['po_amount'],"number"); + $output->add($array[$i]['ga_description']); + $output->write(); + } + +} \ No newline at end of file