FIXME: with ajax autocompleter, does not see the products that have no

supplier prices because they can be selected and it creates an error
message.
Fix: Do not make a "print" on "hook methods", just get the result
This commit is contained in:
Regis Houssin 2012-08-17 15:13:10 +02:00
parent 4825448ced
commit 3438305169
31 changed files with 497 additions and 493 deletions

View File

@ -178,10 +178,10 @@ abstract class CommonDocGenerator
*/ */
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
{ {
if (empty($hidetop)) $pdf->line($x, $y, $x+$l, $y); if (empty($hidetop)) $pdf->line($x, $y, $x+$l, $y);
$pdf->line($x+$l, $y, $x+$l, $y+$h); $pdf->line($x+$l, $y, $x+$l, $y+$h);
if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
$pdf->line($x, $y+$h, $x, $y); $pdf->line($x, $y+$h, $x, $y);
} }
} }

View File

@ -1425,7 +1425,7 @@ class Form
$opt = '<option value="'.$objp->idprodfournprice.'"'; $opt = '<option value="'.$objp->idprodfournprice.'"';
if ($selected && $selected == $objp->idprodfournprice) $opt.= ' selected="selected"'; if ($selected && $selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
if ($objp->fprice == '') $opt.=' disabled="disabled"'; if (empty($objp->idprodfournprice)) $opt.=' disabled="disabled"';
$opt.= '>'; $opt.= '>';
$objRef = $objp->ref; $objRef = $objp->ref;
@ -1440,7 +1440,7 @@ class Form
$opt.=dol_trunc($objp->label,18).' - '; $opt.=dol_trunc($objp->label,18).' - ';
$outval.=dol_trunc($label,18).' - '; $outval.=dol_trunc($label,18).' - ';
if ($objp->fprice != '') // Keep != '' if (! empty($objp->idprodfournprice))
{ {
$currencytext=$langs->trans("Currency".$conf->currency); $currencytext=$langs->trans("Currency".$conf->currency);
$currencytextnoent=$langs->transnoentities("Currency".$conf->currency); $currencytextnoent=$langs->transnoentities("Currency".$conf->currency);
@ -1486,7 +1486,10 @@ class Form
// "key" value of json key array is used by jQuery automatically as selected value // "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box // "label" value of json key array is used by jQuery automatically as text for combo box
$outselect.=$opt; $outselect.=$opt;
array_push($outjson,array('key'=>$outkey,'value'=>$outref,'label'=>$outval)); // FIXME don't select with autocomplete
if (! empty($objp->idprodfournprice)) {
array_push($outjson,array('key'=>$outkey,'value'=>$outref,'label'=>$outval));
}
$i++; $i++;
} }
@ -2265,70 +2268,70 @@ class Form
} }
// Show JQuery confirm box. Note that global var $useglobalvars is used inside this template // Show JQuery confirm box. Note that global var $useglobalvars is used inside this template
$formconfirm.= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; $formconfirm.= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
if (! empty($more)) { if (! empty($more)) {
$formconfirm.= '<p>'.$more.'</p>'; $formconfirm.= '<p>'.$more.'</p>';
} }
$formconfirm.= img_help('','').' '.$question; $formconfirm.= img_help('','').' '.$question;
$formconfirm.= '</div>'; $formconfirm.= '</div>';
$formconfirm.= '<script type="text/javascript">'; $formconfirm.= '<script type="text/javascript">';
$formconfirm.=' $formconfirm.='
$(function() { $(function() {
$( "#'.$dialogconfirm.'" ).dialog({ $( "#'.$dialogconfirm.'" ).dialog({
autoOpen: '.($autoOpen ? "true" : "false").', autoOpen: '.($autoOpen ? "true" : "false").',
resizable: false, resizable: false,
height: "'.$height.'", height: "'.$height.'",
width: "'.$width.'", width: "'.$width.'",
modal: true, modal: true,
closeOnEscape: false, closeOnEscape: false,
buttons: { buttons: {
"'.dol_escape_js($langs->transnoentities("Yes")).'": function() { "'.dol_escape_js($langs->transnoentities("Yes")).'": function() {
var options=""; var options="";
var inputok = '.json_encode($inputok).'; var inputok = '.json_encode($inputok).';
var pageyes = "'.dol_escape_js(! empty($pageyes)?$pageyes:'').'"; var pageyes = "'.dol_escape_js(! empty($pageyes)?$pageyes:'').'";
if (inputok.length>0) { if (inputok.length>0) {
$.each(inputok, function(i, inputname) { $.each(inputok, function(i, inputname) {
var more = ""; var more = "";
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; } if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
var inputvalue = $("#" + inputname + more).val(); var inputvalue = $("#" + inputname + more).val();
if (typeof inputvalue == "undefined") { inputvalue=""; } if (typeof inputvalue == "undefined") { inputvalue=""; }
options += "&" + inputname + "=" + inputvalue; options += "&" + inputname + "=" + inputvalue;
}); });
} }
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options; var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
//alert(urljump); //alert(urljump);
if (pageyes.length > 0) { location.href = urljump; } if (pageyes.length > 0) { location.href = urljump; }
$(this).dialog("close"); $(this).dialog("close");
}, },
"'.dol_escape_js($langs->transnoentities("No")).'": function() { "'.dol_escape_js($langs->transnoentities("No")).'": function() {
var options = ""; var options = "";
var inputko = '.json_encode($inputko).'; var inputko = '.json_encode($inputko).';
var pageno="'.dol_escape_js(! empty($pageno)?$pageno:'').'"; var pageno="'.dol_escape_js(! empty($pageno)?$pageno:'').'";
if (inputko.length>0) { if (inputko.length>0) {
$.each(inputko, function(i, inputname) { $.each(inputko, function(i, inputname) {
var more = ""; var more = "";
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; } if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
var inputvalue = $("#" + inputname + more).val(); var inputvalue = $("#" + inputname + more).val();
if (typeof inputvalue == "undefined") { inputvalue=""; } if (typeof inputvalue == "undefined") { inputvalue=""; }
options += "&" + inputname + "=" + inputvalue; options += "&" + inputname + "=" + inputvalue;
}); });
} }
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options; var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
//alert(urljump); //alert(urljump);
if (pageno.length > 0) { location.href = urljump; } if (pageno.length > 0) { location.href = urljump; }
$(this).dialog("close"); $(this).dialog("close");
} }
} }
}); });
var button = "'.$button.'"; var button = "'.$button.'";
if (button.length > 0) { if (button.length > 0) {
$( "#" + button ).click(function() { $( "#" + button ).click(function() {
$("#'.$dialogconfirm.'").dialog("open"); $("#'.$dialogconfirm.'").dialog("open");
}); });
} }
}); });
</script>'; </script>';
} }
else else

