dolibarr  13.0.2
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@inodbox.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 <https://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 } else {
40  // ... sinon, c'est une nouvelle vente
41  $obj_facturation = new Facturation();
42 }
43 
44 // $obj_facturation contains data for all invoice total + selection of current product
45 
46 $obj_facturation->calculTotaux(); // Redefine prix_total_ttc, prix_total_ht et montant_tva from $_SESSION['poscart']
47 
48 $total_ttc = $obj_facturation->amountWithTax();
49 
50 /*var_dump($obj_facturation);
51 var_dump($_SESSION['poscart']);
52 var_dump($total_ttc);
53 exit;*/
54 
55 
56 // Left area with selected articles (area for article, amount and payments)
57 print '<div class="inline-block" style="vertical-align: top">';
58 print '<div class="principal">';
59 
60 $page = GETPOST('menutpl', 'alpha');
61 if (empty($page)) $page = 'facturation';
62 
63 if (in_array(
64  $page,
65  array(
66  'deconnexion',
67  'index', 'index_verif', 'facturation', 'facturation_verif', 'facturation_dhtml',
68  'validation', 'validation_ok', 'validation_ticket', 'validation_verif',
69  )
70  ))
71 {
72  include $page.'.php';
73 } else {
74  dol_print_error('', 'menu param '.$page.' is not inside allowed list');
75 }
76 
77 print '</div>';
78 print '</div>';
79 
80 
81 
82 // Right area with selected articles (shopping cart)
83 print '<div class="inline-block" style="vertical-align: top">';
84 print '<div class="liste_articles">';
85 
86 require 'tpl/liste_articles.tpl.php';
87 
88 print '</div>';
89 print '</div>';
90 
91 $_SESSION['serObjFacturation'] = serialize($obj_facturation);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage invoices for pos module (cashdesk)
print
Draft customers invoices.
Definition: index.php:89
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...