dolibarr/htdocs/core/modules/facture/modules_facture.php

346 lines
11 KiB
PHP
Raw Permalink Normal View History

<?php
2005-03-08 10:38:12 +00:00
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
2018-10-27 12:43:12 +00:00
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
2025-01-05 17:12:36 +00:00
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 19:55:30 +00:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/
/**
* \file htdocs/core/modules/facture/modules_facture.php
2024-05-13 08:45:20 +00:00
* \ingroup invoice
2019-10-18 11:00:31 +00:00
* \brief File that contains parent class for invoices models
* and parent class for invoices numbering models
2008-10-21 21:27:20 +00:00
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required because used in classes that inherit
// For the experimental feature using swiss QR invoice generated by composer lib sparin/swiss-qr-bill
2023-06-03 23:56:05 +00:00
use Sprain\SwissQrBill;
/**
* Parent class of invoice document generators
2008-10-21 21:27:20 +00:00
*/
abstract class ModelePDFFactures extends CommonDocGenerator
{
2025-01-05 17:12:36 +00:00
/**
* @var float
*/
2023-04-27 21:01:34 +00:00
public $posxpicture;
2025-01-05 17:12:36 +00:00
/**
* @var float
*/
2023-04-27 21:01:34 +00:00
public $posxtva;
2025-01-05 17:12:36 +00:00
/**
* @var float
*/
2023-04-27 21:01:34 +00:00
public $posxup;
2025-01-05 17:12:36 +00:00
/**
* @var float
*/
2023-04-27 21:01:34 +00:00
public $posxqty;
2025-01-05 17:12:36 +00:00
/**
* @var float
*/
2023-04-27 21:01:34 +00:00
public $posxunit;
2025-01-05 17:12:36 +00:00
/**
* @var float
*/
2023-04-27 21:01:34 +00:00
public $posxdesc;
2025-01-05 17:12:36 +00:00
/**
* @var float
*/
2023-04-27 21:01:34 +00:00
public $posxdiscount;
2025-01-05 17:12:36 +00:00
/**
* @var float
*/
2023-04-27 21:01:34 +00:00
public $postotalht;
2025-01-05 17:12:36 +00:00
/**
* @var array<string,float>
*/
public $tva;
2025-01-05 17:12:36 +00:00
/**
* @var array<string,array{amount:float}>
*/
public $tva_array;
2025-01-05 17:12:36 +00:00
/**
* Local tax rates Array[tax_type][tax_rate]
*
* @var array<int,array<string,float>>
*/
public $localtax1;
2025-01-05 17:12:36 +00:00
/**
* Local tax rates Array[tax_type][tax_rate]
*
* @var array<int,array<string,float>>
*/
public $localtax2;
2025-01-05 17:12:36 +00:00
/**
* @var int<0,1>
*/
2020-01-22 13:39:00 +00:00
public $atleastonediscount = 0;
2025-01-05 17:12:36 +00:00
/**
* @var int<0,1>
*/
2020-01-22 13:39:00 +00:00
public $atleastoneratenotnull = 0;
/**
* @var int<0,1>
*/
public $showAmountBeforeDiscount = 1;
/**
* @var int<0,1>
*/
public $showDiscountAmount = 1;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
2011-05-06 13:35:18 +00:00
* Return list of active generation modules
2012-03-13 08:38:00 +00:00
*
Qual: Updates regarding write_file(s) methods for Phan (#30511) * Fix phpdoc for phpstan * Add abstract write_file to ModelePDFContract And update phpdoc for derived classes * Fix typing for php_standard_actions writefile * Improve phpdoc for write_files (& related) * Add abstract write_file to ModelePDFBom * Add abstract write_file to ModelePDFDeliveryOrder * Add abstract write_file to ModeleExpenseReport * Add abstract write_file to ModelePDFFicheinter * Add abstract write_file to ModelePDFEvaluation * Add abstract write_file to ModelePDFFactures * Add abstract write_file to ModelePDFSuppliersInvoices * Update ModelePDFProjects and ModelePDFTask related classes * Qual: Add abstract write_file to ModelePdfExpedition And update phpdoc for derived classes * Qual: Correct reference (doc) to ModelePDFEvaluation * Qual: Add abstract write_file to ModelePDFKnowledgeRecord And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFMo & ModelePDFMouvement And update phpdoc for derived classes * Qual: Set typehint to ModelePDFFicheinter * Qual: Add abstract write_file to ModelePDFCommandes And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFPropales And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePdfReception And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFSuppliersOrders And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFSuppliersOrders And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFSuppliersPayments And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFSupplierProposal And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFWorkstation And update phpdoc for derived classes * Set typing for doc generator (commonobject) * Improve typing for write_file * Set typing for doc generator * Qual: Add abstract write_file to ModelePDFMember And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFProduct And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFProductBatch And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFRecruitmentJobPosition And update phpdoc for derived classes * Add abstract write_file to ModelePDFTicket * Add abstract write_file to ModelePDFUser * Add abstract write_file to ModelePDFUserGroup * Add abstract write_file to ModeleThirdPartyDoc * Add abstract write_file to ModelePDFAsset * Find all incompatible classes * Qual: update phan baseline * Set typing for doc generator (commonobject) * Qual: update phan baseline --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-14 17:21:10 +00:00
* @param DoliDB $db Database handler
* @param int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
// phpcs:enable
$type = 'invoice';
2021-02-09 13:03:13 +00:00
$list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
2021-02-09 13:03:13 +00:00
$list = getListOfModels($db, $type, $maxfilenamelength);
2021-02-09 13:03:13 +00:00
return $list;
}
Qual: Updates regarding write_file(s) methods for Phan (#30511) * Fix phpdoc for phpstan * Add abstract write_file to ModelePDFContract And update phpdoc for derived classes * Fix typing for php_standard_actions writefile * Improve phpdoc for write_files (& related) * Add abstract write_file to ModelePDFBom * Add abstract write_file to ModelePDFDeliveryOrder * Add abstract write_file to ModeleExpenseReport * Add abstract write_file to ModelePDFFicheinter * Add abstract write_file to ModelePDFEvaluation * Add abstract write_file to ModelePDFFactures * Add abstract write_file to ModelePDFSuppliersInvoices * Update ModelePDFProjects and ModelePDFTask related classes * Qual: Add abstract write_file to ModelePdfExpedition And update phpdoc for derived classes * Qual: Correct reference (doc) to ModelePDFEvaluation * Qual: Add abstract write_file to ModelePDFKnowledgeRecord And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFMo & ModelePDFMouvement And update phpdoc for derived classes * Qual: Set typehint to ModelePDFFicheinter * Qual: Add abstract write_file to ModelePDFCommandes And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFPropales And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePdfReception And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFSuppliersOrders And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFSuppliersOrders And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFSuppliersPayments And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFSupplierProposal And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFWorkstation And update phpdoc for derived classes * Set typing for doc generator (commonobject) * Improve typing for write_file * Set typing for doc generator * Qual: Add abstract write_file to ModelePDFMember And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFProduct And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFProductBatch And update phpdoc for derived classes * Qual: Add abstract write_file to ModelePDFRecruitmentJobPosition And update phpdoc for derived classes * Add abstract write_file to ModelePDFTicket * Add abstract write_file to ModelePDFUser * Add abstract write_file to ModelePDFUserGroup * Add abstract write_file to ModeleThirdPartyDoc * Add abstract write_file to ModelePDFAsset * Find all incompatible classes * Qual: update phan baseline * Set typing for doc generator (commonobject) * Qual: update phan baseline --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-14 17:21:10 +00:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Facture $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
/**
* Get the SwissQR object, including validation
*
2023-05-30 10:56:32 +00:00
* @param Facture $object Invoice object
* @param Translate $langs Translation object
* @return SwissQrBill\QrBill|bool The valid SwissQR object, or false
*/
2023-05-26 15:55:25 +00:00
private function getSwissQrBill(Facture $object, Translate $langs)
{
2023-07-19 21:07:38 +00:00
global $conf;
2023-05-26 18:13:37 +00:00
if (getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE') != 'bottom') {
return false;
}
if ($object->mode_reglement_code != 'VIR') {
$this->error = $langs->transnoentities("SwissQrOnlyVIR");
return false;
}
2023-05-26 18:13:37 +00:00
if (empty($object->fk_account)) {
$this->error = 'Bank account must be defined to use this experimental feature';
return false;
}
// Load the autoload file generated by composer
if (file_exists(DOL_DOCUMENT_ROOT.'/includes/sprain/swiss-qr-bill/autoload.php')) {
require_once DOL_DOCUMENT_ROOT.'/includes/sprain/swiss-qr-bill/autoload.php'; // @phpstan-ignore-line
} elseif (file_exists(DOL_DOCUMENT_ROOT.'/includes/autoload.php')) {
require_once DOL_DOCUMENT_ROOT.'/includes/autoload.php'; // @phpstan-ignore-line
2023-07-19 22:42:54 +00:00
} else {
2023-07-19 22:45:57 +00:00
$this->error = 'PHP library sprain/swiss-qr-bill was not found. Please install it with:<br>cd '.dirname(DOL_DOCUMENT_ROOT).'; cp composer.json.disabled composer.json; composer require sprain/swiss-qr-bill;';
2023-07-19 22:42:54 +00:00
return false;
}
// Create a new instance of SwissQrBill, containing default headers with fixed values
$qrBill = SwissQrBill\QrBill::create();
2023-06-03 23:54:32 +00:00
// First, set creditor address
$address = SwissQrBill\DataGroup\Element\CombinedAddress::create(
$this->emetteur->name,
$this->emetteur->address,
$this->emetteur->zip . " " . $this->emetteur->town,
$this->emetteur->country_code
);
if (!$address->isValid()) {
$this->error = $langs->transnoentities("SwissQrCreditorAddressInvalid", (string) $address->getViolations());
return false;
}
$qrBill->setCreditor($address);
// Get IBAN from account.
$account = new Account($this->db);
2026-01-29 14:30:30 +00:00
$account->fetch((int) $object->fk_account);
$creditorInformation = SwissQrBill\DataGroup\Element\CreditorInformation::create($account->iban);
if (!$creditorInformation->isValid()) {
2023-07-19 21:07:38 +00:00
$langs->load("errors");
$this->error = $langs->transnoentities("SwissQrCreditorInformationInvalid", $account->iban, (string) $creditorInformation->getViolations());
return false;
}
$qrBill->setCreditorInformation($creditorInformation);
if ($creditorInformation->containsQrIban()) {
$this->error = $langs->transnoentities("SwissQrIbanNotImplementedYet", $account->iban);
return false;
}
// Add payment reference CLASSIC-IBAN
// This is what you will need to identify incoming payments.
$qrBill->setPaymentReference(
SwissQrBill\DataGroup\Element\PaymentReference::create(
2023-05-26 15:55:25 +00:00
SwissQrBill\DataGroup\Element\PaymentReference::TYPE_NON
)
);
2023-07-19 21:07:38 +00:00
$currencyinvoicecode = $object->multicurrency_code ? $object->multicurrency_code : $conf->currency;
// Add payment amount, with currency
2023-07-19 21:07:38 +00:00
$pai = SwissQrBill\DataGroup\Element\PaymentAmountInformation::create($currencyinvoicecode, $object->total_ttc);
if (!$pai->isValid()) {
$this->error = $langs->transnoentities("SwissQrPaymentInformationInvalid", (string) $object->total_ttc, (string) $pai->getViolations());
return false;
}
$qrBill->setPaymentAmountInformation($pai);
// Add some human-readable information about what the bill is for.
$qrBill->setAdditionalInformation(
SwissQrBill\DataGroup\Element\AdditionalInformation::create(
$object->ref
)
);
2023-06-03 23:54:32 +00:00
// Set debtor address; We _know_ zip&town have to be filled, so skip that if unfilled.
if (!empty($object->thirdparty->zip) && !empty($object->thirdparty->town)) {
$address = SwissQrBill\DataGroup\Element\CombinedAddress::create(
$object->thirdparty->name,
$object->thirdparty->address,
$object->thirdparty->zip . " " . $object->thirdparty->town,
$object->thirdparty->country_code
);
if (!$address->isValid()) {
$this->error = $langs->transnoentities("SwissQrDebitorAddressInvalid", (string) $address->getViolations());
return false;
}
$qrBill->setUltimateDebtor($address);
}
return $qrBill;
}
/**
* Get the height for bottom-page QR invoice in mm, depending on the page number.
*
2023-06-03 23:54:32 +00:00
* @param int $pagenbr Page number
* @param Facture $object Invoice object
* @param Translate $langs Translation object
* @return int Height in mm of the bottom-page QR invoice. Can be zero if not on right page; not enabled
*/
2024-02-07 23:24:27 +00:00
protected function getHeightForQRInvoice(int $pagenbr, Facture $object, Translate $langs)
{
if (getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE') == 'bottom') {
// Keep it, to reset it after QRinvoice getter
$error = $this->error;
if (!$this->getSwissQrBill($object, $langs)) {
// Reset error to previous one if exists
if (!empty($error)) {
$this->error = $error;
}
return 0;
}
// SWIFT's requirementis 105, but we get more room with 100 and the page number is in a nice place.
return $pagenbr == 1 ? 100 : 0;
}
return 0;
}
/**
* Add SwissQR invoice at bottom of page 1
*
2023-06-03 23:54:32 +00:00
* @param TCPDF $pdf TCPDF object
* @param Facture $object Invoice object
* @param Translate $langs Translation object
* @return bool True for for success
*/
2023-12-04 11:07:31 +00:00
public function addBottomQRInvoice(TCPDF $pdf, Facture $object, Translate $langs): bool
{
if (!($qrBill = $this->getSwissQrBill($object, $langs))) {
return false;
}
try {
$pdf->startTransaction();
$pdf->setPage(1);
$pdf->SetTextColor(0, 0, 0);
$output = new SwissQrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput($qrBill, in_array($langs->shortlang, ['de', 'fr', 'it']) ? $langs->shortlang : 'en', $pdf);
$output->setPrintable(false)->getPaymentPart();
} catch (Exception $e) {
$pdf->rollbackTransaction(true);
return false;
}
return true;
}
2004-07-27 15:15:37 +00:00
}
/**
2019-10-18 11:00:31 +00:00
* Parent class of invoice reference numbering templates
2008-10-21 21:27:20 +00:00
*/
abstract class ModeleNumRefFactures extends CommonNumRefGenerator
{
/**
* Return next value not used or last value used
*
* @param Societe $objsoc Object third party
* @param ?Facture $invoice Object invoice
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 17:32:52 +00:00
* @param string $mode 'next' for next value or 'last' for last value
* @return string|int<-1,0> Value if OK, <=0 if KO
*/
abstract public function getNextValue($objsoc, $invoice, $mode = 'next');
2024-09-04 18:17:31 +00:00
/**
* Return an example of numbering
*
* @return string Example
*/
abstract public function getExample();
}