From e179e7d5a5fbcc637aaa8f1d358af9a789bc04f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Nov 2014 17:24:26 +0100 Subject: [PATCH 1/2] Fix 1655 Proposal amount not computed in preview --- htdocs/comm/propal/apercu.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index e575c8f27fc..6ece9ba0347 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -170,8 +170,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''.$langs->trans('AmountHT').''; - print ''.price($object->price).''; - print ''.$langs->trans("Currency".$conf->currency).''; + print '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . ''; print ''; dol_fiche_end(); From f7692959999e3410aec9061501be6ac91f710c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Nov 2014 21:03:01 +0100 Subject: [PATCH 2/2] Update apercu.php --- htdocs/comm/propal/apercu.php | 128 +++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 58 deletions(-) diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index 6ece9ba0347..87281e7ea63 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -3,7 +3,8 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2012 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,14 +23,13 @@ /** * \file htdocs/comm/propal/apercu.php * \ingroup propal - * \brief Page de l'onglet apercu d'une propal + * \brief Preview tab of propal */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('propal'); $langs->load("bills"); @@ -44,18 +44,11 @@ $result = restrictedArea($user, 'propal', $id); /* - * View + * View Mode */ llxHeader(); -$form = new Form($db); - -/* *************************************************************************** */ -/* */ -/* Mode fiche */ -/* */ -/* *************************************************************************** */ if ($id > 0 || ! empty($ref)) { @@ -73,29 +66,30 @@ if ($id > 0 || ! empty($ref)) /* * Propal */ - print ''; + print '
'; - // Ref - print ''; + // Ref + print ''; + print ''; + print ''; - // Ref client - print ''; - print ''; + // Ref client + print ''; + print ''; + print ''; - $rowspan=2; - // Tiers - print ''; - print ''; + // Thirdparty + print ''; + print ''; + print ''; - // Ligne info remises tiers + // Status + print ''; + print ''; + print ''; + + // Discount print ''; + print '.'; + print ''; - // ligne - // partie Gauche - print ''; + // Date + print ''; + print ''; - // partie Droite sur $rowspan lignes - print ''; + print ''; + print ''; + + // Total VAT - left part + print ''; + print ''; + print ''; + + // Total TTC - left part + print ''; + print ''; + print ''; + + print '
'.$langs->trans('Ref').''.$object->ref.'
'.$langs->trans('Ref').''.$object->ref.'
'; - print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print '
'; - print '
'; - print $object->ref_client; - print '
'.$langs->trans('RefCustomer').''.$object->ref_client.'
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans('Discounts').''; if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); @@ -103,44 +97,43 @@ if ($id > 0 || ! empty($ref)) print '. '; if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); - print '.'; - print '
'.$langs->trans('Date').''; - print dol_print_date($object->date,'daytext'); - print '
'.$langs->trans('Date').''.dol_print_date($object->date,'daytext').''; + // Right part with $rowspan lines + $rowspan=4; + print ''; - /* - * Documents - */ - $objectref = dol_sanitizeFileName($object->ref); - $dir_output = $conf->propal->dir_output . "/"; - $filepath = $dir_output . $objectref . "/"; - $file = $filepath . $objectref . ".pdf"; - $filedetail = $filepath . $objectref . "-detail.pdf"; + /* + * Documents + */ + $objectref = dol_sanitizeFileName($object->ref); + $dir_output = $conf->propal->dir_output . "/"; + $filepath = $dir_output . $objectref . "/"; + $file = $filepath . $objectref . ".pdf"; + $filedetail = $filepath . $objectref . "-detail.pdf"; $relativepath = $objectref.'/'.$objectref.'.pdf'; $relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf'; // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") - $fileimage = $file.'_preview.png'; // If PDF has 1 page + $fileimage = $file.'_preview.png'; // If PDF has 1 page $fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page $relativepathimage = $relativepath.'_preview.png'; - $var=true; + $var=true; // Si fichier PDF existe if (file_exists($file)) { $encfile = urlencode($file); - print_titre($langs->trans("Documents")); - print ''; + print '
'; + print ''; - print ""; + print ''; print ''; @@ -166,12 +159,25 @@ if ($id > 0 || ! empty($ref)) } } - print ""; - print ''; + print ''; + print ''; - print ''; - print ''; - print '
'.$langs->trans("Documents").'
".$langs->trans("Propal")." PDF
'.$langs->trans("Proposal").' PDF'.$object->ref.'.pdf
'.$langs->trans('AmountHT').'' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
'; + // Total HT - left part + print '
'.$langs->trans('AmountHT').'' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans('AmountVAT').'' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans('AmountTTC').'' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '
'; dol_fiche_end(); } @@ -182,10 +188,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)) @@ -198,10 +207,13 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } +print '

'; +print '
'; llxFooter();