2010-12-13 14:16:02 +01:00
|
|
|
<?php
|
2024-10-26 13:03:52 +02:00
|
|
|
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
|
|
|
|
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
|
|
|
|
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
|
|
|
|
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
2010-12-13 14:16:02 +01: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
|
2010-12-13 14:16:02 +01: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/>.
|
2010-12-13 14:16:02 +01:00
|
|
|
*/
|
2017-12-21 13:32:16 +01:00
|
|
|
|
|
|
|
|
// Protection to avoid direct call of template
|
2021-02-25 23:21:30 +01:00
|
|
|
if (empty($conf) || !is_object($conf)) {
|
2017-12-21 13:32:16 +01:00
|
|
|
print "Error, template page can't be called as URL";
|
2024-03-16 23:08:15 +01:00
|
|
|
exit(1);
|
2017-12-21 13:32:16 +01:00
|
|
|
}
|
|
|
|
|
|
2010-12-13 14:16:02 +01:00
|
|
|
|
2022-03-01 17:39:38 +01:00
|
|
|
print "<!-- BEGIN PHP TEMPLATE fourn/commande/tpl/linkedobjectblock.tpl.php -->\n";
|
2010-12-13 14:16:02 +01:00
|
|
|
|
2011-03-08 01:15:32 +01:00
|
|
|
|
2014-09-14 13:09:31 +02:00
|
|
|
global $user;
|
2016-11-08 19:19:30 +01:00
|
|
|
global $noMoreLinkedObjectBlockAfter;
|
2014-09-14 13:09:31 +02:00
|
|
|
|
2011-03-08 01:15:32 +01:00
|
|
|
$langs = $GLOBALS['langs'];
|
2024-09-16 01:49:38 +02:00
|
|
|
'@phan-var-force Translate $langs';
|
2024-10-26 13:03:52 +02:00
|
|
|
/** @var Translate $langs */
|
2011-08-23 00:04:21 +02:00
|
|
|
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
2024-09-16 01:49:38 +02:00
|
|
|
'@phan-var-force CommonObject[] $linkedObjectBlock';
|
2024-10-26 13:03:52 +02:00
|
|
|
/** @var CommonObject[] $linkedObjectBlock */
|
2011-03-08 01:15:32 +01:00
|
|
|
|
2010-12-13 14:16:02 +01:00
|
|
|
$langs->load("orders");
|
2016-03-30 19:18:31 +02:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$total = 0;
|
|
|
|
|
$ilink = 0;
|
2021-02-25 23:21:30 +01:00
|
|
|
foreach ($linkedObjectBlock as $key => $objectlink) {
|
2020-10-31 14:32:18 +01:00
|
|
|
$ilink++;
|
2017-12-21 13:32:16 +01:00
|
|
|
|
2020-10-31 14:32:18 +01:00
|
|
|
$trclass = 'oddeven';
|
2021-02-25 23:21:30 +01:00
|
|
|
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
|
|
|
|
|
$trclass .= ' liste_sub_total';
|
2023-12-04 12:12:12 +01:00
|
|
|
} ?>
|
2021-02-25 23:21:30 +01:00
|
|
|
<tr class="<?php echo $trclass; ?>">
|
|
|
|
|
<td><?php echo $langs->trans("SupplierOrder"); ?></td>
|
2023-01-11 21:04:30 +01:00
|
|
|
<td><?php print $objectlink->getNomUrl(1); ?></td>
|
2021-02-25 23:21:30 +01:00
|
|
|
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
|
|
|
|
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
|
|
|
|
<td class="right"><?php
|
2023-06-29 18:45:42 +02:00
|
|
|
if ($user->hasRight("fournisseur", "commande", "lire")) {
|
2024-08-07 02:53:45 +02:00
|
|
|
$total += $objectlink->total_ht;
|
2020-10-31 14:32:18 +01:00
|
|
|
echo price($objectlink->total_ht);
|
|
|
|
|
} ?></td>
|
2021-02-25 23:21:30 +01:00
|
|
|
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
2021-09-19 14:41:46 +02:00
|
|
|
<td class="right"><a class="reposition" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
2021-02-25 23:21:30 +01:00
|
|
|
</tr>
|
2019-10-27 09:51:15 +01:00
|
|
|
<?php
|
2016-11-10 18:03:35 +01:00
|
|
|
}
|
2021-02-25 23:21:30 +01:00
|
|
|
if (count($linkedObjectBlock) > 1) {
|
2020-10-31 14:32:18 +01:00
|
|
|
?>
|
2023-12-04 12:12:12 +01:00
|
|
|
<tr class="liste_total <?php echo(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
|
2021-02-25 23:21:30 +01:00
|
|
|
<td><?php echo $langs->trans("Total"); ?></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td class="center"></td>
|
|
|
|
|
<td class="center"></td>
|
|
|
|
|
<td class="right"><?php echo price($total); ?></td>
|
|
|
|
|
<td class="right"></td>
|
|
|
|
|
<td class="right"></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
2010-12-13 14:16:02 +01:00
|
|
|
}
|
|
|
|
|
|
2019-10-27 09:51:15 +01:00
|
|
|
print "<!-- END PHP TEMPLATE -->\n";
|