Merge pull request #2106 from frederic34/patch-12
Fix 1655 Proposal amount not computed in preview
This commit is contained in:
commit
8a8f9aaee3
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -22,14 +23,13 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/comm/propal/apercu.php
|
* \file htdocs/comm/propal/apercu.php
|
||||||
* \ingroup propal
|
* \ingroup propal
|
||||||
* \brief Page de l'onglet apercu d'une propal
|
* \brief Preview tab of propal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.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/propal.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.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('propal');
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -44,18 +44,11 @@ $result = restrictedArea($user, 'propal', $id);
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View Mode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
/* *************************************************************************** */
|
|
||||||
/* */
|
|
||||||
/* Mode fiche */
|
|
||||||
/* */
|
|
||||||
/* *************************************************************************** */
|
|
||||||
|
|
||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
@ -76,26 +69,27 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="5">'.$object->ref.'</td></tr>';
|
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
|
||||||
|
print '<td colspan="5">'.$object->ref.'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Ref client
|
// Ref client
|
||||||
print '<tr><td>';
|
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
print '<td colspan="5">'.$object->ref_client.'</td>';
|
||||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr></table>';
|
|
||||||
print '</td><td colspan="5">';
|
|
||||||
print $object->ref_client;
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$rowspan=2;
|
|
||||||
|
|
||||||
// Tiers
|
// Thirdparty
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$soc->getNomUrl(1).'</td>';
|
print '<tr><td>'.$langs->trans('Company').'</td>';
|
||||||
|
print '<td colspan="5">'.$soc->getNomUrl(1).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Ligne info remises tiers
|
// Status
|
||||||
|
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||||
|
print '<td colspan="5">'.$object->getLibStatut(4).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Discount
|
||||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
||||||
if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
|
if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
|
||||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||||
@ -103,17 +97,16 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '. ';
|
print '. ';
|
||||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
|
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
|
||||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||||
print '.';
|
print '.</td>';
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// ligne
|
// Date
|
||||||
// partie Gauche
|
print '<tr><td>'.$langs->trans('Date').'</td>';
|
||||||
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
|
print '<td>'.dol_print_date($object->date,'daytext').'</td>';
|
||||||
print dol_print_date($object->date,'daytext');
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// partie Droite sur $rowspan lignes
|
// Right part with $rowspan lines
|
||||||
print '<td colspan="2" rowspan="'.$rowspan.'" valign="top" width="50%">';
|
$rowspan=4;
|
||||||
|
print '<td rowspan="'.$rowspan.'" valign="top" width="50%">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Documents
|
* Documents
|
||||||
@ -137,10 +130,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
$encfile = urlencode($file);
|
$encfile = urlencode($file);
|
||||||
print_titre($langs->trans("Documents"));
|
print '<table class="nobordernopadding" width="100%">';
|
||||||
print '<table class="border" width="100%">';
|
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Documents").'</td></tr>';
|
||||||
|
|
||||||
print "<tr ".$bc[$var]."><td>".$langs->trans("Propal")." PDF</td>";
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("Proposal").' PDF</td>';
|
||||||
|
|
||||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
|
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
|
||||||
|
|
||||||
@ -166,12 +159,24 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</td>";
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Total HT - left part
|
||||||
|
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||||
|
print '<td align="right" class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Total VAT - left part
|
||||||
|
print '<tr><td>'.$langs->trans('AmountVAT').'</td>';
|
||||||
|
print '<td align="right" class="nowrap"><b>' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Total TTC - left part
|
||||||
|
print '<tr><td>'.$langs->trans('AmountTTC').'</td>';
|
||||||
|
print '<td align="right" class="nowrap"><b>' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
|
||||||
print '<td align="right" colspan="2"><b>'.price($object->price).'</b></td>';
|
|
||||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -183,10 +188,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<div class="photolist">';
|
||||||
// Si fichier png PDF d'1 page trouve
|
// Si fichier png PDF d'1 page trouve
|
||||||
if (file_exists($fileimage))
|
if (file_exists($fileimage))
|
||||||
{
|
{
|
||||||
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">';
|
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">';
|
||||||
}
|
}
|
||||||
// Si fichier png PDF de plus d'1 page trouve
|
// Si fichier png PDF de plus d'1 page trouve
|
||||||
elseif (file_exists($fileimagebis))
|
elseif (file_exists($fileimagebis))
|
||||||
@ -199,10 +207,13 @@ elseif (file_exists($fileimagebis))
|
|||||||
|
|
||||||
if (file_exists($dir_output.$preview))
|
if (file_exists($dir_output.$preview))
|
||||||
{
|
{
|
||||||
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>';
|
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print '</div>';
|
||||||
|
print '</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user