View File

@ -112,9 +112,9 @@ class CommActionRapport
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {

View File

@ -117,9 +117,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
// Create PDF instance // Create PDF instance
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {

View File

@ -141,9 +141,9 @@ class pdf_edison extends ModelePDFCommandes
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -208,10 +208,10 @@ class pdf_edison extends ModelePDFCommandes
// Description of product line // Description of product line
pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1,$hidedesc,0,$hookmanager); pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1,$hidedesc,0,$hookmanager);
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore); $pdf->setPage($pageposbefore);
$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.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();

View File

@ -177,9 +177,9 @@ class pdf_einstein extends ModelePDFCommandes
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {

View File

@ -147,9 +147,9 @@ class pdf_expedition_merou extends ModelePdfExpedition
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format,'mm','l'); $pdf=pdf_getInstance($this->format,'mm','l');
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {

View File

@ -126,9 +126,9 @@ class pdf_expedition_rouget extends ModelePdfExpedition
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {

View File

@ -221,13 +221,13 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
//require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); //require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
//dol_delete_preview($object); //dol_delete_preview($object);
// Appel des triggers // Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('SHIPPING_BUILDDOC',$object,$user,$langs,$conf); $result=$interface->run_triggers('SHIPPING_BUILDDOC',$object,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $this->errors=$interface->errors; $error++; $this->errors=$interface->errors;
} }
// Fin appel triggers // Fin appel triggers
return 1; return 1;

View File

@ -180,7 +180,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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,16 +265,16 @@ class pdf_crabe extends ModelePDFFactures
$curY = $nexY; $curY = $nexY;
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$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
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$curX = $this->posxdesc-1; $curX = $this->posxdesc-1;
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(); $pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore); $pdf->setPage($pageposbefore);
$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.
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
@ -351,19 +351,19 @@ class pdf_crabe extends ModelePDFFactures
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); else
// New page {
$pdf->AddPage(); $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); }
$pagenb++; $this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
} }
} }
@ -951,7 +951,7 @@ class pdf_crabe extends ModelePDFFactures
} }
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
// Output Rect // Output Rect
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param

