Merge pull request #25857 from frederic34/stocktransfer

phpstan
This commit is contained in:
Laurent Destailleur 2023-09-09 21:25:40 +02:00 committed by GitHub
commit 830bebe18e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 34 deletions

View File

@ -158,6 +158,8 @@ abstract class CommonDocGenerator
public $posxqty;
public $posxpuht;
public $posxtva;
public $posxtotalht;
public $postotalht;
public $atleastonephoto;
public $atleastoneratenotnull;
public $atleastonediscount;

View File

@ -65,6 +65,18 @@ class pdf_eagle extends ModelePDFStockTransfer
*/
public $version = 'dolibarr';
/**
* @var int posx lot
*/
public $posxlot;
/**
* @var int posx weightvol
*/
public $posxweightvol;
public $posxwarehousesource;
public $posxwarehousedestination;
public $atLeastOneBatch;
/**
* Constructor
@ -136,13 +148,13 @@ class pdf_eagle extends ModelePDFStockTransfer
/**
* Function to build pdf onto disk
*
* @param Object $object Object StockTransfer to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @return int 1=OK, 0=KO
* @param StockTransfer $object Object StockTransfer to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @return int 1=OK, 0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
@ -420,14 +432,14 @@ class pdf_eagle extends ModelePDFStockTransfer
$object->lines[$i]->fetch_product();
$object->lines[$i]->label = $object->lines[$i]->product->label;
$object->lines[$i]->description = $object->lines[$i]->product->description;
$object->lines[$i]->weight = $object->lines[$i]->product->weight;
$object->lines[$i]->weight_units = $object->lines[$i]->product->weight_units;
$object->lines[$i]->length = $object->lines[$i]->product->length;
$object->lines[$i]->length_units = $object->lines[$i]->product->length_units;
$object->lines[$i]->surface = $object->lines[$i]->product->surface;
$object->lines[$i]->weight = $object->lines[$i]->product->weight;
$object->lines[$i]->weight_units = $object->lines[$i]->product->weight_units;
$object->lines[$i]->length = $object->lines[$i]->product->length;
$object->lines[$i]->length_units = $object->lines[$i]->product->length_units;
$object->lines[$i]->surface = $object->lines[$i]->product->surface;
$object->lines[$i]->surface_units = $object->lines[$i]->product->surface_units;
$object->lines[$i]->volume = $object->lines[$i]->product->volume;
$object->lines[$i]->volume_units = $object->lines[$i]->product->volume_units;
$object->lines[$i]->volume = $object->lines[$i]->product->volume;
$object->lines[$i]->volume_units = $object->lines[$i]->product->volume_units;
$object->lines[$i]->fk_unit = $object->lines[$i]->product->fk_unit;
//var_dump($object->lines[$i]);exit;
}
@ -632,12 +644,12 @@ class pdf_eagle extends ModelePDFStockTransfer
/**
* Show total to pay
*
* @param PDF $pdf Object PDF
* @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Translate $outputlangs Objet langs
* @return int Position pour suite
* @param PDF $pdf Object PDF
* @param StockTransfer $object Object invoice
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Translate $outputlangs Objet langs
* @return int Position pour suite
*/
protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{
@ -820,10 +832,10 @@ class pdf_eagle extends ModelePDFStockTransfer
}
/**
* Used to know if at least one line of Stock Transfer object has a batch set
*
* @param Object $object Stock Transfer object
* @return boolean true if at least one line has batch set, false if not
* Used to know if at least one line of Stock Transfer object has a batch set
*
* @param StockTransfer $object Stock Transfer object
* @return boolean true if at least one line has batch set, false if not
*/
public function atLeastOneBatch($object)
{
@ -832,7 +844,9 @@ class pdf_eagle extends ModelePDFStockTransfer
$atLeastOneBatch = false;
if (empty($conf->productbatch->enabled)) return false;
if (!isModEnabled('productbatch')) {
return false;
}
foreach ($object->lines as $line) {
if (!empty($line->batch)) {
@ -847,10 +861,10 @@ class pdf_eagle extends ModelePDFStockTransfer
/**
* Show top header of page.
*
* @param TCPDF $pdf Object PDF
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @param TCPDF $pdf Object PDF
* @param StockTransfer $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
@ -1106,11 +1120,11 @@ class pdf_eagle extends ModelePDFStockTransfer
/**
* Show footer of page. Need this->emetteur object
*
* @param PDF $pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text
* @param PDF $pdf PDF
* @param StockTransfer $object Object to show
* @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text
*/
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{

View File

@ -87,6 +87,7 @@ class StockTransfer extends CommonObject
public $date_prevue_arrivee;
public $date_reelle_depart;
public $date_reelle_arrivee;
public $origin_type;
const STATUS_DRAFT = 0;