Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: PDF Add option to print rounded corner frames #31172

Merged
merged 104 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
2bf184c
NEW: Add option to enable PDF frame rounded corners
sonikf Sep 27, 2024
f74d83e
NEW: function printRoundedRect
sonikf Sep 27, 2024
dc58d75
NEW PDF frame rounded corners
sonikf Sep 27, 2024
f43c2c8
New add rounded corners in frames
sonikf Sep 27, 2024
8b464c3
New add rounded corners in frames
sonikf Sep 27, 2024
6949c46
Update admin.lang
sonikf Sep 27, 2024
80d93de
fix incoterm frame height
sonikf Sep 27, 2024
0974695
Update pdf_sponge.modules.php
sonikf Sep 27, 2024
014c8dd
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 27, 2024
a2ed0fc
fix pre-commit
sonikf Sep 27, 2024
2926a3d
fix pre-commit
sonikf Sep 27, 2024
2613bf9
fix php-stan (8.2)
sonikf Sep 27, 2024
06cc696
New add rounded corners in frames
sonikf Sep 28, 2024
de65dab
New add rounded corners in frames
sonikf Sep 28, 2024
d99c49f
New add rounded corners in frames
sonikf Sep 28, 2024
f7a8455
fix phan php-stan (8.2) declare property
sonikf Sep 28, 2024
2821cf7
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 28, 2024
9349166
New add rounded corners in frames
sonikf Sep 28, 2024
a32fc78
New add rounded corners in frames
sonikf Sep 28, 2024
80da525
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 28, 2024
721edcd
add phpdoc for corner radius
sonikf Sep 28, 2024
895b10a
New add rounded corners in frames
sonikf Sep 28, 2024
57c9bba
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 28, 2024
36725c3
New add rounded corners in frames
sonikf Sep 28, 2024
8586731
New add rounded corners in frames
sonikf Sep 28, 2024
60ec408
fix php-stan (8.2)
sonikf Sep 28, 2024
e44c609
New add rounded corners in frames
sonikf Sep 28, 2024
4654dde
New add rounded corners in frames
sonikf Sep 28, 2024
9c30190
New add rounded corners in frames
sonikf Sep 28, 2024
163a12e
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 28, 2024
ae59eda
New add rounded corners in frames
sonikf Sep 28, 2024
2540cd2
New add rounded corners in frames
sonikf Sep 28, 2024
d590b20
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 28, 2024
46e6595
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 28, 2024
0f69524
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
eldy Sep 29, 2024
3f4dfea
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 29, 2024
df8da2d
fix whitespace
sonikf Sep 29, 2024
c20deca
New add rounded corners in frames
sonikf Sep 29, 2024
c130b8a
New add rounded corners in frames
sonikf Sep 29, 2024
f8b3fe2
New add rounded corners in frames
sonikf Sep 29, 2024
b4c90bf
New add rounded corners in frames
sonikf Sep 29, 2024
cd25544
New add rounded corners in frames
sonikf Sep 29, 2024
1af3db8
New add rounded corners in frames
sonikf Sep 29, 2024
c37ef46
New add rounded corners in frames
sonikf Sep 29, 2024
da1c915
New add rounded corners in frames
sonikf Sep 29, 2024
1e0378f
New add rounded corners in frames
sonikf Sep 29, 2024
56af0be
New add rounded corners in frames
sonikf Sep 29, 2024
79d4652
New add rounded corners in frames
sonikf Sep 29, 2024
d5fe43f
New add rounded corners in frames
sonikf Sep 29, 2024
4560b40
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
eldy Sep 29, 2024
bc7951e
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
eldy Sep 29, 2024
4799669
New add rounded corners in frames
sonikf Sep 29, 2024
9f3fa5b
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 29, 2024
f5ef922
New add rounded corners in frames
sonikf Sep 29, 2024
7ad279a
New add rounded corners in frames
sonikf Sep 29, 2024
d5a766a
New add rounded corners in frames
sonikf Sep 29, 2024
630505f
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 29, 2024
9958616
New add rounded corners in frames
sonikf Sep 29, 2024
0a19049
New add rounded corners in frames
sonikf Sep 29, 2024
fdd5622
New add rounded corners in frames
sonikf Sep 29, 2024
6b1a5a1
New add rounded corners in frames
sonikf Sep 29, 2024
68d7306
New add rounded corners in frames
sonikf Sep 29, 2024
5676f04
New add rounded corners in frames
sonikf Sep 29, 2024
3e69186
New add rounded corners in frames
sonikf Sep 29, 2024
460a8b9
fix pre-commit empty line
sonikf Sep 29, 2024
4e3773a
fix phan php-stan (8.2)
sonikf Sep 29, 2024
3fca0f7
fix phan php-stan (8.2)
sonikf Sep 29, 2024
2c93c5d
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 29, 2024
8e807fd
fix Travis
sonikf Sep 29, 2024
f459584
fix title color
sonikf Sep 29, 2024
6b7b6fa
fix title color
sonikf Sep 29, 2024
5f5dc73
fix title color
sonikf Sep 29, 2024
84b629f
fix title color
sonikf Sep 29, 2024
815e684
fix title color
sonikf Sep 29, 2024
a5d1dbc
fix title color
sonikf Sep 29, 2024
7453d52
fix title color
sonikf Sep 29, 2024
938e93e
fix title color
sonikf Sep 29, 2024
e080f72
fix title color
sonikf Sep 29, 2024
f598b4b
fix title color
sonikf Sep 29, 2024
0da2e07
fix title color
sonikf Sep 29, 2024
05e6003
fix title color
sonikf Sep 29, 2024
64bb1d8
fix title color
sonikf Sep 29, 2024
5b0b938
fix title color
sonikf Sep 29, 2024
18b3c77
fix title color
sonikf Sep 29, 2024
7bc0627
fix title color
sonikf Sep 29, 2024
9ec92fd
fix title color
sonikf Sep 29, 2024
bb7241b
fix title color
sonikf Sep 29, 2024
9db4d2f
fix title color
sonikf Sep 29, 2024
fb35971
fix title color
sonikf Sep 29, 2024
7cbaae7
fix title color
sonikf Sep 29, 2024
6a7f162
fix phan
sonikf Sep 29, 2024
95420d6
fix phan
sonikf Sep 29, 2024
bbdcd18
fix phan
sonikf Sep 29, 2024
3f2acc9
fix phan
sonikf Sep 29, 2024
5d59c5f
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 30, 2024
bc837d7
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 30, 2024
5a877f2
fix phan phpdoc
sonikf Sep 30, 2024
5c99057
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 30, 2024
072fb45
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Sep 30, 2024
1c58569
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Oct 1, 2024
867c20d
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Oct 3, 2024
821dd69
fix pre-commit
sonikf Oct 3, 2024
b5b31a4
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Oct 3, 2024
f0c387f
Merge branch 'develop' into sonikf-patch-pdf-rounded-corners
sonikf Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions htdocs/admin/pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* Copyright (C) 2012-2107 Juanjo Menent <[email protected]>
* Copyright (C) 2019 Ferran Marcet <[email protected]>
* Copyright (C) 2021-2022 Anthony Berton <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -140,6 +141,9 @@
if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) {
dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOSTINT("MAIN_DOCUMENTS_LOGO_HEIGHT"), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('MAIN_PDF_FRAME_CORNER_RADIUS')) {
dolibarr_set_const($db, "MAIN_PDF_FRAME_CORNER_RADIUS", GETPOSTINT("MAIN_PDF_FRAME_CORNER_RADIUS"), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) {
dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
}
Expand Down Expand Up @@ -516,6 +520,14 @@
print '<input type="text" class="maxwidth50" name="MAIN_DOCUMENTS_LOGO_HEIGHT" value="'.getDolGlobalInt('MAIN_DOCUMENTS_LOGO_HEIGHT', 20).'">';
print '</td></tr>';

// Frame corner radius
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("PDFBoxFrameRoundedCorners"), $langs->trans("MAIN_PDF_FRAME_CORNER_RADIUS"));
print '</td><td>';
$arrval = array('0', '1', '2', '3');
print $form->selectarray("MAIN_PDF_FRAME_CORNER_RADIUS", $arrval, getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0));
print '</td></tr>';

