|
@@ -1,7 +1,7 @@
|
|
|
<?php
|
|
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
|
|
- * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
|
+ * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
|
|
*
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
@@ -38,12 +38,13 @@ $id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int'));
|
|
|
$action = GETPOST('action','alpha');
|
|
|
$option = GETPOST('option');
|
|
|
|
|
|
-$diroutputpdf=$conf->facture->dir_output . '/unpaid/temp';
|
|
|
-
|
|
|
// Security check
|
|
|
if ($user->societe_id) $socid=$user->societe_id;
|
|
|
$result = restrictedArea($user,'facture',$id,'');
|
|
|
|
|
|
+$diroutputpdf=$conf->facture->dir_output . '/unpaid/temp';
|
|
|
+if (! $user->rights->societe->client->voir || $socid) $diroutputpdf.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user
|
|
|
+
|
|
|
|
|
|
/*
|
|
|
* Action
|
|
@@ -221,7 +222,7 @@ if ($search_societe) $sql .= " AND s.nom LIKE '%".$db->escape($search_societ
|
|
|
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
|
|
|
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
|
|
|
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
|
|
|
-$sql.= " GROUP BY s.nom, s.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.rowid, f.fk_statut, f.type ";
|
|
|
+$sql.= " GROUP BY s.nom, s.rowid, f.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type ";
|
|
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
|
|
$sql.= " ORDER BY ";
|
|
|
$listfield=explode(',',$sortfield);
|