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 *****
|
***** 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 #1445 ] html fix : missing </tr>
|
||||||
Fix: [ bug #1415 ] Intervention document model name and suppliers model names is not shown
|
Fix: [ bug #1415 ] Intervention document model name and suppliers model names is not shown
|
||||||
properly in module configuration
|
properly in module configuration
|
||||||
|
|||||||
@ -287,11 +287,10 @@ function pdf_getHeightForLogo($logo, $url = false)
|
|||||||
* @param Societe $targetcompany Target company object
|
* @param Societe $targetcompany Target company object
|
||||||
* @param Contact $targetcontact Target contact object
|
* @param Contact $targetcontact Target contact object
|
||||||
* @param int $usecontact Use contact instead of company
|
* @param int $usecontact Use contact instead of company
|
||||||
* @param int $mode Address type
|
* @param int $mode Address type ('source', 'target', 'targetwithdetails')
|
||||||
* @param Societe $deliverycompany Delivery company object
|
|
||||||
* @return string String with full address
|
* @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;
|
global $conf;
|
||||||
|
|
||||||
@ -322,7 +321,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 'target')
|
if ($mode == 'target' || $mode == 'targetwithdetails')
|
||||||
{
|
{
|
||||||
if ($usecontact)
|
if ($usecontact)
|
||||||
{
|
{
|
||||||
@ -341,11 +340,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
|||||||
$stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
$stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails')
|
||||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
|
|
||||||
{
|
{
|
||||||
// Phone
|
// 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
|
// Fax
|
||||||
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
|
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
|
||||||
// EMail
|
// EMail
|
||||||
@ -360,10 +361,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
|||||||
// Country
|
// Country
|
||||||
if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
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
|
// 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
|
// Fax
|
||||||
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
|
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
|
||||||
// EMail
|
// 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;
|
return $stringaddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -602,8 +602,7 @@ class pdf_merou extends ModelePdfExpedition
|
|||||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
$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;
|
$blDestX=$blExpX+55;
|
||||||
$blW=50;
|
$blW=50;
|
||||||
|
|||||||
@ -504,7 +504,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
|
||||||
|
|
||||||
//Date Expedition
|
// Date Expedition
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
@ -530,7 +530,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$origin_id = $object->origin_id;
|
$origin_id = $object->origin_id;
|
||||||
|
|
||||||
// TODO move to external function
|
// TODO move to external function
|
||||||
if ($conf->$origin->enabled)
|
if (! empty($conf->$origin->enabled))
|
||||||
{
|
{
|
||||||
$outputlangs->load('orders');
|
$outputlangs->load('orders');
|
||||||
|
|
||||||
@ -616,7 +616,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
$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
|
// Show recipient
|
||||||
$widthrecbox=100;
|
$widthrecbox=100;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user