2015-09-27 00:35:53 +02:00
|
|
|
<?php
|
|
|
|
/*
|
2018-04-13 18:58:28 +02:00
|
|
|
* This file is part of NOALYSS.
|
2015-09-27 00:35:53 +02:00
|
|
|
*
|
2018-04-13 18:58:28 +02:00
|
|
|
* NOALYSS isfree software; you can redistribute it and/or modify
|
2015-09-27 00:35:53 +02:00
|
|
|
* 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.
|
|
|
|
*
|
2018-04-13 18:58:28 +02:00
|
|
|
* NOALYSS isdistributed in the hope that it will be useful,
|
2015-09-27 00:35:53 +02:00
|
|
|
* 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
|
2018-04-13 18:58:28 +02:00
|
|
|
* along with NOALYSS; if not, write to the Free Software
|
2015-09-27 00:35:53 +02:00
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
// Copyright (2014) Author Dany De Bontridder <dany@alchimerys.be>
|
|
|
|
|
|
|
|
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
|
2018-04-13 18:58:28 +02:00
|
|
|
global $http;
|
2015-09-27 00:35:53 +02:00
|
|
|
/**
|
2018-04-13 18:58:28 +02:00
|
|
|
*@file
|
|
|
|
*@brief Print the aged balance for accountancy see
|
|
|
|
* @see Balance_Age
|
2015-09-27 00:35:53 +02:00
|
|
|
*/
|
2018-04-13 18:58:28 +02:00
|
|
|
$type=$http->get('p_type','string','C');
|
|
|
|
$let=$http->get('p_let','string','unlet');
|
|
|
|
|
|
|
|
$date_start=$http->get('p_date_start','string', '01.01.'.$g_user->get_exercice());
|
2015-09-27 00:35:53 +02:00
|
|
|
$w_date_start=new IDate('p_date_start',$date_start);
|
|
|
|
$w_select=new ISelect('p_type');
|
|
|
|
$w_select->value=array(
|
|
|
|
array('value'=>'C','label'=>_('Client')),
|
|
|
|
array('value'=>'F','label'=>_('Fournisseur'))
|
|
|
|
);
|
2018-04-13 18:58:28 +02:00
|
|
|
$w_select->selected=$type;
|
2015-09-27 00:35:53 +02:00
|
|
|
|
|
|
|
$w_lettre=new ISelect('p_let');
|
|
|
|
$w_lettre->value=array(
|
|
|
|
array('value'=>'let','label'=>_('lettrées et non lettrées')),
|
|
|
|
array('value'=>'unlet','label'=>_('non lettrées'))
|
|
|
|
);
|
2018-04-13 18:58:28 +02:00
|
|
|
$w_lettre->selected=$let;
|
2015-09-27 00:35:53 +02:00
|
|
|
|
|
|
|
?>
|
|
|
|
<form method="GET">
|
|
|
|
<?php
|
|
|
|
echo HtmlInput::request_to_hidden(array('gDossier','ac'));
|
|
|
|
?>
|
|
|
|
<?php printf (_(' Opérations après la date %s qui sont %s '),$w_date_start->input(),$w_lettre->input())?>
|
|
|
|
<?php echo _("Type de tiers")." ".$w_select->input()?>
|
|
|
|
<?php echo HtmlInput::submit("view", _('Valider'))?>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if ( ! isset($_GET['view']) ):
|
|
|
|
html_page_stop();
|
|
|
|
return;
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
<form method="get" action="export.php">
|
|
|
|
<?php
|
|
|
|
echo HtmlInput::request_to_hidden(array('gDossier','ac','p_type','p_let','p_date_start'));
|
|
|
|
echo HtmlInput::hidden('act','CSV:balance_age');
|
|
|
|
echo HtmlInput::submit('csv',_('export CSV'));
|
|
|
|
?>
|
|
|
|
</form>
|
|
|
|
<?php
|
2018-04-13 18:58:28 +02:00
|
|
|
require_once NOALYSS_INCLUDE.'/class/balance_age.class.php';
|
2015-09-27 00:35:53 +02:00
|
|
|
$balance=new Balance_Age($cn);
|
2018-04-13 18:58:28 +02:00
|
|
|
|
2015-09-27 00:35:53 +02:00
|
|
|
if ( $type == "C") :
|
2018-04-13 18:58:28 +02:00
|
|
|
$balance->display_sale($date_start,$let);
|
2015-09-27 00:35:53 +02:00
|
|
|
else:
|
2018-04-13 18:58:28 +02:00
|
|
|
$balance->display_purchase($date_start,$let);
|
2015-09-27 00:35:53 +02:00
|
|
|
endif;
|
|
|
|
|
|
|
|
?>
|