Ajout onglet aperçu sur la fiche commande client
This commit is contained in:
parent
e832655c57
commit
363b286df3
@ -40,6 +40,7 @@ if (!$user->rights->commande->lire)
|
|||||||
$langs->load('propal');
|
$langs->load('propal');
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
|
$langs->load('sendings');
|
||||||
|
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
||||||
@ -206,15 +207,15 @@ if ($_GET["id"] > 0) {
|
|||||||
/*
|
/*
|
||||||
* Documents
|
* Documents
|
||||||
*/
|
*/
|
||||||
$propalref = sanitize_string($propal->ref);
|
$commanderef = sanitize_string($commande->ref);
|
||||||
$file = $conf->propal->dir_output . "/" . $propalref . "/" . $propalref . ".pdf";
|
$file = $conf->commande->dir_output . "/" . $commanderef . "/" . $commanderef . ".pdf";
|
||||||
$filedetail = $conf->propal->dir_output . "/" . $propalref . "/" . $propalref . "-detail.pdf";
|
$filedetail = $conf->commande->dir_output . "/" . $commanderef . "/" . $commanderef . "-detail.pdf";
|
||||||
$relativepath = "${propalref}/${propalref}.pdf";
|
$relativepath = "${commanderef}/${commanderef}.pdf";
|
||||||
$relativepathdetail = "${propalref}/${propalref}-detail.pdf";
|
$relativepathdetail = "${commanderef}/${commanderef}-detail.pdf";
|
||||||
|
|
||||||
// Chemin vers png aperçus
|
// Chemin vers png aperçus
|
||||||
$relativepathimage = "${propalref}/${propalref}.pdf.png";
|
$relativepathimage = "${commanderef}/${commanderef}.pdf.png";
|
||||||
$relativepathimagebis = "${propalref}/${propalref}.pdf.png.0";
|
$relativepathimagebis = "${commanderef}/${commanderef}.pdf.png.0";
|
||||||
$fileimage = $file.".png"; // Si PDF d'1 page
|
$fileimage = $file.".png"; // Si PDF d'1 page
|
||||||
$fileimagebis = $file.".png.0"; // Si PDF de plus 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 "<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">'.filesize($file). ' bytes</td>';
|
||||||
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
|
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Si fichier detail PDF existe
|
// Si fichier detail PDF existe
|
||||||
if (file_exists($filedetail)) { // propal détaillée supplémentaire
|
if (file_exists($filedetail)) { // commande détaillée supplémentaire
|
||||||
print "<tr $bc[$var]><td>Propal détaillée</td>";
|
print "<tr $bc[$var]><td>Commande détaillée</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">'.filesize($filedetail). ' bytes</td>';
|
||||||
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($filedetail)).'</td>';
|
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($filedetail)).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -284,7 +285,7 @@ if ($_GET["id"] > 0) {
|
|||||||
// ligne 5
|
// ligne 5
|
||||||
// partie Gauche
|
// partie Gauche
|
||||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
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 '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
@ -293,7 +294,7 @@ if ($_GET["id"] > 0) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Propal non trouvée
|
// Propal non trouvée
|
||||||
print $langs->trans("ErrorPropalNotFound",$_GET["propalid"]);
|
print $langs->trans("ErrorPropalNotFound",$_GET["id"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user