Skip to content
Snippets Groups Projects
Commit 363b286d authored by Regis Houssin's avatar Regis Houssin
Browse files

Ajout onglet aperçu sur la fiche commande client

parent e832655c
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ if (!$user->rights->commande->lire)
$langs->load('propal');
$langs->load("bills");
$langs->load('compta');
$langs->load('sendings');
require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
......@@ -206,15 +207,15 @@ if ($_GET["id"] > 0) {
/*
* Documents
*/
$propalref = sanitize_string($propal->ref);
$file = $conf->propal->dir_output . "/" . $propalref . "/" . $propalref . ".pdf";
$filedetail = $conf->propal->dir_output . "/" . $propalref . "/" . $propalref . "-detail.pdf";
$relativepath = "${propalref}/${propalref}.pdf";
$relativepathdetail = "${propalref}/${propalref}-detail.pdf";
$commanderef = sanitize_string($commande->ref);
$file = $conf->commande->dir_output . "/" . $commanderef . "/" . $commanderef . ".pdf";
$filedetail = $conf->commande->dir_output . "/" . $commanderef . "/" . $commanderef . "-detail.pdf";
$relativepath = "${commanderef}/${commanderef}.pdf";
$relativepathdetail = "${commanderef}/${commanderef}-detail.pdf";
// Chemin vers png aperus
$relativepathimage = "${propalref}/${propalref}.pdf.png";
$relativepathimagebis = "${propalref}/${propalref}.pdf.png.0";
$relativepathimage = "${commanderef}/${commanderef}.pdf.png";
$relativepathimagebis = "${commanderef}/${commanderef}.pdf.png.0";
$fileimage = $file.".png"; // Si PDF d'1 page
$fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page
......@@ -229,16 +230,16 @@ if ($_GET["id"] > 0) {
print "<tr $bc[$var]><td>".$langs->trans("Propal")." PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$propal->ref.'.pdf</a></td>';
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>';
print '<td align="right">'.filesize($file). ' bytes</td>';
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
print '</tr>';
// Si fichier detail PDF existe
if (file_exists($filedetail)) { // propal dtaille supplmentaire
print "<tr $bc[$var]><td>Propal dtaille</td>";
if (file_exists($filedetail)) { // commande dtaille supplmentaire
print "<tr $bc[$var]><td>Commande dtaille</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepathdetail).'">'.$propal->ref.'-detail.pdf</a></td>';
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepathdetail).'">'.$commande->ref.'-detail.pdf</a></td>';
print '<td align="right">'.filesize($filedetail). ' bytes</td>';
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($filedetail)).'</td>';
print '</tr>';
......@@ -284,7 +285,7 @@ if ($_GET["id"] > 0) {
// ligne 5
// partie Gauche
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
print '<td align="right" colspan="2"><b>'.price($propal->price).'</b></td>';
print '<td align="right" colspan="2"><b>'.price($commande->price).'</b></td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '</table>';
}
......@@ -293,7 +294,7 @@ if ($_GET["id"] > 0) {
}
} else {
// Propal non trouve
print $langs->trans("ErrorPropalNotFound",$_GET["propalid"]);
print $langs->trans("ErrorPropalNotFound",$_GET["id"]);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment