Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0

This commit is contained in:
Laurent Destailleur 2023-02-13 13:58:03 +01:00
commit 239f7a1eb0
5 changed files with 11 additions and 4 deletions

View File

@ -3038,7 +3038,11 @@ if ($action == 'create') {
}
// when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value
$fk_account = GETPOSTISSET("fk_account") ? GETPOST("fk_account", 'int') : $fk_account;
if ($socid > 0 && $fk_account) { // A company has already been set and it has a default fk_account
$fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account; // The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company
} else { // No company forced
$fk_account = GETPOST("fk_account", 'int');
}
if (!empty($soc->id)) {
$absolute_discount = $soc->getAvailableDiscounts();

View File

@ -557,3 +557,6 @@ ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIG
-- Idea is to update this column manually in v15 with value in currency of company for bank that are not into the main currency and the transfer
-- into accounting will use it in priority if value is not null. The script repair.sql contains the sequence to fix datas in llx_bank.
ALTER TABLE llx_bank ADD COLUMN amount_main_currency double(24,8) NULL;
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN ref varchar(128);
ALTER TABLE llx_facture_fourn_det MODIFY COLUMN ref varchar(128);

View File

@ -25,7 +25,7 @@ create table llx_commande_fournisseurdet
fk_commande integer NOT NULL,
fk_parent_line integer NULL,
fk_product integer,
ref varchar(50), -- supplier product ref
ref varchar(128), -- supplier product ref
label varchar(255), -- product label
description text,
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.

View File

@ -24,7 +24,7 @@ create table llx_facture_fourn_det
fk_facture_fourn integer NOT NULL,
fk_parent_line integer NULL,
fk_product integer NULL,
ref varchar(50), -- supplier product ref
ref varchar(128), -- supplier product ref
label varchar(255), -- product label
description text,
pu_ht double(24,8), -- unit price excluding tax

View File

@ -49,7 +49,7 @@ if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
}
$permissionnote = $user->rights->produit->creer; // Used by the include of actions_setnotes.inc.php
$permissionnote = ($user->rights->produit->creer || $user->rights->service->creer); // Used by the include of actions_setnotes.inc.php
if ($object->id > 0) {
if ($object->type == $object::TYPE_PRODUCT) {