forked from Wavyzz/dolibarr
Add pdf link into supplier invoice list and supplier order list
This commit is contained in:
@@ -46,6 +46,7 @@ For users:
|
|||||||
- New: [ task #1016 ] Can define a specific numbering for deposits
|
- New: [ task #1016 ] Can define a specific numbering for deposits
|
||||||
- New: [ task #918 ] Stock replenishment
|
- New: [ task #918 ] Stock replenishment
|
||||||
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count
|
- 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:
|
For translators:
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class FormActions
|
|||||||
global $bc;
|
global $bc;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||||
|
|
||||||
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement);
|
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement);
|
||||||
if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');
|
if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');
|
||||||
|
|
||||||
|
|||||||
@@ -1451,47 +1451,63 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
|||||||
|
|
||||||
// To work with non standard path
|
// To work with non standard path
|
||||||
if ($objecttype == 'facture' || $objecttype == 'invoice') {
|
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') {
|
if ($objecttype == 'commande' || $objecttype == 'order') {
|
||||||
$classpath = 'commande/class'; $module='commande'; $subelement='commande';
|
$classpath = 'commande/class';
|
||||||
|
$module='commande';
|
||||||
|
$subelement='commande';
|
||||||
}
|
}
|
||||||
if ($objecttype == 'propal') {
|
if ($objecttype == 'propal') {
|
||||||
$classpath = 'comm/propal/class';
|
$classpath = 'comm/propal/class';
|
||||||
}
|
}
|
||||||
if ($objecttype == 'shipping') {
|
if ($objecttype == 'shipping') {
|
||||||
$classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
|
$classpath = 'expedition/class';
|
||||||
|
$subelement = 'expedition';
|
||||||
|
$module = 'expedition_bon';
|
||||||
}
|
}
|
||||||
if ($objecttype == 'delivery') {
|
if ($objecttype == 'delivery') {
|
||||||
$classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon';
|
$classpath = 'livraison/class';
|
||||||
}
|
$subelement = 'livraison';
|
||||||
if ($objecttype == 'invoice_supplier') {
|
$module = 'livraison_bon';
|
||||||
$classpath = 'fourn/class';
|
|
||||||
}
|
|
||||||
if ($objecttype == 'order_supplier') {
|
|
||||||
$classpath = 'fourn/class';
|
|
||||||
}
|
}
|
||||||
if ($objecttype == 'contract') {
|
if ($objecttype == 'contract') {
|
||||||
$classpath = 'contrat/class'; $module='contrat'; $subelement='contrat';
|
$classpath = 'contrat/class';
|
||||||
|
$module='contrat';
|
||||||
|
$subelement='contrat';
|
||||||
}
|
}
|
||||||
if ($objecttype == 'member') {
|
if ($objecttype == 'member') {
|
||||||
$classpath = 'adherents/class'; $module='adherent'; $subelement='adherent';
|
$classpath = 'adherents/class';
|
||||||
|
$module='adherent';
|
||||||
|
$subelement='adherent';
|
||||||
}
|
}
|
||||||
if ($objecttype == 'cabinetmed_cons') {
|
if ($objecttype == 'cabinetmed_cons') {
|
||||||
$classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons';
|
$classpath = 'cabinetmed/class';
|
||||||
|
$module='cabinetmed';
|
||||||
|
$subelement='cabinetmedcons';
|
||||||
}
|
}
|
||||||
if ($objecttype == 'fichinter') {
|
if ($objecttype == 'fichinter') {
|
||||||
$classpath = 'fichinter/class'; $module='ficheinter'; $subelement='fichinter';
|
$classpath = 'fichinter/class';
|
||||||
|
$module='ficheinter';
|
||||||
|
$subelement='fichinter';
|
||||||
}
|
}
|
||||||
|
|
||||||
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
|
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
|
||||||
|
|
||||||
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
|
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
|
||||||
if ($objecttype == 'invoice_supplier') {
|
if ($objecttype == 'invoice_supplier') {
|
||||||
$classfile = 'fournisseur.facture'; $classname='FactureFournisseur';
|
$classfile = 'fournisseur.facture';
|
||||||
|
$classname='FactureFournisseur';
|
||||||
|
$classpath = 'fourn/class';
|
||||||
|
$module='fournisseur';
|
||||||
}
|
}
|
||||||
if ($objecttype == 'order_supplier') {
|
if ($objecttype == 'order_supplier') {
|
||||||
$classfile = 'fournisseur.commande'; $classname='CommandeFournisseur';
|
$classfile = 'fournisseur.commande';
|
||||||
|
$classname='CommandeFournisseur';
|
||||||
|
$classpath = 'fourn/class';
|
||||||
|
$module='fournisseur';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->$module->enabled))
|
if (! empty($conf->$module->enabled))
|
||||||
|
|||||||
@@ -1812,6 +1812,16 @@ elseif (! empty($object->id))
|
|||||||
* Linked object block
|
* Linked object block
|
||||||
*/
|
*/
|
||||||
$somethingshown=$object->showLinkedObjectBlock();
|
$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 '</td><td valign="top" width="50%">';
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|||||||
@@ -23,9 +23,11 @@
|
|||||||
* \brief List of suppliers orders
|
* \brief List of suppliers orders
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.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.'/fourn/class/fournisseur.commande.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
@@ -65,6 +67,7 @@ if ($socid > 0)
|
|||||||
llxHeader('',$title);
|
llxHeader('',$title);
|
||||||
|
|
||||||
$commandestatic=new CommandeFournisseur($db);
|
$commandestatic=new CommandeFournisseur($db);
|
||||||
|
$formfile = new FormFile($db);
|
||||||
|
|
||||||
|
|
||||||
if ($sortorder == "") $sortorder="DESC";
|
if ($sortorder == "") $sortorder="DESC";
|
||||||
@@ -154,6 +157,7 @@ if ($resql)
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
|
$objectstatic=new CommandeFournisseur($db);
|
||||||
|
|
||||||
while ($i < min($num,$conf->liste_limit))
|
while ($i < min($num,$conf->liste_limit))
|
||||||
{
|
{
|
||||||
@@ -163,7 +167,11 @@ if ($resql)
|
|||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
// Ref
|
// 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
|
// Company
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' ';
|
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' ';
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.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
|
* 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
|
||||||
@@ -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.'/fourn/class/fournisseur.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.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/lib/date.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
|
||||||
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
|
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
|
||||||
|
|
||||||
@@ -99,6 +101,7 @@ if ($mode == 'search')
|
|||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
$htmlother=new FormOther($db);
|
$htmlother=new FormOther($db);
|
||||||
|
$formfile = new FormFile($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
|
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=$obj->ref;
|
||||||
$facturestatic->ref_supplier=$obj->ref_supplier;
|
$facturestatic->ref_supplier=$obj->ref_supplier;
|
||||||
print $facturestatic->getNomUrl(1);
|
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>\n";
|
||||||
print '<td class="nowrap">'.dol_trunc($obj->ref_supplier,10)."</td>";
|
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>';
|
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datef),'day').'</td>';
|
||||||
|
|||||||
Reference in New Issue
Block a user