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:
parent
4825448ced
commit
3438305169
@ -178,10 +178,10 @@ abstract class CommonDocGenerator
|
||||
*/
|
||||
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
if (empty($hidetop)) $pdf->line($x, $y, $x+$l, $y);
|
||||
$pdf->line($x+$l, $y, $x+$l, $y+$h);
|
||||
if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
|
||||
$pdf->line($x, $y+$h, $x, $y);
|
||||
if (empty($hidetop)) $pdf->line($x, $y, $x+$l, $y);
|
||||
$pdf->line($x+$l, $y, $x+$l, $y+$h);
|
||||
if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
|
||||
$pdf->line($x, $y+$h, $x, $y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1425,7 +1425,7 @@ class Form
|
||||
|
||||
$opt = '<option value="'.$objp->idprodfournprice.'"';
|
||||
if ($selected && $selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
|
||||
if ($objp->fprice == '') $opt.=' disabled="disabled"';
|
||||
if (empty($objp->idprodfournprice)) $opt.=' disabled="disabled"';
|
||||
$opt.= '>';
|
||||
|
||||
$objRef = $objp->ref;
|
||||
@ -1440,7 +1440,7 @@ class Form
|
||||
$opt.=dol_trunc($objp->label,18).' - ';
|
||||
$outval.=dol_trunc($label,18).' - ';
|
||||
|
||||
if ($objp->fprice != '') // Keep != ''
|
||||
if (! empty($objp->idprodfournprice))
|
||||
{
|
||||
$currencytext=$langs->trans("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
|
||||
// "label" value of json key array is used by jQuery automatically as text for combo box
|
||||
$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++;
|
||||
}
|
||||
@ -2265,70 +2268,70 @@ class Form
|
||||
}
|
||||
|
||||
// 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)) {
|
||||
$formconfirm.= '<p>'.$more.'</p>';
|
||||
}
|
||||
$formconfirm.= img_help('','').' '.$question;
|
||||
$formconfirm.= '</div>';
|
||||
|
||||
$formconfirm.= '<script type="text/javascript">';
|
||||
$formconfirm.='
|
||||
$(function() {
|
||||
$( "#'.$dialogconfirm.'" ).dialog({
|
||||
autoOpen: '.($autoOpen ? "true" : "false").',
|
||||
resizable: false,
|
||||
height: "'.$height.'",
|
||||
width: "'.$width.'",
|
||||
modal: true,
|
||||
closeOnEscape: false,
|
||||
buttons: {
|
||||
"'.dol_escape_js($langs->transnoentities("Yes")).'": function() {
|
||||
var options="";
|
||||
var inputok = '.json_encode($inputok).';
|
||||
var pageyes = "'.dol_escape_js(! empty($pageyes)?$pageyes:'').'";
|
||||
if (inputok.length>0) {
|
||||
$.each(inputok, function(i, inputname) {
|
||||
var more = "";
|
||||
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
|
||||
var inputvalue = $("#" + inputname + more).val();
|
||||
if (typeof inputvalue == "undefined") { inputvalue=""; }
|
||||
options += "&" + inputname + "=" + inputvalue;
|
||||
});
|
||||
}
|
||||
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
|
||||
//alert(urljump);
|
||||
if (pageyes.length > 0) { location.href = urljump; }
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"'.dol_escape_js($langs->transnoentities("No")).'": function() {
|
||||
var options = "";
|
||||
var inputko = '.json_encode($inputko).';
|
||||
var pageno="'.dol_escape_js(! empty($pageno)?$pageno:'').'";
|
||||
if (inputko.length>0) {
|
||||
$.each(inputko, function(i, inputname) {
|
||||
var more = "";
|
||||
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
|
||||
var inputvalue = $("#" + inputname + more).val();
|
||||
if (typeof inputvalue == "undefined") { inputvalue=""; }
|
||||
options += "&" + inputname + "=" + inputvalue;
|
||||
});
|
||||
}
|
||||
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
|
||||
//alert(urljump);
|
||||
if (pageno.length > 0) { location.href = urljump; }
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var button = "'.$button.'";
|
||||
if (button.length > 0) {
|
||||
$( "#" + button ).click(function() {
|
||||
$("#'.$dialogconfirm.'").dialog("open");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$formconfirm.= '<script type="text/javascript">';
|
||||
$formconfirm.='
|
||||
$(function() {
|
||||
$( "#'.$dialogconfirm.'" ).dialog({
|
||||
autoOpen: '.($autoOpen ? "true" : "false").',
|
||||
resizable: false,
|
||||
height: "'.$height.'",
|
||||
width: "'.$width.'",
|
||||
modal: true,
|
||||
closeOnEscape: false,
|
||||
buttons: {
|
||||
"'.dol_escape_js($langs->transnoentities("Yes")).'": function() {
|
||||
var options="";
|
||||
var inputok = '.json_encode($inputok).';
|
||||
var pageyes = "'.dol_escape_js(! empty($pageyes)?$pageyes:'').'";
|
||||
if (inputok.length>0) {
|
||||
$.each(inputok, function(i, inputname) {
|
||||
var more = "";
|
||||
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
|
||||
var inputvalue = $("#" + inputname + more).val();
|
||||
if (typeof inputvalue == "undefined") { inputvalue=""; }
|
||||
options += "&" + inputname + "=" + inputvalue;
|
||||
});
|
||||
}
|
||||
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
|
||||
//alert(urljump);
|
||||
if (pageyes.length > 0) { location.href = urljump; }
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"'.dol_escape_js($langs->transnoentities("No")).'": function() {
|
||||
var options = "";
|
||||
var inputko = '.json_encode($inputko).';
|
||||
var pageno="'.dol_escape_js(! empty($pageno)?$pageno:'').'";
|
||||
if (inputko.length>0) {
|
||||
$.each(inputko, function(i, inputname) {
|
||||
var more = "";
|
||||
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
|
||||
var inputvalue = $("#" + inputname + more).val();
|
||||
if (typeof inputvalue == "undefined") { inputvalue=""; }
|
||||
options += "&" + inputname + "=" + inputvalue;
|
||||
});
|
||||
}
|
||||
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
|
||||
//alert(urljump);
|
||||
if (pageno.length > 0) { location.href = urljump; }
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var button = "'.$button.'";
|
||||
if (button.length > 0) {
|
||||
$( "#" + button ).click(function() {
|
||||
$("#'.$dialogconfirm.'").dialog("open");
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -112,9 +112,9 @@ class CommActionRapport
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
|
||||
@ -117,9 +117,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
|
||||
// Create PDF instance
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
|
||||
@ -141,9 +141,9 @@ class pdf_edison extends ModelePDFCommandes
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -208,10 +208,10 @@ class pdf_edison extends ModelePDFCommandes
|
||||
// Description of product line
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1,$hidedesc,0,$hookmanager);
|
||||
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$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
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
|
||||
@ -177,9 +177,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
|
||||
@ -147,9 +147,9 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format,'mm','l');
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
|
||||
@ -126,9 +126,9 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
|
||||
@ -221,13 +221,13 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
|
||||
//require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
//dol_delete_preview($object);
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('SHIPPING_BUILDDOC',$object,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('SHIPPING_BUILDDOC',$object,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
|
||||
return 1;
|
||||
|
||||
@ -180,7 +180,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -265,16 +265,16 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$curY = $nexY;
|
||||
|
||||
$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
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$curX = $this->posxdesc-1;
|
||||
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->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
|
||||
$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 ($pagenb == 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);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$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->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
@ -166,9 +166,9 @@ class pdf_oursin extends ModelePDFFactures
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
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
|
||||
|
||||
// Positionne $this->atleastonediscount si on a au moins une remise
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
if ($object->lines[$i]->remise_percent)
|
||||
{
|
||||
$this->atleastonediscount++;
|
||||
}
|
||||
// Positionne $this->atleastonediscount si on a au moins une remise
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
if ($object->lines[$i]->remise_percent)
|
||||
{
|
||||
$this->atleastonediscount++;
|
||||
}
|
||||
}
|
||||
|
||||
// New page
|
||||
@ -275,63 +275,63 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$pdf->SetXY($this->marges['g']+168, $curY);
|
||||
$pdf->MultiCell(21, 3, $total_excl_tax, 0, 'R', 0);
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
else
|
||||
{
|
||||
$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 ($pagenb == 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);
|
||||
/*if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 40, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$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))
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs);
|
||||
$nexY = $iniY;
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
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);
|
||||
$nexY = $iniY;
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
}
|
||||
|
||||
// Affiche zone infos
|
||||
|
||||
@ -134,9 +134,9 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -270,38 +270,38 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -225,13 +225,13 @@ function delivery_order_pdf_create($db, $object, $modele, $outputlangs='')
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
dol_delete_preview($object);
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('DELIVERY_BUILDDOC',$object,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('DELIVERY_BUILDDOC',$object,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
|
||||
return 1;
|
||||
|
||||
@ -120,9 +120,9 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
|
||||
@ -142,9 +142,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -288,38 +288,38 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
*/
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
|
||||
@ -77,11 +77,11 @@ class modProduct extends DolibarrModules
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
$this->const[$r][0] = "PRODUCT_CODEPRODUCT_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_codeproduct_leopard";
|
||||
$this->const[$r][3] = 'Module to control product codes';
|
||||
$this->const[$r][4] = 0;
|
||||
$this->const[$r][0] = "PRODUCT_CODEPRODUCT_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_codeproduct_leopard";
|
||||
$this->const[$r][3] = 'Module to control product codes';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "MAIN_SEARCHFORM_PRODUITSERVICE";
|
||||
|
||||
@ -74,19 +74,19 @@ class modSociete extends DolibarrModules
|
||||
// Constantes
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
$this->const[$r][0] = "SOCIETE_CODECLIENT_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_codeclient_leopard";
|
||||
$this->const[$r][3] = 'Module to control third parties codes';
|
||||
|
||||
$this->const[$r][0] = "SOCIETE_CODECLIENT_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_codeclient_leopard";
|
||||
$this->const[$r][3] = 'Module to control third parties codes';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "SOCIETE_CODECOMPTA_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_codecompta_panicum";
|
||||
$this->const[$r][3] = 'Module to control third parties codes';
|
||||
$this->const[$r][4] = 0;
|
||||
$this->const[$r][0] = "SOCIETE_CODECOMPTA_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_codecompta_panicum";
|
||||
$this->const[$r][3] = 'Module to control third parties codes';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "SOCIETE_FISCAL_MONTH_START";
|
||||
|
||||
@ -127,9 +127,9 @@ class pdf_baleine extends ModelePDFProjects
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -227,38 +227,38 @@ class pdf_baleine extends ModelePDFProjects
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
|
||||
@ -163,9 +163,9 @@ class pdf_azur extends ModelePDFPropales
|
||||
|
||||
// Create pdf instance
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -317,38 +317,38 @@ class pdf_azur extends ModelePDFPropales
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
|
||||
@ -163,9 +163,9 @@ class pdf_jaune extends ModelePDFPropales
|
||||
|
||||
// Create pdf instance
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -317,38 +317,38 @@ class pdf_jaune extends ModelePDFPropales
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
|
||||
@ -80,7 +80,7 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
|
||||
$this->code='';
|
||||
|
||||
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:'');
|
||||
}
|
||||
|
||||
|
||||
@ -171,9 +171,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -318,38 +318,38 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
|
||||
@ -188,9 +188,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$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)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@ -337,38 +337,38 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 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);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$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 ($pagenb == 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);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
|
||||
@ -62,7 +62,7 @@ if (! empty($conf->margin->enabled)) {
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array();
|
||||
echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
|
||||
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
// Editor wysiwyg
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$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
|
||||
|
||||
@ -77,7 +77,7 @@ jQuery(document).ready(function() {
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$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
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
{
|
||||
$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);
|
||||
echo $hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
|
||||
$reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
|
||||
}
|
||||
|
||||
// editeur wysiwyg
|
||||
|
||||
@ -193,13 +193,14 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
|
||||
$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');
|
||||
$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_thirdparty() < 0) dol_print_error($db,$object->error);
|
||||
@ -1192,7 +1193,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load('projects');
|
||||
print '<tr><td height="10">';
|
||||
@ -1215,9 +1216,9 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$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
|
||||
// Other attributes
|
||||
$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
|
||||
|
||||
// Ligne de 3 colonnes
|
||||
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
|
||||
@ -1418,7 +1419,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$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
|
||||
@ -1474,13 +1475,13 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$forceall=1;
|
||||
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>';
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array();
|
||||
echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
|
||||
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
$nbrows=ROWS_2;
|
||||
@ -1536,7 +1537,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('htmlname'=>'idprodfournprice');
|
||||
echo $hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
|
||||
$reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
$nbrows=ROWS_2;
|
||||
|
||||
@ -1614,7 +1614,7 @@ else
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$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
|
||||
@ -1750,7 +1750,7 @@ else
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array();
|
||||
echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
|
||||
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
// Editor wysiwyg
|
||||
@ -1812,7 +1812,7 @@ else
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('htmlname'=>'idprodfournprice');
|
||||
echo $hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
|
||||
$reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
$nbrows=ROWS_2;
|
||||
|
||||
@ -291,7 +291,7 @@ if ($id || $ref)
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$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>';
|
||||
|
||||
@ -76,12 +76,12 @@ if ($action == "correct_stock" && ! $cancel)
|
||||
$error++;
|
||||
$action='correction';
|
||||
}
|
||||
if (! GETPOST("nbpiece"))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors');
|
||||
if (! GETPOST("nbpiece"))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors');
|
||||
$error++;
|
||||
$action='correction';
|
||||
}
|
||||
$action='correction';
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -112,21 +112,21 @@ if ($action == "correct_stock" && ! $cancel)
|
||||
// Transfer stock from a warehouse to another warehouse
|
||||
if ($action == "transfert_stock" && ! $cancel)
|
||||
{
|
||||
if (! (GETPOST("id_entrepot_source") > 0) || ! (GETPOST("id_entrepot_destination") > 0))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Warehouse")), 'errors');
|
||||
$error++;
|
||||
$action='transfert';
|
||||
}
|
||||
if (! GETPOST("nbpiece"))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors');
|
||||
$error++;
|
||||
$action='transfert';
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! (GETPOST("id_entrepot_source") > 0) || ! (GETPOST("id_entrepot_destination") > 0))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Warehouse")), 'errors');
|
||||
$error++;
|
||||
$action='transfert';
|
||||
}
|
||||
if (! GETPOST("nbpiece"))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors');
|
||||
$error++;
|
||||
$action='transfert';
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (GETPOST("id_entrepot_source") <> GETPOST("id_entrepot_destination"))
|
||||
{
|
||||
if (is_numeric(GETPOST("nbpiece")) && $id)
|
||||
@ -354,18 +354,18 @@ if ($id > 0 || $ref)
|
||||
*/
|
||||
if ($action == "correction")
|
||||
{
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_price()
|
||||
{
|
||||
if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr(\'disabled\');
|
||||
else jQuery("#unitprice").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_price();
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_price()
|
||||
{
|
||||
if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr(\'disabled\');
|
||||
else jQuery("#unitprice").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_price();
|
||||
jQuery("#mouvement").change(function() {
|
||||
init_price();
|
||||
});
|
||||
});
|
||||
init_price();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
print_titre($langs->trans("StockCorrection"));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user