View File

@ -166,9 +166,9 @@ class pdf_oursin extends ModelePDFFactures
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -196,13 +196,13 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
// Positionne $this->atleastonediscount si on a au moins une remise // Positionne $this->atleastonediscount si on a au moins une remise
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
{ {
if ($object->lines[$i]->remise_percent) if ($object->lines[$i]->remise_percent)
{ {
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
// New page // New page
@ -275,63 +275,63 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY($this->marges['g']+168, $curY); $pdf->SetXY($this->marges['g']+168, $curY);
$pdf->MultiCell(21, 3, $total_excl_tax, 0, 'R', 0); $pdf->MultiCell(21, 3, $total_excl_tax, 0, 'R', 0);
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs, 0, 1); $this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); else
$pagenb++; {
$pdf->setPage($pagenb); $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++;
$pdf->setPage($pagenb);
} }
/*if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) /*if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs, 0, 1); $this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); else
// New page {
$pdf->AddPage(); $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, 0, $outputlangs, 1, 1);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); }
$pagenb++; $this->_pagefoot($pdf,$object,$outputlangs);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
}*/ }*/
if (($nexY > 200 && $i < $nblignes - 1) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)) if (($nexY > 200 && $i < $nblignes - 1) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs);
$nexY = $iniY; $nexY = $iniY;
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager); $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
} }
} }
// Show square // Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1; $bottomlasttab=$tab_top + $tab_height + 1;
} }
else else
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs, 1, 0); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs, 1, 0);
$bottomlasttab=$tab_top + $tab_height + 1; $bottomlasttab=$tab_top + $tab_height + 1;
} }
// Affiche zone infos // Affiche zone infos

View File

@ -134,9 +134,9 @@ class pdf_soleil extends ModelePDFFicheinter
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -270,38 +270,38 @@ class pdf_soleil extends ModelePDFFicheinter
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$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.
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
} }
} }
} }

View File

@ -225,13 +225,13 @@ function delivery_order_pdf_create($db, $object, $modele, $outputlangs='')
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
dol_delete_preview($object); dol_delete_preview($object);
// Appel des triggers // Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('DELIVERY_BUILDDOC',$object,$user,$langs,$conf); $result=$interface->run_triggers('DELIVERY_BUILDDOC',$object,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $this->errors=$interface->errors; $error++; $this->errors=$interface->errors;
} }
// Fin appel triggers // Fin appel triggers
return 1; return 1;

View File

@ -120,9 +120,9 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {

View File

@ -142,9 +142,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -288,38 +288,38 @@ class pdf_typhon extends ModelePDFDeliveryOrder
*/ */
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$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.
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
} }
} }
// Show square // Show square

View File

@ -77,11 +77,11 @@ class modProduct extends DolibarrModules
$this->const = array(); $this->const = array();
$r=0; $r=0;
$this->const[$r][0] = "PRODUCT_CODEPRODUCT_ADDON"; $this->const[$r][0] = "PRODUCT_CODEPRODUCT_ADDON";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_codeproduct_leopard"; $this->const[$r][2] = "mod_codeproduct_leopard";
$this->const[$r][3] = 'Module to control product codes'; $this->const[$r][3] = 'Module to control product codes';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "MAIN_SEARCHFORM_PRODUITSERVICE"; $this->const[$r][0] = "MAIN_SEARCHFORM_PRODUITSERVICE";

View File

@ -74,19 +74,19 @@ class modSociete extends DolibarrModules
// Constantes // Constantes
$this->const = array(); $this->const = array();
$r=0; $r=0;
$this->const[$r][0] = "SOCIETE_CODECLIENT_ADDON"; $this->const[$r][0] = "SOCIETE_CODECLIENT_ADDON";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_codeclient_leopard"; $this->const[$r][2] = "mod_codeclient_leopard";
$this->const[$r][3] = 'Module to control third parties codes'; $this->const[$r][3] = 'Module to control third parties codes';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "SOCIETE_CODECOMPTA_ADDON"; $this->const[$r][0] = "SOCIETE_CODECOMPTA_ADDON";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_codecompta_panicum"; $this->const[$r][2] = "mod_codecompta_panicum";
$this->const[$r][3] = 'Module to control third parties codes'; $this->const[$r][3] = 'Module to control third parties codes';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "SOCIETE_FISCAL_MONTH_START"; $this->const[$r][0] = "SOCIETE_FISCAL_MONTH_START";

