diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 64a2314560c..814dfacc5f3 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -162,7 +162,7 @@ class box_actions extends ModeleBoxes $this->info_box_contents[$line][2] = array( 'td' => 'class="center nowraponall"', - 'text' => dol_print_date($datelimite, "dayhour", 'tzuserrel'), + 'text' => $datelimite ? dol_print_date($datelimite, "dayhour", 'tzuserrel') : '', 'asis' => 1 ); diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index baa822dcf29..98aed557557 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -85,7 +85,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $param_day = 'DOLUSERCOOKIE_ticket_last_days'; - if ($_POST[$param_day]) { + if (!empty($_POST[$param_day])) { if ($_POST[$param_day] >= 15) { $days = 14; } else { diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 8125a848fd0..580ccdb373c 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -161,7 +161,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => $delayIcon.' '.dol_print_date($delivery_date, 'day', 'tzuserrel').'', + 'text' => $delayIcon.' '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'', 'asis' => 1 ); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ac2965668a2..a892c557b34 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1384,7 +1384,7 @@ class DolGraph $textoflegend = $arrayofgroupslegend[$i]['legendwithgroup']; } else { - $textoflegend = $this->Legend[$i]; + $textoflegend = !empty($this->Legend[$i]) ? $this->Legend[$i] : ''; } if ($usecolorvariantforgroupby) { diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index effa7311661..2bb1cf1d0cf 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -99,7 +99,7 @@ function bankline_prepare_head($id) */ function payment_supplier_prepare_head(Paiement $object) { - global $langs, $conf; + global $db, $langs, $conf; $h = 0; $head = array(); @@ -120,6 +120,19 @@ function payment_supplier_prepare_head(Paiement $object) $head[$h][2] = 'info'; $h++; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->fournisseur->payment->dir_output.'/'.$object->ref; + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/document.php?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'documents'; + $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment_supplier', 'remove'); return $head; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index b6da2d4c294..0a4cd815d45 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -812,6 +812,25 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); + + // Show default IBAN account + $sql = "SELECT iban_prefix"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as rib"; + $sql .= " WHERE fk_soc = ".($object->thirdparty->id); + $sql .= " AND rib.default_rib = 1"; + $sql .= " AND rib.type = 'ban'"; + $sql .= " LIMIT 1"; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + $iban = $obj->iban_prefix; + } + + if (!empty($iban)) { + $pdf->SetFont('', '', $default_font_size - 1); + $pdf->SetXY($posx + 2, $posy + 15); + $pdf->MultiCell($widthrecbox, 4, $langs->trans("IBAN").': '.$iban, 0, 'L'); + } } } diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 05ad6ac71c4..5f5e6c72908 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -135,6 +135,13 @@ $upload_dir = $conf->fournisseur->payment->dir_output; $permissiontoadd = true; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; +// Actions to send emails +$triggersendname = 'PAYMENTRECEIPT_SENTBYMAIL'; +$paramname = 'id'; +$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO'; +$trackid = 'pre'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; + /* * View @@ -334,6 +341,18 @@ if ($result > 0) { */ print '
| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' | ||
| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.dol_print_size($totalsize, 1, 1).' | ||