From 781eb01c96030351d135a44df1e6d2192d49b605 Mon Sep 17 00:00:00 2001 From: eldy Date: Wed, 12 Oct 2011 19:24:27 +0200 Subject: [PATCH] New: Print ticket show ref of invoice --- ChangeLog | 1 + htdocs/cashdesk/tpl/ticket.tpl.php | 71 ++++++++++++++----------- htdocs/cashdesk/tpl/validation2.tpl.php | 7 ++- htdocs/lib/functions.lib.php | 39 ++++++++++++++ htdocs/lib/pdf.lib.php | 46 ++-------------- 5 files changed, 87 insertions(+), 77 deletions(-) diff --git a/ChangeLog b/ChangeLog index 916aa541bf9..ad511567db3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.2 compared to 3.1 ***** For users: +- New: Print ticket show invoice ref into POS module. - New: Can edit customer discounts from invoice create and edit card. - New: task #11243: Show quantity into stocks for each sub-products into the sub-product tab. - New: task #10500: Option to choose if professional id are unique. diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php index f4f07c25732..834ab76619d 100644 --- a/htdocs/cashdesk/tpl/ticket.tpl.php +++ b/htdocs/cashdesk/tpl/ticket.tpl.php @@ -1,22 +1,29 @@ + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (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 + * along with this program. If not, see . + */ +include_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'); + $langs->load("main"); header("Content-type: text/html; charset=".$conf->file->character_set_client); + +$facid=GETPOST('facid'); +$object=new Facture($db); +$object->fetch($facid); + ?> - Print ticket @@ -97,17 +104,22 @@ along with this program. If not, see .

name; ?>
- address; ?>
- zip.' '.$mysoc->town; ?>

+
+

+

'.dol_print_date($now,'dayhourtext').'

'; + print dol_print_date($now,'dayhourtext').'
'; + print $object->ref; ?> +

+
+ @@ -119,12 +131,12 @@ along with this program. If not, see . LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON c.fk_article = p.rowid ORDER BY id'); - if ( $db->num_rows($res) ) { - + if ($db->num_rows($res)) + { $ret=array(); $i=0; - while ( $tab = $db->fetch_array($res) ) + while ($tab = $db->fetch_array($res)) { - foreach ( $tab as $cle => $valeur ) + foreach ($tab as $cle => $valeur) { $ret[$i][$cle] = $valeur; } @@ -133,17 +145,16 @@ along with this program. If not, see . $tab = $ret; $tab_size=count($tab); - for($i=0;$i < $tab_size;$i++) { - + for($i=0;$i < $tab_size;$i++) + { $remise = $tab[$i]['remise']; echo (''."\n"); - } - } else { - + } + else + { echo ('

Erreur : aucun article

'."\n"); - } ?> @@ -158,11 +169,9 @@ along with this program. If not, see .
trans("Code"); ?>trans("Label"); ?>trans("Qty"); ?>trans("Discount").' (%)'; ?>trans("TotalHT"); ?>
'.$tab[$i]['ref'].''.$tab[$i]['label'].''.$tab[$i]['qte'].''.$tab[$i]['remise_percent'].''.price2num($tab[$i]['total_ht'],'MT').' '.$conf->monnaie.'
-Fermer cette fenetre +trans("Close"); ?> diff --git a/htdocs/cashdesk/tpl/validation2.tpl.php b/htdocs/cashdesk/tpl/validation2.tpl.php index 60c9e7f1e27..f186a070fb0 100644 --- a/htdocs/cashdesk/tpl/validation2.tpl.php +++ b/htdocs/cashdesk/tpl/validation2.tpl.php @@ -22,13 +22,12 @@ along with this program. If not, see .