altocompta/include/history_operation.inc.php
Dany De Bontridder 9b60c79f54 Merged revisions 5560-5575 via svnmerge from
svn+ssh://danydb@ns352270.ovh.net/svn/phpcompta/tags/rel670

........
  r5560 | danydb | 2013-12-05 01:30:40 +0100 (jeu., 05 déc. 2013) | 1 line
  
  fix small bug utf-8 instead of utf8 for javascript
........
  r5561 | danydb | 2013-12-05 02:13:57 +0100 (jeu., 05 déc. 2013) | 1 line
  
  typo
........
  r5562 | danydb | 2013-12-05 02:14:55 +0100 (jeu., 05 déc. 2013) | 2 lines
  
  Task #929 - Ajout d'une description pour les journaux
........
  r5563 | danydb | 2013-12-05 06:37:23 +0100 (jeu., 05 déc. 2013) | 2 lines
  
  task #928 : ajax pour remplacer les journaux
  Task #928 - Fenêtre Journaux dans fenêtre recherche est clippé
........
  r5564 | danydb | 2013-12-05 07:23:14 +0100 (jeu., 05 déc. 2013) | 4 lines
  
  Task #929 : Ajout d'une description pour les journaux
  
  Description pour les journaux visibles dans lors encodages 
  Task #929 - Ajout d'une description pour les journaux
........
  r5565 | danydb | 2013-12-05 07:51:08 +0100 (jeu., 05 déc. 2013) | 3 lines
  
  Task #929 : Ajout d'une description pour les journaux
  
  nettoyage code
........
  r5566 | danydb | 2013-12-05 07:55:11 +0100 (jeu., 05 déc. 2013) | 3 lines
  
  Task #929 : Ajout d'une description pour les journaux
  
  ajout fichier
........
  r5567 | danydb | 2013-12-06 11:38:07 +0100 (ven., 06 déc. 2013) | 3 lines
  
  Task #941 Tag non disponible pour nouveau suivi
  Si nouveau document, on ne peut plus ajouter de tag
  Task #914 - Tag non disponible pour nouveau suivi
........
  r5568 | danydb | 2013-12-06 11:41:15 +0100 (ven., 06 déc. 2013) | 2 lines
  
  Task #924 FSALDO : les lignes paires et impaires n'ont pas la même taille de police
  Task #924 - FSALDO : les lignes paires et impaires n'ont pas la même taille de police
........
  r5569 | danydb | 2013-12-06 12:07:16 +0100 (ven., 06 déc. 2013) | 1 line
  
  FREC : tri incorrect
........
  r5570 | danydb | 2013-12-06 12:07:37 +0100 (ven., 06 déc. 2013) | 1 line
  
  ajout d'un 3ième paramètre pour TH : raw
........
  r5571 | danydb | 2013-12-06 12:20:37 +0100 (ven., 06 déc. 2013) | 2 lines
  
  task #925 - FSALDO  : ajouter les totaux
  Task #925 - FSALDO  : ajouter les totaux
........
  r5572 | danydb | 2013-12-06 12:32:43 +0100 (ven., 06 déc. 2013) | 2 lines
  
  task #930 - Quantité négative et impact sur les stocks
  Task #930 - Quantité négative et impact sur les stocks
........
  r5573 | danydb | 2013-12-06 13:01:05 +0100 (ven., 06 déc. 2013) | 2 lines
  
  task #926 : CARD : balance et balance non soldée
  Task #926 - CARD : balance et balance non soldée
........
  r5574 | danydb | 2013-12-06 14:38:08 +0100 (ven., 06 déc. 2013) | 2 lines
  
  task #0000919: FOLLOW : description des fichiers joints
  Task #919 - FOLLOW : description des fichiers joints
........
  r5575 | danydb | 2013-12-06 14:40:41 +0100 (ven., 06 déc. 2013) | 1 line
  
  Release
........
2013-12-06 14:41:27 +00:00

164 lines
4.4 KiB
PHP

