Skip to content

Commit

Permalink
Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7…
Browse files Browse the repository at this point in the history
….0_fix9161
  • Loading branch information
atm-florian committed Oct 5, 2018
2 parents 68c99d0 + b20dc56 commit cba4676
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 18 deletions.
4 changes: 4 additions & 0 deletions htdocs/accountancy/journal/sellsjournal.php
Expand Up @@ -59,11 +59,15 @@
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);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/card.php
Expand Up @@ -1611,7 +1611,7 @@ function init_repeat()

$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 '</div><div class="fichehalfright"><div class="ficheaddleft">';

Expand Down
12 changes: 8 additions & 4 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -1677,10 +1677,11 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='')

// 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);

Expand Down Expand Up @@ -1882,6 +1883,9 @@ function fetch_lines($only_product=0)
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;

$line->fetch_optionals();


$this->lines[$i] = $line;

$i++;
Expand Down
12 changes: 7 additions & 5 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -1353,10 +1353,12 @@ function fetch($rowid, $ref='', $ref_ext='', $ref_int='', $fetch_situation=false

// 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
Expand Down Expand Up @@ -1477,7 +1479,7 @@ function fetch_lines()
$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;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/list.php
Expand Up @@ -451,7 +451,7 @@
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."'";
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Expand Up @@ -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.='<span class="fa '.$fakey.' valignmiddle'.($morecss?' '.$morecss:'').'" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'"'.($moreatt?' '.$moreatt:'').'">';
$enabledisablehtml.='<span class="fa '.$fakey.' valignmiddle'.($morecss?' '.$morecss:'').'" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'"'.($moreatt?' '.$moreatt:'').'>';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $enabledisablehtml.=$titlealt;
$enabledisablehtml.='</span>';
return $enabledisablehtml;
Expand Down
12 changes: 6 additions & 6 deletions htdocs/core/lib/pdf.lib.php
Expand Up @@ -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));
Expand Down

0 comments on commit cba4676

Please sign in to comment.