Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
bacc8991b3
13
ChangeLog
13
ChangeLog
@ -7,11 +7,11 @@ English Dolibarr ChangeLog
|
|||||||
For users:
|
For users:
|
||||||
- New: [ task #289 ] Can reorder tasks.
|
- New: [ task #289 ] Can reorder tasks.
|
||||||
- New: Add field "signature" into thirdparty card. If filled, text is added
|
- New: Add field "signature" into thirdparty card. If filled, text is added
|
||||||
at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this
|
at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this
|
||||||
feature is disabled.
|
feature is disabled.
|
||||||
- New: Add link "Back to list" on all cards.
|
- New: Add link "Back to list" on all cards.
|
||||||
- New: After first install, warning are visible onto mandatory setup not
|
- New: After first install, warning are visible onto mandatory setup not
|
||||||
configured. Show also total number of activated modules.
|
configured. Show also total number of activated modules.
|
||||||
- New: Can filter list of proposal, order or invoice on sales representative.
|
- New: Can filter list of proposal, order or invoice on sales representative.
|
||||||
- New: Add supplier ref on supplier orders.
|
- New: Add supplier ref on supplier orders.
|
||||||
- New: Can export supplier orders.
|
- New: Can export supplier orders.
|
||||||
@ -25,10 +25,10 @@ For users:
|
|||||||
- New: Can edit and resiliate member status from list.
|
- New: Can edit and resiliate member status from list.
|
||||||
- New: Can insert URL links into elements lines. Also reported into PDF.
|
- New: Can insert URL links into elements lines. Also reported into PDF.
|
||||||
- New: When a member is validated, we can subscribe to mailing-lists
|
- New: When a member is validated, we can subscribe to mailing-lists
|
||||||
according to its type.
|
according to its type.
|
||||||
- New: Add link to third party into sells and purchase journal.
|
- New: Add link to third party into sells and purchase journal.
|
||||||
- New: Suggest a method to generate a backup file for user with no access
|
- New: Suggest a method to generate a backup file for user with no access
|
||||||
to mysqldump binary.
|
to mysqldump binary.
|
||||||
- New: Can use extrafields on contacts/addresses.
|
- New: Can use extrafields on contacts/addresses.
|
||||||
- New: Support unique field for extrafields.
|
- New: Support unique field for extrafields.
|
||||||
- New: Extra fields supports more types (int, string, double, date, datetime).
|
- New: Extra fields supports more types (int, string, double, date, datetime).
|
||||||
@ -57,7 +57,8 @@ For users:
|
|||||||
- New: Added ODT Template tag {object_total_discount}
|
- New: Added ODT Template tag {object_total_discount}
|
||||||
- New: Add new import options: Third parties bank details, warehouses and stocks, categories and suppliers prices
|
- New: Add new import options: Third parties bank details, warehouses and stocks, categories and suppliers prices
|
||||||
- New: English bank account need a bank code (called sort code) to identify an account.
|
- New: English bank account need a bank code (called sort code) to identify an account.
|
||||||
|
- New: Add hidden option MAIN_PDF_MARGIN_LEFT, MAIN_PDF_MARGIN_RIGHT, MAIN_PDF_MARGIN_TOP, MAIN_PDF_MARGIN_BOTTOM
|
||||||
|
to force margins of generated PDF.
|
||||||
New experimental modules:
|
New experimental modules:
|
||||||
- New: Add margin management module.
|
- New: Add margin management module.
|
||||||
- New: Add commissions management module.
|
- New: Add commissions management module.
|
||||||
|
|||||||
@ -148,10 +148,11 @@ cui hai bisogno ed essere facile da usare.
|
|||||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
|
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
|
||||||
%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
|
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
|
||||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version}
|
|
||||||
desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop
|
|
||||||
%endif
|
|
||||||
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
|
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
|
||||||
|
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version}
|
||||||
|
#Commented as it fails with error: /usr/bin/install: cannot stat build/rpm/dolibarr.desktop: No such file or directory
|
||||||
|
#desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop --vendor=""
|
||||||
|
%endif
|
||||||
|
|
||||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/build/rpm
|
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/build/rpm
|
||||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||||
|
|||||||
@ -949,7 +949,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
else if (($action == 'addline' || $action == 'addline_predef') && $user->rights->facture->creer)
|
else if (($action == 'addline' || $action == 'addline_predef') && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
$error = false;
|
$error = 0;
|
||||||
|
|
||||||
$idprod=GETPOST('idprod', 'int');
|
$idprod=GETPOST('idprod', 'int');
|
||||||
$product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):'')));
|
$product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):'')));
|
||||||
@ -959,12 +959,12 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
|||||||
if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && (GETPOST('qty') < 0))
|
if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && (GETPOST('qty') < 0))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
|
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
|
||||||
$error = true;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($idprod) && GETPOST('type') < 0)
|
if (empty($idprod) && GETPOST('type') < 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
|
||||||
$error = true;
|
$error++;
|
||||||
}
|
}
|
||||||
if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
|
if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
|
||||||
{
|
{
|
||||||
@ -974,12 +974,12 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
|||||||
if (! GETPOST('qty') && GETPOST('qty') == '')
|
if (! GETPOST('qty') && GETPOST('qty') == '')
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
|
||||||
$error = true;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($idprod) && empty($product_desc))
|
if (empty($idprod) && empty($product_desc))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
|
||||||
$error = true;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod)))
|
if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod)))
|
||||||
|
|||||||
@ -798,7 +798,6 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
|
|||||||
$labelproductservice=pdf_getlinedesc($object,$i,$outputlangs,$hideref,$hidedesc,$issupplierline);
|
$labelproductservice=pdf_getlinedesc($object,$i,$outputlangs,$hideref,$hidedesc,$issupplierline);
|
||||||
// Description
|
// Description
|
||||||
$pdf->writeHTMLCell($w, $h, $posx, $posy, $outputlangs->convToOutputCharset($labelproductservice), 0, 1);
|
$pdf->writeHTMLCell($w, $h, $posx, $posy, $outputlangs->convToOutputCharset($labelproductservice), 0, 1);
|
||||||
|
|
||||||
return $labelproductservice;
|
return $labelproductservice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,12 @@ class CommActionRapport
|
|||||||
var $title;
|
var $title;
|
||||||
var $subject;
|
var $subject;
|
||||||
|
|
||||||
|
var $marge_gauche;
|
||||||
|
var $marge_droite;
|
||||||
|
var $marge_haute;
|
||||||
|
var $marge_basse;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -51,7 +57,7 @@ class CommActionRapport
|
|||||||
*/
|
*/
|
||||||
function __construct($db, $month, $year)
|
function __construct($db, $month, $year)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf,$langs;
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@ -66,10 +72,10 @@ class CommActionRapport
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=5;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=5;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->title=$langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
$this->title=$langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
||||||
$this->subject=$langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
$this->subject=$langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
||||||
@ -113,7 +119,8 @@ class CommActionRapport
|
|||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
|
|||||||
@ -60,10 +60,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=20;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
// Recupere emmetteur
|
// Recupere emmetteur
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
@ -116,7 +116,8 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
// Create PDF instance
|
// Create PDF instance
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
|
|||||||
@ -78,10 +78,10 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo
|
$this->option_logo = 1; // Affiche logo
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
@ -98,7 +98,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (! $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
|
// Define position of columns
|
||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
@ -126,13 +126,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
/**
|
/**
|
||||||
* Function to build pdf onto disk
|
* Function to build pdf onto disk
|
||||||
*
|
*
|
||||||
* @param int $object Id of object to generate
|
* @param Object $object Object to generate
|
||||||
* @param object $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
* @param int $hidedesc Do not show desc
|
* @param int $hidedesc Do not show desc
|
||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @param object $hookmanager Hookmanager object
|
* @param object $hookmanager Hookmanager object
|
||||||
* @return int 1=OK, 0=KO
|
* @return int 1=OK, 0=KO
|
||||||
*/
|
*/
|
||||||
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||||
@ -184,9 +184,11 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
{
|
{
|
||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
// Create pdf instance
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part (value include bottom margin)
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -273,12 +275,45 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
|
|
||||||
|
$showpricebeforepagebreak=1;
|
||||||
|
|
||||||
|
$pdf->startTransaction();
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
$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,0,$hookmanager);
|
||||||
|
$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);
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||||
|
$pdf->setPage($pagenb+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We found a page break
|
||||||
|
$showpricebeforepagebreak=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // No pagebreak
|
||||||
|
{
|
||||||
|
$pdf->commitTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
@ -287,7 +322,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
if ($pageposafter > $pageposbefore) {
|
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
|
||||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -388,13 +423,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Affiche zone infos
|
||||||
@ -819,7 +854,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
* @param string $tab_height Height of table (rectangle)
|
* @param string $tab_height Height of table (rectangle)
|
||||||
* @param int $nexY Y (not used)
|
* @param int $nexY Y (not used)
|
||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @param int $hidetop Hide top bar of array
|
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -56,10 +56,10 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = round($formatarray['height']/2);
|
$this->page_hauteur = round($formatarray['height']/2);
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1;
|
$this->option_logo = 1;
|
||||||
|
|
||||||
@ -148,7 +148,8 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
|
|
||||||
$pdf=pdf_getInstance($this->format,'mm','l');
|
$pdf=pdf_getInstance($this->format,'mm','l');
|
||||||
$heightforinfotot = 0; // Height reserved to output the info and total part
|
$heightforinfotot = 0; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 28; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -281,13 +282,13 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
|
|||||||
@ -55,10 +55,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1;
|
$this->option_logo = 1;
|
||||||
|
|
||||||
@ -134,7 +134,8 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 0; // Height reserved to output the info and total part
|
$heightforinfotot = 0; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -236,7 +237,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description de la ligne produit
|
// Description de la ligne produit
|
||||||
@ -301,13 +302,13 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext - $heightforinfotot, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfreetext - $heightforinfotot + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext - $heightforinfotot, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfreetext - $heightforinfotot + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
@ -541,8 +542,9 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
{
|
{
|
||||||
// Sender properties
|
// Sender properties
|
||||||
$carac_emetteur='';
|
$carac_emetteur='';
|
||||||
// Add internal contact of proposal if defined
|
// Add internal contact of origin element if defined
|
||||||
$arrayidcontact=$object->$origin->getIdContact('internal','SALESREPFOLL');
|
$arrayidcontact=array();
|
||||||
|
if (! empty($origin) && is_object($object->$origin)) $arrayidcontact=$object->$origin->getIdContact('internal','SALESREPFOLL');
|
||||||
if (count($arrayidcontact) > 0)
|
if (count($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$object->fetch_user($arrayidcontact[0]);
|
$object->fetch_user($arrayidcontact[0]);
|
||||||
|
|||||||
@ -157,8 +157,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
'line_price_ht'=>price($line->total_ht, 0, $outputlangs),
|
'line_price_ht'=>price($line->total_ht, 0, $outputlangs),
|
||||||
'line_price_ttc'=>price($line->total_ttc, 0, $outputlangs),
|
'line_price_ttc'=>price($line->total_ttc, 0, $outputlangs),
|
||||||
'line_price_vat'=>price($line->total_tva, 0, $outputlangs),
|
'line_price_vat'=>price($line->total_tva, 0, $outputlangs),
|
||||||
'line_date_start'=>$line->date_start,
|
'line_date_start'=>dol_print_date($line->date_start, 'day', false, $outputlangs),
|
||||||
'line_date_end'=>$line->date_end
|
'line_date_end'=>dol_print_date($line->date_end, 'day', false, $outputlangs),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,7 +381,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make substitutions into odt of user info
|
// Make substitutions into odt of user info
|
||||||
$tmparray=$this->get_substitutionarray_user($user,$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);
|
||||||
|
|
||||||
|
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet);
|
||||||
|
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||||
|
|
||||||
//var_dump($tmparray); exit;
|
//var_dump($tmparray); exit;
|
||||||
foreach($tmparray as $key=>$value)
|
foreach($tmparray as $key=>$value)
|
||||||
{
|
{
|
||||||
@ -400,66 +407,6 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Make substitutions into odt of mysoc
|
|
||||||
$tmparray=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
|
|
||||||
//var_dump($tmparray); exit;
|
|
||||||
foreach($tmparray as $key=>$value)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (preg_match('/logo$/',$key)) // Image
|
|
||||||
{
|
|
||||||
//var_dump($value);exit;
|
|
||||||
if (file_exists($value)) $odfHandler->setImage($key, $value);
|
|
||||||
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
|
|
||||||
}
|
|
||||||
else // Text
|
|
||||||
{
|
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(OdfException $e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Make substitutions into odt of thirdparty
|
|
||||||
$tmparray=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
|
|
||||||
foreach($tmparray as $key=>$value)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (preg_match('/logo$/',$key)) // Image
|
|
||||||
{
|
|
||||||
if (file_exists($value)) $odfHandler->setImage($key, $value);
|
|
||||||
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
|
|
||||||
}
|
|
||||||
else // Text
|
|
||||||
{
|
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(OdfException $e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Replace tags of object + external modules
|
|
||||||
$tmparray=$this->get_substitutionarray_object($object,$outputlangs);
|
|
||||||
complete_substitutions_array($tmparray, $outputlangs, $object);
|
|
||||||
foreach($tmparray as $key=>$value)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (preg_match('/logo$/',$key)) // Image
|
|
||||||
{
|
|
||||||
if (file_exists($value)) $odfHandler->setImage($key, $value);
|
|
||||||
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
|
|
||||||
}
|
|
||||||
else // Text
|
|
||||||
{
|
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(OdfException $e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Replace tags of lines
|
// Replace tags of lines
|
||||||
try
|
try
|
||||||
|
|||||||
@ -78,10 +78,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo
|
$this->option_logo = 1; // Affiche logo
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
@ -187,7 +187,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -252,8 +253,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
//print $pdf->getStringHeight(200,'SPECIMEN',false,false);
|
|
||||||
//print "$this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1";exit;
|
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_height = $tab_height - $height_note;
|
||||||
@ -276,12 +275,47 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
|
|
||||||
|
$showpricebeforepagebreak=1;
|
||||||
|
|
||||||
|
$pdf->startTransaction();
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
$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,0,$hookmanager);
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$posyafter=$pdf->GetY();
|
||||||
|
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
|
||||||
|
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);
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||||
|
$pdf->setPage($pagenb+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We found a page break
|
||||||
|
$showpricebeforepagebreak=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // No pagebreak
|
||||||
|
{
|
||||||
|
$pdf->commitTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
@ -290,7 +324,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
if ($pageposafter > $pageposbefore) {
|
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
|
||||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,13 +424,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Affiche zone infos
|
||||||
@ -466,14 +500,18 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$tab3_top = $posy + 8;
|
$tab3_top = $posy + 8;
|
||||||
$tab3_width = 80;
|
$tab3_width = 80;
|
||||||
$tab3_height = 4;
|
$tab3_height = 4;
|
||||||
|
if ($this->page_largeur < 210) // To work with US executive format
|
||||||
|
{
|
||||||
|
$tab3_posx -= 20;
|
||||||
|
}
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('','', $default_font_size - 3);
|
||||||
$pdf->SetXY($tab3_posx, $tab3_top - 5);
|
$pdf->SetXY($tab3_posx, $tab3_top - 4);
|
||||||
$pdf->MultiCell(60, 5, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
|
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
|
||||||
|
|
||||||
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
|
$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top);
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 4);
|
$pdf->SetFont('','', $default_font_size - 4);
|
||||||
$pdf->SetXY($tab3_posx, $tab3_top);
|
$pdf->SetXY($tab3_posx, $tab3_top);
|
||||||
@ -485,6 +523,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetXY($tab3_posx+58, $tab3_top);
|
$pdf->SetXY($tab3_posx+58, $tab3_top);
|
||||||
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
|
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
|
||||||
|
|
||||||
|
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
|
||||||
|
|
||||||
$y=0;
|
$y=0;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 4);
|
$pdf->SetFont('','', $default_font_size - 4);
|
||||||
|
|||||||
@ -71,10 +71,10 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo
|
$this->option_logo = 1; // Affiche logo
|
||||||
$this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION
|
||||||
@ -141,7 +141,8 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -249,7 +250,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
@ -310,12 +311,12 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -64,10 +64,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
@ -151,7 +151,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -251,7 +252,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot-50); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
@ -344,12 +345,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,10 +62,10 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
@ -128,7 +128,8 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -265,13 +266,13 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -77,10 +77,10 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo
|
$this->option_logo = 1; // Affiche logo
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
@ -97,7 +97,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (! $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
|
// Define position of columns
|
||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
@ -186,7 +186,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Create pdf instance
|
// Create pdf instance
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -234,10 +235,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_middlepage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_middlepage = 200;
|
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
// Affiche notes
|
// Affiche notes
|
||||||
@ -274,7 +273,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
@ -283,7 +282,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$showpricebeforepagebreak=1;
|
$showpricebeforepagebreak=1;
|
||||||
|
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
{
|
{
|
||||||
@ -293,7 +292,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$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,0,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
if ($pageposafter == $pageposbefore) // There is no pagebreak after second try with small margin
|
$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
|
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||||
{
|
{
|
||||||
@ -332,31 +332,31 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
||||||
$pdf->SetXY($this->posxtva, $curY);
|
$pdf->SetXY($this->posxtva, $curY);
|
||||||
$pdf->MultiCell($this->posxup-$this->posxtva-1, 4, $vat_rate, 0, 'R');
|
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unit price before discount
|
// Unit price before discount
|
||||||
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
||||||
$pdf->SetXY($this->posxup, $curY);
|
$pdf->SetXY($this->posxup, $curY);
|
||||||
$pdf->MultiCell($this->posxqty-$this->posxup-1, 4, $up_excl_tax, 0, 'R', 0);
|
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0);
|
||||||
|
|
||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 4, $qty, 0, 'R');
|
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); // Enough for 6 chars
|
||||||
|
|
||||||
// Discount on line
|
// Discount on line
|
||||||
$pdf->SetXY($this->posxdiscount, $curY);
|
|
||||||
if ($object->lines[$i]->remise_percent)
|
if ($object->lines[$i]->remise_percent)
|
||||||
{
|
{
|
||||||
|
$pdf->SetXY($this->posxdiscount-2, $curY);
|
||||||
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
||||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 4, $remise_percent, 0, 'R');
|
$pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total HT line
|
// Total HT line
|
||||||
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
||||||
$pdf->SetXY($this->postotalht, $curY);
|
$pdf->SetXY($this->postotalht, $curY);
|
||||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 4, $total_excl_tax, 0, 'R', 0);
|
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
|
||||||
|
|
||||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
||||||
$tvaligne=$object->lines[$i]->total_tva;
|
$tvaligne=$object->lines[$i]->total_tva;
|
||||||
@ -421,13 +421,13 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Affiche zone infos
|
||||||
@ -489,7 +489,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
* Show payments table
|
* Show payments table
|
||||||
*
|
*
|
||||||
* @param PDF &$pdf Object PDF
|
* @param PDF &$pdf Object PDF
|
||||||
* @param Object $object Object invoice
|
* @param Object $object Object proposal
|
||||||
* @param int $posy Position y in PDF
|
* @param int $posy Position y in PDF
|
||||||
* @param Translate $outputlangs Object langs for output
|
* @param Translate $outputlangs Object langs for output
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
@ -560,7 +560,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show payments conditions
|
// Show payments conditions
|
||||||
if (empty($conf->global->PROPALE_PDF_HIDE_PAYMENTERMCOND) && ($object->cond_reglement_code || $object->cond_reglement))
|
if (empty($conf->global->PROPALE_PDF_HIDE_PAYMENTTERMCOND) && ($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);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
@ -576,7 +576,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$posy=$pdf->GetY()+3;
|
$posy=$pdf->GetY()+3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->PROPALE_PDF_HIDE_PAYMENTERMCOND))
|
if (empty($conf->global->PROPALE_PDF_HIDE_PAYMENTTERMCOND))
|
||||||
{
|
{
|
||||||
// Check a payment mode is defined
|
// Check a payment mode is defined
|
||||||
/* Not required on a proposal
|
/* Not required on a proposal
|
||||||
@ -696,6 +696,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||||
|
|
||||||
|
$useborder=0;
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
|
||||||
// Total HT
|
// Total HT
|
||||||
@ -704,7 +705,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + $object->remise), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
|
||||||
|
|
||||||
// Show VAT by rates and total
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248,248,248);
|
||||||
@ -757,9 +758,9 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), $useborder, 'L', 1);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total LocalTax2
|
// Total LocalTax2
|
||||||
@ -767,9 +768,9 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), $useborder, 'L', 1);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -792,7 +793,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$tvakey=str_replace('*','',$tvakey);
|
$tvakey=str_replace('*','',$tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
|
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
|
||||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -820,7 +821,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$tvakey=str_replace('*','',$tvakey);
|
$tvakey=str_replace('*','',$tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
|
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
|
||||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -832,8 +833,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$useborder=0;
|
|
||||||
|
|
||||||
// Total TTC
|
// Total TTC
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
@ -888,7 +887,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1);
|
||||||
|
|
||||||
// Fin
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
}
|
}
|
||||||
@ -903,9 +901,9 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
* @param PDF &$pdf Object PDF
|
* @param PDF &$pdf Object PDF
|
||||||
* @param string $tab_top Top position of table
|
* @param string $tab_top Top position of table
|
||||||
* @param string $tab_height Height of table (rectangle)
|
* @param string $tab_height Height of table (rectangle)
|
||||||
* @param int $nexY Y
|
* @param int $nexY Y (not used)
|
||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @param int $hidetop Hide top bar of array
|
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -51,10 +51,10 @@ class pdf_paiement
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->tab_top = 30;
|
$this->tab_top = 30;
|
||||||
|
|
||||||
|
|||||||
@ -77,10 +77,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo
|
$this->option_logo = 1; // Affiche logo
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
@ -185,7 +185,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -271,7 +272,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
@ -376,13 +377,13 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone totaux
|
// Affiche zone totaux
|
||||||
@ -738,14 +739,18 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$tab3_top = $posy + 8;
|
$tab3_top = $posy + 8;
|
||||||
$tab3_width = 80;
|
$tab3_width = 80;
|
||||||
$tab3_height = 4;
|
$tab3_height = 4;
|
||||||
|
if ($this->page_largeur < 210) // To work with US executive format
|
||||||
|
{
|
||||||
|
$tab3_posx -= 20;
|
||||||
|
}
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('','', $default_font_size - 3);
|
||||||
$pdf->SetXY($tab3_posx, $tab3_top - 5);
|
$pdf->SetXY($tab3_posx, $tab3_top - 4);
|
||||||
$pdf->MultiCell(60, 5, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
|
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
|
||||||
|
|
||||||
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
|
$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top);
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 4);
|
$pdf->SetFont('','', $default_font_size - 4);
|
||||||
$pdf->SetXY($tab3_posx, $tab3_top);
|
$pdf->SetXY($tab3_posx, $tab3_top);
|
||||||
@ -757,6 +762,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetXY($tab3_posx+58, $tab3_top);
|
$pdf->SetXY($tab3_posx+58, $tab3_top);
|
||||||
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
|
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
|
||||||
|
|
||||||
|
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
|
||||||
|
|
||||||
$y=0;
|
$y=0;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 4);
|
$pdf->SetFont('','', $default_font_size - 4);
|
||||||
|
|||||||
@ -80,10 +80,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
$this->marge_gauche=10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute=10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
$this->marge_basse=10;
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo
|
$this->option_logo = 1; // Affiche logo
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
@ -197,7 +197,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
@ -283,7 +284,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
@ -393,13 +394,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Affiche zone infos
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user