View File

@ -127,9 +127,9 @@ class pdf_baleine extends ModelePDFProjects
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -227,38 +227,38 @@ class pdf_baleine extends ModelePDFProjects
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$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.
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
} }
} }
// Show square // Show square

View File

@ -163,9 +163,9 @@ class pdf_azur extends ModelePDFPropales
// Create pdf instance // Create pdf instance
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -317,38 +317,38 @@ class pdf_azur extends ModelePDFPropales
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$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.
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
} }
} }
// Show square // Show square

View File

@ -163,9 +163,9 @@ class pdf_jaune extends ModelePDFPropales
// Create pdf instance // Create pdf instance
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -317,38 +317,38 @@ class pdf_jaune extends ModelePDFPropales
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$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.
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
} }
} }
// Show square // Show square

View File

@ -80,7 +80,7 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
$this->code=''; $this->code='';
if (is_object($societe)) { if (is_object($societe)) {
if ($type == 'supplier') $this->code = (! empty($societe->code_compta_fournisseur)?$societe->code_compta_fournisseur:''); if ($type == 'supplier') $this->code = (! empty($societe->code_compta_fournisseur)?$societe->code_compta_fournisseur:'');
else $this->code = (! empty($societe->code_compta)?$societe->code_compta:''); else $this->code = (! empty($societe->code_compta)?$societe->code_compta:'');
} }

View File

@ -171,9 +171,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -318,38 +318,38 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$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.
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
} }
} }
// Show square // Show square

View File

@ -188,9 +188,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin) $heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) $heightforfooter = 25; // 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'))
{ {
@ -337,38 +337,38 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$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.
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 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->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
} }
} }
// Show square // Show square

View File

@ -62,7 +62,7 @@ if (! empty($conf->margin->enabled)) {
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array(); $parameters=array();
echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
} }
// Editor wysiwyg // Editor wysiwyg

View File

@ -42,7 +42,7 @@
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('line'=>$line,'fk_parent_line'=>$line->fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); $parameters=array('line'=>$line,'fk_parent_line'=>$line->fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
echo $hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
} }
// editeur wysiwyg // editeur wysiwyg

View File

@ -77,7 +77,7 @@ jQuery(document).ready(function() {
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]); $parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]);
echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
} }
// Editor wysiwyg // Editor wysiwyg

View File

@ -52,7 +52,7 @@
{ {
$fk_parent_line = ($_POST["fk_parent_line"] ? $_POST["fk_parent_line"] : $line->fk_parent_line); $fk_parent_line = ($_POST["fk_parent_line"] ? $_POST["fk_parent_line"] : $line->fk_parent_line);
$parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
echo $hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
} }
// editeur wysiwyg // editeur wysiwyg

View File

@ -193,13 +193,14 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
$error = true; $error = true;
} }
if ((! isset($_POST['qty']) || $_POST['qty'] == '')) if (empty($_POST['idprodfournprice']) && (! isset($_POST['qty']) || $_POST['qty'] == '')
|| ! empty($_POST['idprodfournprice']) && (! isset($_POST['pqty']) || $_POST['pqty'] == ''))
{ {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true; $error = true;
} }
if (!$error && (($_POST['qty'] || $_POST['pqty']) && (($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprodfournprice']))) if (! $error && (($_POST['qty'] || $_POST['pqty']) && (($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprodfournprice'])))
{ {
if ($object->fetch($id) < 0) dol_print_error($db,$object->error); if ($object->fetch($id) < 0) dol_print_error($db,$object->error);
if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error); if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error);
@ -1192,7 +1193,7 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
$langs->load('projects'); $langs->load('projects');
print '<tr><td height="10">'; print '<tr><td height="10">';
@ -1215,9 +1216,9 @@ if ($id > 0 || ! empty($ref))
print '</tr>'; print '</tr>';
} }
// Other attributes // Other attributes
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
// Ligne de 3 colonnes // Ligne de 3 colonnes
print '<tr><td>'.$langs->trans("AmountHT").'</td>'; print '<tr><td>'.$langs->trans("AmountHT").'</td>';
@ -1418,7 +1419,7 @@ if ($id > 0 || ! empty($ref))
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i); $parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i);
echo $hookmanager->executeHooks('formEditProductOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$object,$action);
} }
// Description - Editor wysiwyg // Description - Editor wysiwyg
@ -1474,13 +1475,13 @@ if ($id > 0 || ! empty($ref))
$forceall=1; $forceall=1;
print $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,0,$forceall); print $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,0,$forceall);
if ($forceall || ($conf->product->enabled && $conf->service->enabled) if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|| (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>'; || (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>';
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array(); $parameters=array();
echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
} }
$nbrows=ROWS_2; $nbrows=ROWS_2;
@ -1536,7 +1537,7 @@ if ($id > 0 || ! empty($ref))
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('htmlname'=>'idprodfournprice'); $parameters=array('htmlname'=>'idprodfournprice');
echo $hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
} }
$nbrows=ROWS_2; $nbrows=ROWS_2;

