Merge pull request #1057 from marcosgdf/develop

CR Fix
This commit is contained in:
Laurent Destailleur 2013-06-19 09:31:28 -07:00
commit 2a014f8c7c
4 changed files with 89 additions and 89 deletions

View File

@ -795,7 +795,7 @@ class BonPrelevement extends CommonObject
{
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
$soc = new Societe($this->db);
$bac = new CompanyBankAccount($this->db);
$bac = new CompanyBankAccount($this->db);
// Check RIB
$i = 0;
@ -810,7 +810,7 @@ class BonPrelevement extends CommonObject
{
if ($soc->fetch($fact->socid) >= 0)
{
$bac->fetch(0,$soc->id);
$bac->fetch(0,$soc->id);
if ($bac->verif() >= 1)
{
$factures_prev[$i] = $fac;

View File

@ -1423,87 +1423,87 @@ function getSoapParams()
return $params;
}
/**
* List urls of element
*
* @param int $objectid Id of record
* @param string $objecttype Type of object ('invoice', 'order', 'expedition_bon', ...)
* @param int $withpicto Picto to show
* @param string $option More options
* @return string URL of link to object id/type
*/
function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
{
global $db,$conf;
/**
* List urls of element
*
* @param int $objectid Id of record
* @param string $objecttype Type of object ('invoice', 'order', 'expedition_bon', ...)
* @param int $withpicto Picto to show
* @param string $option More options
* @return string URL of link to object id/type
*/
function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
{
global $db,$conf;
$ret='';
// Parse element/subelement (ex: project_task)
$module = $element = $subelement = $objecttype;
if (preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
{
$module = $element = $regs[1];
$subelement = $regs[2];
}
$classpath = $element.'/class';
// To work with non standard path
if ($objecttype == 'facture' || $objecttype == 'invoice') {
$classpath = 'compta/facture/class'; $module='facture'; $subelement='facture';
}
if ($objecttype == 'commande' || $objecttype == 'order') {
$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';
}
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';
}
if ($objecttype == 'contract') {
$classpath = 'contrat/class'; $module='contrat'; $subelement='contrat';
}
if ($objecttype == 'member') {
$classpath = 'adherents/class'; $module='adherent'; $subelement='adherent';
}
if ($objecttype == 'cabinetmed_cons') {
$classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons';
}
if ($objecttype == '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';
}
if ($objecttype == 'order_supplier') {
$classfile = 'fournisseur.commande'; $classname='CommandeFournisseur';
}
if (! empty($conf->$module->enabled))
{
$res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
if ($res)
{
$object = new $classname($db);
$res=$object->fetch($objectid);
// Parse element/subelement (ex: project_task)
$module = $element = $subelement = $objecttype;
if (preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
{
$module = $element = $regs[1];
$subelement = $regs[2];
}
$classpath = $element.'/class';
// To work with non standard path
if ($objecttype == 'facture' || $objecttype == 'invoice') {
$classpath = 'compta/facture/class'; $module='facture'; $subelement='facture';
}
if ($objecttype == 'commande' || $objecttype == 'order') {
$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';
}
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';
}
if ($objecttype == 'contract') {
$classpath = 'contrat/class'; $module='contrat'; $subelement='contrat';
}
if ($objecttype == 'member') {
$classpath = 'adherents/class'; $module='adherent'; $subelement='adherent';
}
if ($objecttype == 'cabinetmed_cons') {
$classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons';
}
if ($objecttype == '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';
}
if ($objecttype == 'order_supplier') {
$classfile = 'fournisseur.commande'; $classname='CommandeFournisseur';
}
if (! empty($conf->$module->enabled))
{
$res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
if ($res)
{
$object = new $classname($db);
$res=$object->fetch($objectid);
if ($res > 0) $ret=$object->getNomUrl($withpicto,$option);
unset($object);
}
}
return $ret;
return $ret;
}

View File

@ -36,7 +36,7 @@ if (! empty($conf->categorie->enabled))
$langs->load("products");
$langs->load("stocks");
$langs->load("suppliers");
$langs->load("suppliers");
$action = GETPOST('action');
$sref=GETPOST("sref");

View File

@ -196,15 +196,15 @@ class CompanyBankAccount extends Account
{
global $langs;
if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib)
{
$rib = $this->code_banque." ".$this->code_guichet." ".$this->number;
$rib.=($this->cle_rib?" (".$this->cle_rib.")":"");
}
else
{
$rib=$langs->trans("NoRIB");
}
if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib)
{
$rib = $this->code_banque." ".$this->code_guichet." ".$this->number;
$rib.=($this->cle_rib?" (".$this->cle_rib.")":"");
}
else
{
$rib=$langs->trans("NoRIB");
}
return $rib;
}