forked from Wavyzz/dolibarr
PDF works with us letter format
This commit is contained in:
@@ -56,8 +56,9 @@ class CommActionRapport
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=5;
|
||||
$this->marge_droite=5;
|
||||
|
||||
@@ -55,8 +55,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=20;
|
||||
|
||||
@@ -55,8 +55,9 @@ class pdf_edison extends ModelePDFCommandes
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
|
||||
@@ -59,8 +59,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -799,11 +800,12 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show header of page
|
||||
* \param pdf Objet PDF
|
||||
* \param object Objet commande
|
||||
* \param showaddress 0=no, 1=yes
|
||||
* \param outputlangs Object lang for output
|
||||
* Show header of page
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet commande
|
||||
* @param showaddress 0=no, 1=yes
|
||||
* @param outputlangs Object lang for output
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
{
|
||||
@@ -827,6 +829,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
@@ -854,7 +857,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$title=$outputlangs->transnoentities("Order");
|
||||
$pdf->MultiCell(100, 4, $title, '' , 'R');
|
||||
@@ -862,7 +865,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetFont('','B', $default_font_size + 2);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
|
||||
@@ -870,7 +873,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R');
|
||||
|
||||
|
||||
@@ -53,8 +53,9 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$this->description = $langs->trans("DocumentModelMerou");
|
||||
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 148.5;
|
||||
$this->page_hauteur = 210;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = round($formatarray['height']/2);
|
||||
$this->page_hauteur = $formatarray['width'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
@@ -315,11 +316,12 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
|
||||
|
||||
/**
|
||||
* \brief Show header of page
|
||||
* \param pdf Object PDF
|
||||
* \param object Object invoice
|
||||
* \param showadress 0=no, 1=yes
|
||||
* \param outputlang Object lang for output
|
||||
* Show header of page
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object invoice
|
||||
* @param showadress 0=no, 1=yes
|
||||
* @param outputlang Object lang for output
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $outputlangs)
|
||||
{
|
||||
@@ -335,6 +337,9 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->SENDING_DRAFT_WATERMARK);
|
||||
}
|
||||
|
||||
$posy=$this->marge_haute;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
|
||||
$Xoff = 90;
|
||||
$Yoff = 0;
|
||||
|
||||
|
||||
@@ -51,8 +51,9 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$this->description = $langs->trans("DocumentModelSimple");
|
||||
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -314,6 +315,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
@@ -370,7 +372,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$title=$outputlangs->transnoentities("SendingSheet");
|
||||
$pdf->MultiCell(100, 4, $title, '' , 'R');
|
||||
@@ -379,20 +381,20 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$pdf->SetFont('','', $default_font_size + 2);
|
||||
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
|
||||
|
||||
//Date Expedition
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_delivery,"%d %b %Y",false,$outputlangs,true), '', 'R');
|
||||
|
||||
if (! empty($object->client->code_client))
|
||||
{
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
|
||||
}
|
||||
|
||||
@@ -40,11 +40,24 @@ require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||
|
||||
class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
var $db;
|
||||
var $name;
|
||||
var $description;
|
||||
var $type;
|
||||
|
||||
var $phpmin = array(4,3,0); // Minimum version of PHP required by module
|
||||
var $version = 'dolibarr';
|
||||
|
||||
var $page_largeur;
|
||||
var $page_hauteur;
|
||||
var $format;
|
||||
var $marge_gauche;
|
||||
var $marge_droite;
|
||||
var $marge_haute;
|
||||
var $marge_basse;
|
||||
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -63,8 +76,9 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -411,6 +425,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
/**
|
||||
* Show payments table
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object invoice
|
||||
* @param posy Position y in PDF
|
||||
@@ -533,12 +548,13 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche infos divers
|
||||
* \param pdf Objet PDF
|
||||
* \param object Objet facture
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
* Show other information
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet facture
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@@ -669,13 +685,14 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche le total a payer
|
||||
* \param pdf Objet PDF
|
||||
* \param object Objet facture
|
||||
* \param deja_regle Montant deja regle
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
* Show total to pay
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet facture
|
||||
* @param deja_regle Montant deja regle
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@@ -889,6 +906,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
/**
|
||||
* Affiche la grille des lignes de factures
|
||||
*
|
||||
* @param pdf objet PDF
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
@@ -948,11 +966,12 @@ class pdf_crabe extends ModelePDFFactures
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show header of page
|
||||
* \param pdf Object PDF
|
||||
* \param object Object invoice
|
||||
* \param showaddress 0=no, 1=yes
|
||||
* \param outputlangs Object lang for output
|
||||
* Show header of page
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object invoice
|
||||
* @param showaddress 0=no, 1=yes
|
||||
* @param outputlangs Object lang for output
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
{
|
||||
@@ -976,6 +995,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$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);
|
||||
|
||||
@@ -1002,7 +1022,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
}
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$title=$outputlangs->transnoentities("Invoice");
|
||||
if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement");
|
||||
@@ -1014,7 +1034,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetFont('','B', $default_font_size + 2);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
|
||||
@@ -1028,7 +1048,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$objectreplacing->fetch($objectidnext);
|
||||
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R');
|
||||
}
|
||||
@@ -1038,7 +1058,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$objectreplaced->fetch($object->fk_facture_source);
|
||||
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R');
|
||||
}
|
||||
@@ -1048,20 +1068,20 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$objectreplaced->fetch($object->fk_facture_source);
|
||||
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R');
|
||||
}
|
||||
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : " . dol_print_date($object->date,"day",false,$outputlangs), '', 'R');
|
||||
|
||||
if ($object->type != 2)
|
||||
{
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R');
|
||||
}
|
||||
@@ -1069,7 +1089,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if ($object->client->code_client)
|
||||
{
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
|
||||
}
|
||||
@@ -1087,7 +1107,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefProposal")." : ".$outputlangs->transnoentities($objects[$i]->ref), '', 'R');
|
||||
}
|
||||
@@ -1099,7 +1119,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$text=$objects[$i]->ref;
|
||||
if ($objects[$i]->ref_client) $text.=' ('.$objects[$i]->ref_client.')';
|
||||
|
||||
@@ -64,8 +64,9 @@ class pdf_oursin extends ModelePDFFactures
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
|
||||
@@ -49,8 +49,9 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
|
||||
@@ -55,8 +55,9 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -327,6 +328,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
@@ -387,15 +389,15 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 1);
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 100, 86);
|
||||
$pdf->SetXY($posx, 86);
|
||||
$pdf->MultiCell(100, 2, $outputlangs->transnoentities("Date")." : " . dol_print_date(($object->date_delivery?$object->date_delivery:$date->valid),"day",false,$outputlangs,true), 0, 'R');
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 100, 92);
|
||||
$pdf->SetXY($posx, 92);
|
||||
$pdf->MultiCell(100, 2, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), 0, 'R');
|
||||
|
||||
if ($object->client->code_client)
|
||||
{
|
||||
$posy+=7;
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 100, $posy);
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
|
||||
}
|
||||
@@ -424,7 +426,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
if ($result >= 0)
|
||||
{
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$text=$order->ref;
|
||||
if ($order->ref_client) $text.=' ('.$order->ref_client.')';
|
||||
|
||||
@@ -60,8 +60,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -478,6 +479,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
@@ -501,14 +503,14 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
else $pdf->MultiCell(100, 4, $this->emetteur->name, 0, 'L');
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size + 2);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), '' , 'R');
|
||||
|
||||
$pdf->SetFont('','',$default_font_size + 2);
|
||||
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
if ($object->date_valid)
|
||||
{
|
||||
@@ -524,7 +526,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if ($object->client->code_client)
|
||||
{
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
|
||||
}
|
||||
@@ -553,7 +555,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if ($result >= 0)
|
||||
{
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$text=$order->ref;
|
||||
if ($order->ref_client) $text.=' ('.$order->ref_client.')';
|
||||
@@ -641,11 +643,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page
|
||||
* Need this->emetteur object
|
||||
*
|
||||
* @param pdf PDF factory
|
||||
* @param object Object invoice
|
||||
* @param outputlangs Object lang for output
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@@ -57,8 +57,9 @@ class pdf_baleine extends ModelePDFProjects
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -329,6 +330,7 @@ class pdf_baleine extends ModelePDFProjects
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
@@ -352,17 +354,17 @@ class pdf_baleine extends ModelePDFProjects
|
||||
else $pdf->MultiCell(100, 4, $outputlangs->transnoentities($this->emetteur->name), 0, 'L');
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Project")." ".$outputlangs->convToOutputCharset($object->ref), '' , 'R');
|
||||
$pdf->SetFont('','', $default_font_size + 2);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : " . dol_print_date($object->date_start,'day',false,$outputlangs,true), '', 'R');
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->date_end,'day',false,$outputlangs,true), '', 'R');
|
||||
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
@@ -381,7 +383,7 @@ class pdf_baleine extends ModelePDFProjects
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$posy+=4;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$text=$objects[$i]->ref;
|
||||
if ($objects[$i]->ref_client) $text.=' ('.$objects[$i]->ref_client.')';
|
||||
@@ -394,11 +396,12 @@ class pdf_baleine extends ModelePDFProjects
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page
|
||||
* Need this->emetteur object
|
||||
*
|
||||
* @param pdf PDF factory
|
||||
* @param object Object invoice
|
||||
* @param outputlangs Object lang for output
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@@ -42,8 +42,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param db Handler acces base de donnee
|
||||
* Constructor
|
||||
*
|
||||
* @param db Database access handler
|
||||
*/
|
||||
function pdf_propale_azur($db)
|
||||
{
|
||||
@@ -58,8 +59,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -79,7 +81,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
$this->franchise=!$mysoc->tva_assuj;
|
||||
|
||||
// Recupere emmetteur
|
||||
// Recupere emetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini
|
||||
|
||||
@@ -100,6 +102,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param object Id of object to generate
|
||||
* @param outputlangs Lang output object
|
||||
* @param srctemplatepath Full path of source filename for generator using a template file
|
||||
@@ -155,7 +158,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$nblignes = sizeof($object->lines);
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
// Create pdf instance
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
@@ -409,9 +412,10 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/*
|
||||
* \brief Affiche tableau des versement
|
||||
* \param pdf Objet PDF
|
||||
* \param object Objet propale
|
||||
* Affiche tableau des versement
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet propale
|
||||
*/
|
||||
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@@ -420,12 +424,13 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche infos divers
|
||||
* \param pdf Objet PDF
|
||||
* \param object Objet facture
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
* Affiche infos divers
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet facture
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@@ -570,14 +575,15 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche le total a payer
|
||||
* \param pdf Objet PDF
|
||||
* \param object Objet propale
|
||||
* \param deja_regle Montant deja regle
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
/**
|
||||
* Show total to pay
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet propale
|
||||
* @param deja_regle Montant deja regle
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@@ -783,8 +789,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Affiche la grille des lignes de propales
|
||||
* \param pdf objet PDF
|
||||
* Affiche la grille des lignes de propales
|
||||
*
|
||||
* @param pdf objet PDF
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@@ -843,6 +850,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
|
||||
/**
|
||||
* Show header of document
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object commercial proposal
|
||||
* @param showaddress 0=no, 1=yes
|
||||
@@ -870,6 +878,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
@@ -897,15 +906,15 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
$pdf->SetFont('','B',$default_font_size + 3);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$title=$outputlangs->transnoentities("CommercialProposal");
|
||||
$pdf->MultiCell(100, 4, $title, '' , 'R');
|
||||
|
||||
$pdf->SetFont('','B',$default_font_size + 2);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$posy+=5;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
|
||||
@@ -915,25 +924,25 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
if ($object->ref_client)
|
||||
{
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R');
|
||||
}
|
||||
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$posy+=4;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,"day",false,$outputlangs,true), '', 'R');
|
||||
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$posy+=4;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : " . dol_print_date($object->fin_validite,"day",false,$outputlangs,true), '', 'R');
|
||||
|
||||
if ($object->client->code_client)
|
||||
{
|
||||
$posy+=5;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$posy+=4;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -47,8 +47,9 @@ class pdf_paiement
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
|
||||
@@ -54,8 +54,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -717,6 +718,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
@@ -745,13 +747,13 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
//}
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("SupplierInvoice")." ".$outputlangs->convToOutputCharset($object->ref), '' , 'R');
|
||||
$pdf->SetFont('','', $default_font_size + 2);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
if ($object->date)
|
||||
{
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
@@ -798,8 +800,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$posy=42;
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY(100,$posy-5);
|
||||
$pdf->MultiCell(96, 4, $outputlangs->transnoentities("Supplier").":");
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Supplier").":");
|
||||
//
|
||||
$client = new Societe($this->db);
|
||||
$client->fetch($object->socid);
|
||||
|
||||
@@ -56,8 +56,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
@@ -641,6 +642,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B',$default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
@@ -668,20 +670,20 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
}
|
||||
|
||||
$pdf->SetFont('','B',$default_font_size + 3);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$title=$outputlangs->transnoentities("SupplierOrder");
|
||||
$pdf->MultiCell(100, 4, $title, '' , 'R');
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetFont('','B',$default_font_size + 2);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetFont('','', $default_font_size + 2);
|
||||
$pdf->SetXY(100,$posy);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
if ($object->date_commande)
|
||||
{
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
@@ -728,7 +730,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$posy=42;
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY(100,$posy-5);
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->MultiCell(96, 4, $outputlangs->transnoentities("Supplier").":");
|
||||
//
|
||||
$client = new Societe($this->db);
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
|
||||
|
||||
/**
|
||||
* Return default paper format code
|
||||
* Try to guess default paper format according to language into $langs
|
||||
*
|
||||
* @return string Defautl paper format code
|
||||
*/
|
||||
function dol_getDefaultFormat()
|
||||
@@ -40,6 +41,7 @@ function dol_getDefaultFormat()
|
||||
|
||||
/**
|
||||
* Output content of a file $filename in version of current language (otherwise may use an alternate language)
|
||||
*
|
||||
* @param langs Object language to use for output
|
||||
* @param filename Relative filename to output
|
||||
* @param searchalt 1=Search also in alternative languages
|
||||
@@ -88,8 +90,9 @@ function dol_print_file($langs,$filename,$searchalt=0)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show informations on an object
|
||||
* \param object Objet to show
|
||||
* Show informations on an object
|
||||
*
|
||||
* @param object Objet to show
|
||||
*/
|
||||
function dol_print_object_info($object)
|
||||
{
|
||||
@@ -212,9 +215,10 @@ function dol_print_object_info($object)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return true if email has a domain name that can't be resolved
|
||||
* \param mail adresse email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
|
||||
* \return boolean true if domain email is OK, false if KO
|
||||
* Return true if email has a domain name that can't be resolved
|
||||
*
|
||||
* @param mail adresse email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
|
||||
* @return boolean true if domain email is OK, false if KO
|
||||
*/
|
||||
function isValidMailDomain($mail)
|
||||
{
|
||||
@@ -231,16 +235,17 @@ function isValidMailDomain($mail)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Url string validation
|
||||
* \remarks <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor]
|
||||
* \param url Url
|
||||
* \param http 1: verify http, 0: not verify http
|
||||
* \param pass 1: verify user and pass, 0: not verify user and pass
|
||||
* \param port 1: verify port, 0: not verify port
|
||||
* \param path 1: verify path, 0: not verify path
|
||||
* \param query 1: verify query, 0: not verify query
|
||||
* \param anchor 1: verify anchor, 0: not verify anchor
|
||||
* \return int 1=Check is OK, 0=Check is KO
|
||||
* Url string validation
|
||||
* <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor]
|
||||
*
|
||||
* @param url Url
|
||||
* @param http 1: verify http, 0: not verify http
|
||||
* @param pass 1: verify user and pass, 0: not verify user and pass
|
||||
* @param port 1: verify port, 0: not verify port
|
||||
* @param path 1: verify path, 0: not verify path
|
||||
* @param query 1: verify query, 0: not verify query
|
||||
* @param anchor 1: verify anchor, 0: not verify anchor
|
||||
* @return int 1=Check is OK, 0=Check is KO
|
||||
*/
|
||||
function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
|
||||
{
|
||||
@@ -280,10 +285,11 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Clean an url string
|
||||
* \param url Url
|
||||
* \param http 1: keep http://, 0: remove also http://
|
||||
* \return string Cleaned url
|
||||
* Clean an url string
|
||||
*
|
||||
* @param url Url
|
||||
* @param http 1: keep http://, 0: remove also http://
|
||||
* @return string Cleaned url
|
||||
*/
|
||||
function clean_url($url,$http=1)
|
||||
{
|
||||
@@ -319,8 +325,8 @@ function clean_url($url,$http=1)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return lines of an html table from an array
|
||||
* \remarks Used by array2table function only
|
||||
* Return lines of an html table from an array
|
||||
* Used by array2table function only
|
||||
*/
|
||||
function array2tr($data,$troptions='',$tdoptions=''){
|
||||
$text = '<tr '.$troptions.'>' ;
|
||||
@@ -332,7 +338,7 @@ function array2tr($data,$troptions='',$tdoptions=''){
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return an html table from an array
|
||||
* Return an html table from an array
|
||||
*/
|
||||
function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdoptions=''){
|
||||
$text='' ;
|
||||
@@ -643,6 +649,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
|
||||
/**
|
||||
* Check value
|
||||
*
|
||||
* @param $mask Mask to use
|
||||
* @param $value Value
|
||||
* @return int <0 if KO, 0 if OK
|
||||
@@ -733,6 +740,7 @@ function check_value($mask,$value)
|
||||
|
||||
/**
|
||||
* Convert a binary data to string that represent hexadecimal value
|
||||
*
|
||||
* @param bin Value to convert
|
||||
* @param pad Add 0
|
||||
* @param upper Convert to tupper
|
||||
@@ -751,6 +759,7 @@ function binhex($bin, $pad=false, $upper=false)
|
||||
|
||||
/**
|
||||
* Convert an hexadecimal string into a binary string
|
||||
*
|
||||
* @param hexa Hexadecimal string to convert (example: 'FF')
|
||||
* @return string bin
|
||||
*/
|
||||
@@ -767,6 +776,7 @@ function hexbin($hexa)
|
||||
|
||||
/**
|
||||
* Retourne le numero de la semaine par rapport a une date
|
||||
*
|
||||
* @param time Date au format 'timestamp'
|
||||
* @return int Numero de semaine
|
||||
*/
|
||||
@@ -848,6 +858,7 @@ function numero_semaine($time)
|
||||
|
||||
/**
|
||||
* Convertit une masse d'une unite vers une autre unite
|
||||
*
|
||||
* @param weight float Masse a convertir
|
||||
* @param from_unit int Unite originale en puissance de 10
|
||||
* @param to_unit int Nouvelle unite en puissance de 10
|
||||
@@ -882,6 +893,7 @@ function weight_convert($weight,&$from_unit,$to_unit)
|
||||
|
||||
/**
|
||||
* Save personnal parameter
|
||||
*
|
||||
* @param db Handler database
|
||||
* @param conf Object conf
|
||||
* @param user Object user
|
||||
@@ -947,6 +959,7 @@ function dol_set_user_param($db, $conf, &$user, $tab)
|
||||
|
||||
/**
|
||||
* Returns formated reduction
|
||||
*
|
||||
* @param reduction Reduction percentage
|
||||
* @param langs Output language
|
||||
* @return string Formated reduction
|
||||
@@ -968,8 +981,9 @@ function dol_print_reduction($reduction=0,$langs)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return OS version
|
||||
* \return string OS version
|
||||
* Return OS version
|
||||
*
|
||||
* @return string OS version
|
||||
*/
|
||||
function version_os()
|
||||
{
|
||||
@@ -984,8 +998,9 @@ function version_os()
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return PHP version
|
||||
* \return string PHP version
|
||||
* Return PHP version
|
||||
*
|
||||
* @return string PHP version
|
||||
*/
|
||||
function version_php()
|
||||
{
|
||||
@@ -993,8 +1008,9 @@ function version_php()
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return Dolibarr version
|
||||
* \return string Dolibarr version
|
||||
* Return Dolibarr version
|
||||
*
|
||||
* @return string Dolibarr version
|
||||
*/
|
||||
function version_dolibarr()
|
||||
{
|
||||
@@ -1002,8 +1018,9 @@ function version_dolibarr()
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return web server version
|
||||
* \return string Web server version
|
||||
* Return web server version
|
||||
*
|
||||
* @return string Web server version
|
||||
*/
|
||||
function version_webserver()
|
||||
{
|
||||
@@ -1012,7 +1029,8 @@ function version_webserver()
|
||||
|
||||
|
||||
/**
|
||||
* Return list of activated modules usable for document generation.
|
||||
* Return list of activated modules usable for document generation
|
||||
*
|
||||
* @param $db Database handler
|
||||
* @param $type Type of models (company, invoice, ...)
|
||||
* @param $maxfilenamelength Max length of value to show
|
||||
@@ -1098,6 +1116,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
|
||||
|
||||
/**
|
||||
* This function evaluates a string that should be a valid IPv4
|
||||
*
|
||||
* @return It returns 0 if $ip is not a valid IPv4
|
||||
* It returns 1 if $ip is a valid IPv4 and is a public IP
|
||||
* It returns 2 if $ip is a valid IPv4 and is a private lan IP
|
||||
@@ -1116,6 +1135,7 @@ function is_ip($ip)
|
||||
|
||||
/**
|
||||
* Build a login from lastname, firstname
|
||||
*
|
||||
* @param lastname Lastname
|
||||
* @param firstname Firstname
|
||||
* @return string
|
||||
@@ -1133,6 +1153,7 @@ function dol_buildlogin($lastname,$firstname)
|
||||
|
||||
/**
|
||||
* Return array to use for SoapClient constructor
|
||||
*
|
||||
* @return param
|
||||
*/
|
||||
function getSoapParams()
|
||||
|
||||
@@ -38,12 +38,12 @@ function pdf_getFormat()
|
||||
// Default value if setup was not done and/or entry into c_paper_format not defined
|
||||
$width=210; $height=297; $unit='mm';
|
||||
|
||||
$pdfformat=$conf->global->MAIN_PDF_FORMAT;
|
||||
if (empty($pdfformat))
|
||||
if (empty($conf->global->MAIN_PDF_FORMAT))
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/functions2.lib.php');
|
||||
$pdfformat=dol_getDefaultFormat();
|
||||
}
|
||||
else $pdfformat=$conf->global->MAIN_PDF_FORMAT;
|
||||
|
||||
$sql="SELECT code, label, width, height, unit FROM ".MAIN_DB_PREFIX."c_paper_format";
|
||||
$sql.=" WHERE code = '".$pdfformat."'";
|
||||
@@ -53,8 +53,8 @@ function pdf_getFormat()
|
||||
$obj=$db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
$width=$obj->width;
|
||||
$height=$obj->height;
|
||||
$width=(int) $obj->width;
|
||||
$height=(int) $obj->height;
|
||||
$unit=$obj->unit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user