Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2023-03-31 02:54:22 +02:00
commit f1898e5ac0
7 changed files with 38 additions and 17 deletions

View File

@ -1599,7 +1599,7 @@ if (empty($reshook)) {
$error++; $error++;
} }
if (!$error) { if (!$error) {
$result = $object->updateExtraField(GETPOST('attribute', 'restricthtml'), 'PROPAL_MODIFY', $user); $result = $object->insertExtraFields('PROPAL_MODIFY');
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error++; $error++;

View File

@ -574,6 +574,7 @@ class Facture extends CommonInvoice
$this->type = self::TYPE_STANDARD; $this->type = self::TYPE_STANDARD;
} }
$this->ref_client = trim($this->ref_client); $this->ref_client = trim($this->ref_client);
$this->ref_customer = trim($this->ref_customer);
$this->note_public = trim($this->note_public); $this->note_public = trim($this->note_public);
$this->note_private = trim($this->note_private); $this->note_private = trim($this->note_private);
$this->note_private = dol_concatdesc($this->note_private, $langs->trans("GeneratedFromRecurringInvoice", $_facrec->ref)); $this->note_private = dol_concatdesc($this->note_private, $langs->trans("GeneratedFromRecurringInvoice", $_facrec->ref));
@ -5466,10 +5467,10 @@ class Facture extends CommonInvoice
/** /**
* Send reminders by emails for ivoices that are due * Send reminders by emails for invoices that are due
* CAN BE A CRON TASK * CAN BE A CRON TASK
* *
* @param int $nbdays Delay after due date (or before if delay is negative) * @param int $nbdays Delay before due date (or after if delay is negative)
* @param string $paymentmode '' or 'all' by default (no filter), or 'LIQ', 'CHQ', CB', ... * @param string $paymentmode '' or 'all' by default (no filter), or 'LIQ', 'CHQ', CB', ...
* @param int|string $template Name (or id) of email template (Must be a template of type 'facture_send') * @param int|string $template Name (or id) of email template (Must be a template of type 'facture_send')
* @param string $forcerecipient Force email of recipient (for example to send the email to an accountant supervisor instead of the customer) * @param string $forcerecipient Force email of recipient (for example to send the email to an accountant supervisor instead of the customer)

View File

@ -1952,7 +1952,7 @@ if ($resql) {
// Action column // Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap" align="center">'; print '<td class="nowrap center">';
if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0; $selected = 0;
if (in_array($obj->id, $arrayofselected)) { if (in_array($obj->id, $arrayofselected)) {
@ -2570,7 +2570,7 @@ if ($resql) {
// Action column (Show the massaction button only when this page is not opend from the Extended POS) // Action column (Show the massaction button only when this page is not opend from the Extended POS)
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap" align="center">'; print '<td class="nowrap center">';
if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0; $selected = 0;
if (in_array($obj->id, $arrayofselected)) { if (in_array($obj->id, $arrayofselected)) {

View File

@ -619,7 +619,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
} }
} }
if (!empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { if (!empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) {
if (!empty($_GET['action']) && (preg_match('/^create/', $_GET['action']) || preg_match('/^presend/', $_GET['action'])) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) { if (!empty($_GET['action']) && (preg_match('/^create|^add_price|^make/', $_GET['action']) || preg_match('/^presend/', $_GET['action'])) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) {
// Now search in setup to overwrite default values // Now search in setup to overwrite default values
if (!empty($user->default_values)) { // $user->default_values defined from menu 'Setup - Default values' if (!empty($user->default_values)) { // $user->default_values defined from menu 'Setup - Default values'
if (isset($user->default_values[$relativepathstring]['createform'])) { if (isset($user->default_values[$relativepathstring]['createform'])) {

View File

@ -368,11 +368,14 @@ class pdf_espadon extends ModelePdfExpedition
if (!empty($notetoshow) || !empty($object->tracking_number)) { if (!empty($notetoshow) || !empty($object->tracking_number)) {
$tab_top -= 2; $tab_top -= 2;
$tab_topbeforetrackingnumber = $tab_top;
// Tracking number // Tracking number
if (!empty($object->tracking_number)) { if (!empty($object->tracking_number)) {
$height_trackingnumber = 4;
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L'); $pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L');
$tab_top_alt = $pdf->GetY(); $tab_top_alt = $pdf->GetY();
$object->getUrlTrackingStatus($object->tracking_number); $object->getUrlTrackingStatus($object->tracking_number);
@ -390,8 +393,10 @@ class pdf_espadon extends ModelePdfExpedition
$label .= " : "; $label .= " : ";
$label .= $object->tracking_url; $label .= $object->tracking_url;
} }
$height_trackingnumber += 6;
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top_alt, $label, 0, 1, false, true, 'L'); $pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top_alt, $label, 0, 1, false, true, 'L');
$tab_top = $pdf->GetY(); $tab_top = $pdf->GetY();
} }
@ -401,7 +406,7 @@ class pdf_espadon extends ModelePdfExpedition
// Notes // Notes
$pagenb = $pdf->getPage(); $pagenb = $pdf->getPage();
if (!empty($notetoshow)) { if (!empty($notetoshow) || !empty($object->tracking_number)) {
$tab_top -= 2; $tab_top -= 2;
$tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite; $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
@ -465,10 +470,20 @@ class pdf_espadon extends ModelePdfExpedition
$pdf->SetDrawColor(128, 128, 128); $pdf->SetDrawColor(128, 128, 128);
// Draw note frame // Draw note frame
if ($i > $pageposbeforenote) { if ($i > $pageposbeforenote) {
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); if (empty($height_trackingnumber)) {
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
} else {
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter) + $height_trackingnumber + 1;
$tab_top_newpage = $tab_topbeforetrackingnumber;
}
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
} else { } else {
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter); if (empty($height_trackingnumber)) {
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
} else {
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter)+ $height_trackingnumber + 1;
$tab_top = $tab_topbeforetrackingnumber;
}
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
} }
@ -489,7 +504,12 @@ class pdf_espadon extends ModelePdfExpedition
{ {
$pdf->commitTransaction(); $pdf->commitTransaction();
$posyafter = $pdf->GetY(); $posyafter = $pdf->GetY();
$height_note = $posyafter - $tab_top; if (empty($height_trackingnumber)) {
$height_note = $posyafter - $tab_top + 1;
} else {
$height_note = $posyafter - $tab_top + $height_trackingnumber + 1;
$tab_top = $tab_topbeforetrackingnumber;
}
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);

View File

@ -1082,9 +1082,9 @@ if ($step == 4 && $datatoimport) {
$valforsourcefieldnb[$lefti] = $key; $valforsourcefieldnb[$lefti] = $key;
$lefti++; $lefti++;
if ($lefti > count($fieldstarget)) { /*if ($lefti > count($fieldstarget)) {
break; // Other fields are in the not imported area break; // Other fields are in the not imported area
} }*/
} }
//var_dump($valforsourcefieldnb); //var_dump($valforsourcefieldnb);
@ -1138,9 +1138,9 @@ if ($step == 4 && $datatoimport) {
print '<table class="nobordernopadding centpercent tableimport">'; print '<table class="nobordernopadding centpercent tableimport">';
foreach ($fieldssource as $code => $line) { // $fieldssource is an array code=column num, line=content on first line for column in source file. foreach ($fieldssource as $code => $line) { // $fieldssource is an array code=column num, line=content on first line for column in source file.
if ($i == $minpos) { /*if ($i == $minpos) {
break; break;
} }*/
print '<tr style="height:'.$height.'" class="trimport oddevenimport">'; print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
$entity = (!empty($objimport->array_import_entities[0][$code]) ? $objimport->array_import_entities[0][$code] : $objimport->array_import_icon[0]); $entity = (!empty($objimport->array_import_entities[0][$code]) ? $objimport->array_import_entities[0][$code] : $objimport->array_import_icon[0]);

View File

@ -1111,7 +1111,7 @@ END;
// Date from // Date from
if (!empty($arrayfields['pfp.datec']['checked'])) { if (!empty($arrayfields['pfp.datec']['checked'])) {
print '<td>'.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour').'</td>'; print '<td>'.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour', 'tzuserrel').'</td>';
} }
// Supplier // Supplier