mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: The object deliverycompany was not used anymore and output of
details for delivery reports was lost during 3.5. Rewrite code to restore feature. Conflicts: htdocs/core/modules/expedition/doc/pdf_merou.modules.php htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
This commit is contained in:
parent
11cb23f4ac
commit
8ce8bf47ee
|
|
@ -3,6 +3,9 @@ English Dolibarr ChangeLog
|
|||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
||||
Fix: The object deliverycompany was not used anymore and output of
|
||||
details for delivery reports was lost during 3.5. Rewrite code to
|
||||
restore feature.
|
||||
Fix: [ bug #1445 ] html fix : missing </tr>
|
||||
Fix: [ bug #1415 ] Intervention document model name and suppliers model names is not shown
|
||||
properly in module configuration
|
||||
|
|
|
|||
|
|
@ -287,11 +287,10 @@ function pdf_getHeightForLogo($logo, $url = false)
|
|||
* @param Societe $targetcompany Target company object
|
||||
* @param Contact $targetcontact Target contact object
|
||||
* @param int $usecontact Use contact instead of company
|
||||
* @param int $mode Address type
|
||||
* @param Societe $deliverycompany Delivery company object
|
||||
* @param int $mode Address type ('source', 'target', 'targetwithdetails')
|
||||
* @return string String with full address
|
||||
*/
|
||||
function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$targetcontact='',$usecontact=0,$mode='source',$deliverycompany='')
|
||||
function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$targetcontact='',$usecontact=0,$mode='source')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -322,7 +321,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
|||
}
|
||||
}
|
||||
|
||||
if ($mode == 'target')
|
||||
if ($mode == 'target' || $mode == 'targetwithdetails')
|
||||
{
|
||||
if ($usecontact)
|
||||
{
|
||||
|
|
@ -341,11 +340,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
|||
$stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails')
|
||||
{
|
||||
// Phone
|
||||
if ($targetcontact->phone_pro) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone_pro);
|
||||
if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ";
|
||||
if (! empty($targetcontact->phone_pro)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
|
||||
if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= " / ";
|
||||
if (! empty($targetcontact->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
|
||||
// Fax
|
||||
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
|
||||
// EMail
|
||||
|
|
@ -360,10 +361,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
|||
// Country
|
||||
if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails')
|
||||
{
|
||||
// Phone
|
||||
if ($targetcompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->phone);
|
||||
if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ";
|
||||
if (! empty($targetcompany->phone)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone);
|
||||
if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= " / ";
|
||||
if (! empty($targetcompany->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile);
|
||||
// Fax
|
||||
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
|
||||
// EMail
|
||||
|
|
@ -406,16 +410,6 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
|||
}
|
||||
}
|
||||
|
||||
if ($mode == 'delivery') // for a delivery address (address + phone/fax)
|
||||
{
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($deliverycompany))."\n";
|
||||
|
||||
// Phone
|
||||
if ($deliverycompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($deliverycompany->phone);
|
||||
// Fax
|
||||
if ($deliverycompany->fax) $stringaddress .= ($stringaddress ? ($deliverycompany->phone ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($deliverycompany->fax);
|
||||
}
|
||||
|
||||
return $stringaddress;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -602,8 +602,7 @@ class pdf_merou extends ModelePdfExpedition
|
|||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||
}
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,((!empty($object->contact))?$object->contact:null),$usecontact,'targetwithdetails');
|
||||
|
||||
$blDestX=$blExpX+55;
|
||||
$blW=50;
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
|
||||
|
||||
//Date Expedition
|
||||
// Date Expedition
|
||||
$posy+=4;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
|
|
@ -530,7 +530,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$origin_id = $object->origin_id;
|
||||
|
||||
// TODO move to external function
|
||||
if ($conf->$origin->enabled)
|
||||
if (! empty($conf->$origin->enabled))
|
||||
{
|
||||
$outputlangs->load('orders');
|
||||
|
||||
|
|
@ -616,7 +616,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||
}
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails');
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=100;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user