Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog_Immeca.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
--------------------------------------------------------------
IMMECA Dolibarr ChangeLog
--------------------------------------------------------------
FIX - pdf_rouget : ajout de la date d'expédition effective (date_shipping) sur le BL, en plus de la date de livraison prévue
FIX - DA027670 - Spé custom cliimmeca Default Attachment on mail
FIX - DA027605 - BACKPORT - PR STD #37038
FIX - DA027462 - fichier /product/card.php - PR STD #36603
23 changes: 20 additions & 3 deletions htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ class pdf_rouget extends ModelePdfExpedition
*/
public $posxqtyordered;

/**
* Spé IMMECA : décalage vertical (mm) appliqué aux cadres expéditeur/destinataire
* pour absorber la ligne "DateShipping" ajoutée dans l'en-tête.
*/
const IMMECA_HEADER_EXTRA_OFFSET = 5;

/**
* Constructor
Expand Down Expand Up @@ -984,6 +989,14 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending")." : ".$object->ref, '', 'R');

// Spé IMMECA : affichage de la date d'expédition effective en plus de la date de livraison prévue.
// Le libellé "DateDeliveryPlanned" seul était lu comme la date de livraison réelle par les clients destinataires.
if (!empty($object->date_shipping)) {
$posy += 4;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateShipping")." : ".dol_print_date($object->date_shipping, "day", false, $outputlangs, true), '', 'R');
}
// Date planned delivery
if (!empty($object->date_delivery)) {
$posy += 4;
Expand All @@ -1007,7 +1020,9 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
}

$pdf->SetFont('', '', $default_font_size + 3);
$Yoff = 25;
// Spé IMMECA : départ dynamique pour ne pas chevaucher les lignes ajoutées au-dessus (date d'expédition, codes client).
// Les cadres expéditeur/destinataire sont décalés plus bas (cf. lignes ~1087 et ~1147) pour absorber l'espace.
$Yoff = max(25, $posy);

// Add list of linked orders
$origin = $object->origin;
Expand Down Expand Up @@ -1073,7 +1088,8 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object);

// Show sender
$posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42;
// Spé IMMECA : cadre décalé via self::IMMECA_HEADER_EXTRA_OFFSET pour laisser la place aux lignes ajoutées dans l'en-tête (date d'expédition + date de livraison prévue).
$posy = (getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42) + self::IMMECA_HEADER_EXTRA_OFFSET;
$posx = $this->marge_gauche;
if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
$posx = $this->page_largeur - $this->marge_droite - 80;
Expand Down Expand Up @@ -1133,7 +1149,8 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
if ($this->page_largeur < 210) {
$widthrecbox = 84; // To work with US executive format
}
$posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42;
// Spé IMMECA : aligné sur le cadre expéditeur décalé plus haut.
$posy = (getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42) + self::IMMECA_HEADER_EXTRA_OFFSET;
$posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
$posx = $this->marge_gauche;
Expand Down
Loading