Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
f2d33716f6
6 changed files with 99 additions and 103 deletions
|
|
@ -2040,12 +2040,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../../htdocs/asset/tpl/depreciation_view.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$object might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../../htdocs/asset/tpl/linkedobjectblock.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Right side of && is always true\.$#'
|
||||
identifier: booleanAnd.rightAlwaysTrue
|
||||
|
|
@ -2184,12 +2178,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../../htdocs/bom/class/bom.class.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$object might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 2
|
||||
path: ../../../htdocs/bom/tpl/linkedobjectblock.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Call to function is_object\(\) with BOMLine will always evaluate to true\.$#'
|
||||
identifier: function.alreadyNarrowedType
|
||||
|
|
|
|||
|
|
@ -56,19 +56,19 @@ $formother = new FormOther($db);
|
|||
$default = 'ffffff';
|
||||
|
||||
// Constant and translation of the module description
|
||||
$modules = array(
|
||||
$modules = [
|
||||
'PROPAL' => array('lang' => 'propal', 'key' => 'Proposal', 'old_pdf' => '(azur model)'),
|
||||
'COMMANDE' => array('lang' => 'orders', 'key' => 'CustomerOrder', 'old_pdf' => '(einstein model)'),
|
||||
'FACTURE' => array('lang' => 'bills', 'key' => 'CustomerInvoice', 'old_pdf' => '(crabe model)'),
|
||||
'FACTUREREC' => array('lang' => 'bills', 'key' => 'RecurringInvoiceTemplate'),
|
||||
);
|
||||
];
|
||||
// Conditions for the option to be offered
|
||||
$conditions = array(
|
||||
'PROPAL' => (isModEnabled("propal")),
|
||||
'COMMANDE' => (isModEnabled("order")),
|
||||
'FACTURE' => (isModEnabled("invoice")),
|
||||
'FACTUREREC' => (isModEnabled("invoice")),
|
||||
);
|
||||
$conditions = [
|
||||
'PROPAL' => isModEnabled("propal"),
|
||||
'COMMANDE' => isModEnabled("order"),
|
||||
'FACTURE' => isModEnabled("invoice"),
|
||||
'FACTUREREC' => isModEnabled("invoice"),
|
||||
];
|
||||
|
||||
$max_depth = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
|
|
@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
|||
} ?>
|
||||
<tr class="<?php echo $trclass; ?>">
|
||||
<td><?php echo $langs->trans("SupplierInvoice"); ?></td>
|
||||
<td><a href="<?php echo DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowBill"), "bill").' '.$objectlink->ref; ?></a></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1) ?></td>
|
||||
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
|
|
@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
|||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) {
|
||||
$sign = -1;
|
||||
}
|
||||
if ($objectlink->statut != 3) {
|
||||
if ($objectlink->status != 3) {
|
||||
// If not abandoned
|
||||
$total += $sign * $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
|
|
|
|||
|
|
@ -188,13 +188,14 @@ class modMyModule extends DolibarrModules
|
|||
|
||||
// Array to add new pages in new tabs
|
||||
/* BEGIN MODULEBUILDER TABS */
|
||||
// Don't forget to deactivate/reactivate your module to test your changes
|
||||
$this->tabs = array();
|
||||
/* END MODULEBUILDER TABS */
|
||||
// Example:
|
||||
// To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data' => 'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight(\'mymodule\', \'read\'):/mymodule/mynewtab1.php?id=__ID__');
|
||||
// $this->tabs[] = array('data' => 'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight('mymodule', 'myobject', 'read'):/mymodule/mynewtab1.php?id=__ID__');
|
||||
// To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data' => 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight(\'othermodule\', \'read\'):/mymodule/mynewtab2.php?id=__ID__',
|
||||
// $this->tabs[] = array('data' => 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight('othermodule', 'otherobject', 'read'):/mymodule/mynewtab2.php?id=__ID__',
|
||||
// To remove an existing tab identified by code tabname
|
||||
// $this->tabs[] = array('data' => 'objecttype:-tabname:NU:conditiontoremove');
|
||||
//
|
||||
|
|
|
|||
|
|
@ -493,7 +493,13 @@ trait CommonSubtotal
|
|||
{
|
||||
$current_module = $this->element;
|
||||
// Ensure the object is one of the supported types
|
||||
$allowed_types = array('propal', 'commande', 'facture', 'facturerec', 'shipping');
|
||||
$allowed_types = [
|
||||
'propal',
|
||||
'commande',
|
||||
'facture',
|
||||
'facturerec',
|
||||
'shipping',
|
||||
];
|
||||
if (!in_array($current_module, $allowed_types)) {
|
||||
if (isset($this->errors)) {
|
||||
$this->errors[] = $langs->trans("UnsupportedModuleError");
|
||||
|
|
@ -512,78 +518,78 @@ trait CommonSubtotal
|
|||
return 1;
|
||||
}
|
||||
} else {
|
||||
if ($current_module == 'facture') {
|
||||
$result = $this->updateline( // @phpstan-ignore-line
|
||||
$this->lines[$i]->id, // @phpstan-ignore-line
|
||||
$this->lines[$i]->desc, // @phpstan-ignore-line
|
||||
$this->lines[$i]->subprice, // @phpstan-ignore-line
|
||||
$this->lines[$i]->qty, // @phpstan-ignore-line
|
||||
$mode == 'discount' ? $value : $this->lines[$i]->remise_percent, // @phpstan-ignore-line
|
||||
$this->lines[$i]->date_start, // @phpstan-ignore-line
|
||||
$this->lines[$i]->date_end, // @phpstan-ignore-line
|
||||
$mode == 'tva' ? $value : $this->lines[$i]->tva_tx, // @phpstan-ignore-line
|
||||
$this->lines[$i]->localtax1_tx, // @phpstan-ignore-line
|
||||
$this->lines[$i]->localtax2_tx, // @phpstan-ignore-line
|
||||
'HT', // @phpstan-ignore-line
|
||||
$this->lines[$i]->info_bits, // @phpstan-ignore-line
|
||||
$this->lines[$i]->product_type, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_parent_line, 0, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_fournprice, // @phpstan-ignore-line
|
||||
$this->lines[$i]->pa_ht, // @phpstan-ignore-line
|
||||
$this->lines[$i]->label, // @phpstan-ignore-line
|
||||
$this->lines[$i]->special_code, // @phpstan-ignore-line
|
||||
$this->lines[$i]->array_options, // @phpstan-ignore-line
|
||||
$this->lines[$i]->situation_percent, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_unit, // @phpstan-ignore-line
|
||||
$this->lines[$i]->multicurrency_subprice // @phpstan-ignore-line
|
||||
if ($current_module == 'facture' && $this instanceof Facture) {
|
||||
$result = $this->updateline(
|
||||
$this->lines[$i]->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$mode == 'discount' ? $value : $this->lines[$i]->remise_percent,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$mode == 'tva' ? $value : $this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
'HT',
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->fk_parent_line, 0,
|
||||
$this->lines[$i]->fk_fournprice,
|
||||
$this->lines[$i]->pa_ht,
|
||||
$this->lines[$i]->label,
|
||||
$this->lines[$i]->special_code,
|
||||
$this->lines[$i]->array_options,
|
||||
$this->lines[$i]->situation_percent,
|
||||
$this->lines[$i]->fk_unit,
|
||||
$this->lines[$i]->multicurrency_subprice
|
||||
);
|
||||
} elseif ($current_module == 'commande') {
|
||||
$result = $this->updateline( // @phpstan-ignore-line
|
||||
$this->lines[$i]->id, // @phpstan-ignore-line
|
||||
$this->lines[$i]->desc, // @phpstan-ignore-line
|
||||
$this->lines[$i]->subprice, // @phpstan-ignore-line
|
||||
$this->lines[$i]->qty, // @phpstan-ignore-line
|
||||
$mode == 'discount' ? $value : $this->lines[$i]->remise_percent, // @phpstan-ignore-line
|
||||
$mode == 'tva' ? $value : $this->lines[$i]->tva_tx, // @phpstan-ignore-line
|
||||
$this->lines[$i]->localtax1_rate, // @phpstan-ignore-line
|
||||
$this->lines[$i]->localtax2_rate, // @phpstan-ignore-line
|
||||
'HT', // @phpstan-ignore-line
|
||||
$this->lines[$i]->info_bits, // @phpstan-ignore-line
|
||||
$this->lines[$i]->date_start, // @phpstan-ignore-line
|
||||
$this->lines[$i]->date_end, // @phpstan-ignore-line
|
||||
$this->lines[$i]->product_type, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_parent_line, 0, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_fournprice, // @phpstan-ignore-line
|
||||
$this->lines[$i]->pa_ht, // @phpstan-ignore-line
|
||||
$this->lines[$i]->label, // @phpstan-ignore-line
|
||||
$this->lines[$i]->special_code, // @phpstan-ignore-line
|
||||
$this->lines[$i]->array_options, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_unit, // @phpstan-ignore-line
|
||||
$this->lines[$i]->multicurrency_subprice // @phpstan-ignore-line
|
||||
} elseif ($current_module == 'commande' && $this instanceof Commande) {
|
||||
$result = $this->updateline(
|
||||
$this->lines[$i]->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$mode == 'discount' ? $value : $this->lines[$i]->remise_percent,
|
||||
$mode == 'tva' ? $value : $this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_rate,
|
||||
$this->lines[$i]->localtax2_rate,
|
||||
'HT',
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->fk_parent_line, 0,
|
||||
$this->lines[$i]->fk_fournprice,
|
||||
$this->lines[$i]->pa_ht,
|
||||
$this->lines[$i]->label,
|
||||
$this->lines[$i]->special_code,
|
||||
$this->lines[$i]->array_options,
|
||||
$this->lines[$i]->fk_unit,
|
||||
$this->lines[$i]->multicurrency_subprice
|
||||
);
|
||||
} elseif ($current_module == 'propal') {
|
||||
$result = $this->updateline( // @phpstan-ignore-line
|
||||
$this->lines[$i]->id, // @phpstan-ignore-line
|
||||
$this->lines[$i]->subprice, // @phpstan-ignore-line
|
||||
$this->lines[$i]->qty, // @phpstan-ignore-line
|
||||
$mode == 'discount' ? $value : $this->lines[$i]->remise_percent, // @phpstan-ignore-line
|
||||
$mode == 'tva' ? $value : $this->lines[$i]->tva_tx, // @phpstan-ignore-line
|
||||
$this->lines[$i]->localtax1_rate, // @phpstan-ignore-line
|
||||
$this->lines[$i]->localtax2_rate, // @phpstan-ignore-line
|
||||
$this->lines[$i]->desc, // @phpstan-ignore-line
|
||||
'HT', // @phpstan-ignore-line
|
||||
$this->lines[$i]->info_bits, // @phpstan-ignore-line
|
||||
$this->lines[$i]->special_code, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_parent_line, 0, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_fournprice, // @phpstan-ignore-line
|
||||
$this->lines[$i]->pa_ht, // @phpstan-ignore-line
|
||||
$this->lines[$i]->label, // @phpstan-ignore-line
|
||||
$this->lines[$i]->product_type, // @phpstan-ignore-line
|
||||
$this->lines[$i]->date_start, // @phpstan-ignore-line
|
||||
$this->lines[$i]->date_end, // @phpstan-ignore-line
|
||||
$this->lines[$i]->array_options, // @phpstan-ignore-line
|
||||
$this->lines[$i]->fk_unit, // @phpstan-ignore-line
|
||||
$this->lines[$i]->multicurrency_subprice // @phpstan-ignore-line
|
||||
} elseif ($current_module == 'propal' && $this instanceof Propal) {
|
||||
$result = $this->updateline(
|
||||
$this->lines[$i]->id,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$mode == 'discount' ? $value : $this->lines[$i]->remise_percent,
|
||||
$mode == 'tva' ? $value : $this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_rate,
|
||||
$this->lines[$i]->localtax2_rate,
|
||||
$this->lines[$i]->desc,
|
||||
'HT',
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->special_code,
|
||||
$this->lines[$i]->fk_parent_line, 0,
|
||||
$this->lines[$i]->fk_fournprice,
|
||||
$this->lines[$i]->pa_ht,
|
||||
$this->lines[$i]->label,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->array_options,
|
||||
$this->lines[$i]->fk_unit,
|
||||
$this->lines[$i]->multicurrency_subprice
|
||||
);
|
||||
}
|
||||
if ($result < 0) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -2692,9 +2692,10 @@ class SupplierProposal extends CommonObject
|
|||
|
||||
$this->lines[$i] = new SupplierProposalLine($this->db);
|
||||
$this->lines[$i]->id = $obj->rowid; // for backward compatibility
|
||||
$this->lines[$i]->rowid = $obj->rowid;
|
||||
$this->lines[$i]->label = $obj->custom_label;
|
||||
$this->lines[$i]->description = $obj->description;
|
||||
$this->lines[$i]->rowid = $obj->rowid;
|
||||
$this->lines[$i]->label = $obj->custom_label;
|
||||
$this->lines[$i]->description = $obj->description; // deprecated
|
||||
$this->lines[$i]->desc = $obj->description;
|
||||
$this->lines[$i]->fk_product = $obj->fk_product;
|
||||
$this->lines[$i]->ref = $obj->ref;
|
||||
$this->lines[$i]->product_label = $obj->product_label;
|
||||
|
|
|
|||
Loading…
Reference in a new issue