// Show project
if (isModEnabled('project')) {
print '<tr class="oddeven"><td>'.$langs->trans("PDF_SHOW_PROJECT").'</td><td>';
Expand All @@ -525,8 +537,7 @@
print '</td></tr>';
}

//

// Hide customer code
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_HIDE_CUSTOMER_CODE");
print '</td><td>';
if ($conf->use_javascript_ajax) {
Expand All @@ -537,7 +548,7 @@
}
print '</td></tr>';

// Ref
// Hide Ref

print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
if ($conf->use_javascript_ajax) {
Expand Down
34 changes: 34 additions & 0 deletions htdocs/core/class/commondocgenerator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Copyright (C) 2020 Josep Lluís Amador <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Mélina Joum <[email protected]>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -122,9 +123,15 @@ abstract class CommonDocGenerator
*/
public $marge_basse;

/**
* @var int corner radius
*/
public $corner_radius;
sonikf marked this conversation as resolved.
Show resolved Hide resolved

/**
* @var int<0,1> option logo
*/

public $option_logo;
public $option_tva;
public $option_multilang;
Expand Down Expand Up @@ -1109,6 +1116,33 @@ public function printRect($pdf, $x, $y, $l, $h, $hidetop = 0, $hidebottom = 0)
$pdf->line($x, $y + $h, $x, $y);
}

