dolibarr  9.0.0
liste_articles.tpl.php
1 <?php
2 /* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
3  * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19 
20 // Protection to avoid direct call of template
21 if (empty($langs) || ! is_object($langs))
22 {
23  print "Error, template page can't be called as URL";
24  exit;
25 }
26 
27 
28 require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
30 
31 // Load translation files required by the page
32 $langs->loadLangs(array("main","bills","cashdesk"));
33 
34 ?>
35 
36 <div class="liste_articles_haut">
37 <div class="liste_articles_bas">
38 
39 <p class="titre"><?php echo $langs->trans("ShoppingCart"); ?></p>
40 
41 <?php
43 $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
44 $societe = new Societe($db);
45 $societe->fetch($thirdpartyid);
48 $tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());
49 
50 $tab_size=count($tab);
51 if ($tab_size <= 0) print '<div class="center">'.$langs->trans("NoArticle").'</div><br>';
52 else
53 {
54  for ($i=0;$i < $tab_size;$i++)
55  {
56  echo ('<div class="cadre_article">'."\n");
57  echo ('<p><a href="facturation_verif.php?action=suppr_article&suppr_id='.$tab[$i]['id'].'" title="'.$langs->trans("DeleteArticle").'">'.$tab[$i]['ref'].' - '.$tab[$i]['label'].'</a></p>'."\n");
58 
59  if ( $tab[$i]['remise_percent'] > 0 ) {
60 
61  $remise_percent = ' -'.$tab[$i]['remise_percent'].'%';
62  } else {
63 
64  $remise_percent = '';
65  }
66 
67  $remise = $tab[$i]['remise'];
68 
69  echo ('<p>'.$tab[$i]['qte'].' x '.price2num($tab[$i]['price'], 'MT').$remise_percent.' = '.price(price2num($tab[$i]['total_ht'], 'MT'),0,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT").' ('.price(price2num($tab[$i]['total_ttc'], 'MT'),0,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC").')</p>'."\n");
70  echo ('</div>'."\n");
71  }
72 }
73 
74 echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'<br></p>'."\n");
75 
76 ?></div>
77 </div>
print
Draft customers invoices.
Definition: index.php:91
Class to manage third parties objects (customers, suppliers, prospects...)
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is &#39;...