noalyss Version-9
export_balance_age_csv.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS isfree software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS isdistributed in the hope that it will be useful,
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// Copyright (2014) Author Dany De Bontridder <dany@alchimerys.be>
21
22if (!defined('ALLOWED'))
23 die('Appel direct ne sont pas permis');
24require 'class/balance_age.class.php';
26
27/**
28 * @file
29 * @brief Export an ageing balance
30 * @param p_date_start considered writing after this date
31 * @param p_let lettered or not value (all): let or only unlettered value:unlet
32 * @param p_type
33 * - C customer
34 * - F supplier
35 * - U only a card
36 * - X a category
37 * @param cat only if p_type = X it that case contains the category id (fiche_def.fd_id)
38 * @param fiche only if p_type = U in that case contains the card id (fiche.f_id)
39 * @param all Ony with p_type = X all the customer / supplier cards
40 */
41/*
42 * Retrieve card
43 */
45$p_type = $http->get('p_type',"string", "-");
46$p_date= $http->get('p_date_start',"string", "-");
47$p_let= $http->get('p_let',"string", "let");
48$cat= $http->get('cat',"string", "");
49$fiche= $http->get('fiche',"string", "0");
50$all= $http->get('all',"string", "0");
51switch ($p_type)
52{
53 case 'C':
54 $bal->get_array_card('C');
55 $bal->export_csv($p_date, $p_let);
56 break;
57 case 'F':
58 $bal->get_array_card('F');
59 $bal->export_csv($p_date, $p_let);
60 break;
61 case 'U':
62 $bal->get_array_card('U', $fiche);
63 $bal->export_csv($p_date, $p_let);
64 break;
65 case 'X':
66 $all=$http->get('all', "string",0);
67 if ($all==0)
68 {
69 $bal->get_array_card('X', $http->get('cat'));
70 $bal->export_csv($p_date, $p_let);
71 }
72 else
73 {
74 $a_cat=$cn->get_array("select fd_id from vw_fiche_def where ad_id=".ATTR_DEF_ACCOUNT." order by fd_label asc");
75 $nb_cat=count($a_cat);
76 for ($i=0; $i<$nb_cat; $i++)
77 {
78 $bal->get_array_card('X', $a_cat[$i]['fd_id']);
79 $bal->export_csv($p_date, $p_let);
80 }
81 }
82 break;
83
84 default:
85 break;
86}
87?>
compute the ageing balance, currently this code is not used
manage the http input (get , post, request) and extract from an array
const ATTR_DEF_ACCOUNT
Definition: constant.php:215