diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index f75bf57a972..3b968af09c3 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -62,7 +62,8 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity);
-
+ dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity);
+
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit;
}
@@ -247,6 +248,12 @@ if ($action == 'edit') // Edit
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
print '';
+ // Place customer adress to the ISO location
+ $var=!$var;
+ print '
| '.$langs->trans("PlaceCustomerAddressToIsoLocation").' | ';
+ print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1);
+ print ' |
';
+
print '';
@@ -444,6 +451,10 @@ else // Show
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
print '';
+ $var=!$var;
+ print '| '.$langs->trans("PlaceCustomerAddressToIsoLocation").' | ';
+ print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION,1);
+ print ' |
';
print '';
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 802bc9d3ad3..297913d7bd7 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1546,10 +1546,13 @@ class pdf_crabe extends ModelePDFFactures
$carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client);
// Show sender
- $posy=42;
+ $posy=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
$posx=$this->marge_gauche;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
- $hautcadre=40;
+
+ $hautcadre=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
+ $widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
+
// Show sender frame
$pdf->SetTextColor(0,0,0);
@@ -1558,19 +1561,19 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L');
$pdf->SetXY($posx,$posy);
$pdf->SetFillColor(230,230,230);
- $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
+ $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1);
$pdf->SetTextColor(0,0,60);
// Show sender name
$pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B', $default_font_size);
- $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
+ $pdf->MultiCell($widthrecbox-2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
$posy=$pdf->getY();
// Show sender information
$pdf->SetXY($posx+2,$posy);
$pdf->SetFont('','', $default_font_size - 1);
- $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
+ $pdf->MultiCell($widthrecbox-2, 4, $carac_emetteur, 0, 'L');
@@ -1596,9 +1599,9 @@ class pdf_crabe extends ModelePDFFactures
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
// Show recipient
- $widthrecbox=100;
+ $widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
- $posy=42;
+ $posy=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 459214b45fb..8f8428b3c75 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -366,6 +366,7 @@ HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF
HideDescOnPDF=Hide products description on generated PDF
HideRefOnPDF=Hide products ref. on generated PDF
HideDetailsOnPDF=Hide products lines details on generated PDF
+PlaceCustomerAddressToIsoLocation=Use ISO location for customer address
Library=Library
UrlGenerationParameters=Parameters to secure URLs
SecurityTokenIsUnique=Use a unique securekey parameter for each URL
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 7dd792059d9..0de11174d41 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -364,6 +364,7 @@ HideAnyVATInformationOnPDF=Cacher toutes les informations en rapport avec la TVA
HideDescOnPDF=Cacher la description des produits sur les PDF générés
HideRefOnPDF=Cacher la référence des produits sur les PDF générés
HideDetailsOnPDF=Cacher les détails des lignes de produits sur les PDF générés
+PlaceCustomerAddressToIsoLocation=Utiliser l'emplacement ISO pour l'addresse du destinatire
Library=Bibliothèque
UrlGenerationParameters=Sécurisation des URLs
SecurityTokenIsUnique=Utiliser un paramètre securekey unique pour chaque URL ?