noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
export_stock_histo_csv.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free 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 is distributed 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
21// Copyright Author Dany De Bontridder danydb@aevalys.eu
22
23/**
24 * @file
25 * @brief export in CSV the export of history
26 *
27 */
28if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
29$export=new Noalyss_Csv(_('historique-stock'));
31$sql = $stock->create_query_histo($_GET);
32$sql .= " order by real_date asc";
33
34$res=$cn->exec_sql($sql);
36$export->send_header();
37
38$export->write_header(array(_("Date"),
39 _("N° pièce"),
40 _('Code Stock'),
41 _('Depot'),
42 _('Code Stock'),
43 _('Nom Stock'),
44 _("Code Tiers"),
45 _("Nom Tiers"),
46 _('Commentaire'),
47 _('Quantité'),
48 _('Prix unitaire'),
49 _('IN/OUT')));
50
51for ($i=0;$i<$max_row;$i++)
52{
54 $export->add($row['cdate']);
55 $export->add($row['jr_pj_number']);
56 $export->add($row['sg_code']);
57 $export->add($row['r_name']);
58 $export->add($row['qcode']);
59 $export->add($row['fname']);
60 $export->add($row['qcode_tiers']);
61 $export->add($row['fname_tiers']);
62 $row['ccomment']=noalyss_str_replace('"','',$row['ccomment']);
63 $export->add($row['ccomment']);
64 $export->add($row['sg_quantity'],"number");
65 $export->add($row['j_montant'],"number");
66 $export->add($row['direction']);
67 $export->write();
68
69}
70
71?>
noalyss_str_replace($search, $replace, $string)
_("actif, passif,charge,...")
$_GET['qcode']
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
Manage the CSV : manage files and write CSV record.
manage the stocks
$stock