#238 : recode entirely the export (PDF / CSV )
This commit is contained in:
parent
2ed18aed5c
commit
d83210ea14
43 changed files with 237 additions and 135 deletions
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is part of PhpCompta.
|
||||
*
|
||||
* PhpCompta is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpCompta is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with PhpCompta; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
/* $Revision$ */
|
||||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/*!\file
|
||||
* \brief this file is used to print the listing of CA operation
|
||||
*
|
||||
*/
|
||||
require_once('constant.php');
|
||||
require_once('class_database.php');
|
||||
require_once('class_anc_operation.php');
|
||||
|
||||
$cn=new Database(dossier::id);
|
||||
$op=new Anc_Operation($cn);
|
||||
$op->pa_id=$_GET['pa_id'];
|
||||
$array=$op->get_list($_GET['from'],$_GET['to']);
|
||||
$length=count($array);
|
||||
$size=40;
|
||||
$offset=0;
|
||||
?>
|
||||
|
|
@ -80,7 +80,7 @@ if ( $action == 'stock')
|
|||
}
|
||||
if ( $action=='quick_writing')
|
||||
{
|
||||
require_once ('quick_writing.inc.php');
|
||||
require_once ('compta_ods.inc.php');
|
||||
}
|
||||
if ( $action == 'gl' )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,13 +42,13 @@ if ( basename($_GET['ajax']) == 'ajax_history.php' )
|
|||
|
||||
if (isset($_GET['pcm_val']) )
|
||||
{
|
||||
$href_csv="poste_csv.php?".$href.'&poste_id='.$_GET['pcm_val'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode;
|
||||
$href_pdf="poste_pdf.php?".$href.'&poste_id='.$_GET['pcm_val'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode;
|
||||
$href_csv="export.php?".$href.'&poste_id='.$_GET['pcm_val'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV/postedetail";
|
||||
$href_pdf="export.php?".$href.'&poste_id='.$_GET['pcm_val'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF/postedetail";;
|
||||
}
|
||||
else
|
||||
{
|
||||
$href_csv="quick_code_csv.php?".$href.'&f_id='.$_GET['f_id'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode;
|
||||
$href_pdf="quick_code_pdf.php?".$href.'&f_id='.$_GET['f_id'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode;
|
||||
$href_csv="export.php?".$href.'&f_id='.$_GET['f_id'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV/fichedetail";
|
||||
$href_pdf="export.php?".$href.'&f_id='.$_GET['f_id'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF/fichedetail";
|
||||
}
|
||||
|
||||
echo '<a class="button" href="'.$href_csv.'">Export CSV</a>';
|
||||
|
|
|
|||
|
|
@ -95,8 +95,9 @@ if ( isset ($_GET['viewsearch']))
|
|||
foreach ($_GET['r_jrn'] as $k=>$v)
|
||||
$r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
|
||||
}
|
||||
echo '<form action="histo_csv.php" method="get">';
|
||||
echo '<form action="export.php" method="get">';
|
||||
echo $r;
|
||||
echo HtmlInput::hidden('act','CSV/histo');
|
||||
echo HtmlInput::submit('viewsearch','Export vers CSV');
|
||||
echo HtmlInput::hidden('p_action','ALL');
|
||||
echo '</form>';
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ if ($sub == 'bs')
|
|||
echo '</form>';
|
||||
if ( isset($_GET['result']))
|
||||
{
|
||||
echo $bs->show_button('ca_bs_csv.php','ca_bs_pdf.php',$str_hidden);
|
||||
echo $bs->show_button($str_hidden);
|
||||
echo $bs->display_html();
|
||||
}
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ if ( $sub == 'bc2')
|
|||
echo '</form>';
|
||||
if ( isset($_GET['result']))
|
||||
{
|
||||
echo $bc->show_button('ca_bc_csv.php','ca_bc_pdf.php',$str_hidden);
|
||||
echo $bc->show_button($str_hidden);
|
||||
echo $bc->display_html();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,10 +171,12 @@ if ( isset ($_GET['view'] ) )
|
|||
|
||||
echo "<table>";
|
||||
echo '<TR>';
|
||||
echo '<TD><form method="GET" ACTION="print_balance.php">'.
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.
|
||||
dossier::hidden().
|
||||
HtmlInput::submit('bt_pdf',"Export PDF").
|
||||
HtmlInput::hidden("p_action","impress").
|
||||
HtmlInput::hidden("act","PDF/balance").
|
||||
|
||||
HtmlInput::hidden("from_periode",$_GET['from_periode']).
|
||||
HtmlInput::hidden("to_periode",$_GET['to_periode']);
|
||||
echo HtmlInput::hidden('p_filter',$_GET['p_filter']);
|
||||
|
|
@ -191,10 +193,11 @@ if ( isset ($_GET['view'] ) )
|
|||
|
||||
echo "</form></TD>";
|
||||
|
||||
echo '<TD><form method="GET" ACTION="bal_csv.php">'.
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.
|
||||
HtmlInput::submit('bt_csv',"Export CSV").
|
||||
dossier::hidden().
|
||||
HtmlInput::hidden("p_action","impress").
|
||||
HtmlInput::hidden("act","CSV/balance").
|
||||
HtmlInput::hidden("from_periode",$_GET['from_periode']).
|
||||
HtmlInput::hidden("to_periode",$_GET['to_periode']);
|
||||
echo HtmlInput::hidden('p_filter',$_GET['p_filter']);
|
||||
|
|
|
|||
|
|
@ -405,6 +405,20 @@ class Acc_Account_Ledger
|
|||
*/
|
||||
static function HtmlTableHeader($actiontarget="poste")
|
||||
{
|
||||
switch($actiontarget)
|
||||
{
|
||||
case 'poste':
|
||||
$action_csv='CSV/postedetail';
|
||||
$action_pdf='PDF/postedetail';
|
||||
break;
|
||||
case 'gl_comptes':
|
||||
$action_csv='CSV/glcompte';
|
||||
$action_pdf='PDF/glcompte';
|
||||
break;
|
||||
default:
|
||||
throw new Exception(" Fonction HtmlTableHeader argument actiontarget invalid");
|
||||
exit;
|
||||
}
|
||||
$hid=new IHidden();
|
||||
echo '<div class="noprint">';
|
||||
echo "<table >";
|
||||
|
|
@ -417,9 +431,10 @@ class Acc_Account_Ledger
|
|||
HtmlInput::submit('bt_other',"Autre poste").
|
||||
$hid->input("type","poste").$hid->input('p_action','impress')."</form></TD>";
|
||||
}
|
||||
echo '<TD><form method="GET" ACTION="'.$actiontarget.'_pdf.php">'.
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.
|
||||
dossier::hidden().
|
||||
HtmlInput::submit('bt_pdf',"Export PDF").
|
||||
HtmlInput::hidden('act',$action_pdf).
|
||||
$hid->input("type","poste").$str_ople.
|
||||
$hid->input('p_action','impress').
|
||||
$hid->input("from_periode",$_REQUEST['from_periode']).
|
||||
|
|
@ -434,9 +449,10 @@ class Acc_Account_Ledger
|
|||
|
||||
echo "</form></TD>";
|
||||
|
||||
echo '<TD><form method="GET" ACTION="'.$actiontarget.'_csv.php">'.
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.
|
||||
dossier::hidden().
|
||||
HtmlInput::submit('bt_csv',"Export CSV").
|
||||
HtmlInput::hidden('act',$action_csv).
|
||||
$hid->input("type","poste").$str_ople.
|
||||
$hid->input('p_action','impress').
|
||||
$hid->input("from_periode",$_REQUEST['from_periode']).
|
||||
|
|
|
|||
|
|
@ -313,19 +313,18 @@ class Anc_Balance_Double extends Anc_Print
|
|||
}
|
||||
/*!
|
||||
* \brief Show the button to export in PDF or CSV
|
||||
* \param $url_csv url of the csv
|
||||
* \param $url_pdf url of the pdf
|
||||
* \param $p_string hidden data to include in the form
|
||||
*
|
||||
*
|
||||
* \return string with the button
|
||||
*/
|
||||
function show_button($url_csv,$url_pdf,$p_string="")
|
||||
function show_button($p_string="")
|
||||
{
|
||||
$r="";
|
||||
$r.= '<form method="GET" action="'.$url_pdf.'" style="display:inline">';
|
||||
$r.= '<form method="GET" action="export.php" style="display:inline">';
|
||||
$r.= $p_string;
|
||||
$r.= HtmlInput::hidden("to",$this->to);
|
||||
$r.= HtmlInput::hidden("act","PDF/AncBalDouble");
|
||||
$r.= HtmlInput::hidden("from",$this->from);
|
||||
$r.= HtmlInput::hidden("pa_id",$this->pa_id);
|
||||
$r.= HtmlInput::hidden("from_poste",$this->from_poste);
|
||||
|
|
@ -337,8 +336,9 @@ class Anc_Balance_Double extends Anc_Print
|
|||
$r.=HtmlInput::submit('bt_pdf',"Export en PDF");
|
||||
$r.= '</form>';
|
||||
|
||||
$r.= '<form method="GET" action="'.$url_csv.'" style="display:inline">';
|
||||
$r.= '<form method="GET" action="export.php" style="display:inline">';
|
||||
$r.= HtmlInput::hidden("to",$this->to);
|
||||
$r.= HtmlInput::hidden("act","CSV/AncBalDouble");
|
||||
$r.= HtmlInput::hidden("from",$this->from);
|
||||
$r.= HtmlInput::hidden("pa_id",$this->pa_id);
|
||||
$r.= HtmlInput::hidden("from_poste",$this->from_poste);
|
||||
|
|
|
|||
|
|
@ -239,13 +239,15 @@ class Anc_Balance_Simple extends Anc_Print
|
|||
*
|
||||
* \return string with the button
|
||||
*/
|
||||
function show_button($url_csv,$url_pdf,$p_string="")
|
||||
function show_button($p_string="")
|
||||
{
|
||||
$r="";
|
||||
$r.= '<form method="GET" action="'.$url_pdf.'" style="display:inline">';
|
||||
$r.= '<form method="GET" action="export.php" style="display:inline">';
|
||||
$r.= $p_string;
|
||||
$r.= dossier::hidden();
|
||||
$r.= HtmlInput::hidden("to",$this->to);
|
||||
$r.= HtmlInput::hidden("act","PDF/AncBalSimple");
|
||||
|
||||
$r.= HtmlInput::hidden("from",$this->from);
|
||||
$r.= HtmlInput::hidden("pa_id",$this->pa_id);
|
||||
$r.= HtmlInput::hidden("from_poste",$this->from_poste);
|
||||
|
|
@ -253,7 +255,8 @@ class Anc_Balance_Simple extends Anc_Print
|
|||
$r.=HtmlInput::submit('bt_pdf',"Export en PDF");
|
||||
$r.= '</form>';
|
||||
|
||||
$r.= '<form method="GET" action="'.$url_csv.'" style="display:inline">';
|
||||
$r.= '<form method="GET" action="export.php" style="display:inline">';
|
||||
$r.= HtmlInput::hidden("act","CSV/AncBalSimple");
|
||||
$r.= HtmlInput::hidden("to",$this->to);
|
||||
$r.= HtmlInput::hidden("from",$this->from);
|
||||
$r.= HtmlInput::hidden("pa_id",$this->pa_id);
|
||||
|
|
|
|||
|
|
@ -167,13 +167,13 @@ class Anc_Listing extends Anc_Print
|
|||
$r.= '</form>';
|
||||
*/
|
||||
|
||||
$r.= '<form method="GET" action="ca_list_csv.php" style="display:inline">';
|
||||
$r.= '<form method="GET" action="export.php" style="display:inline">';
|
||||
$r.= HtmlInput::hidden("to",$this->to);
|
||||
$r.= HtmlInput::hidden("from",$this->from);
|
||||
$r.= HtmlInput::hidden("pa_id",$this->pa_id);
|
||||
$r.= HtmlInput::hidden("from_poste",$this->from_poste);
|
||||
$r.= HtmlInput::hidden("to_poste",$this->to_poste);
|
||||
|
||||
$r.=HtmlInput::hidden('act','CSV/AncList');
|
||||
$r.= $p_string;
|
||||
$r.= dossier::hidden();
|
||||
$r.=HtmlInput::submit('bt_csv',"Export en CSV");
|
||||
|
|
|
|||
|
|
@ -1383,9 +1383,10 @@ class Fiche
|
|||
$hid->input("type","poste").$hid->input('p_action','impress')."</form></TD>";
|
||||
$str_ople=(isset($_REQUEST['ople']))?HtmlInput::hidden('ople',$_REQUEST['ople']):'';
|
||||
|
||||
echo '<TD><form method="GET" ACTION="quick_code_pdf.php">'.
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.
|
||||
HtmlInput::submit('bt_pdf',"Export PDF").
|
||||
dossier::hidden().$str_ople.
|
||||
HtmlInput::hidden('act','PDF/fichedetail').
|
||||
$hid->input("type","poste").
|
||||
$hid->input('p_action','impress').
|
||||
$hid->input("f_id",$this->id).
|
||||
|
|
@ -1397,8 +1398,9 @@ class Fiche
|
|||
|
||||
echo "</form></TD>";
|
||||
|
||||
echo '<TD><form method="GET" ACTION="quick_code_csv.php">'.
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.
|
||||
HtmlInput::submit('bt_csv',"Export CSV").
|
||||
HtmlInput::hidden('act','PDF/fichedetail').
|
||||
dossier::hidden().$str_ople.
|
||||
$hid->input("type","poste").
|
||||
$hid->input('p_action','impress').
|
||||
|
|
|
|||
|
|
@ -339,8 +339,9 @@ if ( $def == 2 )
|
|||
foreach ($_GET['r_jrn'] as $k=>$v)
|
||||
$r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
|
||||
}
|
||||
echo '<form action="histo_csv.php" method="get">';
|
||||
echo '<form action="export.php" method="get">';
|
||||
echo $r;
|
||||
echo HtmlInput::hidden('act','CSV/histo');
|
||||
echo HtmlInput::submit('viewsearch','Export vers CSV');
|
||||
|
||||
echo '</form>';
|
||||
|
|
|
|||
|
|
@ -221,8 +221,9 @@ if ( $def == 2)
|
|||
foreach ($_GET['r_jrn'] as $k=>$v)
|
||||
$r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
|
||||
}
|
||||
echo '<form action="histo_csv.php" method="get">';
|
||||
echo '<form action="export.php" method="get">';
|
||||
echo $r;
|
||||
echo HtmlInput::hidden('act','CSV/histo');
|
||||
echo HtmlInput::submit('viewsearch','Export vers CSV');
|
||||
|
||||
echo '</form>';
|
||||
|
|
|
|||
|
|
@ -190,8 +190,9 @@ if ($sa == 'l' && $id != -1)
|
|||
foreach ($_GET['r_jrn'] as $k=>$v)
|
||||
$r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
|
||||
}
|
||||
echo '<form action="histo_csv.php" method="get">';
|
||||
echo '<form action="export.php" method="get">';
|
||||
echo $r;
|
||||
echo HtmlInput::hidden('act','CSV/histo');
|
||||
echo HtmlInput::submit('viewsearch','Export vers CSV');
|
||||
|
||||
echo '</form>';
|
||||
|
|
@ -359,8 +359,9 @@ if ( $def == 2 )
|
|||
foreach ($_GET['r_jrn'] as $k=>$v)
|
||||
$r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
|
||||
}
|
||||
echo '<form action="histo_csv.php" method="get">';
|
||||
echo '<form action="export.php" method="get">';
|
||||
echo $r;
|
||||
echo HtmlInput::hidden('act','CSV/histo');
|
||||
echo HtmlInput::submit('viewsearch','Export vers CSV');
|
||||
|
||||
echo '</form>';
|
||||
|
|
|
|||
|
|
@ -35,13 +35,12 @@ $g_captcha=false;
|
|||
/* set to none for production */
|
||||
/* uncomment for production */
|
||||
|
||||
$version_phpcompta=SVNINFO;
|
||||
define ("DEBUG",false);
|
||||
//$version_phpcompta=SVNINFO;
|
||||
//define ("DEBUG",false);
|
||||
|
||||
/*
|
||||
define ("DEBUG",true);
|
||||
$version_phpcompta=3872;
|
||||
*/
|
||||
$version_phpcompta=4014;
|
||||
|
||||
|
||||
define ("DBVERSION",93);
|
||||
define ("DBVERSIONREPO",13);
|
||||
|
|
|
|||
|
|
@ -34,15 +34,6 @@ require_once('class_database.php');
|
|||
require_once('class_dossier.php');
|
||||
require_once('ac_common.php');
|
||||
|
||||
/* Security */
|
||||
$gDossier=dossier::id();
|
||||
$cn=new Database($gDossier);
|
||||
$User=new User($cn);
|
||||
$User->Check();
|
||||
$User->check_dossier($gDossier);
|
||||
$User->can_request(IMPFIC,0);
|
||||
|
||||
|
||||
/* balance */
|
||||
if ( $_GET['histo'] == 4 )
|
||||
{
|
||||
|
|
@ -34,10 +34,7 @@ $gDossier=dossier::id();
|
|||
$cn=new Database($gDossier);
|
||||
|
||||
require_once ('class_user.php');
|
||||
$User=new User($cn);
|
||||
$User->Check();
|
||||
$User->check_dossier($gDossier);
|
||||
$User->can_request(IMPFIC,0);
|
||||
|
||||
|
||||
|
||||
if ( isset ($_GET['fd_id']))
|
||||
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
include_once("ac_common.php");
|
||||
require_once('class_database.php');
|
||||
include ('class_user.php');
|
||||
require_once("class_fiche.php");
|
||||
header('Content-type: application/csv');
|
||||
|
||||
|
|
@ -36,9 +35,6 @@ $gDossier=dossier::id();
|
|||
$cn=new Database($gDossier);
|
||||
|
||||
|
||||
$User=new User($cn);
|
||||
$User->Check();
|
||||
|
||||
$Fiche=new Fiche($cn,$_REQUEST['f_id']);
|
||||
$Fiche->getName();
|
||||
list($array,$tot_deb,$tot_cred)=$Fiche->get_row_date(
|
||||
|
|
@ -21,9 +21,9 @@
|
|||
/*! \file
|
||||
* \brief Send a report in CSV format
|
||||
*/
|
||||
include_once("ac_common.php");
|
||||
require_once ("ac_common.php");
|
||||
require_once('class_database.php');
|
||||
include ('class_user.php');
|
||||
require_once ('class_user.php');
|
||||
require_once("class_acc_report.php");
|
||||
require_once("impress_inc.php");
|
||||
header('Pragma: public');
|
||||
|
|
@ -35,11 +35,6 @@ $gDossier=dossier::id();
|
|||
/* Admin. Dossier */
|
||||
$cn=new Database($gDossier);
|
||||
|
||||
|
||||
$User=new User($cn);
|
||||
$User->Check();
|
||||
|
||||
|
||||
$Form=new Acc_Report($cn,$_GET['form_id']);
|
||||
$Form->get_name();
|
||||
// Step ?
|
||||
|
|
@ -42,10 +42,7 @@ $gDossier=dossier::id();
|
|||
|
||||
/* Security */
|
||||
$cn=new Database($gDossier);
|
||||
$User=new User($cn);
|
||||
$User->Check();
|
||||
$User->check_dossier($gDossier);
|
||||
$User->can_request(IMPBIL,0);
|
||||
|
||||
|
||||
extract($_GET);
|
||||
|
||||
|
|
@ -24,27 +24,6 @@
|
|||
* \brief
|
||||
*/
|
||||
|
||||
require_once('class_database.php');
|
||||
require_once('class_acc_ledger.php');
|
||||
|
||||
$gDossier=dossier::id();
|
||||
$cn=new Database($gDossier);
|
||||
|
||||
$user=new User($cn);
|
||||
$user->Check();
|
||||
$act=$user->check_dossier($gDossier);
|
||||
if ( $act=='P')
|
||||
{
|
||||
redirect("extension.php?".dossier::get(),0);
|
||||
exit();
|
||||
}
|
||||
if ( $act=='X')
|
||||
{
|
||||
echo alert('Accès interdit');
|
||||
exit();
|
||||
}
|
||||
$user->can_request(IMPJRN,0);
|
||||
|
||||
header('Pragma: public');
|
||||
header('Content-type: application/csv');
|
||||
header('Content-Disposition: attachment;filename="histo-export.csv"',FALSE);
|
||||
155
include/export_poste_detail_csv.php
Normal file
155
include/export_poste_detail_csv.php
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is part of PhpCompta.
|
||||
*
|
||||
* PhpCompta is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpCompta is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with PhpCompta; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
/* $Revision$ */
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
/*! \file
|
||||
* \brief Send the poste list in csv
|
||||
*/
|
||||
include_once("ac_common.php");
|
||||
require_once('class_database.php');
|
||||
require_once("class_acc_account_ledger.php");
|
||||
require_once ('class_acc_operation.php');
|
||||
|
||||
header('Pragma: public');
|
||||
header('Content-type: application/csv');
|
||||
header('Content-Disposition: attachment;filename="poste.csv"',FALSE);
|
||||
require_once('class_dossier.php');
|
||||
$gDossier=dossier::id();
|
||||
|
||||
/* Admin. Dossier */
|
||||
$cn=new Database($gDossier);
|
||||
|
||||
if ( isset ( $_REQUEST['poste_fille']) )
|
||||
{ //choisit de voir tous les postes
|
||||
$a_poste=$cn->get_array("select pcm_val from tmp_pcmn where pcm_val::text like $1||'%'",array($_REQUEST["poste_id"]));
|
||||
}
|
||||
else
|
||||
{
|
||||
$a_poste=$cn->get_array("select pcm_val from tmp_pcmn where pcm_val = $1",array($_REQUEST['poste_id']));
|
||||
}
|
||||
|
||||
if ( ! isset ($_REQUEST['oper_detail']))
|
||||
{
|
||||
if ( count($a_poste) == 0 )
|
||||
exit;
|
||||
|
||||
foreach ($a_poste as $pos)
|
||||
{
|
||||
$Poste=new Acc_Account_Ledger($cn,$pos['pcm_val']);
|
||||
$name=$Poste->get_name();
|
||||
list($array,$tot_deb,$tot_cred)=$Poste->get_row_date( $_REQUEST['from_periode'],
|
||||
$_REQUEST['to_periode'],
|
||||
$_GET['ople']
|
||||
);
|
||||
if ( count($Poste->row ) == 0 )
|
||||
continue;
|
||||
|
||||
echo '"Poste";'.
|
||||
'"n° pièce";'.
|
||||
'"Lib.";'.
|
||||
"\"Code interne\";".
|
||||
"\"Date\";".
|
||||
"\"Description\";".
|
||||
"\"Débit\";".
|
||||
"\"Crédit\";".
|
||||
"\"Prog.\"";
|
||||
printf("\n");
|
||||
|
||||
$prog=0;
|
||||
foreach ( $Poste->row as $op )
|
||||
{
|
||||
$diff=bcsub($op['deb_montant'],$op['cred_montant']);
|
||||
$prog=bcadd($prog,$diff);
|
||||
echo '"'.$pos['pcm_val'].'";'.
|
||||
'"'.$op['jr_pj_number'].'"'.";".
|
||||
'"'.$name.'";'.
|
||||
'"'.$op['jr_internal'].'"'.";".
|
||||
'"'.$op['j_date_fmt'].'"'.";".
|
||||
'"'.$op['description'].'";'.
|
||||
nb($op['deb_montant']).";".
|
||||
nb($op['cred_montant']).";".
|
||||
nb(abs($prog));
|
||||
printf("\n");
|
||||
|
||||
|
||||
}
|
||||
$solde_type=($tot_deb>$tot_cred)?"solde débiteur":"solde créditeur";
|
||||
$diff=abs($tot_deb-$tot_cred);
|
||||
printf(
|
||||
'"'."$solde_type".'"'.";".
|
||||
nb($diff).";".
|
||||
nb($tot_deb).";".
|
||||
nb($tot_cred)."\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* detail of all operation */
|
||||
if ( count($a_poste) == 0 )
|
||||
exit;
|
||||
|
||||
foreach ($a_poste as $pos)
|
||||
{
|
||||
$Poste=new Acc_Account_Ledger($cn,$pos['pcm_val']);
|
||||
$Poste->get_name();
|
||||
list($array,$tot_deb,$tot_cred)=$Poste->get_row_date( $_REQUEST['from_periode'],
|
||||
$_REQUEST['to_periode']
|
||||
);
|
||||
if ( count($Poste->row ) == 0 )
|
||||
continue;
|
||||
|
||||
echo '"Poste";'.
|
||||
'"Lib.";'.
|
||||
'"QuickCode";'.
|
||||
"\"Code interne\";".
|
||||
"\"Date\";".
|
||||
"\"Description\";".
|
||||
"\"Montant\";".
|
||||
"\"D/C\"";
|
||||
printf("\n");
|
||||
|
||||
|
||||
foreach ( $Poste->row as $a )
|
||||
{
|
||||
$op=new Acc_Operation($cn);
|
||||
$op->jr_id=$a['jr_id'];
|
||||
$result=$op->get_jrnx_detail();
|
||||
foreach ( $result as $r)
|
||||
{
|
||||
printf('"%s";"%s";"%s";"%s";"%s";"%s";"%s";%12.2f;"%s"',
|
||||
$r['j_poste'],
|
||||
$r['pcm_lib'],
|
||||
$r['j_qcode'],
|
||||
$r['jr_internal'],
|
||||
$r['jr_date'],
|
||||
$a['description'],
|
||||
$a['jr_pj_number'],
|
||||
nb($r['j_montant']),
|
||||
$r['debit']);
|
||||
printf("\r\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
|
@ -36,11 +36,6 @@ $gDossier=dossier::id();
|
|||
|
||||
/* Security */
|
||||
$cn=new Database($gDossier);
|
||||
$User=new User($cn);
|
||||
$User->Check();
|
||||
$User->check_dossier($gDossier);
|
||||
$User->can_request(IMPPOSTE,0);
|
||||
|
||||
extract($_GET);
|
||||
|
||||
if ( isset ( $poste_fille) )
|
||||
|
|
@ -202,5 +197,3 @@ foreach ($a_poste as $poste)
|
|||
$fDate=date('dmy-Hi');
|
||||
$pdf->Output('poste-'.$fDate.'.pdf','I');
|
||||
?>
|
||||
?>
|
||||
?>
|
||||
|
|
@ -101,8 +101,9 @@ if ( $_GET['histo'] == 3 )
|
|||
require_once('template/result_cat_card_summary.php');
|
||||
|
||||
$hid=new IHidden();
|
||||
echo '<form method="GET" ACTION="fiche_csv.php">'.dossier::hidden().
|
||||
echo '<form method="GET" ACTION="export.php">'.dossier::hidden().
|
||||
HtmlInput::submit('bt_csv',"Export CSV").
|
||||
HtmlInput::hidden('act',"CSV/fiche").
|
||||
$hid->input("type","fiche").
|
||||
$hid->input("p_action","impress").
|
||||
$hid->input("fd_id",$_REQUEST['cat']);
|
||||
|
|
@ -110,16 +111,19 @@ if ( $_GET['histo'] == 3 )
|
|||
|
||||
exit();
|
||||
}
|
||||
$export_pdf='<FORM METHOD="get" ACTION="category_pdf.php" style="display:inline">';
|
||||
$export_pdf='<FORM METHOD="get" ACTION="export.php" style="display:inline">';
|
||||
$export_pdf.=HtmlInput::hidden('cat',$_GET['cat']);
|
||||
$export_pdf.=HtmlInput::hidden('act',"PDF/fiche").
|
||||
$export_pdf.=HtmlInput::hidden('start',$_GET['start']);
|
||||
$export_pdf.=HtmlInput::hidden('end',$_GET['end']);
|
||||
$export_pdf.=HtmlInput::hidden('histo',$_GET['histo']);
|
||||
$export_pdf.=dossier::hidden();
|
||||
$export_pdf.=HtmlInput::submit('pdf','Export en PDF');
|
||||
$export_pdf.='</FORM>';
|
||||
$export_csv='<FORM METHOD="get" ACTION="category_csv.php" style="display:inline">';
|
||||
$export_csv='<FORM METHOD="get" ACTION="export.php" style="display:inline">';
|
||||
|
||||
$export_csv.=HtmlInput::hidden('cat',$_GET['cat']);
|
||||
$export_csv.=HtmlInput::hidden('act','CSV/fiche_balance');
|
||||
$export_csv.=HtmlInput::hidden('start',$_GET['start']);
|
||||
$export_csv.=HtmlInput::hidden('end',$_GET['end']);
|
||||
$export_csv.=HtmlInput::hidden('histo',$_GET['histo']);
|
||||
|
|
|
|||
|
|
@ -167,8 +167,9 @@ if ( isset( $_REQUEST['bt_html'] ) )
|
|||
echo '<TD><form method="GET" ACTION="?">'.dossier::hidden().
|
||||
$hid->input("type","jrn").$hid->input('p_action','impress')."</form></TD>";
|
||||
|
||||
echo '<TD><form method="GET" ACTION="jrn_pdf.php">'.dossier::hidden().
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.dossier::hidden().
|
||||
HtmlInput::submit('bt_pdf',"Export PDF").
|
||||
HtmlInput::hidden('act','PDF/ledger').
|
||||
$hid->input("type","jrn").
|
||||
$hid->input("p_action","impress").
|
||||
$hid->input("jrn_id",$Jrn->id).
|
||||
|
|
@ -177,8 +178,9 @@ if ( isset( $_REQUEST['bt_html'] ) )
|
|||
echo $hid->input("p_simple",$_GET['p_simple']);
|
||||
|
||||
echo "</form></TD>";
|
||||
echo '<TD><form method="GET" ACTION="jrn_csv.php">'.dossier::hidden().
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.dossier::hidden().
|
||||
HtmlInput::submit('bt_csv',"Export CSV").
|
||||
HtmlInput::hidden('act','CSV/ledger').
|
||||
$hid->input("type","jrn").
|
||||
$hid->input("p_action","impress").
|
||||
$hid->input("jrn_id",$Jrn->id).
|
||||
|
|
|
|||
|
|
@ -92,8 +92,9 @@ if ( isset( $_GET['bt_html'] ) )
|
|||
HtmlInput::submit('bt_other',"Autre Rapport").
|
||||
$hid->input("type","rapport").$hid->input("p_action","impress")."</form></TD>";
|
||||
|
||||
echo '<TD><form method="GET" ACTION="form_pdf.php">'.
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.
|
||||
HtmlInput::submit('bt_pdf',"Export PDF").
|
||||
HtmlInput::hidden('act','PDF/report').
|
||||
dossier::hidden().
|
||||
$hid->input("type","rapport").
|
||||
$hid->input("p_action","impress").
|
||||
|
|
@ -109,7 +110,8 @@ if ( isset( $_GET['bt_html'] ) )
|
|||
|
||||
|
||||
echo "</form></TD>";
|
||||
echo '<TD><form method="GET" ACTION="form_csv.php">'.
|
||||
echo '<TD><form method="GET" ACTION="export.php">'.
|
||||
HtmlInput::hidden('act','CSV/report').
|
||||
HtmlInput::submit('bt_csv',"Export CSV").
|
||||
dossier::hidden().
|
||||
$hid->input("type","form").
|
||||
|
|
|
|||
|
|
@ -75,8 +75,9 @@ if (isset($_GET['r_jrn'])) {
|
|||
foreach ($_GET['r_jrn'] as $k=>$v)
|
||||
$r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
|
||||
}
|
||||
echo '<form action="histo_csv.php" method="get">';
|
||||
echo '<form action="export.php" method="get">';
|
||||
echo $r;
|
||||
echo HtmlInput::hidden('act','CSV/histo');
|
||||
echo HtmlInput::submit('viewsearch','Export vers CSV');
|
||||
echo HtmlInput::hidden('p_action','ALL');
|
||||
echo '</form>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue