Merge pull request #11328 from fappels/clean_10_beta
Fix scrutinizer bugs
This commit is contained in:
commit
60e1e89981
@ -1647,7 +1647,7 @@ class Contrat extends CommonObject
|
||||
// if buy price not defined, define buyprice as configured in margin admin
|
||||
if ($this->pa_ht == 0)
|
||||
{
|
||||
if (($result = $this->defineBuyPrice($pu_ht, $remise_percent)) < 0)
|
||||
if (($result = $this->defineBuyPrice($pu, $remise_percent)) < 0)
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -116,7 +116,6 @@ class modTcpdfbarcode extends ModeleBarCode
|
||||
|
||||
$_GET["code"]=$code;
|
||||
$_GET["type"]=$encoding;
|
||||
$_GET["height"]=$height;
|
||||
$_GET["readable"]=$readable;
|
||||
|
||||
if ($code) {
|
||||
@ -166,7 +165,6 @@ class modTcpdfbarcode extends ModeleBarCode
|
||||
|
||||
$_GET["code"]=$code;
|
||||
$_GET["type"]=$encoding;
|
||||
$_GET["height"]=$height;
|
||||
$_GET["readable"]=$readable;
|
||||
|
||||
if ($code) {
|
||||
|
||||
@ -501,9 +501,9 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$posy=$this->tablePayments($pdf, $object, $posy_start_of_totals, $outputlangs);
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
// Page footer
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPage();
|
||||
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
||||
|
||||
$pdf->Close();
|
||||
|
||||
@ -1024,6 +1024,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
$totalpaid = 0;
|
||||
$i=0;
|
||||
while ($i < $num) {
|
||||
$y+=$tab3_height;
|
||||
|
||||
@ -154,7 +154,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
||||
$widthtouse = $maxwidthtouse;
|
||||
$heighttouse = $maxheighttouse;
|
||||
$logoHeight = $heighttouse;
|
||||
$logoWidth = $heighttouse;
|
||||
$logoWidth = $widthtouse;
|
||||
|
||||
//var_dump($this->_Width.'x'.$this->_Height.' with border and scale '.$imgscale.' => max '.$maxwidthtouse.'x'.$maxheighttouse.' => We use '.$widthtouse.'x'.$heighttouse);exit;
|
||||
|
||||
@ -175,9 +175,11 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
||||
}
|
||||
elseif ($textleft!='' && $textright!='') // left and right part
|
||||
{
|
||||
$logoHeight = $heighttouse/2;
|
||||
$logoWidth = $widthtouse/2;
|
||||
if (($textleft == '%LOGO%' || $textleft == '%PHOTO%' || $textleft == '%BARCODE%') && !strstr($textright, '%') ) // left part logo/barcode right part text
|
||||
{
|
||||
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, 0);
|
||||
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $logoWidth, 0);
|
||||
elseif ($code && !empty($encoding))
|
||||
{
|
||||
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, $heighttouse);
|
||||
@ -187,7 +189,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
||||
}
|
||||
elseif (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) // right part logo/barcode left part text
|
||||
{
|
||||
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, 0);
|
||||
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $logoWidth, 0);
|
||||
elseif ($code && !empty($encoding))
|
||||
{
|
||||
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, $heighttouse);
|
||||
@ -203,7 +205,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
||||
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft+$logoWidth+1, $_PosY+$ytop, $widthtouse-$logoWidth-1, $heighttouse);
|
||||
} else {
|
||||
$pdf->SetXY($_PosX+$xleft+$logoWidth+1, $_PosY+$ytop);
|
||||
$pdf->MultiCell($widthtouse-$logoWidth1-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R');
|
||||
$pdf->MultiCell($widthtouse-$logoWidth-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R');
|
||||
}
|
||||
}
|
||||
elseif ($textright == '%LOGO%') // right part logo left part text/barcode
|
||||
|
||||
@ -1398,6 +1398,8 @@ class Expedition extends CommonObject
|
||||
$this->total_localtax1 = 0;
|
||||
$this->total_localtax2 = 0;
|
||||
|
||||
$line = new ExpeditionLigne($this->db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
@ -2562,8 +2564,6 @@ class ExpeditionLigne extends CommonObjectLine
|
||||
$this->error = 'ErrorMandatoryParametersNotProvided';
|
||||
return -1;
|
||||
}
|
||||
// Clean parameters
|
||||
if (empty($this->entrepot_id)) $this->entrepot_id='null';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -2574,7 +2574,7 @@ class ExpeditionLigne extends CommonObjectLine
|
||||
$sql.= ", qty";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= $this->fk_expedition;
|
||||
$sql.= ", ".$this->entrepot_id;
|
||||
$sql.= ", ".(empty($this->entrepot_id) ? 'NULL' : $this->entrepot_id);
|
||||
$sql.= ", ".$this->fk_origin_line;
|
||||
$sql.= ", ".$this->qty;
|
||||
$sql.= ")";
|
||||
|
||||
@ -369,7 +369,7 @@ class ProductFournisseur extends Product
|
||||
// End call triggers
|
||||
if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG))
|
||||
{
|
||||
$result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrenc, $multicurrency_code);
|
||||
$result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrency, $multicurrency_code);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
@ -1089,7 +1089,7 @@ class ProductFournisseur extends Product
|
||||
*
|
||||
* @return int < 0 NOK > 0 OK
|
||||
*/
|
||||
private function logPrice($user, $datec, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrency, $multicurrency_code)
|
||||
private function logPrice($user, $datec, $buyprice, $qty, $multicurrency_buyprice = null, $multicurrency_unitBuyPrice = null, $multicurrency_tx = null, $fk_multicurrency = null, $multicurrency_code = null)
|
||||
{
|
||||
// Add record into log table
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price_log(";
|
||||
|
||||
@ -379,9 +379,9 @@ class FormProduct
|
||||
*/
|
||||
public function selectLotStock($selected = '', $htmlname = 'batch_id', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array(), $empty_label = '', $forcecombo = 0, $events = array(), $morecss = 'minwidth200')
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
dol_syslog(get_class($this)."::selectLot $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $fk_entrepot, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::selectLot $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $fk_entrepot, $empty_label, $forcecombo, $morecss", LOG_DEBUG);
|
||||
|
||||
$out='';
|
||||
$productIdArray = array();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user