Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
ldestailleur 2025-06-19 11:31:44 +02:00
commit 9c2da8b9b6
25 changed files with 111 additions and 187 deletions

View file

@ -1,21 +0,0 @@
name: "Set label for v18"
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "18.0"
push:
branches:
- "18.0"
jobs:
changed-lines-count-labeler:
runs-on: ubuntu-latest
name: An action for automatically labelling pull requests based on the changed lines count
steps:
- name: Set a label
uses: vkirilichev/changed-lines-count-labeler@v0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/changed-lines-count-labeler.yml
continue-on-error: true

View file

@ -1,64 +0,0 @@
name: Set reviewer for v18
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "18.0"
push:
branches:
- "18.0"
jobs:
pr18:
runs-on: ubuntu-latest
#env:
# GH_TOKEN: ${{ github.token }}
# GH_TOKENS: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
#- name: Install GitHub CLI
# run: |
# sudo apt update
# sudo apt install gh -y
- name: Assign reviewer method 1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: ${{ github.event.pull_request.html_url }}
run: |
gh pr edit "$url" --add-assignee rycks --add-reviewer rycks
gh pr merge "$url" --merge --auto
continue-on-error: true
- name: Assign reviewer method 2
env:
#REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
run: |
# shellcheck disable=2086
echo "Run action by ${{ github.actor }}"
# shellcheck disable=2086
echo "github.token=${{ github.token }}"
# shellcheck disable=2086
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
# shellcheck disable=2086
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
# shellcheck disable=2086
echo Get the pr_number
# shellcheck disable=2086
pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH)
# shellcheck disable=2086
echo "pr_number=$pr_number"
# shellcheck disable=2086
echo Authenticate login gh
# shellcheck disable=2086
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
# shellcheck disable=2086
gh auth setup-git
# shellcheck disable=2086
gh pr edit $pr_number --add-reviewer "$REVIEWER"
continue-on-error: true

View file

@ -22,6 +22,8 @@ $PROJECT="dolibarr";
$PUBLISHBETARC="$ENV{'DESTIASSOLOGIN'}\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
$PUBLISHSTABLE="$ENV{'DESTISFLOGIN'}\@frs.sourceforge.net:/home/frs/project/dolibarr";
# due to implicit origin on git commands, example: implicit origin, lionel upstream, eric dolibarr
$GITREMOTENAME="$ENV{'GITREMOTENAME'}";
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
%REQUIREMENTPUBLISH=(
@ -118,6 +120,13 @@ if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"})
exit 1;
}
if (! $ENV{"GITREMOTENAME"}) {
print "Error: environment variable GITREMOTENAME does not exist. You can set it to 'origin' or any other git remote name.\n";
print "$PROG.$Extension aborted.\n";
sleep 2;
exit 1;
}
# Detect OS type
# --------------
if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; }
@ -468,15 +477,15 @@ if ($nboftargetok) {
{
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
print 'Run git push -f --tags'."\n";
$ret=`git push -f --tags`;
print 'Run git push $GITREMOTENAME -f --tags'."\n";
$ret=`git push $GITREMOTENAME -f --tags`;
#$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`;
}
}
else
{
print 'Run git push --tags'."\n";
$ret=`git push --tags`;
print 'Run git push $GITREMOTENAME --tags'."\n";
$ret=`git push $GITREMOTENAME --tags`;
#$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`;
}
chdir("$olddir");

View file

