Merge remote-tracking branch 'upstream/develop' into psr2squizwhite

This commit is contained in:
Frédéric FRANCE
2019-02-03 22:41:57 +01:00
1546 changed files with 29438 additions and 33304 deletions

View File

@@ -99,7 +99,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Recupere emetteur
$this->emetteur=$mysoc;
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined
}
@@ -128,20 +128,20 @@ class doc_generic_order_odt extends ModelePDFCommandes
// List of directories area
$texte.= '<tr><td>';
$texttitle=$langs->trans("ListOfDirectories");
$listofdir=explode(',',preg_replace('/[\r\n]+/',',',trim($conf->global->COMMANDE_ADDON_PDF_ODT_PATH)));
$listofdir=explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->COMMANDE_ADDON_PDF_ODT_PATH)));
$listoffiles=array();
foreach($listofdir as $key=>$tmpdir)
{
$tmpdir=trim($tmpdir);
$tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
$tmpdir=preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
if (! $tmpdir) {
unset($listofdir[$key]); continue;
}
if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0);
if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0);
else
{
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)');
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
$tmpfiles=dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)');
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles, $tmpfiles);
}
}
$texthelp=$langs->trans("ListOfDirectoriesForModelGenODT");
@@ -149,7 +149,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$texthelp.='<br>'.$langs->trans("FollowingSubstitutionKeysCanBeUsed").'<br>';
$texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it
$texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1);
$texte.= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1);
$texte.= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
$texte.= '<textarea class="flat" cols="60" name="value1">';
$texte.=$conf->global->COMMANDE_ADDON_PDF_ODT_PATH;
@@ -240,21 +240,21 @@ class doc_generic_order_odt extends ModelePDFCommandes
$result=$object->fetch($id);
if ($result < 0)
{
dol_print_error($this->db,$object->error);
dol_print_error($this->db, $object->error);
return -1;
}
}
$dir = $conf->commande->dir_output;
$objectref = dol_sanitizeFileName($object->ref);
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
if (! preg_match('/specimen/i', $objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".odt";
if (! file_exists($dir))
{
if (dol_mkdir($dir) < 0)
{
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
return -1;
}
}
@@ -263,9 +263,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
//print "srctemplatepath=".$srctemplatepath; // Src filename
$newfile=basename($srctemplatepath);
$newfiletmp=preg_replace('/\.od(t|s)/i','',$newfile);
$newfiletmp=preg_replace('/template_/i','',$newfiletmp);
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
$newfiletmp=preg_replace('/\.od(t|s)/i', '', $newfile);
$newfiletmp=preg_replace('/template_/i', '', $newfiletmp);
$newfiletmp=preg_replace('/modele_/i', '', $newfiletmp);
$newfiletmp=$objectref.'_'.$newfiletmp;
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
@@ -274,7 +274,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
$format=$conf->global->MAIN_DOC_USE_TIMING;
if ($format == '1') $format='%Y%m%d%H%M%S';
$filename=$newfiletmp.'-'.dol_print_date(dol_now(),$format).'.'.$newfileformat;
$filename=$newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
}
else
{
@@ -291,7 +291,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
// If CUSTOMER contact defined on order, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
$arrayidcontact=$object->getIdContact('external', 'CUSTOMER');
if (count($arrayidcontact) > 0)
{
$usecontact=true;
@@ -326,14 +326,14 @@ class doc_generic_order_odt extends ModelePDFCommandes
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$substitutionarray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
$newfreetext='';
$paramfreetext='ORDER_FREE_TEXT';
if (! empty($conf->global->$paramfreetext))
{
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
$newfreetext=make_substitutions($conf->global->$paramfreetext, $substitutionarray);
}
// Open and load template
@@ -374,26 +374,26 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Define substitution array
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
$array_object_from_properties=$this->get_substitutionarray_each_var_object($object, $outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object, $outputlangs);
$array_user=$this->get_substitutionarray_user($user, $outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc, $outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject, $outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
$tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key=>$value)
{
try {
if (preg_match('/logo$/',$key)) // Image
if (preg_match('/logo$/', $key)) // Image
{
if (file_exists($value)) $odfHandler->setImage($key, $value);
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
@@ -425,11 +425,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
$tmparray=$this->get_substitutionarray_lines($line, $outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
@@ -473,7 +473,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Call the beforeODTSave hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
@@ -496,7 +496,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
}
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
@@ -509,7 +509,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
}
else
{
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
return -1;
}
}

View File

@@ -164,7 +164,7 @@ class pdf_einstein extends ModelePDFCommandes
// Get source company
$this->emetteur=$mysoc;
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
// Define position of columns
$this->posxdesc=$this->marge_gauche+1;
@@ -252,7 +252,7 @@ class pdf_einstein extends ModelePDFCommandes
{
if (dol_mkdir($dir) < 0)
{
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
return 0;
}
}
@@ -268,12 +268,12 @@ class pdf_einstein extends ModelePDFCommandes
$hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action;
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$pdf->SetAutoPageBreak(1,0);
$pdf->SetAutoPageBreak(1, 0);
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
@@ -295,7 +295,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->Open();
$pagenb=0;
$pdf->SetDrawColor(128,128,128);
$pdf->SetDrawColor(128, 128, 128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("PdfOrderTitle"));
@@ -329,9 +329,9 @@ class pdf_einstein extends ModelePDFCommandes
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$pdf->SetTextColor(0, 0, 0);
$tab_top = 90+$top_shift;
@@ -345,13 +345,13 @@ class pdf_einstein extends ModelePDFCommandes
{
$tab_top -= 2;
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
$nexY = $pdf->GetY();
$height_incoterms=$nexY-$tab_top;
// Rect prend une longueur en 3eme param
$pdf->SetDrawColor(192,192,192);
$pdf->SetDrawColor(192, 192, 192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
$tab_top = $nexY+6;
@@ -379,13 +379,13 @@ class pdf_einstein extends ModelePDFCommandes
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;
// Rect prend une longueur en 3eme param
$pdf->SetDrawColor(192,192,192);
$pdf->SetDrawColor(192, 192, 192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_top = $nexY+6;
@@ -399,8 +399,8 @@ class pdf_einstein extends ModelePDFCommandes
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0, 0, 0);
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
@@ -412,7 +412,7 @@ class pdf_einstein extends ModelePDFCommandes
$showpricebeforepagebreak=1;
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc);
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva-$curX, 3, $curX, $curY, $hideref, $hidedesc);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
@@ -420,14 +420,14 @@ class pdf_einstein extends ModelePDFCommandes
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc);
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva-$curX, 4, $curX, $curY, $hideref, $hidedesc);
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
{
$pdf->AddPage('','',true);
$pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1);
@@ -457,7 +457,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
}
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
@@ -528,7 +528,7 @@ class pdf_einstein extends ModelePDFCommandes
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
{
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$object->thirdparty,$mysoc);
$localtaxtmp_array=getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
@@ -567,7 +567,7 @@ class pdf_einstein extends ModelePDFCommandes
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
$this->_pagefoot($pdf, $object, $outputlangs, 1);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
@@ -583,7 +583,7 @@ class pdf_einstein extends ModelePDFCommandes
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
$this->_pagefoot($pdf, $object, $outputlangs, 1);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@@ -636,13 +636,13 @@ class pdf_einstein extends ModelePDFCommandes
}
else
{
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
return 0;
}
}
else
{
$this->error=$langs->transnoentities("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR");
$this->error=$langs->transnoentities("ErrorConstantNotDefined", "COMMANDE_OUTPUTDIR");
return 0;
}
}
@@ -679,12 +679,12 @@ class pdf_einstein extends ModelePDFCommandes
global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
// If France, show VAT mention if not applicable
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
{
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0);
@@ -696,16 +696,16 @@ class pdf_einstein extends ModelePDFCommandes
// Show payments conditions
if ($object->cond_reglement_code || $object->cond_reglement)
{
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':';
$pdf->MultiCell(43, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
$lib_condition_paiement=str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');
$posy=$pdf->GetY()+3;
}
@@ -741,28 +741,28 @@ class pdf_einstein extends ModelePDFCommandes
if (! empty($object->date_livraison))
{
$outputlangs->load("sendings");
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("DateDeliveryPlanned").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true);
$dlp=dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy=$pdf->GetY()+1;
}
elseif ($object->availability_code || $object->availability) // Show availability conditions
{
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("AvailabilityPeriod").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_availability=$outputlangs->transnoentities("AvailabilityType".$object->availability_code)!=('AvailabilityType'.$object->availability_code)?$outputlangs->transnoentities("AvailabilityType".$object->availability_code):$outputlangs->convToOutputCharset(isset($object->availability)?$object->availability:'');
$lib_availability=str_replace('\n',"\n",$lib_availability);
$lib_availability=str_replace('\n', "\n", $lib_availability);
$pdf->MultiCell(80, 4, $lib_availability, 0, 'L');
$posy=$pdf->GetY()+1;
@@ -770,17 +770,17 @@ class pdf_einstein extends ModelePDFCommandes
// Show payment mode
if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') {
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
$posy=$pdf->GetY()+2;
}
@@ -797,14 +797,14 @@ class pdf_einstein extends ModelePDFCommandes
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
$pdf->SetFont('', 'B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0);
$posy=$pdf->GetY()+1;
if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
{
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','', $default_font_size - 3);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
@@ -812,14 +812,14 @@ class pdf_einstein extends ModelePDFCommandes
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
{
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
$pdf->SetFont('', 'B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
$posy=$pdf->GetY()+1;
if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
{
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','', $default_font_size - 3);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
@@ -840,7 +840,7 @@ class pdf_einstein extends ModelePDFCommandes
$curx=$this->marge_gauche;
$cury=$posy;
$posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size);
$posy=pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
$posy+=2;
}
@@ -870,7 +870,7 @@ class pdf_einstein extends ModelePDFCommandes
$tab2_top = $posy;
$tab2_hl = 4;
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
// Tableau total
$col1x = 120; $col2x = 170;
@@ -884,7 +884,7 @@ class pdf_einstein extends ModelePDFCommandes
$index = 0;
// Total HT
$pdf->SetFillColor(255,255,255);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
@@ -893,7 +893,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248,248,248);
$pdf->SetFillColor(248, 248, 248);
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
@@ -910,10 +910,10 @@ class pdf_einstein extends ModelePDFCommandes
//Local tax 1 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
foreach( $this->localtax1 as $localtax_type => $localtax_rate )
foreach($this->localtax1 as $localtax_type => $localtax_rate)
{
if (in_array((string) $localtax_type, array('1','3','5'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
foreach($localtax_rate as $tvakey => $tvaval)
{
if ($tvakey!=0) // On affiche pas taux 0
{
@@ -923,13 +923,13 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -941,10 +941,10 @@ class pdf_einstein extends ModelePDFCommandes
//Local tax 2 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
foreach($this->localtax2 as $localtax_type => $localtax_rate)
{
if (in_array((string) $localtax_type, array('1','3','5'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
foreach($localtax_rate as $tvakey => $tvaval)
{
if ($tvakey!=0) // On affiche pas taux 0
{
@@ -956,13 +956,13 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -982,13 +982,13 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$totalvat =$outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' ';
$totalvat.=vatrate($tvakey, 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -999,11 +999,11 @@ class pdf_einstein extends ModelePDFCommandes
//Local tax 1 after VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
foreach( $this->localtax1 as $localtax_type => $localtax_rate )
foreach($this->localtax1 as $localtax_type => $localtax_rate)
{
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
foreach($localtax_rate as $tvakey => $tvaval)
{
if ($tvakey != 0) // On affiche pas taux 0
{
@@ -1013,14 +1013,14 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
@@ -1031,11 +1031,11 @@ class pdf_einstein extends ModelePDFCommandes
//Local tax 2 after VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
foreach($this->localtax2 as $localtax_type => $localtax_rate)
{
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
foreach($localtax_rate as $tvakey => $tvaval)
{
if ($tvakey != 0) // On affiche pas taux 0
{
@@ -1045,14 +1045,14 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -1065,8 +1065,8 @@ class pdf_einstein extends ModelePDFCommandes
// Total TTC
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(224,224,224);
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFillColor(224, 224, 224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -1074,7 +1074,7 @@ class pdf_einstein extends ModelePDFCommandes
}
}
$pdf->SetTextColor(0,0,0);
$pdf->SetTextColor(0, 0, 0);
$creditnoteamount=0;
$depositsamount=0;
@@ -1095,16 +1095,16 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0);
$index++;
$pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(224,224,224);
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFillColor(224, 224, 224);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetTextColor(0, 0, 0);
}
$index++;
@@ -1136,31 +1136,31 @@ class pdf_einstein extends ModelePDFCommandes
$default_font_size = pdf_getPDFFontSize($outputlangs);
// Amount in (at tab_top - 1)
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
if (empty($hidetop))
{
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$currency));
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
}
$pdf->SetDrawColor(128,128,128);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetDrawColor(128, 128, 128);
$pdf->SetFont('', '', $default_font_size - 1);
// Output Rect
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
if (empty($hidetop))
{
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
$pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L');
}
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
@@ -1169,7 +1169,7 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($hidetop))
{
$pdf->SetXY($this->posxtva-3, $tab_top+1);
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
$pdf->MultiCell($this->posxup-$this->posxtva+3, 2, $outputlangs->transnoentities("VAT"), '', 'C');
}
}
@@ -1177,7 +1177,7 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($hidetop))
{
$pdf->SetXY($this->posxup-1, $tab_top+1);
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
$pdf->MultiCell($this->posxqty-$this->posxup-1, 2, $outputlangs->transnoentities("PriceUHT"), '', 'C');
}
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
@@ -1186,11 +1186,11 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
}
@@ -1209,7 +1209,7 @@ class pdf_einstein extends ModelePDFCommandes
if ($this->atleastonediscount)
{
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C');
}
}
@@ -1220,7 +1220,7 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($hidetop))
{
$pdf->SetXY($this->postotalht-1, $tab_top+1);
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C');
$pdf->MultiCell(30, 2, $outputlangs->transnoentities("TotalHT"), '', 'C');
}
}
@@ -1243,21 +1243,21 @@ class pdf_einstein extends ModelePDFCommandes
$default_font_size = pdf_getPDFFontSize($outputlangs);
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
// Show Draft Watermark
if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
{
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK);
pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->COMMANDE_DRAFT_WATERMARK);
}
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFont('', 'B', $default_font_size + 3);
$posy=$this->marge_haute;
$posx=$this->page_largeur-$this->marge_droite-100;
$pdf->SetXY($this->marge_gauche,$posy);
$pdf->SetXY($this->marge_gauche, $posy);
// Logo
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO))
@@ -1272,9 +1272,9 @@ class pdf_einstein extends ModelePDFCommandes
}
else
{
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('','B', $default_font_size -2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->SetTextColor(200, 0, 0);
$pdf->SetFont('', 'B', $default_font_size -2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
}
}
@@ -1285,46 +1285,46 @@ class pdf_einstein extends ModelePDFCommandes
}
}
$pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('', 'B', $default_font_size + 3);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$title=$outputlangs->transnoentities($titlekey);
$pdf->MultiCell(100, 3, $title, '', 'R');
$pdf->SetFont('','B',$default_font_size);
$pdf->SetFont('', 'B', $default_font_size);
$posy+=5;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
$posy+=1;
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
if ($object->ref_client)
{
$posy+=5;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R');
}
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R');
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date, "%d %b %Y", false, $outputlangs, true), '', 'R');
// Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
$arrayidcontact=$object->getIdContact('internal', 'SALESREPFOLL');
if (count($arrayidcontact) > 0)
{
$usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]);
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
@@ -1345,7 +1345,7 @@ class pdf_einstein extends ModelePDFCommandes
// Sender properties
$carac_emetteur='';
// Add internal contact of proposal if defined
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
$arrayidcontact=$object->getIdContact('internal', 'SALESREPFOLL');
if (count($arrayidcontact) > 0)
{
$object->fetch_user($arrayidcontact[0]);
@@ -1362,31 +1362,31 @@ class pdf_einstein extends ModelePDFCommandes
$hautcadre=40;
// Show sender frame
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posx,$posy-5);
$pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L');
$pdf->SetXY($posx,$posy);
$pdf->SetFillColor(230,230,230);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx, $posy-5);
$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->SetTextColor(0,0,60);
$pdf->SetTextColor(0, 0, 60);
// Show sender name
$pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B', $default_font_size);
$pdf->SetXY($posx+2, $posy+3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell(80, 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->SetXY($posx+2, $posy);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
// If CUSTOMER contact defined on order, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
$arrayidcontact=$object->getIdContact('external', 'CUSTOMER');
if (count($arrayidcontact) > 0)
{
$usecontact=true;
@@ -1403,7 +1403,7 @@ class pdf_einstein extends ModelePDFCommandes
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,($usecontact?$object->contact:''),$usecontact,'target', $object);
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact?$object->contact:''), $usecontact, 'target', $object);
// Show recipient
$widthrecbox=100;
@@ -1413,26 +1413,26 @@ class pdf_einstein extends ModelePDFCommandes
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
// Show recipient frame
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posx+2,$posy-5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx+2, $posy-5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":", 0, 'L');
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
// Show recipient name
$pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B', $default_font_size);
$pdf->SetXY($posx+2, $posy+3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
$posy = $pdf->getY();
// Show recipient information
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($posx+2,$posy);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetXY($posx+2, $posy);
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
}
$pdf->SetTextColor(0,0,0);
$pdf->SetTextColor(0, 0, 0);
return $top_shift;
}
@@ -1449,6 +1449,6 @@ class pdf_einstein extends ModelePDFCommandes
{
global $conf;
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
return pdf_pagefoot($pdf,$outputlangs,'ORDER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
}
}

