2
0
forked from Wavyzz/dolibarr

Add pdf link into supplier invoice list and supplier order list

This commit is contained in:
Florian Henry
2013-08-09 13:48:44 +02:00
parent 057df6df85
commit 3cf3dbeb51
6 changed files with 59 additions and 18 deletions

View File

@@ -46,6 +46,7 @@ For users:
- New: [ task #1016 ] Can define a specific numbering for deposits
- New: [ task #918 ] Stock replenishment
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count
- New : Add pdf link into supplier invoice list and supplier order list
For translators:

View File

@@ -144,7 +144,7 @@ class FormActions
global $bc;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement);
if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');

View File

@@ -1451,47 +1451,63 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
// To work with non standard path
if ($objecttype == 'facture' || $objecttype == 'invoice') {
$classpath = 'compta/facture/class'; $module='facture'; $subelement='facture';
$classpath = 'compta/facture/class';
$module='facture';
$subelement='facture';
}
if ($objecttype == 'commande' || $objecttype == 'order') {
$classpath = 'commande/class'; $module='commande'; $subelement='commande';
$classpath = 'commande/class';
$module='commande';
$subelement='commande';
}
if ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
}
if ($objecttype == 'shipping') {
$classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
$classpath = 'expedition/class';
$subelement = 'expedition';
$module = 'expedition_bon';
}
if ($objecttype == 'delivery') {
$classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon';
}
if ($objecttype == 'invoice_supplier') {
$classpath = 'fourn/class';
}
if ($objecttype == 'order_supplier') {
$classpath = 'fourn/class';
$classpath = 'livraison/class';
$subelement = 'livraison';
$module = 'livraison_bon';
}
if ($objecttype == 'contract') {
$classpath = 'contrat/class'; $module='contrat'; $subelement='contrat';
$classpath = 'contrat/class';
$module='contrat';
$subelement='contrat';
}
if ($objecttype == 'member') {
$classpath = 'adherents/class'; $module='adherent'; $subelement='adherent';
$classpath = 'adherents/class';
$module='adherent';
$subelement='adherent';
}
if ($objecttype == 'cabinetmed_cons') {
$classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons';
$classpath = 'cabinetmed/class';
$module='cabinetmed';
$subelement='cabinetmedcons';
}
if ($objecttype == 'fichinter') {
$classpath = 'fichinter/class'; $module='ficheinter'; $subelement='fichinter';
$classpath = 'fichinter/class';
$module='ficheinter';
$subelement='fichinter';
}
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
if ($objecttype == 'invoice_supplier') {
$classfile = 'fournisseur.facture'; $classname='FactureFournisseur';
$classfile = 'fournisseur.facture';
$classname='FactureFournisseur';
$classpath = 'fourn/class';
$module='fournisseur';
}
if ($objecttype == 'order_supplier') {
$classfile = 'fournisseur.commande'; $classname='CommandeFournisseur';
$classfile = 'fournisseur.commande';
$classname='CommandeFournisseur';
$classpath = 'fourn/class';
$module='fournisseur';
}
if (! empty($conf->$module->enabled))

View File

@@ -1812,6 +1812,16 @@ elseif (! empty($object->id))
* Linked object block
*/
$somethingshown=$object->showLinkedObjectBlock();
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'order_supplier',$socid);
print '</div></div></div>';
//print '</td><td valign="top" width="50%">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';

View File

@@ -23,9 +23,11 @@
* \brief List of suppliers orders
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$langs->load("orders");
@@ -65,6 +67,7 @@ if ($socid > 0)
llxHeader('',$title);
$commandestatic=new CommandeFournisseur($db);
$formfile = new FormFile($db);
if ($sortorder == "") $sortorder="DESC";
@@ -154,6 +157,7 @@ if ($resql)
$var=true;
$userstatic = new User($db);
$objectstatic=new CommandeFournisseur($db);
while ($i < min($num,$conf->liste_limit))
{
@@ -163,7 +167,11 @@ if ($resql)
print "<tr ".$bc[$var].">";
// Ref
print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>'."\n";
print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a>';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
print '</td>'."\n";
// Company
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' ';

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
@@ -29,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
@@ -99,6 +101,7 @@ if ($mode == 'search')
$now=dol_now();
$form=new Form($db);
$htmlother=new FormOther($db);
$formfile = new FormFile($db);
llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
@@ -252,6 +255,9 @@ if ($resql)
$facturestatic->ref=$obj->ref;
$facturestatic->ref_supplier=$obj->ref_supplier;
print $facturestatic->getNomUrl(1);
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->fournisseur->dir_output.'/facture' . '/' . dol_sanitizeFileName($obj->facid).'/0/'.dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print "</td>\n";
print '<td class="nowrap">'.dol_trunc($obj->ref_supplier,10)."</td>";
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datef),'day').'</td>';