/**
* Print a rounded rectangle on the PDF
*
* @param TCPDF $pdf Object PDF
* @param float $x Abscissa of first point
* @param float $y Ordinate of first point
* @param float $w Width of the rectangle
* @param float $h Height of the rectangle
* @param float $r Corner radius (can be an array for different radii per corner)
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom
* @param string $style Draw style (e.g. 'D' for draw, 'F' for fill, 'DF' for both)
* @return void
*/
public function printRoundedRect($pdf, $x, $y, $w, $h, $r, $hidetop = 0, $hidebottom = 0, $style = 'D')
{
// Top line
if (empty($hidetop) || $hidetop == -1) {
$pdf->RoundedRect($x, $y, $w, $h, $r, '1111', $style);
} else {
// Draw rounded rectangle with hidden top side
$pdf->RoundedRect($x, $y, $w, $h, $r, '0111', $style);
}
if (!empty($hidebottom)) {
$pdf->RoundedRect($x, $y, $w, $h, $r, '1101', $style);
}
}

/**
* uasort callback function to Sort columns fields
Expand Down
20 changes: 13 additions & 7 deletions htdocs/core/modules/action/doc/pdf_standard_actions.class.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004-2012 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
/* Copyright (C) 2004 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004-2012 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -122,6 +123,11 @@ class pdf_standard_actions
*/
public $page_largeur;

/**
* @var int corner radius
*/
public $corner_radius;

/**
* @var array{fullpath:string}
*/
Expand All @@ -146,7 +152,7 @@ public function __construct($db, $month, $year)
$this->date_edition = time();
$this->month = $month;
$this->year = $year;

$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
// Page size for A4 format
$this->type = 'pdf';
$formatarray = pdf_getFormat();
Expand Down Expand Up @@ -424,7 +430,7 @@ private function _pagehead(&$pdf, $outputlangs, $pagenb)

$y = $pdf->GetY() + 2;

$pdf->Rect($this->marge_gauche, $y, ($this->page_largeur - $this->marge_gauche - $this->marge_droite), ($this->page_hauteur - $this->marge_haute - $this->marge_basse));
$pdf->RoundedRect($this->marge_gauche, $y, ($this->page_largeur - $this->marge_gauche - $this->marge_droite), ($this->page_hauteur - $this->marge_haute - $this->marge_basse), $this->corner_radius, '1234', 'D');
$y = $pdf->GetY() + 1;

return $y;
Expand Down
21 changes: 11 additions & 10 deletions htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* Copyright (C) 2015 Marcos García <[email protected]>
* Copyright (C) 2017 Ferran Marcet <[email protected]>
* Copyright (C) 2018-2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -113,7 +114,7 @@ public function __construct($db)
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);

$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
// Get source company
$this->emetteur = $mysoc;
if (empty($this->emetteur->country_code)) {
Expand Down Expand Up @@ -368,10 +369,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
// Draw note frame
if ($i > $pageposbeforenote) {
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
$pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D');
} else {
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
$pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D');
}

// Add footer
Expand All @@ -390,12 +391,12 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
$height_note = $posyafter - $tab_top_newpage;
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
$pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D');
} else { // No pagebreak
$pdf->commitTransaction();
$posyafter = $pdf->GetY();
$height_note = $posyafter - $tab_top;
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
$pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D');


if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
Expand Down Expand Up @@ -761,15 +762,15 @@ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $

//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
$pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
}
}

$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 takes a length in 3rd parameter and 4th parameter
$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter


$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
Expand Down Expand Up @@ -959,7 +960,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output
$pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom").":", 0, 'L');
$pdf->SetXY($posx, $posy);
$pdf->SetFillColor(230, 230, 230);
$pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1);
$pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D');
$pdf->SetTextColor(0, 0, 60);