View File

@@ -133,7 +133,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// Get source company
$this->emetteur=$mysoc;
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
// Define position of columns
$this->posxdesc=$this->marge_gauche+1;
@@ -195,7 +195,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
if (dol_mkdir($dir) < 0)
{
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
return 0;
}
}
@@ -211,12 +211,12 @@ class pdf_eratosthene extends ModelePDFCommandes
$hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action;
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$pdf->SetAutoPageBreak(1,0);
$pdf->SetAutoPageBreak(1, 0);
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
@@ -237,7 +237,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->Open();
$pagenb=0;
$pdf->SetDrawColor(128,128,128);
$pdf->SetDrawColor(128, 128, 128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("PdfOrderTitle"));
@@ -271,9 +271,9 @@ class pdf_eratosthene extends ModelePDFCommandes
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$pdf->SetTextColor(0, 0, 0);
$tab_top = 90+$top_shift;
@@ -287,13 +287,13 @@ class pdf_eratosthene extends ModelePDFCommandes
{
$tab_top -= 2;
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
$nexY = $pdf->GetY();
$height_incoterms=$nexY-$tab_top;
// Rect prend une longueur en 3eme param
$pdf->SetDrawColor(192,192,192);
$pdf->SetDrawColor(192, 192, 192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
$tab_top = $nexY+6;
@@ -328,7 +328,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->startTransaction();
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
// Description
$pageposafternote=$pdf->getPage();
@@ -353,7 +353,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// back to start
$pdf->setPage($pageposbeforenote);
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$pageposafternote=$pdf->getPage();
@@ -361,7 +361,7 @@ class pdf_eratosthene extends ModelePDFCommandes
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+20))) // There is no space left for total+free text
{
$pdf->AddPage('','',true);
$pdf->AddPage('', '', true);
$pagenb++;
$pageposafternote++;
$pdf->setPage($pageposafternote);
@@ -378,7 +378,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->setPage($i);
$pdf->SetDrawColor(128,128,128);
$pdf->SetDrawColor(128, 128, 128);
// Draw note frame
if($i>$pageposbeforenote){
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
@@ -391,7 +391,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// Add footer
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$this->_pagefoot($pdf,$object,$outputlangs,1);
$this->_pagefoot($pdf, $object, $outputlangs, 1);
$i++;
}
@@ -414,7 +414,7 @@ class pdf_eratosthene extends ModelePDFCommandes
if($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+20)) )
{
// not enough space, need to add page
$pdf->AddPage('','',true);
$pdf->AddPage('', '', true);
$pagenb++;
$pageposafternote++;
$pdf->setPage($pageposafternote);
@@ -438,7 +438,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$nexY = $tab_top + 7;
// Use new auto collum system
$this->prepareArrayColumnField($object,$outputlangs,$hidedetails,$hidedesc,$hideref);
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
// Loop on each lines
$pageposbeforeprintlines=$pdf->getPage();
@@ -446,8 +446,8 @@ class pdf_eratosthene extends ModelePDFCommandes
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0, 0, 0);
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
@@ -461,7 +461,7 @@ class pdf_eratosthene extends ModelePDFCommandes
if($this->getColumnStatus('desc'))
{
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->getColumnContentWidth('desc'),3,$this->getColumnContentXStart('desc'),$curY,$hideref,$hidedesc);
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
@@ -469,14 +469,14 @@ class pdf_eratosthene extends ModelePDFCommandes
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->getColumnContentWidth('desc'),3,$this->getColumnContentXStart('desc'),$curY,$hideref,$hidedesc);
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
{
$pdf->AddPage('','',true);
$pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
//if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1);
@@ -507,14 +507,14 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
}
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
if ($this->getColumnStatus('vat'))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$this->printStdColumnContent($pdf, $curY, 'vat', $vat_rate);
$nexY = max($pdf->GetY(),$nexY);
$nexY = max($pdf->GetY(), $nexY);
}
// Unit price before discount
@@ -522,7 +522,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
$this->printStdColumnContent($pdf, $curY, 'subprice', $up_excl_tax);
$nexY = max($pdf->GetY(),$nexY);
$nexY = max($pdf->GetY(), $nexY);
}
// Quantity
@@ -531,7 +531,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$this->printStdColumnContent($pdf, $curY, 'qty', $qty);
$nexY = max($pdf->GetY(),$nexY);
$nexY = max($pdf->GetY(), $nexY);
}
@@ -540,7 +540,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
$this->printStdColumnContent($pdf, $curY, 'unit', $unit);
$nexY = max($pdf->GetY(),$nexY);
$nexY = max($pdf->GetY(), $nexY);
}
// Discount on line
@@ -548,7 +548,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$this->printStdColumnContent($pdf, $curY, 'discount', $remise_percent);
$nexY = max($pdf->GetY(),$nexY);
$nexY = max($pdf->GetY(), $nexY);
}
// Total HT line
@@ -556,7 +556,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$this->printStdColumnContent($pdf, $curY, 'totalexcltax', $total_excl_tax);
$nexY = max($pdf->GetY(),$nexY);
$nexY = max($pdf->GetY(), $nexY);
}
@@ -569,7 +569,7 @@ class pdf_eratosthene extends ModelePDFCommandes
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails
);
$reshook=$hookmanager->executeHooks('printPDFline',$parameters,$this); // Note that $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printPDFline', $parameters, $this); // Note that $object may have been modified by hook
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
@@ -593,7 +593,7 @@ class pdf_eratosthene extends ModelePDFCommandes
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
{
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$object->thirdparty,$mysoc);
$localtaxtmp_array=getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
@@ -632,7 +632,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
$this->_pagefoot($pdf, $object, $outputlangs, 1);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
@@ -648,7 +648,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
$this->_pagefoot($pdf, $object, $outputlangs, 1);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@@ -701,13 +701,13 @@ class pdf_eratosthene extends ModelePDFCommandes
}
else
{
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
return 0;
}
}
else
{
$this->error=$langs->transnoentities("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR");
$this->error=$langs->transnoentities("ErrorConstantNotDefined", "COMMANDE_OUTPUTDIR");
return 0;
}
}
@@ -739,12 +739,12 @@ class pdf_eratosthene extends ModelePDFCommandes
global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
// If France, show VAT mention if not applicable
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
{
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0);
@@ -756,16 +756,16 @@ class pdf_eratosthene extends ModelePDFCommandes
// Show payments conditions
if ($object->cond_reglement_code || $object->cond_reglement)
{
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':';
$pdf->MultiCell(43, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
$lib_condition_paiement=str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');
$posy=$pdf->GetY()+3;
}
@@ -801,28 +801,28 @@ class pdf_eratosthene extends ModelePDFCommandes
if (! empty($object->date_livraison))
{
$outputlangs->load("sendings");
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("DateDeliveryPlanned").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true);
$dlp=dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy=$pdf->GetY()+1;
}
elseif ($object->availability_code || $object->availability) // Show availability conditions
{
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("AvailabilityPeriod").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_availability=$outputlangs->transnoentities("AvailabilityType".$object->availability_code)!=('AvailabilityType'.$object->availability_code)?$outputlangs->transnoentities("AvailabilityType".$object->availability_code):$outputlangs->convToOutputCharset(isset($object->availability)?$object->availability:'');
$lib_availability=str_replace('\n',"\n",$lib_availability);
$lib_availability=str_replace('\n', "\n", $lib_availability);
$pdf->MultiCell(80, 4, $lib_availability, 0, 'L');
$posy=$pdf->GetY()+1;
@@ -830,22 +830,22 @@ class pdf_eratosthene extends ModelePDFCommandes
// Show payment mode
if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') {
$pdf->SetFont('','B', $default_font_size - 2);
&& $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') {
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
$posy=$pdf->GetY()+2;
}
// Show payment mode CHQ
// Show payment mode CHQ
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
{
// Si mode reglement non force ou si force a CHQ
@@ -857,14 +857,14 @@ class pdf_eratosthene extends ModelePDFCommandes
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
$pdf->SetFont('', 'B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0);
$posy=$pdf->GetY()+1;
if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
{
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','', $default_font_size - 3);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
@@ -872,14 +872,14 @@ class pdf_eratosthene extends ModelePDFCommandes
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
{
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
$pdf->SetFont('', 'B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
$posy=$pdf->GetY()+1;
if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
{
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','', $default_font_size - 3);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
@@ -900,7 +900,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$curx=$this->marge_gauche;
$cury=$posy;
$posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size);
$posy=pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
$posy+=2;
}
@@ -928,7 +928,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$tab2_top = $posy;
$tab2_hl = 4;
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
// Tableau total
$col1x = 120; $col2x = 170;
@@ -942,7 +942,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$index = 0;
// Total HT
$pdf->SetFillColor(255,255,255);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
@@ -951,7 +951,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248,248,248);
$pdf->SetFillColor(248, 248, 248);
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
@@ -968,10 +968,10 @@ class pdf_eratosthene extends ModelePDFCommandes
//Local tax 1 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
foreach( $this->localtax1 as $localtax_type => $localtax_rate )
foreach($this->localtax1 as $localtax_type => $localtax_rate)
{
if (in_array((string) $localtax_type, array('1','3','5'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
foreach($localtax_rate as $tvakey => $tvaval)
{
if ($tvakey!=0) // On affiche pas taux 0
{
@@ -981,13 +981,13 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -999,10 +999,10 @@ class pdf_eratosthene extends ModelePDFCommandes
//Local tax 2 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
foreach($this->localtax2 as $localtax_type => $localtax_rate)
{
if (in_array((string) $localtax_type, array('1','3','5'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
foreach($localtax_rate as $tvakey => $tvaval)
{
if ($tvakey!=0) // On affiche pas taux 0
{
@@ -1014,13 +1014,13 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -1040,13 +1040,13 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$totalvat =$outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' ';
$totalvat.=vatrate($tvakey, 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -1057,11 +1057,11 @@ class pdf_eratosthene extends ModelePDFCommandes
//Local tax 1 after VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
foreach( $this->localtax1 as $localtax_type => $localtax_rate )
foreach($this->localtax1 as $localtax_type => $localtax_rate)
{
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
foreach($localtax_rate as $tvakey => $tvaval)
{
if ($tvakey != 0) // On affiche pas taux 0
{
@@ -1071,14 +1071,14 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
@@ -1089,11 +1089,11 @@ class pdf_eratosthene extends ModelePDFCommandes
//Local tax 2 after VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
foreach($this->localtax2 as $localtax_type => $localtax_rate)
{
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
foreach($localtax_rate as $tvakey => $tvaval)
{
if ($tvakey != 0) // On affiche pas taux 0
{
@@ -1103,14 +1103,14 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -1123,8 +1123,8 @@ class pdf_eratosthene extends ModelePDFCommandes
// Total TTC
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(224,224,224);
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFillColor(224, 224, 224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@@ -1132,7 +1132,7 @@ class pdf_eratosthene extends ModelePDFCommandes
}
}
$pdf->SetTextColor(0,0,0);
$pdf->SetTextColor(0, 0, 0);
$creditnoteamount=0;
$depositsamount=0;
@@ -1153,16 +1153,16 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0);
$index++;
$pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(224,224,224);
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFillColor(224, 224, 224);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetTextColor(0, 0, 0);
}
$index++;
@@ -1194,24 +1194,24 @@ class pdf_eratosthene extends ModelePDFCommandes
$default_font_size = pdf_getPDFFontSize($outputlangs);
// Amount in (at tab_top - 1)
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
if (empty($hidetop))
{
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$currency));
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
}
$pdf->SetDrawColor(128,128,128);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetDrawColor(128, 128, 128);
$pdf->SetFont('', '', $default_font_size - 1);
// Output Rect
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
foreach ($this->cols as $colKey => $colDef)
@@ -1231,7 +1231,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0] );
$textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1];
$pdf->MultiCell($textWidth,2,$colDef['title']['label'],'',$colDef['title']['align']);
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']);
}
}
@@ -1259,21 +1259,21 @@ class pdf_eratosthene extends ModelePDFCommandes
$default_font_size = pdf_getPDFFontSize($outputlangs);
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
// Show Draft Watermark
if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
{
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK);
pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->COMMANDE_DRAFT_WATERMARK);
}
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFont('', 'B', $default_font_size + 3);
$posy=$this->marge_haute;
$posx=$this->page_largeur-$this->marge_droite-100;
$pdf->SetXY($this->marge_gauche,$posy);
$pdf->SetXY($this->marge_gauche, $posy);
// Logo
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO))
@@ -1288,9 +1288,9 @@ class pdf_eratosthene extends ModelePDFCommandes
}
else
{
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('','B', $default_font_size -2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->SetTextColor(200, 0, 0);
$pdf->SetFont('', 'B', $default_font_size -2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
}
}
@@ -1301,46 +1301,46 @@ class pdf_eratosthene extends ModelePDFCommandes
}
}
$pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('', 'B', $default_font_size + 3);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$title=$outputlangs->transnoentities($titlekey);
$pdf->MultiCell(100, 3, $title, '', 'R');
$pdf->SetFont('','B',$default_font_size);
$pdf->SetFont('', 'B', $default_font_size);
$posy+=5;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
$posy+=1;
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
if ($object->ref_client)
{
$posy+=5;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R');
}
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R');
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date, "%d %b %Y", false, $outputlangs, true), '', 'R');
// Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
$arrayidcontact=$object->getIdContact('internal', 'SALESREPFOLL');
if (count($arrayidcontact) > 0)
{
$usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]);
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
@@ -1361,7 +1361,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// Sender properties
$carac_emetteur='';
// Add internal contact of proposal if defined
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
$arrayidcontact=$object->getIdContact('internal', 'SALESREPFOLL');
if (count($arrayidcontact) > 0)
{
$object->fetch_user($arrayidcontact[0]);
@@ -1378,31 +1378,31 @@ class pdf_eratosthene extends ModelePDFCommandes
$hautcadre=40;
// Show sender frame
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posx,$posy-5);
$pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L');
$pdf->SetXY($posx,$posy);
$pdf->SetFillColor(230,230,230);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx, $posy-5);
$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->SetTextColor(0,0,60);
$pdf->SetTextColor(0, 0, 60);
// Show sender name
$pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B', $default_font_size);
$pdf->SetXY($posx+2, $posy+3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell(80, 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->SetXY($posx+2, $posy);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
// If CUSTOMER contact defined on order, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
$arrayidcontact=$object->getIdContact('external', 'CUSTOMER');
if (count($arrayidcontact) > 0)
{
$usecontact=true;
@@ -1419,7 +1419,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,($usecontact?$object->contact:''),$usecontact,'target', $object);
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact?$object->contact:''), $usecontact, 'target', $object);
// Show recipient
$widthrecbox=100;
@@ -1429,26 +1429,26 @@ class pdf_eratosthene extends ModelePDFCommandes
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
// Show recipient frame
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posx+2,$posy-5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx+2, $posy-5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":", 0, 'L');
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
// Show recipient name
$pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B', $default_font_size);
$pdf->SetXY($posx+2, $posy+3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
$posy = $pdf->getY();
// Show recipient information
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($posx+2,$posy);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetXY($posx+2, $posy);
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
}
$pdf->SetTextColor(0,0,0);
$pdf->SetTextColor(0, 0, 0);
return $top_shift;
}
@@ -1465,7 +1465,7 @@ class pdf_eratosthene extends ModelePDFCommandes
{
global $conf;
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
return pdf_pagefoot($pdf,$outputlangs,'ORDER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
}
@@ -1654,7 +1654,7 @@ class pdf_eratosthene extends ModelePDFCommandes
'hideref' => $hideref
);
$reshook=$hookmanager->executeHooks('defineColumnField',$parameters,$this); // Note that $object may have been modified by hook
$reshook=$hookmanager->executeHooks('defineColumnField', $parameters, $this); // Note that $object may have been modified by hook
if ($reshook < 0)
{
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@@ -63,7 +63,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
function info()
{
global $langs;
return $langs->trans("SimpleNumRefModelDesc",$this->prefix);
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
}
@@ -100,9 +100,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes
if ($resql)
{
$row = $db->fetch_row($resql);
if ($row) { $coyymm = substr($row[0],0,6); $max=$row[0]; }
if ($row) { $coyymm = substr($row[0], 0, 6); $max=$row[0]; }
}
if ($coyymm && ! preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$coyymm))
if ($coyymm && ! preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm))
{
$langs->load("errors");
$this->error=$langs->trans('ErrorNumRefModel', $max);
@@ -145,7 +145,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
//$date=time();
$date=$object->date;
$yymm = strftime("%y%m",$date);
$yymm = strftime("%y%m", $date);
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
else $num = sprintf("%04s", $max+1);
@@ -166,6 +166,6 @@ class mod_commande_marbre extends ModeleNumRefCommandes
function commande_get_num($objsoc, $objforref)
{
// phpcs:enable
return $this->getNextValue($objsoc,$objforref);
return $this->getNextValue($objsoc, $objforref);
}
}

