dolibarr  7.0.0-beta
affContenu.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
3  * Copyright (C) 2008-2009 Laurent Destailleur <eldy@uers.sourceforge.net>
4  * Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
25 require_once 'class/Facturation.class.php';
26 
27 // Si nouvelle vente, reinitialisation des donnees (destruction de l'objet et vidage de la table contenant la liste des articles)
28 if ( $_GET['id'] == 'NOUV' )
29 {
30  unset($_SESSION['serObjFacturation']);
31  unset($_SESSION['poscart']);
32 }
33 
34 // Recuperation, s'il existe, de l'objet contenant les infos de la vente en cours ...
35 if (isset($_SESSION['serObjFacturation']))
36 {
37  $obj_facturation = unserialize($_SESSION['serObjFacturation']);
38  unset($_SESSION['serObjFacturation']);
39 }
40 else
41 {
42  // ... sinon, c'est une nouvelle vente
43  $obj_facturation = new Facturation();
44 }
45 
46 // $obj_facturation contains data for all invoice total + selection of current product
47 
48 $obj_facturation->calculTotaux(); // Redefine prix_total_ttc, prix_total_ht et montant_tva from $_SESSION['poscart']
49 
50 $total_ttc = $obj_facturation->prixTotalTtc();
51 
52 /*var_dump($obj_facturation);
53 var_dump($_SESSION['poscart']);
54 var_dump($total_ttc);
55 exit;*/
56 
57 
58 // Left area with selected articles (area for article, amount and payments)
59 print '<div class="inline-block" style="vertical-align: top">';
60 print '<div class="principal">';
61 
62 $page=GETPOST('menutpl','alpha');
63 if (empty($page)) $page='facturation';
64 
65 if (in_array(
66  $page,
67  array(
68  'deconnexion',
69  'index','index_verif','facturation','facturation_verif','facturation_dhtml',
70  'validation','validation_ok','validation_ticket','validation_verif',
71  )
72  ))
73 {
74  include $page.'.php';
75 }
76 else
77 {
78  dol_print_error('','menu param '.$page.' is not inside allowed list');
79 }
80 
81 print '</div>';
82 print '</div>';
83 
84 
85 
86 // Right area with selected articles (shopping cart)
87 print '<div class="inline-block" style="vertical-align: top">';
88 print '<div class="liste_articles">';
89 
90 require ('tpl/liste_articles.tpl.php');
91 
92 print '</div>';
93 print '</div>';
94 
95 $_SESSION['serObjFacturation'] = serialize($obj_facturation);
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class ot manage invoices for pos module (cashdesk)
print
Draft customers invoices.
Definition: index.php:91