Fix: Link betwen supplier order and invoice

This commit is contained in:
Laurent Destailleur 2011-03-08 00:17:56 +00:00
parent 6110ec4b2a
commit 42343a1206
5 changed files with 20 additions and 10 deletions

View File

@ -1375,14 +1375,14 @@ class CommonObject
}
$classpath = $element.'/class';
if ($element == 'facture') { $tplpath = 'compta/'.$element; $classpath = $tplpath.'/class'; } // To work with non standard path
if ($element == 'propal') { $tplpath = 'comm/'.$element; $classpath = $tplpath.'/class'; } // To work with non standard path
if ($element == 'invoice_supplier') { $tplpath = 'fourn/facture'; $classpath = 'fourn/class'; } // To work with non standard path
if ($element == 'order_supplier') { $tplpath = 'fourn/commande'; $classpath = 'fourn/class'; } // To work with non standard path
if ($objecttype == 'facture') { $tplpath = 'compta/'.$element; $classpath = $tplpath.'/class'; } // To work with non standard path
if ($objecttype == 'propal') { $tplpath = 'comm/'.$element; $classpath = $tplpath.'/class'; } // To work with non standard path
if ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; $classpath = 'fourn/class'; } // To work with non standard path
if ($objecttype == 'order_supplier') { $tplpath = 'fourn/commande'; $classpath = 'fourn/class'; } // To work with non standard path
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
if ($subelement == 'invoice_supplier') { $classfile='fournisseur.facture'; $classname='FactureFournisseur'; }
if ($subelement == 'order_supplier') { $classfile='fournisseur.commande'; $classname='CommandeFournisseur'; }
if ($objecttype == 'invoice_supplier') { $classfile='fournisseur.facture'; $classname='FactureFournisseur'; }
if ($objecttype == 'order_supplier') { $classfile='fournisseur.commande'; $classname='CommandeFournisseur'; }
//print $classfile." - ".$classpath." - ".$tplpath;
if(!class_exists($classname))
{

View File

@ -1341,8 +1341,6 @@ if ($id > 0 || ! empty($ref))
$object=$commande;
if ($somethingshown) print '<br>';
/*
* Linked object block
*/

View File

@ -22,6 +22,13 @@
<!-- BEGIN PHP TEMPLATE -->
<?php
$langs = $GLOBALS['langs'];
$somethingshown = $GLOBALS['somethingshown'];
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
$objectid = $GLOBALS['object']->objectid;
$num = count($objectid);
$langs->load("orders");
if ($somethingshown) { echo '<br>'; }
print_titre($langs->trans('RelatedOrders'));

View File

@ -1806,8 +1806,6 @@ else
$object=$fac;
if ($somethingshown) print '<br>';
/*
* Linked object block
*/

View File

@ -22,6 +22,13 @@
<!-- BEGIN PHP TEMPLATE -->
<?php
$langs = $GLOBALS['langs'];
$somethingshown = $GLOBALS['somethingshown'];
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
$objectid = $GLOBALS['object']->objectid;
$num = count($objectid);
$langs->load("bills");
if ($somethingshown) { echo '<br>'; }
if ($num > 1) print_titre($langs->trans("RelatedBills"));