dolibarr  7.0.0-beta
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 $langs->load("main");
32 $langs->load("bills");
33 $langs->load("cashdesk");
34 
35 ?>
36 
37 <div class="liste_articles_haut">
38 <div class="liste_articles_bas">
39 
40 <p class="titre"><?php echo $langs->trans("ShoppingCart"); ?></p>
41 
42 <?php
44 $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
45 $societe = new Societe($db);
46 $societe->fetch($thirdpartyid);
49 $tab=array();
50 $tab = $_SESSION['poscart'];
51 
52 $tab_size=count($tab);
53 if ($tab_size <= 0) print '<div class="center">'.$langs->trans("NoArticle").'</div><br>';
54 else
55 {
56  for ($i=0;$i < $tab_size;$i++)
57  {
58  echo ('<div class="cadre_article">'."\n");
59  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");
60 
61  if ( $tab[$i]['remise_percent'] > 0 ) {
62 
63  $remise_percent = ' -'.$tab[$i]['remise_percent'].'%';
64 
65  } else {
66 
67  $remise_percent = '';
68 
69  }
70 
71  $remise = $tab[$i]['remise'];
72 
73  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");
74  echo ('</div>'."\n");
75  }
76 }
77 
78 echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'<br></p>'."\n");
79 
80 ?></div>
81 </div>
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...
print
Draft customers invoices.
Definition: index.php:91
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is '...