@ -649,7 +649,7 @@ class Lettering extends BookKeeping
$grouped_lines = array();
foreach (self::$doc_type_infos as $doc_type => $doc_type_info) {
if (!is_array($bookkeeping_lines_by_type[$doc_type])) {
if (empty($bookkeeping_lines_by_type[$doc_type]) || !is_array($bookkeeping_lines_by_type[$doc_type])) {
continue;
}

View file

@ -9,6 +9,7 @@
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 William Mead <william@m34d.com>
*
* 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
@ -579,7 +580,7 @@ print "<td>";
if (!isModEnabled('invoice')) {
print '<select class="flat" name="chq" id="chq">';
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
print '<option value="-1"'.(getDolGlobalString('FACTURE_CHQ_NUMBER') ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
$sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";

View file

@ -63,6 +63,9 @@ if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
$object = new ActionComm($db);
$object->fetch($id);
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create'));
@ -75,8 +78,6 @@ $form = new Form($db);
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
llxHeader('', $langs->trans("Agenda"), $help_url);
$object = new ActionComm($db);
$object->fetch($id);
$object->info($object->id);
$head = actions_prepare_head($object);

View file

@ -3511,22 +3511,10 @@ if ($action == 'create' && $usercancreate) {
'enabled' => (isModEnabled("intervention") && $object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0),
'perm' => ($user->hasRight('ficheinter', 'creer') == 1),
'label' => 'AddIntervention',
'url' => '/fichinter/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid,
'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
);
}
/*if (isModEnabled('ficheinter')) {
$langs->load("interventions");
if ($object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
if ($user->hasRight('ficheinter', 'creer')) {
print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid, '');
} else {
print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('AddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
}
}
}*/
// Create contract
$arrayforbutaction[] = array(
'lang' => 'contracts',

View file

@ -5447,7 +5447,7 @@ class Facture extends CommonInvoice
if ($generic_facture->hasDelay()) {
$response->nbtodolate++;
$response->url_late = DOL_URL_ROOT.'/compta/facture/list.php?search_late=late&mainmenu=billing&leftmenu=customers_bills';
$response->url_late = DOL_URL_ROOT.'/compta/facture/list.php?search_option=late&mainmenu=billing&leftmenu=customers_bills';
}
}

View file

@ -480,7 +480,7 @@ while ($i < $imaxinloop) {
print '<td>';
print $line->LibStatut($obj->statut_ligne, 2);
print "&nbsp;";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.($type == 'bank-transfer' ? '&type=bank-transfer' : '').'">';
print substr('000000'.$obj->rowid_ligne, -6);
print '</a></td>';

View file

@ -7850,6 +7850,7 @@ abstract class CommonObject
$tmpselect = '';
$nbchoice = 0;
foreach ($param['options'] as $keyb => $valb) {
if ((string) $keyb == '') {
continue;
@ -7868,7 +7869,7 @@ abstract class CommonObject
}
$out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
if ((!isset($this->fields[$key]['default'])) || ($this->fields[$key]['notnull'] != 1) || $nbchoice >= 2) {
if ((!isset($this->fields[$key]['default'])) || empty($this->fields[$key]['notnull']) || ($this->fields[$key]['notnull'] != 1) || $nbchoice >= 2) {
$out .= '<option value="0">&nbsp;</option>';
}
$out .= $tmpselect;

View file

@ -3237,7 +3237,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file = $conf->fckeditor->dir_output.'/'.$original_file;
} elseif ($modulepart == 'user' && !empty($conf->user->dir_output)) {
// Wrapping for users
$canreaduser = (!empty($fuser->admin) || $fuser->hasRight('user', 'user', 'lire'));
$canreaduser = (!empty($fuser->admin) || $fuser->hasRight('user', 'user', $lire));
if ($fuser->id == (int) $refname) {
$canreaduser = 1;
} // A user can always read its own card
@ -3632,7 +3632,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
exit;
}
// Check fuser->rights->modulepart->myobject->read and fuser->rights->modulepart->read
// Check fuser->hasRight('modulepart', 'myobject', 'read') and fuser->hasRight('modulepart', 'read')
$partsofdirinoriginalfile = explode('/', $original_file);
if (!empty($partsofdirinoriginalfile[1])) { // If original_file is xxx/filename (xxx is a part we will use)
$partofdirinoriginalfile = $partsofdirinoriginalfile[0];

View file

@ -136,7 +136,7 @@ $original_file = GETPOST('file', 'alphanohtml');
$hashp = GETPOST('hashp', 'aZ09');
$modulepart = GETPOST('modulepart', 'alpha');
$urlsource = GETPOST('urlsource', 'alpha');
$entity = GETPOSTINT('entity');
$entity = GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity;
// Security check
if (empty($modulepart) && empty($hashp)) {

View file

@ -414,9 +414,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -536,9 +533,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -653,9 +647,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -774,9 +765,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -895,9 +883,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -1014,9 +999,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -1058,9 +1040,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -1092,9 +1071,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -1331,12 +1307,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@ -1436,9 +1406,6 @@ if (empty($reshook)) {
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (empty($newlang)) {
$newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);

View file

@ -58,6 +58,7 @@ $massaction = GETPOST('massaction', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist';
$mode = GETPOST('mode', 'alpha');
$toselect = GETPOSTISSET('toselect') ? GETPOST('toselect', 'array:int') : array();
$socid = GETPOSTINT('socid');

View file

@ -347,7 +347,7 @@ class Fichinter extends CommonObject
$sql .= ", ".((int) $this->fk_project > 0 ? ((int) $this->fk_project) : 0);
$sql .= ", ".((int) $this->fk_contrat > 0 ? ((int) $this->fk_contrat) : 0);
$sql .= ", ".((int) $this->status);
$sql .= ", ".($this->signed_status);
$sql .= ", ".((int) $this->signed_status);
$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null");
$sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null");
$sql .= ")";

View file

@ -513,6 +513,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_label, cr.libelle_facture as cond_reglement_doc,";
$sql .= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle";
$sql .= ', c.fk_incoterms, c.location_incoterms';
$sql .= ', c.last_main_doc';
$sql .= ', i.libelle as label_incoterms';
$sql .= " FROM ".$this->db->prefix()."commande_fournisseur as c";
$sql .= " LEFT JOIN ".$this->db->prefix()."c_payment_term as cr ON c.fk_cond_reglement = cr.rowid";
@ -550,6 +551,7 @@ class CommandeFournisseur extends CommonOrder
$this->statut = $obj->status; // deprecated
$this->status = $obj->status;
$this->billed = $obj->billed;
$this->last_main_doc = $obj->last_main_doc;
$this->user_author_id = $obj->user_author_id;
$this->user_validation_id = $obj->user_validation_id;
$this->user_approve_id = $obj->user_approve_id;

View file

@ -320,3 +320,9 @@ TaskStatus=Task status
TaskReopened=Task reopened
ThisContactHasAUser=Warning, you must assign the associated user of this contact (the user '%s', and not the contact '%s') if you want to give access permission on this object to the respective user contact.
TasksToDo=Tasks to do
CloneChanges=Recalculate date of task
CloneAffectation=Clone assignations
CloneProgression=Clone progression
CloneTimes=Clone times
CloneFile=Clone files
ConfirmCloneTask=Do you want to clone this task?

View file

@ -55,6 +55,12 @@ $cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'moagenda'; // To manage different context of search
// Protection
$socid = 0;
if ($user->socid > 0) {
$socid = $user->socid;
}
if (GETPOST('actioncode', 'array')) {
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) {
@ -95,7 +101,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->mrp->multidir_output[$object->entity]."/".$object->id;
$upload_dir = (empty($conf->mrp->multidir_output[$object->entity]) ? $conf->mrp->dir_output : $conf->mrp->multidir_output[$object->entity])."/".$object->id;
}
// Security check - Protection if external user
@ -240,7 +246,10 @@ if ($object->id > 0) {
print '</div>';
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
$param = '&id='.$object->id.'&socid='.$socid;
$param = '&id='.$object->id;
if (!empty($socid)) {
$param .= '&socid='.$socid;
}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}

View file

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2007-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 All-3kcis <contact@all-3kcis.fr>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2007-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 All-3kcis <contact@all-3kcis.fr>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -22,8 +23,7 @@
/**
* \file product/stock/productlot_card.php
* \ingroup stock
* \brief This file is an example of a php page
* Initially built by build_class_from_table on 2016-05-17 12:22
* \brief Batch/series card on products
*/
// Load Dolibarr environment
@ -287,8 +287,10 @@ if (empty($reshook)) {
$form = new Form($db);
$formfile = new FormFile($db);
$title = $langs->trans("ProductLot");
$help_url = '';
$shortlabel = dol_trunc($object->batch, 16);
$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Card');
$help_url = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_card');

View file

@ -1,14 +1,15 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 All-3kcis <contact@all-3kcis.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 All-3kcis <contact@all-3kcis.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* 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
@ -48,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
*/
// Load translation files required by the page
$langs->loadLangs(array('other', 'products'));
$langs->loadLangs(array('other', 'products', 'productbatch'));
$id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');
@ -153,12 +154,16 @@ if (empty($reshook)) {
$form = new Form($db);
llxHeader('', $langs->trans('ProductLot'), '', '', 0, 0, '', '', '', 'mod-product page-stock_productlot_document');
$help_url = '';
$shortlabel = dol_trunc($object->batch, 16);
$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Documents');
$help_url = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_document');
if ($object->id) {
$head = productlot_prepare_head($object);
print dol_get_fiche_head($head, 'documents', $langs->trans("Batch"), -1, 'barcode');
print dol_get_fiche_head($head, 'documents', $langs->trans("Batch"), -1, $object->picto);
$parameters = array();

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* 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
@ -35,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
*/
// Load translation files required by the page
$langs->loadLangs(array('other', 'products'));
$langs->loadLangs(array('other', 'products', 'productbatch'));
// Get parameters
$id = GETPOSTINT('id');
@ -86,8 +87,11 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('ProductLot'), $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_note');
$shortlabel = dol_trunc($object->batch, 16);
$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Notes');
$help_url = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_note');
if ($id > 0 || !empty($ref)) {
$object->fetch_thirdparty();
@ -98,7 +102,7 @@ if ($id > 0 || !empty($ref)) {
// Object card
// ------------------------------------------------------------
$linkback = '<a href="'.dol_buildpath('/stock/productlot_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/productlot_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'batch');

View file

@ -98,7 +98,8 @@ if (empty($reshook)) {
if ($action == 'delete' && GETPOST('langtodelete', 'alpha') && $usercancreate) {
$object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
$action = '';
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id);
exit;
}
// Add translation
@ -127,7 +128,8 @@ if (empty($reshook)) {
}
if ($result > 0) {
$action = '';
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id);
exit;
} else {
$action = 'add';
setEventMessages($object->error, $object->errors, 'errors');
@ -154,7 +156,8 @@ if (empty($reshook)) {
$result = $object->setMultiLangs($user);
if ($result > 0) {
$action = '';
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id);
exit;
} else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
@ -167,7 +170,8 @@ if (empty($reshook)) {
$result = $object->delMultiLangs($langtodelete, $user);
if ($result > 0) {
$action = '';
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id);
exit;
} else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');

View file

@ -1708,18 +1708,21 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
// Buttons Create
if (!getDolGlobalString('PROJECT_HIDE_CREATE_OBJECT_BUTTON')) {
// We check the type of thirdparty
$is_customer_or_prospect = (!empty($object->thirdparty->prospect) || !empty($object->thirdparty->client));
$is_supplier_only= (!empty($object->thirdparty->fournisseur) && $is_customer_or_prospect == false);
$arrayforbutaction = array(
//1 => array('lang' => 'propal', 'enabled' => 1, 'perm' => 1, 'label' => 'XXX'),
10 => array('lang' => 'propal', 'enabled' => isModEnabled("propal"), 'perm' => $user->hasRight('propal', 'creer') ? true : false, 'label' => 'AddProp', 'url' => '/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
20 => array('lang' => 'orders', 'enabled' => isModEnabled("order"), 'perm' => $user->hasRight('commande', 'creer') ? true : false, 'label' => 'CreateOrder', 'url' => '/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
30 => array('lang' => 'bills', 'enabled' => isModEnabled("invoice"), 'perm' => $user->hasRight('facture', 'creer') ? true : false, 'label' => 'CreateBill', 'url' => '/compta/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
40 => array('lang' => 'supplier_proposal', 'enabled' => isModEnabled("supplier_proposal"), 'perm' => $user->hasRight('supplier_proposal', 'creer') ? true : false, 'label' => 'AddSupplierProposal', 'url' => '/supplier_proposal/card.php?action=create&amp;projectid='.$object->id),
50 => array('lang' => 'suppliers', 'enabled' => isModEnabled("supplier_order"), 'perm' => $user->hasRight('fournisseur', 'commande', 'creer') ? true : false, 'label' => 'AddSupplierOrder', 'url' => '/fourn/commande/card.php?action=create&amp;projectid='.$object->id),
60 => array('lang' => 'suppliers', 'enabled' => isModEnabled("supplier_invoice"), 'perm' => $user->hasRight('fournisseur', 'facture', 'creer') ? true : false, 'label' => 'AddSupplierInvoice', 'url' => '/fourn/facture/card.php?action=create&amp;projectid='.$object->id),
70 => array('lang' => 'interventions', 'enabled' => isModEnabled("intervention"), 'perm' => $user->hasRight('fichinter', 'creer') ? true : false, 'label' => 'AddIntervention', 'url' => '/fichinter/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
80 => array('lang' => 'contracts', 'enabled' => isModEnabled("contract"), 'perm' => $user->hasRight('contrat', 'creer') ? true : false, 'label' => 'AddContract', 'url' => '/contrat/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
90 => array('lang' => 'trips', 'enabled' => isModEnabled("expensereport"), 'perm' => $user->hasRight('expensereport', 'creer') ? true : false, 'label' => 'AddTrip', 'url' => '/expensereport/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
100 => array('lang' => 'donations', 'enabled' => isModEnabled("don"), 'perm' => $user->hasRight('don', 'creer') ? true : false, 'label' => 'AddDonation', 'url' => '/don/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
10 => array('lang'=>'propal', 'enabled' => (isModEnabled("propal") && $is_customer_or_prospect == true), 'perm' => $user->hasRight('propal', 'creer') ? true : false, 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
20 => array('lang'=>'orders', 'enabled' => (isModEnabled("order") && $is_customer_or_prospect == true), 'perm' => $user->hasRight('commande', 'creer') ? true : false, 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
30 => array('lang'=>'bills', 'enabled' => (isModEnabled("invoice") && $is_customer_or_prospect == true), 'perm' => $user->hasRight('facture', 'creer') ? true : false, 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
40 => array('lang'=>'supplier_proposal', 'enabled' => isModEnabled("supplier_proposal"), 'perm' => $user->hasRight('supplier_proposal', 'creer') ? true : false, 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&amp;projectid='.$object->id.($is_supplier_only == true ? '&amp;socid='.$object->socid : '')),
50 => array('lang'=>'suppliers', 'enabled' => isModEnabled("supplier_order"), 'perm' => $user->hasRight('fournisseur', 'commande', 'creer') ? true : false, 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&amp;projectid='.$object->id.($is_supplier_only == true ? '&amp;socid='.$object->socid : '')),
60 => array('lang'=>'suppliers', 'enabled' => isModEnabled("supplier_invoice"), 'perm' => $user->hasRight('fournisseur', 'facture', 'creer') ? true : false, 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&amp;projectid='.$object->id.($is_supplier_only == true ? '&amp;socid='.$object->socid : '')),
70 => array('lang'=>'interventions', 'enabled' => isModEnabled("intervention"), 'perm' => $user->hasRight('fichinter', 'creer') ? true : false, 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
80 => array('lang'=>'contracts', 'enabled' => isModEnabled("contract"), 'perm' => $user->hasRight('contrat', 'creer') ? true : false, 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
90 => array('lang'=>'trips', 'enabled' => isModEnabled("expensereport"), 'perm' => $user->hasRight('expensereport', 'creer') ? true : false, 'label' => 'AddTrip', 'url'=>'/expensereport/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
100 => array('lang'=>'donations', 'enabled' => isModEnabled("don"), 'perm' => $user->hasRight('don', 'creer') ? true : false, 'label' => 'AddDonation', 'url'=>'/don/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
);
$params = array('backtopage' => $_SERVER["PHP_SELF"].'?id='.$object->id);

View file

@ -1691,6 +1691,8 @@ class Reception extends CommonObject
if ($resql) {
// Set order billed if 100% of order is received (qty in reception lines match qty in order lines)
if ($this->origin == 'order_supplier' && $this->origin_id > 0) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$order = new CommandeFournisseur($this->db);
$order->fetch($this->origin_id);
@ -1953,6 +1955,8 @@ class Reception extends CommonObject
}
if (!$error && $this->origin == 'order_supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$commande = new CommandeFournisseur($this->db);
$commande->fetch($this->origin_id);
$result = $commande->setStatus($user, 4);

View file

@ -1260,6 +1260,7 @@ class SupplierProposal extends CommonObject
$sql .= ", p.fk_mode_reglement";
$sql .= ', p.fk_account';
$sql .= ", p.fk_shipping_method";
$sql .= ", p.last_main_doc";
$sql .= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc";
$sql .= ", c.label as statut_label";
$sql .= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture as cond_reglement_libelle_doc";
@ -1306,6 +1307,7 @@ class SupplierProposal extends CommonObject
$this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
$this->last_main_doc = $obj->last_main_doc;
$this->mode_reglement_id = $obj->fk_mode_reglement;
$this->mode_reglement_code = $obj->mode_reglement_code;
$this->mode_reglement = $obj->mode_reglement;