Fix: Error management
This commit is contained in:
parent
f6d9b2abe3
commit
13ef8491b7
@ -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)))
|
||||||
|
|||||||
@ -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,8 +184,9 @@ 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);
|
||||||
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= 5; // Height reserved to output the free text on last page
|
$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)
|
$heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
@ -279,7 +280,40 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
// 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();
|
||||||
|
if ($pageposafter == $pageposbefore) // There is no pagebreak after second try with small margin
|
||||||
|
{
|
||||||
|
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();
|
||||||
@ -288,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -820,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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -253,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;
|
||||||
@ -282,7 +280,40 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
// 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();
|
||||||
|
if ($pageposafter == $pageposbefore) // There is no pagebreak after second try with small margin
|
||||||
|
{
|
||||||
|
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();
|
||||||
@ -291,7 +322,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,14 +498,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);
|
||||||
@ -486,6 +521,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);
|
||||||
|
|||||||
@ -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;
|
||||||
@ -235,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
|
||||||
@ -284,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
|
||||||
{
|
{
|
||||||
@ -333,31 +331,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;
|
||||||
@ -490,7 +488,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
|
||||||
@ -561,7 +559,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);
|
||||||
@ -577,7 +575,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
|
||||||
@ -697,6 +695,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
|
||||||
@ -705,7 +704,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);
|
||||||
@ -758,9 +757,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
|
||||||
@ -768,9 +767,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
|
||||||
@ -793,7 +792,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);
|
||||||
|
|
||||||
@ -821,7 +820,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);
|
||||||
|
|
||||||
@ -833,8 +832,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);
|
||||||
@ -889,7 +886,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);
|
||||||
}
|
}
|
||||||
@ -904,9 +900,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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -739,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);
|
||||||
@ -758,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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user