diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index 839ca73d5b9..e6878eef179 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -3,7 +3,8 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2014 Frederic France * * 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 @@ -22,21 +23,17 @@ /** * \file htdocs/commande/apercu.php * \ingroup commande - * \brief Page de l'onglet apercu d'une commande + * \brief Preview tab of order */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('orders'); -$langs->load('propal'); $langs->load("bills"); $langs->load('compta'); -$langs->load('sendings'); // Security check $socid=0; @@ -47,19 +44,11 @@ $result=restrictedArea($user,'commande',$id,''); /* - * View + * View Mode */ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'); -$form = new Form($db); - -/* *************************************************************************** */ -/* */ -/* Mode fiche */ -/* */ -/* *************************************************************************** */ - if ($id > 0 || ! empty($ref)) { $object = new Commande($db); @@ -70,40 +59,46 @@ if ($id > 0 || ! empty($ref)) $soc->fetch($object->socid); - $head = commande_prepare_head($object); + $head = commande_prepare_head($object); dol_fiche_head($head, 'preview', $langs->trans("CustomerOrder"), 0, 'order'); - print ''; + print '
'; // Ref - print '"; - print ''; - print '"; + print '"; + print ''; // Ref cde client - print ''; - print ''; - $nbrow=6; - print ''; + print ''; + print ''; - /* - * Documents - */ + // Client + print ''; + print ''; + print ''; + + // Statut + print ''; + print ''; + print ''; + + // Discount - left part + print ''; + print ''; + print ''; + + // Date - left part + print ''; + print ''; + + // Right part with $rowspan lines + $rowspan=4; + print '
'.$langs->trans("Ref")."'.$object->ref.''.$langs->trans("Source").' : '.$object->getLabelSource(); - if ($object->source == 0) - { - // Propale - $propal = new Propal($db); - $propal->fetch($object->propale_id); - print ' -> '.$propal->ref.''; - } - print "
'.$langs->trans("Ref")."'.$object->ref.'
'; - print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print '
'; - print '
'; - print $object->ref_client; - print ''; + print '
'.$langs->trans('RefCustomer').''.$object->ref_client.'
'.$langs->trans("Customer").''.$soc->getNomUrl(1).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans('Discounts').''.$object->remise_percent.'%
'.$langs->trans("Date").''.dol_print_date($object->date,"daytext").''; + + /* + * Documents + */ $objectref = dol_sanitizeFileName($object->ref); $dir_output = $conf->commande->dir_output . "/"; $filepath = $dir_output . $objectref . "/"; @@ -119,16 +114,16 @@ if ($id > 0 || ! empty($ref)) $var=true; - // Si fichier PDF existe + // if PDF file exist if (file_exists($file)) { $encfile = urlencode($file); - print_titre($langs->trans("Documents")); - print ''; + print '
'; + print ''; print ""; - print ''; + print ''; print ''; print ''; print ''; @@ -139,7 +134,7 @@ if ($id > 0 || ! empty($ref)) { print ""; - print ''; + print ''; print ''; print ''; print ''; @@ -162,37 +157,24 @@ if ($id > 0 || ! empty($ref)) } } - print ""; + print ''; - // Client - print ""; - print ''; + // Total HT - left part + print ''; + print ''; print ''; - // Statut - print ''; - print "\n"; + // Total VAT - left part + print ''; + print ''; print ''; - // Date - print ''; - print "\n"; - print ''; + // Total TTC - left part + print ''; + print ''; + print ''; - // ligne 6 - // partie Gauche - print ''; - print ''; - print ''; - - // ligne 7 - // partie Gauche - print ''; - print ''; - print ''; - print '
'.$langs->trans("Documents").'
".$langs->trans("Order")." PDF'.$object->ref.'.pdf'.$object->ref.'.pdf'.dol_print_size(dol_filesize($file)).''.dol_print_date(dol_filemtime($file),'dayhour').'
Commande detaillee'.$object->ref.'-detail.pdf'.$object->ref.'-detail.pdf'.dol_print_size(dol_filesize($filedetail)).''.dol_print_date(dol_filemtime($filedetail),'dayhour').'
".$langs->trans("Customer")."'; - print ''.$soc->getNomUrl(1).''; - print '
'.$langs->trans('AmountHT').'' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans("Status").'".$object->getLibStatut(4)."
'.$langs->trans('AmountVAT').'' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans("Date").'".dol_print_date($object->date,"daytext")."
'.$langs->trans('AmountTTC').'' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans('GlobalDiscount').''.$object->remise_percent.'%
'.$langs->trans('AmountHT').''.price($object->total_ht).''.$langs->trans("Currency".$conf->currency).'
'; + print '
'; dol_fiche_end(); } @@ -203,10 +185,13 @@ if ($id > 0 || ! empty($ref)) } } +print ''; +print ''; +print '
'; +print '
'; // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -219,10 +204,13 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } +print '

'; +print '
'; llxFooter();