dolibarr/htdocs/fourn/paiement/info.php

85 lines
2.5 KiB
PHP
Raw Normal View History

2005-08-01 14:29:45 +02:00
<?php
2005-10-17 19:07:30 +02:00
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
2009-08-05 20:22:40 +02:00
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
2005-08-01 14:29:45 +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
* the Free Software Foundation; either version 3 of the License, or
2005-08-01 14:29:45 +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-08-01 14:29:45 +02:00
*/
2005-10-17 19:07:30 +02:00
/**
2009-08-05 20:22:40 +02:00
* \file htdocs/fourn/paiement/info.php
* \ingroup facture
* \brief Onglet info d'un paiement fournisseur
*/
2005-08-01 14:29:45 +02:00
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
2016-11-24 17:03:18 +01:00
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
2005-08-01 14:29:45 +02:00
$langs->loadLangs(array("bills", "suppliers", "companies"));
2005-08-01 14:29:45 +02:00
$id = GETPOST('id', 'int');
2017-10-13 20:04:11 +02:00
$object = new PaiementFourn($db);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', '');
// Security check
2021-02-25 23:21:30 +01:00
if ($user->socid) {
$socid = $user->socid;
}
// Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
// It should be enough because all payments are done on invoices of the same thirdparty.
if ($socid && $socid != $object->thirdparty->id) {
accessforbidden();
}
/*
* Actions
*/
// None
2017-10-13 20:04:11 +02:00
2009-08-05 20:22:40 +02:00
/*
* View
*/
2005-08-01 14:29:45 +02:00
llxHeader();
2005-10-17 19:07:30 +02:00
$object->info($id);
2017-10-13 20:04:11 +02:00
$head = payment_supplier_prepare_head($object);
2005-08-01 14:29:45 +02:00
2020-10-22 22:50:03 +02:00
print dol_get_fiche_head($head, 'info', $langs->trans("SupplierPayment"), 0, 'payment');
2005-08-01 14:29:45 +02:00
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
2017-10-13 20:04:11 +02:00
dol_banner_tab($object, 'id', $linkback, -1, 'rowid', 'ref');
2020-10-27 18:19:31 +01:00
print dol_get_fiche_end();
2017-10-13 20:04:11 +02:00
2005-08-01 14:29:45 +02:00
print '<table width="100%"><tr><td>';
2017-10-13 20:04:11 +02:00
dol_print_object_info($object);
2005-08-01 14:29:45 +02:00
print '</td></tr></table>';
2018-08-13 10:20:21 +02:00
// End of page
llxFooter();
$db->close();