2005-09-04 21:10:18 +02:00
< ? php
2025-02-05 19:01:42 +01:00
/* Copyright ( C ) 2001 - 2005 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2004 - 2022 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2005 - 2015 Regis Houssin < regis . houssin @ inodbox . com >
* Copyright ( C ) 2015 - 2020 Juanjo Menent < jmenent @ 2 byte . es >
* Copyright ( C ) 2015 Jean - François Ferry < jfefe @ aternatik . fr >
* Copyright ( C ) 2015 Raphaël Doursenaud < rdoursenaud @ gpcsolutions . fr >
* Copyright ( C ) 2016 Marcos García < marcosgdf @ gmail . com >
* Copyright ( C ) 2019 Nicolas ZABOURI < info @ inovea - conseil . com >
* Copyright ( C ) 2020 Tobias Sekan < tobias . sekan @ startmail . com >
* Copyright ( C ) 2020 Josep Lluís Amador < joseplluis @ lliuretic . cat >
* Copyright ( C ) 2021 - 2025 Frédéric France < frederic . france @ free . fr >
* Copyright ( C ) 2024 Rafael San José < rsanjose @ alxarafe . com >
* Copyright ( C ) 2024 MDW < mdeweerd @ users . noreply . github . com >
2005-09-04 21:10:18 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2005-09-04 21:10:18 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* 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
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2005-09-04 21:10:18 +02:00
*/
2006-07-01 15:03:46 +02:00
/**
2009-03-09 20:48:29 +01:00
* \file htdocs / compta / index . php
* \ingroup compta
* \brief Main page of accountancy area
2009-02-20 23:53:15 +01:00
*/
2005-09-04 21:10:18 +02:00
2022-08-29 18:55:02 +02:00
// Load Dolibarr environment
2012-08-22 23:24:21 +02:00
require '../main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php' ;
2020-09-03 12:20:20 +02:00
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/compta/sociales/class/chargesociales.class.php' ;
2021-04-05 19:34:56 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php' ;
2005-09-04 21:10:18 +02:00
2009-11-06 17:03:54 +01:00
// L'espace compta/treso doit toujours etre actif car c'est un espace partage
2010-03-23 09:26:27 +01:00
// par de nombreux modules (banque, facture, commande a facturer, etc...) independamment
2006-05-20 12:10:41 +02:00
// de l'utilisation de la compta ou non. C'est au sein de cet espace que chaque sous fonction
2010-03-23 09:26:27 +01:00
// est protegee par le droit qui va bien du module concerne.
2005-09-06 16:12:53 +02:00
2024-11-04 23:53:20 +01:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Translate $langs
* @ var User $user
*/
2018-05-26 16:35:29 +02:00
// Load translation files required by the page
2018-05-26 15:41:32 +02:00
$langs -> loadLangs ( array ( 'compta' , 'bills' ));
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'order' )) {
2012-10-13 10:39:16 +02:00
$langs -> load ( " orders " );
2021-02-23 21:09:01 +01:00
}
2012-10-13 10:39:16 +02:00
2022-08-29 18:55:02 +02:00
// Get parameters
2020-09-16 19:39:50 +02:00
$action = GETPOST ( 'action' , 'aZ09' );
Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448)
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: Update spelling exceptions
* Qual: Ignore Phan Notice
2024-02-27 14:05:53 +01:00
$bid = GETPOSTINT ( 'bid' );
2005-09-04 21:10:18 +02:00
2008-11-08 23:09:00 +01:00
// Security check
2019-11-13 19:35:02 +01:00
$socid = '' ;
2021-02-23 21:09:01 +01:00
if ( $user -> socid > 0 ) {
2009-02-20 23:53:15 +01:00
$action = '' ;
2019-10-31 20:46:31 +01:00
$socid = $user -> socid ;
2005-09-04 21:10:18 +02:00
}
2021-04-05 19:34:56 +02:00
// Maximum elements of the tables
2024-04-03 15:30:10 +02:00
$max = getDolGlobalInt ( 'MAIN_SIZE_SHORTLIST_LIMIT' , 5 );
2023-11-27 11:39:32 +01:00
$maxDraftCount = ! getDolGlobalString ( 'MAIN_MAXLIST_OVERLOAD' ) ? 500 : $conf -> global -> MAIN_MAXLIST_OVERLOAD ;
2021-04-05 19:34:56 +02:00
$maxLatestEditCount = 5 ;
2023-11-27 11:39:32 +01:00
$maxOpenCount = ! getDolGlobalString ( 'MAIN_MAXLIST_OVERLOAD' ) ? 500 : $conf -> global -> MAIN_MAXLIST_OVERLOAD ;
2021-04-05 19:34:56 +02:00
2024-06-30 21:02:50 +02:00
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
2018-01-15 14:24:19 +01:00
$hookmanager -> initHooks ( array ( 'invoiceindex' ));
2005-09-04 21:10:18 +02:00
2021-04-05 19:34:56 +02:00
2023-11-27 11:39:32 +01:00
$maxofloop = ( ! getDolGlobalString ( 'MAIN_MAXLIST_OVERLOAD' ) ? 500 : $conf -> global -> MAIN_MAXLIST_OVERLOAD );
2021-04-26 10:22:28 +02:00
2005-09-04 21:10:18 +02:00
/*
* Actions
*/
2021-04-05 19:34:56 +02:00
// None
2006-02-24 20:44:20 +01:00
2005-09-04 21:10:18 +02:00
/*
2009-05-10 06:20:37 +02:00
* View
2005-09-04 21:10:18 +02:00
*/
2006-02-24 20:44:20 +01:00
2019-11-13 19:35:02 +01:00
$now = dol_now ();
2009-01-07 16:21:16 +01:00
2011-11-08 10:18:45 +01:00
$form = new Form ( $db );
2008-01-20 14:53:02 +01:00
$formfile = new FormFile ( $db );
2010-11-20 14:20:22 +01:00
$thirdpartystatic = new Societe ( $db );
2007-07-13 18:32:34 +02:00
2023-06-10 17:00:48 +02:00
llxHeader ( " " , $langs -> trans ( " InvoicesArea " ));
2006-02-24 20:44:20 +01:00
2023-06-10 17:00:48 +02:00
print load_fiche_titre ( $langs -> trans ( " InvoicesArea " ), '' , 'bill' );
2005-09-04 21:10:18 +02:00
2013-04-12 16:16:39 +02:00
2024-06-27 10:41:55 +02:00
print '<div class="fichecenter">' ;
print '<div class="twocolumns">' ;
print '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">' ;
2005-09-04 21:10:18 +02:00
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' )) {
2022-07-29 14:50:21 +02:00
print getNumberInvoicesPieChart ( 'customers' );
print '<br>' ;
}
2022-06-07 16:55:57 +02:00
2022-07-29 14:50:21 +02:00
if ( isModEnabled ( 'fournisseur' ) || isModEnabled ( 'supplier_invoice' )) {
2023-02-04 12:31:50 +01:00
print getNumberInvoicesPieChart ( 'suppliers' );
2022-06-07 16:55:57 +02:00
print '<br>' ;
}
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' )) {
2022-07-29 14:50:21 +02:00
print getCustomerInvoiceDraftTable ( $max , $socid );
2022-06-07 16:55:57 +02:00
print '<br>' ;
2022-07-29 14:50:21 +02:00
}
if ( isModEnabled ( 'fournisseur' ) || isModEnabled ( 'supplier_invoice' )) {
2022-06-07 16:55:57 +02:00
print getDraftSupplierTable ( $max , $socid );
2022-07-29 14:50:21 +02:00
print '<br>' ;
2022-06-07 16:55:57 +02:00
}
2013-03-16 14:53:15 +01:00
2024-06-27 10:41:55 +02:00
print '</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">' ;
2013-03-16 14:53:15 +01:00
2005-09-04 21:10:18 +02:00
2018-06-17 01:50:10 +02:00
// Latest modified customer invoices
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' ) && $user -> hasRight ( 'facture' , 'lire' )) {
2009-05-10 06:20:37 +02:00
$langs -> load ( " boxes " );
2020-11-06 16:41:54 +01:00
$tmpinvoice = new Facture ( $db );
2009-05-10 06:20:37 +02:00
2021-02-22 05:58:46 +01:00
$sql = " SELECT f.rowid, f.ref, f.fk_statut as status, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms " ;
2019-11-13 19:35:02 +01:00
$sql .= " , f.date_lim_reglement as datelimite " ;
$sql .= " , s.nom as name " ;
2020-10-31 14:32:18 +01:00
$sql .= " , s.rowid as socid " ;
2024-08-14 16:51:53 +02:00
$sql .= " , s.code_client, s.code_compta as code_compta_client, s.email " ;
2020-10-31 14:32:18 +01:00
$sql .= " , cc.rowid as country_id, cc.code as country_code " ;
2024-03-17 22:21:58 +01:00
$sql .= " , (SELECT SUM(pf.amount) FROM " . $db -> prefix () . " paiement_facture as pf WHERE pf.fk_facture = f.rowid) as am " ;
2024-02-25 09:28:14 +01:00
$sql .= " FROM " . MAIN_DB_PREFIX . " facture as f " ;
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . " societe as s ON s.rowid = f.fk_soc " ;
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " c_country as cc ON cc.rowid = s.fk_pays " ;
$sql .= " WHERE f.entity IN ( " . getEntity ( 'invoice' ) . " ) " ;
if ( $socid > 0 ) {
$sql .= " AND f.fk_soc = " . (( int ) $socid );
2021-02-23 21:09:01 +01:00
}
2024-02-25 09:28:14 +01:00
// Filter on sale representative
2025-01-13 11:58:16 +01:00
if ( empty ( $user -> socid ) && ! $user -> hasRight ( 'societe' , 'client' , 'voir' )) {
2024-02-25 09:28:14 +01:00
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = " . (( int ) $user -> id ) . " ) " ;
2021-02-23 21:09:01 +01:00
}
2018-01-16 20:23:32 +01:00
// Add where from hooks
2019-11-13 19:35:02 +01:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'printFieldListWhereCustomerLastModified' , $parameters );
$sql .= $hookmanager -> resPrint ;
2018-01-16 20:23:32 +01:00
2020-03-23 19:46:43 +01:00
$sql .= " ORDER BY f.tms DESC " ;
2019-11-13 19:35:02 +01:00
$sql .= $db -> plimit ( $max , 0 );
2009-05-10 06:20:37 +02:00
$resql = $db -> query ( $sql );
2021-02-23 21:09:01 +01:00
if ( $resql ) {
2009-05-10 06:20:37 +02:00
$num = $db -> num_rows ( $resql );
$i = 0 ;
2020-09-21 13:54:26 +02:00
$othernb = 0 ;
2009-05-10 06:20:37 +02:00
2020-10-31 14:32:18 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2024-04-29 12:52:46 +02:00
print '<tr class="liste_titre"><th colspan="2">' . $langs -> trans ( " BoxTitleLastCustomerBills " , $max );
2024-05-02 12:41:33 +02:00
print '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>' ;
2024-04-29 12:52:46 +02:00
print '</th>' ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-02-23 21:09:01 +01:00
print '<th class="right">' . $langs -> trans ( " AmountHT " ) . '</th>' ;
}
2019-02-14 16:51:09 +01:00
print '<th class="right">' . $langs -> trans ( " AmountTTC " ) . '</th>' ;
print '<th class="right">' . $langs -> trans ( " DateModificationShort " ) . '</th>' ;
2017-03-07 22:45:22 +01:00
print '<th width="16"> </th>' ;
2009-05-10 06:20:37 +02:00
print '</tr>' ;
2021-02-23 21:09:01 +01:00
if ( $num ) {
2021-03-01 04:07:31 +01:00
$total_ttc = $totalam = $total_ht = 0 ;
2021-02-23 21:09:01 +01:00
while ( $i < $num && $i < $conf -> liste_limit ) {
2009-05-10 06:20:37 +02:00
$obj = $db -> fetch_object ( $resql );
2020-09-21 13:54:26 +02:00
if ( $i >= $max ) {
$othernb += 1 ;
$i ++ ;
2021-03-01 04:07:31 +01:00
$total_ht += $obj -> total_ht ;
2020-09-21 13:54:26 +02:00
$total_ttc += $obj -> total_ttc ;
continue ;
}
2020-11-06 16:41:54 +01:00
$tmpinvoice -> ref = $obj -> ref ;
$tmpinvoice -> id = $obj -> rowid ;
$tmpinvoice -> total_ht = $obj -> total_ht ;
$tmpinvoice -> total_tva = $obj -> total_tva ;
$tmpinvoice -> total_ttc = $obj -> total_ttc ;
$tmpinvoice -> statut = $obj -> status ;
2024-02-25 09:28:14 +01:00
$tmpinvoice -> status = $obj -> status ;
2020-11-06 16:41:54 +01:00
$tmpinvoice -> paye = $obj -> paye ;
$tmpinvoice -> date_lim_reglement = $db -> jdate ( $obj -> datelimite );
$tmpinvoice -> type = $obj -> type ;
2019-11-13 19:35:02 +01:00
$thirdpartystatic -> id = $obj -> socid ;
$thirdpartystatic -> name = $obj -> name ;
$thirdpartystatic -> email = $obj -> email ;
$thirdpartystatic -> country_id = $obj -> country_id ;
$thirdpartystatic -> country_code = $obj -> country_code ;
$thirdpartystatic -> email = $obj -> email ;
$thirdpartystatic -> client = 1 ;
2018-02-05 00:36:54 +01:00
$thirdpartystatic -> code_client = $obj -> code_client ;
//$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
2024-08-14 16:51:53 +02:00
$thirdpartystatic -> code_compta_client = $obj -> code_compta_client ;
2018-02-05 00:36:54 +01:00
//$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
2024-10-13 21:04:17 +02:00
$totalallpayments = $tmpinvoice -> getSommePaiement ( 0 );
$totalallpayments += $tmpinvoice -> getSumCreditNotesUsed ( 0 );
$totalallpayments += $tmpinvoice -> getSumDepositsUsed ( 0 );
2018-02-05 00:36:54 +01:00
print '<tr class="oddeven">' ;
print '<td class="nowrap">' ;
print '<table class="nobordernopadding"><tr class="nocellnopadd">' ;
2021-09-30 01:15:36 +02:00
2020-01-21 10:54:31 +01:00
print '<td class="nobordernopadding nowraponall">' ;
2020-11-06 16:41:54 +01:00
print $tmpinvoice -> getNomUrl ( 1 , '' );
2009-05-10 06:20:37 +02:00
print '</td>' ;
2020-11-06 16:41:54 +01:00
if ( $tmpinvoice -> hasDelay ()) {
2022-01-28 17:59:58 +01:00
print '<td width="20" class="nobordernopadding nowrap">' ;
2015-09-05 10:56:13 +02:00
print img_warning ( $langs -> trans ( " Late " ));
2022-01-28 17:59:58 +01:00
print '</td>' ;
2015-09-05 10:56:13 +02:00
}
2019-02-14 16:51:09 +01:00
print '<td width="16" class="nobordernopadding hideonsmartphone right">' ;
2019-11-13 19:35:02 +01:00
$filename = dol_sanitizeFileName ( $obj -> ref );
$filedir = $conf -> facture -> dir_output . '/' . dol_sanitizeFileName ( $obj -> ref );
$urlsource = $_SERVER [ 'PHP_SELF' ] . '?facid=' . $obj -> rowid ;
2020-11-06 16:41:54 +01:00
print $formfile -> getDocumentsLink ( $tmpinvoice -> element , $filename , $filedir );
2009-05-10 06:20:37 +02:00
print '</td></tr></table>' ;
print '</td>' ;
2021-09-30 01:15:36 +02:00
print '<td class="tdoverflowmax150">' ;
2020-10-31 14:32:18 +01:00
print $thirdpartystatic -> getNomUrl ( 1 , 'customer' , 44 );
2010-11-20 14:20:22 +01:00
print '</td>' ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-07-13 13:46:20 +02:00
print '<td class="nowrap right"><span class="amount">' . price ( $obj -> total_ht ) . '</span></td>' ;
2021-02-23 21:09:01 +01:00
}
2021-04-05 19:34:56 +02:00
print '<td class="nowrap right"><span class="amount">' . price ( $obj -> total_ttc ) . '</span></td>' ;
2021-09-30 01:15:36 +02:00
2022-06-27 10:45:04 +02:00
print '<td class="right" title="' . dol_escape_htmltag ( $langs -> trans ( " DateModificationShort " ) . ' : ' . dol_print_date ( $db -> jdate ( $obj -> tms ), 'dayhour' , 'tzuserrel' )) . '">' . dol_print_date ( $db -> jdate ( $obj -> tms ), 'day' , 'tzuserrel' ) . '</td>' ;
2021-09-30 01:15:36 +02:00
2024-10-13 21:04:17 +02:00
print '<td>' . $tmpinvoice -> getLibStatut ( 3 , $totalallpayments ) . '</td>' ;
2021-09-30 01:15:36 +02:00
2009-05-10 06:20:37 +02:00
print '</tr>' ;
2019-11-13 19:35:02 +01:00
$total_ttc += $obj -> total_ttc ;
2021-03-01 04:07:31 +01:00
$total_ht += $obj -> total_ht ;
2019-11-13 19:35:02 +01:00
$totalam += $obj -> am ;
2017-11-12 12:39:23 +01:00
2009-05-10 06:20:37 +02:00
$i ++ ;
}
2020-09-21 13:54:26 +02:00
if ( $othernb ) {
print '<tr class="oddeven">' ;
print '<td class="nowrap" colspan="5">' ;
print '<span class="opacitymedium">' . $langs -> trans ( " More " ) . '... (' . $othernb . ')</span>' ;
print '</td>' ;
print " </tr> \n " ;
}
2020-05-21 15:05:19 +02:00
} else {
2019-11-13 19:35:02 +01:00
$colspan = 5 ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-02-23 21:09:01 +01:00
$colspan ++ ;
}
2023-09-22 13:50:52 +02:00
print '<tr class="oddeven"><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs -> trans ( " NoInvoice " ) . '</span></td></tr>' ;
2009-05-10 06:20:37 +02:00
}
2019-06-12 04:56:16 +02:00
print '</table></div><br>' ;
2009-05-10 06:20:37 +02:00
$db -> free ( $resql );
2020-05-21 15:05:19 +02:00
} else {
2009-05-10 06:20:37 +02:00
dol_print_error ( $db );
}
}
// Last modified supplier invoices
2023-11-27 11:39:32 +01:00
if (( isModEnabled ( 'fournisseur' ) && ! getDolGlobalString ( 'MAIN_USE_NEW_SUPPLIERMOD' ) && $user -> hasRight ( " fournisseur " , " facture " , " lire " )) || ( isModEnabled ( 'supplier_invoice' ) && $user -> hasRight ( " supplier_invoice " , " lire " ))) {
2009-05-10 06:20:37 +02:00
$langs -> load ( " boxes " );
2019-11-13 19:35:02 +01:00
$facstatic = new FactureFournisseur ( $db );
2009-05-10 06:20:37 +02:00
2021-06-10 01:13:50 +02:00
$sql = " SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier " ;
2019-11-13 19:35:02 +01:00
$sql .= " , s.nom as name " ;
2020-10-31 14:32:18 +01:00
$sql .= " , s.rowid as socid " ;
$sql .= " , s.code_fournisseur, s.code_compta_fournisseur, s.email " ;
2024-03-17 22:21:58 +01:00
$sql .= " , (SELECT SUM(pf.amount) FROM " . $db -> prefix () . " paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am " ;
2019-11-13 19:35:02 +01:00
$sql .= " FROM " . MAIN_DB_PREFIX . " societe as s, " . MAIN_DB_PREFIX . " facture_fourn as ff " ;
$sql .= " WHERE s.rowid = ff.fk_soc " ;
2024-01-09 14:24:21 +01:00
$sql .= " AND ff.entity IN ( " . getEntity ( 'facture_fourn' ) . " ) " ;
2024-02-25 09:28:14 +01:00
if ( $socid > 0 ) {
2021-06-09 15:36:47 +02:00
$sql .= " AND ff.fk_soc = " . (( int ) $socid );
2021-02-23 21:09:01 +01:00
}
2024-02-25 09:28:14 +01:00
// Filter on sale representative
2025-01-13 11:58:16 +01:00
if ( empty ( $user -> socid ) && ! $user -> hasRight ( 'societe' , 'client' , 'voir' )) {
2024-02-25 09:28:14 +01:00
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = ff.fk_soc AND sc.fk_user = " . (( int ) $user -> id ) . " ) " ;
}
2018-01-16 20:23:32 +01:00
// Add where from hooks
2019-11-13 19:35:02 +01:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'printFieldListWhereSupplierLastModified' , $parameters );
$sql .= $hookmanager -> resPrint ;
2018-01-16 20:23:32 +01:00
2024-02-25 09:28:14 +01:00
$sql .= " ORDER BY ff.tms DESC " ;
2019-11-13 19:35:02 +01:00
$sql .= $db -> plimit ( $max , 0 );
2009-05-10 06:20:37 +02:00
2019-11-13 19:35:02 +01:00
$resql = $db -> query ( $sql );
2021-02-23 21:09:01 +01:00
if ( $resql ) {
2009-05-10 06:20:37 +02:00
$num = $db -> num_rows ( $resql );
2020-10-31 14:32:18 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2024-04-29 12:52:46 +02:00
print '<tr class="liste_titre"><th colspan="2">' . $langs -> trans ( " BoxTitleLastSupplierBills " , $max );
2024-05-02 12:41:33 +02:00
print '<a href="' . DOL_URL_ROOT . '/fourn/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>' ;
2024-04-29 12:52:46 +02:00
print '</th>' ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-02-23 21:09:01 +01:00
print '<th class="right">' . $langs -> trans ( " AmountHT " ) . '</th>' ;
}
2019-02-14 16:51:09 +01:00
print '<th class="right">' . $langs -> trans ( " AmountTTC " ) . '</th>' ;
print '<th class="right">' . $langs -> trans ( " DateModificationShort " ) . '</th>' ;
2017-03-07 22:45:22 +01:00
print '<th width="16"> </th>' ;
2009-05-10 06:20:37 +02:00
print " </tr> \n " ;
2021-02-23 21:09:01 +01:00
if ( $num ) {
2009-05-10 06:20:37 +02:00
$i = 0 ;
2021-03-01 04:07:31 +01:00
$total_ht = $total_ttc = $totalam = 0 ;
2020-09-21 13:54:26 +02:00
$othernb = 0 ;
2021-02-23 21:09:01 +01:00
while ( $i < $num ) {
2009-05-10 06:20:37 +02:00
$obj = $db -> fetch_object ( $resql );
2018-02-05 00:36:54 +01:00
2020-09-21 13:54:26 +02:00
if ( $i >= $max ) {
$othernb += 1 ;
$i ++ ;
2021-03-01 04:07:31 +01:00
$total_ht += $obj -> total_ht ;
2020-09-21 13:54:26 +02:00
$total_ttc += $obj -> total_ttc ;
continue ;
}
2019-11-13 19:35:02 +01:00
$facstatic -> ref = $obj -> ref ;
2018-02-05 00:36:54 +01:00
$facstatic -> id = $obj -> rowid ;
$facstatic -> total_ht = $obj -> total_ht ;
$facstatic -> total_tva = $obj -> total_tva ;
$facstatic -> total_ttc = $obj -> total_ttc ;
2020-11-06 11:52:48 +01:00
$facstatic -> statut = $obj -> status ;
2024-03-29 23:04:34 +01:00
$facstatic -> status = $obj -> status ;
2020-11-06 11:52:48 +01:00
$facstatic -> paye = $obj -> paye ;
2024-03-29 23:04:34 +01:00
$facstatic -> paid = $obj -> paye ;
2021-06-10 01:13:50 +02:00
$facstatic -> type = $obj -> type ;
$facstatic -> ref_supplier = $obj -> ref_supplier ;
2018-02-05 00:36:54 +01:00
2019-11-13 19:35:02 +01:00
$thirdpartystatic -> id = $obj -> socid ;
$thirdpartystatic -> name = $obj -> name ;
2020-02-26 17:02:23 +01:00
$thirdpartystatic -> email = $obj -> email ;
$thirdpartystatic -> country_id = 0 ;
$thirdpartystatic -> country_code = '' ;
$thirdpartystatic -> client = 0 ;
2019-11-13 19:35:02 +01:00
$thirdpartystatic -> fournisseur = 1 ;
2020-02-25 19:59:53 +01:00
$thirdpartystatic -> code_client = '' ;
2018-02-05 00:36:54 +01:00
$thirdpartystatic -> code_fournisseur = $obj -> code_fournisseur ;
2024-05-02 12:41:33 +02:00
$thirdpartystatic -> code_compta_client = '' ;
2018-02-05 00:36:54 +01:00
$thirdpartystatic -> code_compta_fournisseur = $obj -> code_compta_fournisseur ;
2020-10-06 15:11:45 +02:00
print '<tr class="oddeven nowraponall tdoverflowmax100"><td>' ;
2019-01-27 11:55:16 +01:00
print $facstatic -> getNomUrl ( 1 , '' );
2018-02-05 00:36:54 +01:00
print '</td>' ;
2020-10-06 15:11:45 +02:00
print '<td class="nowrap tdoverflowmax100">' ;
print $thirdpartystatic -> getNomUrl ( 1 , 'supplier' );
2010-11-20 14:20:22 +01:00
print '</td>' ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-03-29 13:00:17 +02:00
print '<td class="right"><span class="amount">' . price ( $obj -> total_ht ) . '</span></td>' ;
2021-02-23 21:09:01 +01:00
}
2021-04-05 19:34:56 +02:00
print '<td class="nowrap right"><span class="amount">' . price ( $obj -> total_ttc ) . '</span></td>' ;
2022-06-27 10:45:04 +02:00
print '<td class="right" title="' . dol_escape_htmltag ( $langs -> trans ( " DateModificationShort " ) . ' : ' . dol_print_date ( $db -> jdate ( $obj -> tms ), 'dayhour' , 'tzuserrel' )) . '">' . dol_print_date ( $db -> jdate ( $obj -> tms ), 'day' , 'tzuserrel' ) . '</td>' ;
2024-09-28 13:05:24 +02:00
2021-10-06 19:30:37 +02:00
$alreadypaid = $facstatic -> getSommePaiement ();
2024-09-28 13:05:24 +02:00
$alreadypaid += $facstatic -> getSumCreditNotesUsed ();
$alreadypaid += $facstatic -> getSumDepositsUsed ();
2021-10-06 19:30:37 +02:00
print '<td>' . $facstatic -> getLibStatut ( 3 , $alreadypaid ) . '</td>' ;
2009-05-10 06:20:37 +02:00
print '</tr>' ;
2024-09-28 13:05:24 +02:00
2021-03-01 04:07:31 +01:00
$total_ht += $obj -> total_ht ;
2019-11-13 19:35:02 +01:00
$total_ttc += $obj -> total_ttc ;
$totalam += $obj -> am ;
2009-05-10 06:20:37 +02:00
$i ++ ;
}
2020-09-21 13:54:26 +02:00
if ( $othernb ) {
print '<tr class="oddeven">' ;
print '<td class="nowrap" colspan="5">' ;
print '<span class="opacitymedium">' . $langs -> trans ( " More " ) . '... (' . $othernb . ')</span>' ;
print '</td>' ;
print " </tr> \n " ;
}
2020-05-21 15:05:19 +02:00
} else {
2019-11-13 19:35:02 +01:00
$colspan = 5 ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-02-23 21:09:01 +01:00
$colspan ++ ;
}
2023-09-22 13:50:52 +02:00
print '<tr class="oddeven"><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs -> trans ( " NoInvoice " ) . '</span></td></tr>' ;
2009-05-10 06:20:37 +02:00
}
2019-06-12 04:56:16 +02:00
print '</table></div><br>' ;
2020-05-21 15:05:19 +02:00
} else {
2009-05-10 06:20:37 +02:00
dol_print_error ( $db );
}
}
2005-09-04 21:10:18 +02:00
2020-04-13 14:32:15 +02:00
// Latest donations
2023-05-02 17:26:12 +02:00
if ( isModEnabled ( 'don' ) && $user -> hasRight ( 'don' , 'lire' )) {
2015-03-25 22:37:14 +01:00
include_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php' ;
2010-04-27 10:25:13 +02:00
2007-03-16 20:14:06 +01:00
$langs -> load ( " boxes " );
2020-10-31 14:32:18 +01:00
$donationstatic = new Don ( $db );
2007-03-16 20:14:06 +01:00
2025-02-05 13:54:36 +01:00
$sql = " SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status, d.fk_soc as socid " ;
2019-11-13 19:35:02 +01:00
$sql .= " FROM " . MAIN_DB_PREFIX . " don as d " ;
$sql .= " WHERE d.entity IN ( " . getEntity ( 'donation' ) . " ) " ;
2018-01-16 20:23:32 +01:00
// Add where from hooks
2019-11-13 19:35:02 +01:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'printFieldListWhereLastDonations' , $parameters );
$sql .= $hookmanager -> resPrint ;
2018-01-16 20:23:32 +01:00
2019-11-13 19:35:02 +01:00
$sql .= $db -> order ( " d.tms " , " DESC " );
$sql .= $db -> plimit ( $max , 0 );
2007-03-16 20:14:06 +01:00
$result = $db -> query ( $sql );
2021-02-23 21:09:01 +01:00
if ( $result ) {
2007-03-16 20:14:06 +01:00
$num = $db -> num_rows ( $result );
$i = 0 ;
2020-09-21 13:54:26 +02:00
$othernb = 0 ;
2007-03-16 20:14:06 +01:00
2020-10-31 14:32:18 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2017-02-17 01:41:33 +01:00
print '<tr class="liste_titre">' ;
2024-05-02 12:41:33 +02:00
print '<th colspan="2">' . $langs -> trans ( " BoxTitleLastModifiedDonations " , $max );
2025-01-09 12:07:03 +01:00
print '<a href="' . DOL_URL_ROOT . '/don/list.php?sortfield=d.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>' ;
2024-04-29 12:52:46 +02:00
print '</th>' ;
2020-10-31 14:32:18 +01:00
print '<th class="right">' . $langs -> trans ( " AmountTTC " ) . '</th>' ;
print '<th class="right">' . $langs -> trans ( " DateModificationShort " ) . '</th>' ;
print '<th width="16"> </th>' ;
2007-07-07 15:20:36 +02:00
print '</tr>' ;
2023-05-02 17:26:12 +02:00
2021-02-23 21:09:01 +01:00
if ( $num ) {
2021-03-01 04:07:31 +01:00
$total_ttc = $totalam = $total_ht = 0 ;
2007-03-16 20:14:06 +01:00
2021-02-23 21:09:01 +01:00
while ( $i < $num && $i < $max ) {
2022-06-27 10:45:04 +02:00
$obj = $db -> fetch_object ( $result );
2017-11-12 12:39:23 +01:00
2020-09-21 13:54:26 +02:00
if ( $i >= $max ) {
$othernb += 1 ;
$i ++ ;
2021-03-01 04:07:31 +01:00
$total_ht += $obj -> total_ht ;
2020-09-21 13:54:26 +02:00
$total_ttc += $obj -> total_ttc ;
continue ;
}
2022-06-27 10:45:04 +02:00
$donationstatic -> id = $obj -> rowid ;
$donationstatic -> ref = $obj -> rowid ;
$donationstatic -> lastname = $obj -> lastname ;
$donationstatic -> firstname = $obj -> firstname ;
2022-12-24 15:53:33 +01:00
$donationstatic -> date = $db -> jdate ( $obj -> date );
2022-06-27 10:45:04 +02:00
$donationstatic -> statut = $obj -> status ;
$donationstatic -> status = $obj -> status ;
2017-11-12 12:39:23 +01:00
2025-02-05 18:52:38 +01:00
$label = '' ;
2025-02-05 13:54:36 +01:00
if ( ! empty ( $obj -> socid )) {
$companystatic = new Societe ( $db );
$ret = $companystatic -> fetch ( $obj -> socid );
if ( $ret > 0 ) {
$label = $companystatic -> getNomUrl ( 1 );
}
} else {
$label = $donationstatic -> getFullName ( $langs );
if ( $obj -> societe ) {
$label .= ( $label ? ' - ' : '' ) . $obj -> societe ;
}
2021-02-23 21:09:01 +01:00
}
2017-11-12 12:39:23 +01:00
2020-10-06 15:11:45 +02:00
print '<tr class="oddeven tdoverflowmax100">' ;
2011-06-29 19:55:32 +02:00
print '<td>' . $donationstatic -> getNomUrl ( 1 ) . '</td>' ;
2017-11-12 12:39:23 +01:00
print '<td>' . $label . '</td>' ;
2022-06-27 10:45:04 +02:00
print '<td class="nowrap right"><span class="amount">' . price ( $obj -> amount ) . '</span></td>' ;
print '<td class="right" title="' . dol_escape_htmltag ( $langs -> trans ( " DateModificationShort " ) . ' : ' . dol_print_date ( $db -> jdate ( $obj -> dm ), 'dayhour' , 'tzuserrel' )) . '">' . dol_print_date ( $db -> jdate ( $obj -> dm ), 'day' , 'tzuserrel' ) . '</td>' ;
2020-11-05 22:25:14 +01:00
print '<td>' . $donationstatic -> getLibStatut ( 3 ) . '</td>' ;
2007-03-16 20:14:06 +01:00
print '</tr>' ;
$i ++ ;
}
2020-09-21 13:54:26 +02:00
if ( $othernb ) {
print '<tr class="oddeven">' ;
print '<td class="nowrap" colspan="5">' ;
print '<span class="opacitymedium">' . $langs -> trans ( " More " ) . '... (' . $othernb . ')</span>' ;
print '</td>' ;
print " </tr> \n " ;
}
2020-05-21 15:05:19 +02:00
} else {
2023-09-22 13:50:52 +02:00
print '<tr class="oddeven"><td colspan="5"><span class="opacitymedium">' . $langs -> trans ( " None " ) . '</span></td></tr>' ;
2007-07-07 15:20:36 +02:00
}
2019-06-12 04:56:16 +02:00
print '</table></div><br>' ;
2021-02-23 21:09:01 +01:00
} else {
dol_print_error ( $db );
}
2007-03-16 20:14:06 +01:00
}
2009-03-09 20:48:29 +01:00
/**
* Social contributions to pay
*/
2023-10-15 15:32:35 +02:00
if ( isModEnabled ( 'tax' ) && $user -> hasRight ( 'tax' , 'charges' , 'lire' )) {
2021-02-23 21:09:01 +01:00
if ( ! $socid ) {
2019-11-13 19:35:02 +01:00
$chargestatic = new ChargeSociales ( $db );
2009-03-09 20:48:29 +01:00
$sql = " SELECT c.rowid, c.amount, c.date_ech, c.paye, " ;
2019-11-13 19:35:02 +01:00
$sql .= " cc.libelle as label, " ;
$sql .= " SUM(pc.amount) as sumpaid " ;
$sql .= " FROM ( " . MAIN_DB_PREFIX . " c_chargesociales as cc, " . MAIN_DB_PREFIX . " chargesociales as c) " ;
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " paiementcharge as pc ON pc.fk_charge = c.rowid " ;
$sql .= " WHERE c.fk_type = cc.id " ;
$sql .= " AND c.entity IN ( " . getEntity ( 'tax' ) . ')' ;
$sql .= " AND c.paye = 0 " ;
2018-01-16 20:23:32 +01:00
// Add where from hooks
2019-11-13 19:35:02 +01:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'printFieldListWhereSocialContributions' , $parameters );
$sql .= $hookmanager -> resPrint ;
2018-01-16 20:23:32 +01:00
2019-11-13 19:35:02 +01:00
$sql .= " GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle " ;
2009-03-09 20:48:29 +01:00
$resql = $db -> query ( $sql );
2021-02-23 21:09:01 +01:00
if ( $resql ) {
2009-03-09 20:48:29 +01:00
$num = $db -> num_rows ( $resql );
2020-10-31 14:32:18 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2009-03-09 20:48:29 +01:00
print '<tr class="liste_titre">' ;
2024-05-02 12:41:33 +02:00
print '<th>' . $langs -> trans ( " ContributionsToPay " ) . ( $num ? '<a href="' . DOL_URL_ROOT . '/compta/sociales/list.php?status=0"><span class="badge marginleftonly">' . $num . '</span></a>' : '' ) . '</th>' ;
2017-03-07 22:45:22 +01:00
print '<th align="center">' . $langs -> trans ( " DateDue " ) . '</th>' ;
2019-02-14 16:51:09 +01:00
print '<th class="right">' . $langs -> trans ( " AmountTTC " ) . '</th>' ;
print '<th class="right">' . $langs -> trans ( " Paid " ) . '</th>' ;
2017-03-07 22:45:22 +01:00
print '<th align="center" width="16"> </th>' ;
2009-03-09 20:48:29 +01:00
print '</tr>' ;
2021-02-23 21:09:01 +01:00
if ( $num ) {
2009-03-09 20:48:29 +01:00
$i = 0 ;
2019-11-13 19:35:02 +01:00
$tot_ttc = 0 ;
2024-05-02 12:05:30 +02:00
$tot_paid = 0 ;
2020-09-21 13:54:26 +02:00
$othernb = 0 ;
2021-02-23 21:09:01 +01:00
while ( $i < $num ) {
2009-03-09 20:48:29 +01:00
$obj = $db -> fetch_object ( $resql );
2017-11-12 12:39:23 +01:00
2020-09-21 13:54:26 +02:00
if ( $i >= $max ) {
$othernb += 1 ;
2022-05-02 20:21:58 +02:00
$tot_ttc += $obj -> amount ;
2024-05-02 12:05:30 +02:00
$tot_paid += $obj -> sumpaid ;
2020-09-21 13:54:26 +02:00
$i ++ ;
continue ;
}
2019-11-13 19:35:02 +01:00
$chargestatic -> id = $obj -> rowid ;
$chargestatic -> ref = $obj -> rowid ;
$chargestatic -> label = $obj -> label ;
$chargestatic -> paye = $obj -> paye ;
2020-11-05 22:25:14 +01:00
$chargestatic -> status = $obj -> paye ;
2017-11-12 12:39:23 +01:00
print '<tr class="oddeven">' ;
2020-10-06 15:11:45 +02:00
print '<td class="nowraponall">' . $chargestatic -> getNomUrl ( 1 ) . '</td>' ;
2019-12-12 10:31:08 +01:00
print '<td class="center">' . dol_print_date ( $db -> jdate ( $obj -> date_ech ), 'day' ) . '</td>' ;
2021-04-05 19:34:56 +02:00
print '<td class="nowrap right"><span class="amount">' . price ( $obj -> amount ) . '</span></td>' ;
print '<td class="nowrap right"><span class="amount">' . price ( $obj -> sumpaid ) . '</span></td>' ;
2019-12-12 10:31:08 +01:00
print '<td class="center">' . $chargestatic -> getLibStatut ( 3 ) . '</td>' ;
2009-03-09 20:48:29 +01:00
print '</tr>' ;
2019-11-02 11:12:57 +01:00
2019-11-13 19:35:02 +01:00
$tot_ttc += $obj -> amount ;
2009-03-09 20:48:29 +01:00
$i ++ ;
}
2020-09-21 13:54:26 +02:00
if ( $othernb ) {
print '<tr class="oddeven">' ;
print '<td class="nowrap" colspan="5">' ;
print '<span class="opacitymedium">' . $langs -> trans ( " More " ) . '... (' . $othernb . ')</span>' ;
print '</td>' ;
print " </tr> \n " ;
}
2019-02-14 16:51:09 +01:00
print '<tr class="liste_total"><td class="left" colspan="2">' . $langs -> trans ( " Total " ) . '</td>' ;
2019-07-24 09:01:11 +02:00
print '<td class="nowrap right">' . price ( $tot_ttc ) . '</td>' ;
2024-05-02 12:05:30 +02:00
print '<td class="nowrap right">' . price ( $tot_paid ) . '</td>' ;
2019-02-14 16:51:09 +01:00
print '<td class="right"> </td>' ;
2009-03-09 20:48:29 +01:00
print '</tr>' ;
2020-05-21 15:05:19 +02:00
} else {
2023-09-22 13:50:52 +02:00
print '<tr class="oddeven"><td colspan="5"><span class="opacitymedium">' . $langs -> trans ( " None " ) . '</span></td></tr>' ;
2009-03-09 20:48:29 +01:00
}
2019-06-12 04:56:16 +02:00
print " </table></div><br> " ;
2009-03-09 20:48:29 +01:00
$db -> free ( $resql );
2020-05-21 15:05:19 +02:00
} else {
2009-03-09 20:48:29 +01:00
dol_print_error ( $db );
}
}
}
2005-09-04 21:10:18 +02:00
/*
2009-10-29 18:30:29 +01:00
* Customers orders to be billed
2005-09-04 21:10:18 +02:00
*/
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' ) && isModEnabled ( 'order' ) && $user -> hasRight ( " commande " , " lire " ) && ! getDolGlobalString ( 'WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER' )) {
2019-11-13 19:35:02 +01:00
$commandestatic = new Commande ( $db );
2006-07-01 15:03:46 +02:00
$langs -> load ( " orders " );
2021-03-01 04:07:31 +01:00
$sql = " SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc " ;
2019-11-13 19:35:02 +01:00
$sql .= " , s.nom as name, s.email " ;
2020-10-31 14:32:18 +01:00
$sql .= " , s.rowid as socid " ;
2024-08-14 16:51:53 +02:00
$sql .= " , s.code_client, s.code_compta as code_compta_client " ;
2021-02-20 08:00:27 +01:00
$sql .= " , c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc, " ;
2019-11-13 19:35:02 +01:00
$sql .= " cc.rowid as country_id, cc.code as country_code " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " societe as s LEFT JOIN " . MAIN_DB_PREFIX . " c_country as cc ON cc.rowid = s.fk_pays " ;
$sql .= " , " . MAIN_DB_PREFIX . " commande as c " ;
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande' " ;
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture' " ;
$sql .= " WHERE c.fk_soc = s.rowid " ;
2024-01-09 14:24:21 +01:00
$sql .= " AND c.entity IN ( " . getEntity ( 'commande' ) . " ) " ;
2021-02-23 21:09:01 +01:00
if ( $socid ) {
2021-06-09 15:36:47 +02:00
$sql .= " AND c.fk_soc = " . (( int ) $socid );
2021-02-23 21:09:01 +01:00
}
2024-02-25 09:28:14 +01:00
$sql .= " AND c.fk_statut = " . (( int ) Commande :: STATUS_CLOSED );
2019-11-13 19:35:02 +01:00
$sql .= " AND c.facture = 0 " ;
2024-02-25 09:28:14 +01:00
// Filter on sale representative
2025-01-13 11:58:16 +01:00
if ( empty ( $user -> socid ) && ! $user -> hasRight ( 'societe' , 'client' , 'voir' )) {
2024-02-25 09:28:14 +01:00
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = " . (( int ) $user -> id ) . " ) " ;
}
2018-01-16 20:23:32 +01:00
// Add where from hooks
2019-11-13 19:35:02 +01:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'printFieldListWhereCustomerOrderToBill' , $parameters );
$sql .= $hookmanager -> resPrint ;
2018-01-16 20:23:32 +01:00
2021-02-20 08:00:27 +01:00
$sql .= " GROUP BY s.nom, s.email, s.rowid, s.code_client, s.code_compta, c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_tva, c.total_ttc, cc.rowid, cc.code " ;
2005-09-04 21:10:18 +02:00
2006-07-01 15:03:46 +02:00
$resql = $db -> query ( $sql );
2021-02-23 21:09:01 +01:00
if ( $resql ) {
2006-07-01 15:03:46 +02:00
$num = $db -> num_rows ( $resql );
2009-02-20 23:53:15 +01:00
2021-02-23 21:09:01 +01:00
if ( $num ) {
2006-07-01 15:03:46 +02:00
$i = 0 ;
2020-09-21 13:54:26 +02:00
$othernb = 0 ;
2019-06-12 04:56:16 +02:00
2020-10-31 14:32:18 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2020-09-03 11:36:11 +02:00
2024-05-02 12:41:33 +02:00
print '<tr class="liste_titre">' ;
2020-09-03 11:36:11 +02:00
print '<th colspan="2">' ;
2024-05-02 12:41:33 +02:00
print $langs -> trans ( " OrdersDeliveredToBill " );
2024-04-12 03:14:46 +02:00
print '<a href="' . DOL_URL_ROOT . '/commande/list.php?search_status=' . Commande :: STATUS_CLOSED . '&search_billed=0">' ;
2024-05-02 12:41:33 +02:00
print '<span class="badge marginleftonly">' . $num . '</span>' ;
2020-09-03 11:36:11 +02:00
print '</a>' ;
print '</th>' ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-02-23 21:09:01 +01:00
print '<th class="right">' . $langs -> trans ( " AmountHT " ) . '</th>' ;
}
2019-02-14 16:51:09 +01:00
print '<th class="right">' . $langs -> trans ( " AmountTTC " ) . '</th>' ;
print '<th class="right">' . $langs -> trans ( " ToBill " ) . '</th>' ;
2017-03-07 22:45:22 +01:00
print '<th align="center" width="16"> </th>' ;
2006-07-01 15:03:46 +02:00
print '</tr>' ;
2018-02-05 00:36:54 +01:00
2019-11-13 19:35:02 +01:00
$tot_ht = $tot_ttc = $tot_tobill = 0 ;
2011-09-20 15:32:16 +02:00
$societestatic = new Societe ( $db );
2021-02-23 21:09:01 +01:00
while ( $i < $num ) {
2006-07-01 15:03:46 +02:00
$obj = $db -> fetch_object ( $resql );
2010-11-22 20:32:54 +01:00
2020-09-21 13:54:26 +02:00
if ( $i >= $max ) {
$othernb += 1 ;
$i ++ ;
2021-03-01 04:07:31 +01:00
$total_ht += $obj -> total_ht ;
2020-09-21 13:54:26 +02:00
$total_ttc += $obj -> total_ttc ;
continue ;
}
2019-11-13 19:35:02 +01:00
$societestatic -> id = $obj -> socid ;
$societestatic -> name = $obj -> name ;
$societestatic -> email = $obj -> email ;
$societestatic -> country_id = $obj -> country_id ;
$societestatic -> country_code = $obj -> country_code ;
$societestatic -> client = 1 ;
2018-02-05 00:36:54 +01:00
$societestatic -> code_client = $obj -> code_client ;
//$societestatic->code_fournisseur = $obj->code_fournisseur;
2024-08-14 16:51:53 +02:00
$societestatic -> code_compta_client = $obj -> code_compta_client ;
2024-05-02 12:41:33 +02:00
//$societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
2009-02-20 23:53:15 +01:00
2019-11-13 19:35:02 +01:00
$commandestatic -> id = $obj -> rowid ;
$commandestatic -> ref = $obj -> ref ;
2020-11-06 11:52:48 +01:00
$commandestatic -> statut = $obj -> status ;
$commandestatic -> billed = $obj -> facture ;
2009-02-20 23:53:15 +01:00
2018-02-05 00:36:54 +01:00
print '<tr class="oddeven">' ;
print '<td class="nowrap">' ;
2007-07-13 18:32:34 +02:00
print '<table class="nobordernopadding"><tr class="nocellnopadd">' ;
2021-02-28 11:48:35 +01:00
print '<td class="nobordernopadding nowrap">' ;
2007-07-13 18:32:34 +02:00
print $commandestatic -> getNomUrl ( 1 );
print '</td>' ;
2013-04-25 01:13:13 +02:00
print '<td width="20" class="nobordernopadding nowrap">' ;
2007-07-14 16:14:22 +02:00
print ' ' ;
print '</td>' ;
2019-02-14 16:51:09 +01:00
print '<td width="16" class="nobordernopadding hideonsmartphone right">' ;
2019-11-13 19:35:02 +01:00
$filename = dol_sanitizeFileName ( $obj -> ref );
$filedir = $conf -> commande -> dir_output . '/' . dol_sanitizeFileName ( $obj -> ref );
$urlsource = $_SERVER [ 'PHP_SELF' ] . '?id=' . $obj -> rowid ;
2012-09-15 09:02:20 +02:00
print $formfile -> getDocumentsLink ( $commandestatic -> element , $filename , $filedir );
2007-07-13 18:32:34 +02:00
print '</td></tr></table>' ;
2009-02-20 23:53:15 +01:00
2007-07-13 18:32:34 +02:00
print '</td>' ;
2006-07-01 15:03:46 +02:00
2020-10-06 15:11:45 +02:00
print '<td class="nowrap tdoverflowmax100">' ;
2020-10-31 14:32:18 +01:00
print $societestatic -> getNomUrl ( 1 , 'customer' );
2014-11-25 18:54:56 +01:00
print '</td>' ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-03-29 13:00:17 +02:00
print '<td class="right"><span class="amount">' . price ( $obj -> total_ht ) . '</span></td>' ;
2021-02-23 21:09:01 +01:00
}
2021-04-05 19:34:56 +02:00
print '<td class="nowrap right"><span class="amount">' . price ( $obj -> total_ttc ) . '</span></td>' ;
print '<td class="nowrap right"><span class="amount">' . price ( $obj -> total_ttc - $obj -> tot_fttc ) . '</span></td>' ;
2020-11-06 11:52:48 +01:00
print '<td>' . $commandestatic -> getLibStatut ( 3 ) . '</td>' ;
2006-07-01 15:03:46 +02:00
print '</tr>' ;
2005-09-04 21:10:18 +02:00
$tot_ht += $obj -> total_ht ;
$tot_ttc += $obj -> total_ttc ;
2006-08-26 14:45:38 +02:00
//print "x".$tot_ttc."z".$obj->tot_fttc;
2019-11-13 19:35:02 +01:00
$tot_tobill += ( $obj -> total_ttc - $obj -> tot_fttc );
2006-07-01 15:03:46 +02:00
$i ++ ;
}
2020-09-21 13:54:26 +02:00
if ( $othernb ) {
print '<tr class="oddeven">' ;
print '<td class="nowrap" colspan="5">' ;
print '<span class="opacitymedium">' . $langs -> trans ( " More " ) . '... (' . $othernb . ')</span>' ;
print '</td>' ;
print " </tr> \n " ;
}
2021-10-05 09:41:03 +02:00
print '<tr class="liste_total"><td colspan="2">' . $langs -> trans ( " Total " ) . ' <span style="font-weight: normal">(' . $langs -> trans ( " RemainderToBill " ) . ': ' . price ( $tot_tobill ) . ')</span> </td>' ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_SHOW_HT_ON_SUMMARY' )) {
2021-04-05 19:34:56 +02:00
print '<td class="right">' . price ( $tot_ht ) . '</td>' ;
2021-02-23 21:09:01 +01:00
}
2021-04-05 19:34:56 +02:00
print '<td class="nowrap right">' . price ( $tot_ttc ) . '</td>' ;
print '<td class="nowrap right">' . price ( $tot_tobill ) . '</td>' ;
2006-07-01 15:03:46 +02:00
print '<td> </td>' ;
print '</tr>' ;
2019-06-12 04:56:16 +02:00
print '</table></div><br>' ;
2006-07-01 15:03:46 +02:00
}
$db -> free ( $resql );
2020-05-21 15:05:19 +02:00
} else {
2009-02-20 23:53:15 +01:00
dol_print_error ( $db );
2005-09-04 21:10:18 +02:00
}
}
2006-07-01 15:03:46 +02:00
2009-12-22 16:13:49 +01:00
// TODO Mettre ici recup des actions en rapport avec la compta
2023-01-06 19:34:45 +01:00
$sql = '' ;
if ( $sql ) {
2020-10-31 14:32:18 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2024-05-02 12:41:33 +02:00
print '<tr class="liste_titre"><th colspan="2">' . $langs -> trans ( " TasksToDo " ) . '</th>' ;
2009-02-20 23:53:15 +01:00
print " </tr> \n " ;
$i = 0 ;
2023-01-06 19:34:45 +01:00
$resql = $db -> query ( $sql );
if ( $resql ) {
$num_rows = $db -> num_rows ( $resql );
while ( $i < $num_rows ) {
$obj = $db -> fetch_object ( $resql );
2017-11-12 12:39:23 +01:00
2023-01-06 19:34:45 +01:00
print '<tr class="oddeven"><td>' . dol_print_date ( $db -> jdate ( $obj -> da ), " day " ) . '</td>' ;
print '<td><a href="action/card.php">' . $obj -> label . '</a></td></tr>' ;
$i ++ ;
}
$db -> free ( $resql );
2009-02-20 23:53:15 +01:00
}
2019-06-12 04:56:16 +02:00
print " </table></div><br> " ;
2005-09-04 21:10:18 +02:00
}
2013-04-12 16:16:39 +02:00
2024-06-27 10:41:55 +02:00
print '</div></div></div>' ;
2005-09-04 21:10:18 +02:00
2019-06-18 14:07:52 +02:00
$parameters = array ( 'user' => $user );
$reshook = $hookmanager -> executeHooks ( 'dashboardAccountancy' , $parameters , $object ); // Note that $action and $object may have been modified by hook
2018-10-05 15:34:32 +02:00
// End of page
2012-02-01 11:32:55 +01:00
llxFooter ();
$db -> close ();