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

View File

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

View File

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

View File

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