noalyss Version-9
tax_summary.inc.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19*/
20
21// Copyright Author Dany De Bontridder danydb@noalyss.eu
22/**
23 * @file
24 * @brief display summary of tax (VAT) possible parameter is time range
25 *
26 */
28$limit = $g_user->get_limit_current_exercice();
29
30$start = $http->request("start_date", "date", $limit[0]);
31$end = $http->request("end_date", "date", $limit[1]);
32
33$start_periode = new IDate("start_date", $start);
34$end_periode = new IDate("end_date", $end);
35echo '<FORM METHOD="GET">';
36echo HtmlInput::array_to_hidden(['gDossier','ac'],$_GET);
37echo HtmlInput::hidden("do","display");
38$select_tva=new ISelect("tva_type");
39$select_tva->value=array(
40 array("value"=>'O',"label"=>_("Opération")),
41 array("value"=>'P',"label"=>_("Paiement")),
42 array("value"=>'T',"label"=>_("TVA"))
43);
44$select_tva->selected=$http->get('tva_type','string','O');
45printf(_("Calcul d'après la date"));
46echo $select_tva->input();
47printf(_("Période du %s au %s"),
48 $start_periode->input(),
49 $end_periode->input());
50
51echo HtmlInput::submit("show_tax_summary",_("Afficher"));
52echo '</FORM>';
53echo '<hr>';
54if ( $http->get("do","string","no") == "display")
55{
57 $tax_summary->set_tva_type($select_tva->selected);
58 try {
59 try {
60 $tax_summary->check();
61 }catch (Exception $e)
62 {
63 echo '<span class="warning">';
64 echo $e->getMessage();
65 echo '</span>';
66
67 }
68 echo '<ul class="aligned-block">';
69 echo '<li>';
70 echo $tax_summary->form_export_csv();
71 echo '</li>';
72 echo '<li>';
73 echo $tax_summary->form_export_pdf();
74 echo '</li>';
75 echo '</ul>';
76 $tax_summary->display();
77 echo '<ul class="aligned-block">';
78 echo '<li>';
79 echo $tax_summary->form_export_csv();
80 echo '</li>';
81 echo '<li>';
82 echo $tax_summary->form_export_pdf();
83 echo '</li>';
84 echo '</ul>';
85
86 } catch (Exception $e) {
87 echo '<span class="warning">';
88 echo $e->getMessage();
89 echo '</span>';
90 }
91}
global $g_user
if no group available , then stop
$_GET['qcode']
static hidden($p_name, $p_value, $p_id="")
static array_to_hidden($array, $global_array)
transform request data to hidden
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
manage the http input (get , post, request) and extract from an array
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Definition: idate.class.php:34
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Compute , display and export the tax summary.
$start_periode
$select_tva
$end_periode