View File

@@ -77,15 +77,15 @@ class mod_commande_saphir extends ModeleNumRefCommandes
$texte.= '<input type="hidden" name="maskconstorder" value="COMMANDE_SAPHIR_MASK">';
$texte.= '<table class="nobordernopadding" width="100%">';
$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Order"),$langs->transnoentities("Order"));
$tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("Order"), $langs->transnoentities("Order"));
$tooltip.=$langs->trans("GenericMaskCodes2");
$tooltip.=$langs->trans("GenericMaskCodes3");
$tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Order"),$langs->transnoentities("Order"));
$tooltip.=$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Order"), $langs->transnoentities("Order"));
$tooltip.=$langs->trans("GenericMaskCodes5");
// Parametrage du prefix
$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskorder" value="'.$conf->global->COMMANDE_SAPHIR_MASK.'">',$tooltip,1,1).'</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskorder" value="'.$conf->global->COMMANDE_SAPHIR_MASK.'">', $tooltip, 1, 1).'</td>';
$texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
@@ -110,7 +110,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
$old_code_type=$mysoc->typent_code;
$mysoc->code_client='CCCCCCCCCC';
$mysoc->typent_code='TTTTTTTTTT';
$numExample = $this->getNextValue($mysoc,'');
$numExample = $this->getNextValue($mysoc, '');
$mysoc->code_client=$old_code_client;
$mysoc->typent_code=$old_code_type;
@@ -145,7 +145,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
$date = ($object->date_commande ? $object->date_commande : $object->date);
$numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc,$date);
$numFinal=get_next_value($db, $mask, 'commande', 'ref', '', $objsoc, $date);
return $numFinal;
}
@@ -162,6 +162,6 @@ class mod_commande_saphir extends ModeleNumRefCommandes
function commande_get_num($objsoc, $objforref)
{
// phpcs:enable
return $this->getNextValue($objsoc,$objforref);
return $this->getNextValue($objsoc, $objforref);
}
}