View File

@ -1614,7 +1614,7 @@ else
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$object->lines[$i],'var'=>$var,'num'=>$num,'i'=>$i); $parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$object->lines[$i],'var'=>$var,'num'=>$num,'i'=>$i);
echo $hookmanager->executeHooks('formEditProductOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$object,$action);
} }
// Description - Editor wysiwyg // Description - Editor wysiwyg
@ -1750,7 +1750,7 @@ else
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array(); $parameters=array();
echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
} }
// Editor wysiwyg // Editor wysiwyg
@ -1812,7 +1812,7 @@ else
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('htmlname'=>'idprodfournprice'); $parameters=array('htmlname'=>'idprodfournprice');
echo $hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
} }
$nbrows=ROWS_2; $nbrows=ROWS_2;

View File

@ -291,7 +291,7 @@ if ($id || $ref)
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$product->id); $parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$product->id);
echo $hookmanager->executeHooks('formCreateThirdpartyOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateThirdpartyOptions',$parameters,$object,$action);
} }
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -76,12 +76,12 @@ if ($action == "correct_stock" && ! $cancel)
$error++; $error++;
$action='correction'; $action='correction';
} }
if (! GETPOST("nbpiece")) if (! GETPOST("nbpiece"))
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors');
$error++; $error++;
$action='correction'; $action='correction';
} }
if (! $error) if (! $error)
{ {
@ -112,21 +112,21 @@ if ($action == "correct_stock" && ! $cancel)
// Transfer stock from a warehouse to another warehouse // Transfer stock from a warehouse to another warehouse
if ($action == "transfert_stock" && ! $cancel) if ($action == "transfert_stock" && ! $cancel)
{ {
if (! (GETPOST("id_entrepot_source") > 0) || ! (GETPOST("id_entrepot_destination") > 0)) if (! (GETPOST("id_entrepot_source") > 0) || ! (GETPOST("id_entrepot_destination") > 0))
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Warehouse")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Warehouse")), 'errors');
$error++; $error++;
$action='transfert'; $action='transfert';
} }
if (! GETPOST("nbpiece")) if (! GETPOST("nbpiece"))
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors');
$error++; $error++;
$action='transfert'; $action='transfert';
} }
if (! $error) if (! $error)
{ {
if (GETPOST("id_entrepot_source") <> GETPOST("id_entrepot_destination")) if (GETPOST("id_entrepot_source") <> GETPOST("id_entrepot_destination"))
{ {
if (is_numeric(GETPOST("nbpiece")) && $id) if (is_numeric(GETPOST("nbpiece")) && $id)
@ -354,18 +354,18 @@ if ($id > 0 || $ref)
*/ */
if ($action == "correction") if ($action == "correction")
{ {
print '<script type="text/javascript" language="javascript"> print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
function init_price() function init_price()
{ {
if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr(\'disabled\'); if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr(\'disabled\');
else jQuery("#unitprice").attr(\'disabled\',\'disabled\'); else jQuery("#unitprice").attr(\'disabled\',\'disabled\');
} }
init_price(); init_price();
jQuery("#mouvement").change(function() { jQuery("#mouvement").change(function() {
init_price(); init_price();
}); });
}); });
</script>'; </script>';
print_titre($langs->trans("StockCorrection")); print_titre($langs->trans("StockCorrection"));