Skip to content

Commit

Permalink
Fix date of delivery, and avoid duplicate tracking number.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 31, 2015
1 parent ce8ad39 commit d32f52c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
16 changes: 12 additions & 4 deletions htdocs/core/modules/expedition/doc/pdf_merou.modules.php
Expand Up @@ -560,15 +560,15 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
$pdf->SetXY($blSocX-80,$blSocY+17);
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("DateDelivery")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');

$pdf->SetXY($blSocX-80,$blSocY+20);
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, '', 'L');

// Deliverer
$pdf->SetXY($blSocX-80,$blSocY+24);
$pdf->SetXY($blSocX-80,$blSocY+23);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);

Expand All @@ -581,8 +581,16 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
// Get code using getLabelFromKey
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
$label=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
$pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
$label='';
$label.=$outputlangs->trans("SendingMethod").": ".$outputlangs->trans("SendingMethod".strtoupper($code));
//var_dump($object->tracking_url != $object->tracking_number);exit;
if ($object->tracking_url != $object->tracking_number)
{
$label.=" : ";
$label.=$object->tracking_url;
}
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->writeHTMLCell(50, 8, '', '', $label, '', 'L');
}
}
}
Expand Down
15 changes: 11 additions & 4 deletions htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
Expand Up @@ -212,10 +212,17 @@ function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hi
{
// Get code using getLabelFromKey
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
$label=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
$label='';
if ($object->tracking_url != $object->tracking_number) $label.=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
$label.=$outputlangs->trans("SendingMethod").": ".$outputlangs->trans("SendingMethod".strtoupper($code));
//var_dump($object->tracking_url != $object->tracking_number);exit;
if ($object->tracking_url != $object->tracking_number)
{
$label.=" : ";
$label.=$object->tracking_url;
}
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top+6, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top_alt, $label, 0, 1, false, true, 'L');

$tab_top_alt = $pdf->GetY();
}
Expand Down Expand Up @@ -537,7 +544,7 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_creation,"daytext",false,$outputlangs,true), '', 'R');
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true), '', 'R');

if (! empty($object->client->code_client))
{
Expand Down

0 comments on commit d32f52c

Please sign in to comment.