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
  • Loading branch information
eldy committed Jan 19, 2014
1 parent e96e240 commit f4fe083
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 13 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,7 @@
English Dolibarr ChangeLog
--------------------------------------------------------------


***** ChangeLog for 3.5 compared to 3.4.* *****
For users:
- New: Add hidden option BANK_DISABLE_DIRECT_INPUT.
Expand Down
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/commande/doc/pdf_proforma.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
18 changes: 15 additions & 3 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 Expand Up @@ -378,7 +390,7 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;

$vatrate=(string) $object->lines[$i]->tva_tx;

// Retrieve type from database for backward compatibility with old records
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
Expand Down
24 changes: 18 additions & 6 deletions htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2004-2013 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-2013 Juanjo Menent <jmenent@2byte.es>
Expand Down Expand Up @@ -153,15 +153,15 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$outputlangs->load("products");

$nblignes = count($object->lines);

// Loop on each lines to detect if there is at least one image to show
$realpatharray=array();
if (! empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
{
for ($i = 0 ; $i < $nblignes ; $i++)
{
if (empty($object->lines[$i]->fk_product)) continue;

$objphoto = new Product($this->db);
$objphoto->fetch($object->lines[$i]->fk_product);

Expand All @@ -185,7 +185,7 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
if ($conf->propal->dir_output)
{
$object->fetch_thirdparty();

// $deja_regle = 0;

// Definition of $dir and $file
Expand Down Expand Up @@ -270,12 +270,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 f4fe083

Please sign in to comment.