diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index b10e0d37c75..2c0ab7c1a2f 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -59,11 +59,15 @@ $now = dol_now(); if ($user->societe_id > 0) accessforbidden(); +$hookmanager->initHooks(array('sellsjournal')); +$parameters=array(); /* * Actions */ +$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks + // Get informations of journal $accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic->fetch($id_journal); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 890996bddce..4afde1e0ac4 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1611,7 +1611,7 @@ if ($id > 0) $var=true; - print $formfile->showdocuments('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang); + print $formfile->showdocuments('actions',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang); print '
'; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 9007490d421..6677a9f08de 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1677,10 +1677,11 @@ class Commande extends CommonOrder // Retrieve all extrafields for invoice // fetch optionals attributes and labels - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields=new ExtraFields($this->db); - $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - $this->fetch_optionals($this->id,$extralabels); +// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +// $extrafields=new ExtraFields($this->db); +// $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); +// $this->fetch_optionals($this->id,$extralabels); + $this->fetch_optionals(); $this->db->free($result); @@ -1882,6 +1883,9 @@ class Commande extends CommonOrder $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $line->fetch_optionals(); + + $this->lines[$i] = $line; $i++; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index bc7a14c0c45..9bf6d4b876c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1353,10 +1353,12 @@ class Facture extends CommonInvoice // Retrieve all extrafield for invoice // fetch optionals attributes and labels - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields=new ExtraFields($this->db); - $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - $this->fetch_optionals($this->id,$extralabels); +// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +// $extrafields=new ExtraFields($this->db); +// $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); +// $this->fetch_optionals($this->id,$extralabels); + $this->fetch_optionals(); + /* * Lines @@ -1477,7 +1479,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; - // TODO Fetch optional like done in fetch line of facture_rec ? + $line->fetch_optionals(); $this->lines[$i] = $line; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 139fe355d3d..6c9822fd8a3 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -451,7 +451,7 @@ if ($search_month > 0) if ($search_year > 0 && empty($search_day)) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; else if ($search_year > 0 && ! empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $serch_year))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else $sql.= " AND date_format(f.datef, '%m') = '".$month."'"; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1797617a26d..f760dd32cc1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2806,7 +2806,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if ($picto == 'off') { $fakey = 'fa-square-o'; $fasize='1.3em'; } if ($picto == 'on') { $fakey = 'fa-check-square-o'; $fasize='1.3em'; } $enabledisablehtml=''; - $enabledisablehtml.=''; + $enabledisablehtml.=''; if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $enabledisablehtml.=$titlealt; $enabledisablehtml.=''; return $enabledisablehtml; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1d6c26caecd..22b9eba29cc 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -437,15 +437,15 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target } else { $companytouseforaddress = $targetcompany; - // Contact on a thirdparty that is a different thirdparty than the thirdparty of object - if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) - { - $targetcontact->fetch_thirparty(); + // Contact on a thirdparty that is a different thirdparty than the thirdparty of object + if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) + { + $targetcontact->fetch_thirdparty(); $companytouseforaddress = $targetcontact->thirdparty; } - $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress)); - } + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress)); + } // Country if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { $stringaddress.= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code));