2
0
forked from Wavyzz/dolibarr

add new rule

This commit is contained in:
Frédéric FRANCE
2020-05-21 15:05:19 +02:00
parent b58060f899
commit b41ac00b98
961 changed files with 9487 additions and 19110 deletions

View File

@@ -204,8 +204,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
{
$dir = $conf->expedition->dir_output."/receipt";
$file = $dir."/SPECIMEN.pdf";
}
else {
} else {
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expedition->dir_output."/receipt/".$objectref;
$file = $dir."/".$objectref.".pdf";
@@ -356,8 +355,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$tab_height = $tab_height - $height_note;
$tab_top = $nexY + 6;
}
else {
} else {
$height_note = 0;
}
@@ -401,16 +399,14 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter + 1);
}
}
else {
} else {
// We found a page break
// Allows data in the first page if description is long enough to break in multiples pages
if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else $showpricebeforepagebreak = 0;
}
}
else // No pagebreak
} else // No pagebreak
{
$pdf->commitTransaction();
}
@@ -485,8 +481,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else {
} else {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf, $object, $outputlangs, 1);
@@ -500,8 +495,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else {
} else {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf, $object, $outputlangs, 1);
@@ -518,8 +512,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
else {
} else {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
@@ -619,8 +612,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$this->result = array('fullpath'=>$file);
return 1; // No error
}
else {
} else {
$this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
return 0;
}
@@ -766,15 +758,13 @@ class pdf_typhon extends ModelePDFDeliveryOrder
{
$height = pdf_getHeightForLogo($logo);
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
}
else {
} else {
$pdf->SetTextColor(200, 0, 0);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
}
}
else $pdf->MultiCell(100, 4, $this->emetteur->name, 0, 'L');
} else $pdf->MultiCell(100, 4, $this->emetteur->name, 0, 'L');
$pdf->SetFont('', 'B', $default_font_size + 2);
$pdf->SetXY($posx, $posy);
@@ -789,8 +779,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if ($object->date_valid)
{
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_delivery, "%d %b %Y", false, $outputlangs, true), '', 'R');
}
else {
} else {
$pdf->SetTextColor(255, 0, 0);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryNotValidated"), '', 'R');
$pdf->SetTextColor(0, 0, 60);

View File

@@ -142,8 +142,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
$obj = $db->fetch_object($resql);
if ($obj) $max = intval($obj->max);
else $max = 0;
}
else {
} else {
return -1;
}