<?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
*
*/
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
require_once 'class_acc_ledger_purchase.php';
require_once 'class_acc_ledger_fin.php';
require_once 'class_acc_ledger_sold.php';
require_once 'class_acc_ledger.php';
global $g_user,$cn;
$p_array = $_GET;
if ( isset ($_GET['ledger_type']))
{
$ledger_type=$_GET['ledger_type'];
switch($ledger_type)
{
case 'ACH':
$Ledger = new Acc_Ledger_Purchase($cn, 0);
$ask_pay=1;
break;
case 'ODS':
$Ledger=new Acc_Ledger($cn,0);
$ask_pay=0;
$p_array['ledger_type']='ODS';
$Ledger->type='ODS';
break;
case 'ALL':
$Ledger=new Acc_Ledger($cn,0);
$ask_pay=0;
$p_array['ledger_type']='ALL';
$Ledger->type='ALL';
break;
case 'VEN':
$Ledger=new Acc_Ledger_Sold($cn,0);
$ask_pay=1;
break;
case 'FIN':
$Ledger=new Acc_Ledger_Fin($cn,0);
$ask_pay=0;
break;
}
}
echo '<div class="content">';
// Check privilege
if (isset($_REQUEST['p_jrn']) &&
$g_user->check_jrn($_REQUEST['p_jrn']) == 'X')
{
NoAccess();
exit - 1;
}
if (!isset($_REQUEST['p_jrn']))
{
$Ledger->id = -1;
}
else
$Ledger->id = $_REQUEST['p_jrn'];
echo $Ledger->display_search_form();
//------------------------------
// UPdate the payment
//------------------------------
if (isset($_GET ['paid']))
{
$Ledger->update_paid($_GET);
}
$msg="";
/* by default we should use the default period */
if (!isset($p_array['date_start']))
{
$period = $g_user->get_periode();
$per = new Periode($cn, $period);
list($date_start, $date_end) = $per->get_date_limit();
$p_array['date_start'] = $date_start;
$p_array['date_end'] = $date_end;
$msg='<h2 class="info2">'."Période ".$date_start." au ".$date_end.'</h2>';
}
else
{
$msg='<h2 class="info2">'."Période ".$_GET['date_start']." au ".$_GET['date_end'].'</h2>';
}
/* compute the sql stmt */
list($sql, $where) = $Ledger->build_search_sql($p_array);
$max_line = $cn->count_sql($sql);
$step = $_SESSION['g_pagesize'];
$page = (isset($_GET['offset'])) ? $_GET['page'] : 1;
$offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0;
$bar = navigation_bar($offset, $max_line, $step, $page);
echo $msg;
echo '<form method="GET" id="fpaida" class="print">';
echo HtmlInput::hidden("ac", $_REQUEST['ac']);
echo HtmlInput::hidden('ledger_type',$_REQUEST['ledger_type']);
echo dossier::hidden();
echo $bar;
list($count, $html) = $Ledger->list_operation($sql, $offset, $ask_pay);
echo $html;
echo $bar;
$r = HtmlInput::get_to_hidden(array('l', 'date_start', 'date_end', 'desc', 'amount_min', 'amount_max', 'qcode', 'accounting', 'unpaid', 'gDossier', 'ledger_type', 'p_action'));
if (isset($_GET['r_jrn']))
{
foreach ($_GET['r_jrn'] as $k => $v)
$r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v);
}
echo $r;
if ($ask_pay)
echo '<p>' . HtmlInput::submit('paid', _('Mise à jour paiement')) . IButton::select_checkbox('fpaida') . IButton::unselect_checkbox('fpaida') . '</p>';
echo '</form>';
/*
* Export to csv
*/
$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['r_jrn']))
{
foreach ($_GET['r_jrn'] as $k => $v)
$r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v);
}
echo '<form action="export.php" method="get">';
echo $r;
echo HtmlInput::hidden('act', 'CSV:histo');
echo HtmlInput::submit('viewsearch', 'Export vers CSV');
echo '</form>';
echo '</div>';
exit();
?>