Skip to content

Commit

Permalink
New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE
Browse files Browse the repository at this point in the history
Conflicts:
	ChangeLog

Conflicts:
	ChangeLog
	htdocs/core/modules/commande/doc/pdf_proforma.modules.php
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
	htdocs/core/modules/propale/doc/pdf_azur.modules.php
  • Loading branch information
eldy committed Jan 19, 2014
1 parent 613392f commit cfed6e3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 7 deletions.
16 changes: 14 additions & 2 deletions htdocs/core/modules/commande/doc/pdf_einstein.modules.php
Expand Up @@ -244,12 +244,24 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$tab_height_newpage = 150;

// Affiche notes
if (! empty($object->note_public))
$notetoshow=empty($object->note_public)?'':$object->note_public;
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
{
// Get first sale rep
if (is_object($object->thirdparty))
{
$salereparray=$object->thirdparty->getSalesRepresentatives($user);
$salerepobj=new User($this->db);
$salerepobj->fetch($salereparray[0]['id']);
if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
}
}
if ($notetoshow)
{
$tab_top = 88;

$pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;

Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Expand Up @@ -245,12 +245,24 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$tab_height_newpage = 150;

// Affiche notes
if (! empty($object->note_public))
$notetoshow=empty($object->note_public)?'':$object->note_public;
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
{
// Get first sale rep
if (is_object($object->thirdparty))
{
$salereparray=$object->thirdparty->getSalesRepresentatives($user);
$salerepobj=new User($this->db);
$salerepobj->fetch($salereparray[0]['id']);
if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
}
}
if ($notetoshow)
{
$tab_top = 88;

$pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;

Expand Down
18 changes: 15 additions & 3 deletions htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
Expand Down Expand Up @@ -242,12 +242,24 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$tab_height_newpage = 150;

// Affiche notes
if (! empty($object->note_public))
$notetoshow=empty($object->note_public)?'':$object->note_public;
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
{
// Get first sale rep
if (is_object($object->thirdparty))
{
$salereparray=$object->thirdparty->getSalesRepresentatives($user);
$salerepobj=new User($this->db);
$salerepobj->fetch($salereparray[0]['id']);
if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
}
}
if ($notetoshow)
{
$tab_top = 88;

$pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;

Expand Down

0 comments on commit cfed6e3

Please sign in to comment.