// Show sender name
Expand Down Expand Up @@ -1011,7 +1012,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output
$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);
$pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D');

// Show recipient name
$pdf->SetXY($posx + 2, $posy + 3);
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/modules/bank/doc/pdf_ban.modules.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <[email protected]>
/* Copyright (C) 2016 Laurent Destailleur <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -78,7 +79,7 @@ public function __construct($db)
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);

$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

Expand Down Expand Up @@ -206,7 +207,7 @@ public function write_file($object, $outputlangs)

// Rect takes a length in 3rd parameter
$pdf->SetDrawColor(192, 192, 192);
$pdf->Rect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
$pdf->RoundedRect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D');

$tab_height -= $height_note;
$tab_top = $nexY + 6;
Expand Down
17 changes: 9 additions & 8 deletions htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <[email protected]>
* Copyright (C) 2020 Josep Lluís Amador <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
/* Copyright (C) 2016 Laurent Destailleur <[email protected]>
* Copyright (C) 2020 Josep Lluís Amador <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -89,7 +90,7 @@ public function __construct($db)
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);

$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

Expand Down Expand Up @@ -238,7 +239,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede

// Rect takes a length in 3rd parameter
$pdf->SetDrawColor(192, 192, 192);
$pdf->Rect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
$pdf->RoundedRect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D');

$tab_height -= $height_note;
$tab_top = $nexY + 6;
Expand Down Expand Up @@ -385,7 +386,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->SetXY($this->marge_gauche, $posY);
$txt = $outputlangs->transnoentitiesnoconv("SEPAFrstOrRecur").' * : ';
$pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L');
$pdf->Rect(80, $posY, 5, 5);
$pdf->RoundedRect(80, $posY, 5, 5, $this->corner_radius, '1234', 'D');
$pdf->SetXY(80, $posY);
if ($object->frstrecur == 'RCUR') {
$pdf->MultiCell(5, 3, 'X', 0, 'L');
Expand All @@ -394,7 +395,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$txt = $langs->transnoentitiesnoconv("ModeRECUR").' '.$langs->transnoentitiesnoconv("or");
$pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L');
$posY += 6;
$pdf->Rect(80, $posY, 5, 5);
$pdf->RoundedRect(80, $posY, 5, 5, $this->corner_radius, '1234', 'D');
$pdf->SetXY(80, $posY);
if ($object->frstrecur == 'FRST') {
$pdf->MultiCell(5, 3, 'X', 0, 'L');
Expand Down
12 changes: 7 additions & 5 deletions htdocs/core/modules/cheque/doc/pdf_blochet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
/* Copyright (C) 2006 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2009-2015 Laurent Destailleur <[email protected]>
* Copyright (C) 2016 Juanjo Menent <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -86,6 +87,7 @@ public function __construct($db)
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);

// Retrieves transmitter
$this->emetteur = $mysoc;
Expand Down Expand Up @@ -286,7 +288,7 @@ public function Header(&$pdf, $page, $pages, $outputlangs)
$pdf->SetXY(114, 15);
$pdf->MultiCell(40, 2, $outputlangs->transnoentities("Signature"), 0, 'L');

$pdf->Rect(9, 14, 192, 35);
$pdf->RoundedRect(9, 14, 192, 35, $this->corner_radius, '1234', 'D');
$pdf->line(9, 19, 112, 19);
$pdf->line(9, 25, 112, 25);
//$pdf->line(9, 31, 201, 31);
Expand All @@ -297,7 +299,7 @@ public function Header(&$pdf, $page, $pages, $outputlangs)

// Number of cheques
$posy = 51;
$pdf->Rect(9, $posy, 192, 6);
$pdf->RoundedRect(9, $posy, 192, 6, $this->corner_radius, '1234', 'D');
$pdf->line(55, $posy, 55, $posy + 6);
$pdf->line(140, $posy, 140, $posy + 6);
$pdf->line(170, $posy, 170, $posy + 6);
Expand Down Expand Up @@ -336,7 +338,7 @@ public function Header(&$pdf, $page, $pages, $outputlangs)
$pdf->MultiCell(20, 2, $outputlangs->transnoentities("Amount"), 0, 'R');
$pdf->line(9, $this->tab_top + 8, 201, $this->tab_top + 8);

$pdf->Rect(9, $this->tab_top, 192, $this->tab_height + 10);
$pdf->RoundedRect(9, $this->tab_top, 192, $this->tab_height + 10, $this->corner_radius, '1234', 'D');
}


Expand Down
Loading
Loading