';
-$tmp = getCustomerInvoiceLatestEditTable($maxLatestEditCount, $socid);
+$tmp = getCustomerInvoiceLatestEditTable($max, $socid);
if ($tmp) {
print $tmp;
print '
';
}
-$tmp = getCustomerInvoiceUnpaidOpenTable($max, $socid);
+$tmp = getCustomerInvoiceUnpaidOpenTable($maxOpenCount, $socid);
if ($tmp) {
print $tmp;
print '
';
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 00cbfc4158a..bb3f2ae035d 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -1389,7 +1389,7 @@ class Contact extends CommonObject
* Return name of contact with link (and eventually picto)
* Use $this->id, $this->lastname, $this->firstname, this->civility_id
*
- * @param int $withpicto Include picto with link
+ * @param int $withpicto Include picto with link (1=picto + name, 2=picto only, -1=photo+name, -2=photo only)
* @param string $option Where the link point to
* @param int $maxlen Max length of
* @param string $moreparam Add more param into URL
@@ -1475,14 +1475,14 @@ class Contact extends CommonObject
$result .= $linkstart;
if ($withpicto) {
- if ($withpicto == -2) {
+ if ($withpicto < 0) {
$result .= '
'.Form::showphoto('contact', $this, 0, 0, 0, 'userphoto'.($withpicto == -3 ? 'small' : ''), 'mini', 0, 1).'';
} else {
$result .= img_object(($notooltip ? '' : $label), ( $this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
}
}
if ($withpicto != 2 && $withpicto != -2) {
- $result .= ($maxlen ?dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs));
+ $result .= '
'.($maxlen ? dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs)).'';
}
$result .= $linkend;
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 74ff2141820..6043814dc45 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -857,7 +857,7 @@ abstract class CommonInvoice extends CommonObject
// Using TLV format
$s = pack('C1', 1).pack('C1', strlen($this->thirdparty->name)).$this->thirdparty->name;
$s .= pack('C1', 2).pack('C1', strlen($this->thirdparty->tva_intra)).$this->thirdparty->tva_intra;
- $s .= pack('C1', 3).pack('C1', strlen($datestring)).$date;
+ $s .= pack('C1', 3).pack('C1', strlen($datestring)).$this->date;
$s .= pack('C1', 4).pack('C1', strlen($pricewithtaxstring)).$pricewithtaxstring;
$s .= pack('C1', 5).pack('C1', strlen($pricetaxstring)).$pricetaxstring;
$s .= ''; // Hash of xml invoice
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index f5502426b00..457d310492c 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -359,7 +359,7 @@ class FormActions
* @param string $morecss More css to add to SELECT component.
* @return string
*/
- public function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0, $morecss = '')
+ public function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0, $morecss = 'minwidth300')
{
// phpcs:enable
global $langs, $user, $form, $conf;
@@ -399,7 +399,7 @@ class FormActions
}
$out .= $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
} else {
- $out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth300'.($morecss ? ' '.$morecss : ''), 1);
+ $out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', $morecss, 1);
}
if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0) {
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index b848e04b061..ea28deb85f0 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1417,7 +1417,7 @@ class FormFile
} else {
print '
';
}
- print '
';
+ print '
';
print '';
} else {
print ' ';
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 2902430bf82..2d46ee2a239 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -201,8 +201,7 @@ function societe_prepare_head(Societe $object)
$foundonexternalonlinesystem = 0;
$langs->load("banks");
- //$title = $langs->trans("BankAccounts");
- $title = $langs->trans("PaymentInformation");
+ $title = $langs->trans("PaymentModes");
if (!empty($conf->stripe->enabled)) {
//$langs->load("stripe");
@@ -1710,7 +1709,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$out .= '
| ';
$out .= '
| ';
$out .= '
';
- $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1);
+ $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1, 'minwidth200');
$out .= ' | ';
$out .= '
| ';
$out .= '
';
@@ -1741,14 +1740,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
$out .= getTitleFieldOfList($tmp);
}
- $out .= getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder);
- $out .= getTitleFieldOfList($langs->trans("Owner"));
- $out .= getTitleFieldOfList($langs->trans("Type"));
- $out .= getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
- $out .= getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder);
- $out .= getTitleFieldOfList($langs->trans("RelatedObjects"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
- $out .= getTitleFieldOfList($langs->trans("ActionOnContact"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
- $out .= getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder);
+ $out .= getTitleFieldOfList("Ref", 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder);
+ $out .= getTitleFieldOfList("Owner");
+ $out .= getTitleFieldOfList("Type");
+ $out .= getTitleFieldOfList("Label", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
+ $out .= getTitleFieldOfList("Date", 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, '', $sortfield, $sortorder, 'center ');
+ $out .= getTitleFieldOfList("RelatedObjects", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
+ $out .= getTitleFieldOfList("ActionOnContact", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'tdoverflowmax125 ', 0, '', 0);
+ $out .= getTitleFieldOfList("Status", 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, '', $sortfield, $sortorder, 'center ');
$out .= getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
$out .= '';
@@ -1782,7 +1781,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$out .= ' | ';
// Author of event
- $out .= '
';
+ $out .= ' | ';
//$userstatic->id=$histo[$key]['userid'];
//$userstatic->login=$histo[$key]['login'];
//$out.=$userstatic->getLoginUrl(1);
@@ -1813,25 +1812,27 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$labeltype .= ' - '.$arraylist[$actionstatic->code]; // Use code in priority on type_code
}
}
- $out .= ' | ';
+ $out .= ' | ';
$out .= $actionstatic->getTypePicto();
$out .= $labeltype;
$out .= ' | ';
- // Title
- $out .= '
';
+ // Title/Label of event
+ $out .= ' | trans("Action".$histo[$key]['acode']);
$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : $histo[$key]['alabel']);
//$actionstatic->libelle=$libelle;
$libelle = $histo[$key]['note'];
$actionstatic->id = $histo[$key]['id'];
+ $out .= ' title="'.dol_escape_htmltag($libelle).'">';
$out .= dol_trunc($libelle, 120);
}
if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') {
$out .= ''.img_object($langs->trans("ShowEMailing"), "email").' ';
$transcode = $langs->trans("Action".$histo[$key]['acode']);
$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing');
+ $out .= ' title="'.dol_escape_htmltag($libelle).'">';
$out .= dol_trunc($libelle, 120);
}
$out .= ' | ';
@@ -1888,13 +1889,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$out .= '';
// Contact(s) for action
- if (empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0) {
- $contactstatic->lastname = $histo[$key]['lastname'];
- $contactstatic->firstname = $histo[$key]['firstname'];
- $contactstatic->id = $histo[$key]['contact_id'];
- $out .= '
'.$contactstatic->getNomUrl(1, '', 10).' | ';
- } elseif (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) {
- $out .= '
';
+ if (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) {
+ $out .= ' | ';
$contact = new Contact($db);
foreach ($histo[$key]['socpeopleassigned'] as $cid => $value) {
$result = $contact->fetch($cid);
@@ -1904,7 +1900,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
if ($result > 0) {
- $out .= $contact->getNomUrl(1, '', 16);
+ $out .= $contact->getNomUrl(-3, '', 10, '', -1, 0, 'paddingright');
if (isset($histo[$key]['acode']) && $histo[$key]['acode'] == 'AC_TEL') {
if (!empty($contact->phone_pro)) {
$out .= '('.dol_print_phone($contact->phone_pro).')';
@@ -1914,6 +1910,12 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
}
$out .= ' | ';
+ } elseif (empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0) {
+ $contactstatic->lastname = $histo[$key]['lastname'];
+ $contactstatic->firstname = $histo[$key]['firstname'];
+ $contactstatic->id = $histo[$key]['contact_id'];
+ $contactstatic->photo = $histo[$key]['contact_photo'];
+ $out .= '
'.$contactstatic->getNomUrl(-1, '', 10).' | ';
} else {
$out .= '
| ';
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 54320ddf928..b00738ef5ed 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4851,6 +4851,7 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
if ($field1 && ($sortfield1 == $field1 || $sortfield1 == preg_replace("/^[^\.]+\./", "", $field1))) {
$liste_titre = 'liste_titre_sel';
}
+
$out .= '<'.$tag.' class="'.$prefix.$liste_titre.'" '.$moreattrib;
//$out .= (($field && empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) && preg_match('/^[a-zA-Z_0-9\s\.\-:&;]*$/', $name)) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
$out .= ($name && empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) && empty($forcenowrapcolumntitle) && !dol_textishtml($name)) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '';
@@ -4885,7 +4886,6 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
//$out .= (empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
$out .= '>';
}
-
if ($tooltip) {
// You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
$tmptooltip = explode(':', $tooltip);
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index fe6e8e0fa40..3a0b077be6b 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1368,6 +1368,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$numFinal = $ref;
} elseif ($mode == 'next') {
$counter++;
+ $maskrefclient_counter = 0;
// If value for $counter has a length higher than $maskcounter chars
if ($counter >= pow(10, dol_strlen($maskcounter))) {
@@ -1398,7 +1399,6 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$maskrefclient_maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'), $maskrefclient_clientcode.str_pad("", dol_strlen($maskrefclient_maskcounter), "_"), $maskrefclient_maskLike);
// Get counter in database
- $maskrefclient_counter = 0;
$maskrefclient_sql = "SELECT MAX(".$maskrefclient_sqlstring.") as val";
$maskrefclient_sql .= " FROM ".MAIN_DB_PREFIX.$table;
//$sql.= " WHERE ".$field." not like '(%'";
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index 0ed0134a944..db961962ba6 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -575,7 +575,10 @@ class pdf_einstein extends ModelePDFCommandes
}
$this->tva[$vatrate] += $tvaligne;
$vatcode = $object->lines[$i]->vat_src_code;
- $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=>$tvaligne);
+ if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
+ $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
+ }
+ $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
// Add line
if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index a901a23cc69..210ef249ac2 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -259,7 +259,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$arephoto = false;
foreach ($pdir as $midir) {
if (!$arephoto) {
- if ($conf->product->entity != $objphoto->entity) {
+ if ($conf->entity != $objphoto->entity) {
$dir = $conf->product->multidir_output[$objphoto->entity].'/'.$midir; //Check repertories of current entities
} else {
$dir = $conf->product->dir_output.'/'.$midir; //Check repertory of the current product
@@ -800,7 +800,10 @@ class pdf_eratosthene extends ModelePDFCommandes
}
$this->tva[$vatrate] += $tvaligne;
$vatcode = $object->lines[$i]->vat_src_code;
- $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=>$tvaligne);
+ if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
+ $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
+ }
+ $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
// Add line
if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index be42ab002d5..b9ceb3e346b 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -749,9 +749,12 @@ class pdf_crabe extends ModelePDFFactures
if (!isset($this->tva[$vatrate])) {
$this->tva[$vatrate] = 0;
}
- $this->tva[$vatrate] += $tvaligne;
+ $this->tva[$vatrate] += $tvaligne; // ->tva is abandonned, we use now ->tva_array that is more complete
$vatcode = $object->lines[$i]->vat_src_code;
- $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=>$tvaligne);
+ if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
+ $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
+ }
+ $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
if ($posYAfterImage > $posYAfterDescription) {
$nexY = $posYAfterImage;
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index 2def31cbf30..c1666545891 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -265,7 +265,7 @@ class pdf_sponge extends ModelePDFFactures
$arephoto = false;
foreach ($pdir as $midir) {
if (!$arephoto) {
- if ($conf->product->entity != $objphoto->entity) {
+ if ($conf->entity != $objphoto->entity) {
$dir = $conf->product->multidir_output[$objphoto->entity].'/'.$midir; //Check repertories of current entities
} else {
$dir = $conf->product->dir_output.'/'.$midir; //Check repertory of the current product
@@ -887,9 +887,12 @@ class pdf_sponge extends ModelePDFFactures
if (!isset($this->tva[$vatrate])) {
$this->tva[$vatrate] = 0;
}
- $this->tva[$vatrate] += $tvaligne;
+ $this->tva[$vatrate] += $tvaligne; // ->tva is abandonned, we use now ->tva_array that is more complete
$vatcode = $object->lines[$i]->vat_src_code;
- $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=>$tvaligne);
+ if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
+ $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
+ }
+ $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
$nexY = max($nexY, $posYAfterImage);
diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php
index ef43f05b86a..4b928d8af07 100644
--- a/htdocs/core/modules/mailings/contacts1.modules.php
+++ b/htdocs/core/modules/mailings/contacts1.modules.php
@@ -138,9 +138,8 @@ class mailing_contacts1 extends MailingTargets
$sql .= " ORDER BY sp.poste";
$resql = $this->db->query($sql);
- $s .= $langs->trans("PostOrFunction").' ';
- $s .= '