Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
8f0d1d4e25
32 changed files with 117 additions and 220 deletions
2
.github/workflows/phan.yml
vendored
2
.github/workflows/phan.yml
vendored
|
|
@ -90,7 +90,7 @@ jobs:
|
|||
cs2pr --prepend-filename --prepend-source --notices-as-warnings _phan.xml
|
||||
|
||||
- name: Provide phan log as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v6
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: phan-srcrt
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2013-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2022 Lionel Vessiller <lvessiller@open-dsi.fr>
|
||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
|
|
@ -869,7 +869,7 @@ if ($action == 'export_file') {
|
|||
);
|
||||
}
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', '', 'export_fileconfirm', $form_question, '', 1, 390, 700);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 500, 700);
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
|
|
|
|||
|
|
@ -31,21 +31,21 @@ class Documentation
|
|||
/**
|
||||
* Views
|
||||
*
|
||||
* @var array
|
||||
* @var array|array<int,string>
|
||||
*/
|
||||
public $view = array();
|
||||
|
||||
/**
|
||||
* Menu - Set in setMenu in order to use dol_buildpath and called in constructor
|
||||
*
|
||||
* @var array
|
||||
* @var array<array{url?: string, summary?: array<string,string>, submenu?: array<string,mixed>}>
|
||||
*/
|
||||
public $menu = array();
|
||||
|
||||
/**
|
||||
* Summary - Set in setSummary and called in constructor
|
||||
*
|
||||
* @var array
|
||||
* @var array<int,string>
|
||||
*/
|
||||
public $summary = array();
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ class Documentation
|
|||
),
|
||||
'Inputs' => array(
|
||||
'url' => dol_buildpath($this->baseUrl.'/components/inputs.php', 1),
|
||||
'icon' => 'fas fa-comments',
|
||||
'icon' => 'far fa-edit',
|
||||
'submenu' => array(),
|
||||
'summary' => array(
|
||||
'DocBasicUsage' => '#setinputssection-basicusage',
|
||||
|
|
@ -167,6 +167,12 @@ class Documentation
|
|||
'DocHelperFunctionsGetSearchFilterToolInput' => '#setinputssection-getSearchFilterToolInput',
|
||||
)
|
||||
),
|
||||
'ExperimentalUxInputAjaxFeedback' => array(
|
||||
'url' => dol_buildpath($this->baseUrl.'/content/input-feedback.php', 1),
|
||||
'icon' => 'far fa-share-square',
|
||||
'submenu' => array(),
|
||||
'summary' => array(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
@ -247,12 +253,6 @@ class Documentation
|
|||
'ExperimentalUxContributionTitle' => '#experimental-ux-contribution',
|
||||
),
|
||||
),
|
||||
'ExperimentalUxInputAjaxFeedback' => array(
|
||||
'url' => dol_buildpath($this->baseUrl.'/experimental/experiments/input-feedback/index.php', 1),
|
||||
'icon' => 'fas fa-flask',
|
||||
'submenu' => array(),
|
||||
'summary' => array(),
|
||||
),
|
||||
'UxDolibarrContext' => array(
|
||||
'url' => dol_buildpath($this->baseUrl.'/experimental/experiments/dolibarr-context/index.php', 1),
|
||||
'icon' => 'fas fa-flask',
|
||||
|
|
@ -369,7 +369,7 @@ class Documentation
|
|||
/**
|
||||
* Recursive function to set Menu
|
||||
*
|
||||
* @param array $menu $this->menu or submenus
|
||||
* @param array<string, array{url?: string, icon?: string, summary?: array<string,string>, submenu?: array<string,array>}> $menu Menu entry or submenu
|
||||
* @param int $level level of menu
|
||||
* @return void
|
||||
*/
|
||||
|
|
@ -446,9 +446,9 @@ class Documentation
|
|||
foreach ($this->view as $view) {
|
||||
$i++;
|
||||
if ($i == 1) {
|
||||
$menu_entry = $this->menu[$view];
|
||||
$menu_entry = $this->menu[$view] ?? [];
|
||||
} else {
|
||||
$menu_entry = $menu_entry['submenu'][$view];
|
||||
$menu_entry = $menu_entry['submenu'][$view] ?? [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -464,7 +464,7 @@ class Documentation
|
|||
/**
|
||||
* Recursive function for Automatic Summary
|
||||
*
|
||||
* @param array $menu $this->menu or submenus
|
||||
* @param array{summary?: array<string,string>, submenu?: array<string,array>} $menu $this->menu or submenus
|
||||
* @param int $level level of menu
|
||||
* @param int $showsubmenu Show Sub menus: 0 = No, 1 = Yes
|
||||
* @param int $showsubmenu_summary Show summary of sub menus: 0 = No, 1 = Yes
|
||||
|
|
@ -518,7 +518,7 @@ class Documentation
|
|||
/**
|
||||
* Output a View Code area
|
||||
*
|
||||
* @param array $lines Lines of code to show
|
||||
* @param array<int,string> $lines Lines of code to show
|
||||
* @param string $option Source code language ('html', 'php' etc)
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../../../../../main.inc.php';
|
||||
require '../../../../main.inc.php';
|
||||
|
||||
/**
|
||||
* @var DoliDB $db
|
||||
|
|
@ -50,7 +50,7 @@ $js = [
|
|||
'/includes/ace/src/ext-language_tools.js',
|
||||
];
|
||||
$css = [
|
||||
$experimentAssetsPath . 'feddback-01.css'
|
||||
|
||||
];
|
||||
|
||||
// Output html head + body - Param is Title
|
||||
|
|
@ -73,11 +73,10 @@ $documentation->showSidebar(); ?>
|
|||
<?php $documentation->showSummary(); ?>
|
||||
|
||||
<div class="documentation-section" >
|
||||
<h2 class="documentation-title" >Input Feedback (Experimental)</h2>
|
||||
<h2 class="documentation-title" >Input Feedback</h2>
|
||||
|
||||
<p>
|
||||
This experimental feature provides visual feedback on input fields based on their processing state.
|
||||
Currently, it is only available in this documentation and may be integrated into the <code>develop</code> branch of Dolibarr in the future.
|
||||
This feature provides visual feedback on input fields based on their processing state.
|
||||
</p>
|
||||
|
||||
<h3>How It Works</h3>
|
||||
|
|
@ -153,7 +152,7 @@ document.getElementById(\'btn-process-fail\').addEventListener(\'click\', functi
|
|||
});',
|
||||
'</script>',
|
||||
);
|
||||
echo $documentation->showCode($lines, 'html'); ?>
|
||||
$documentation->showCode($lines); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -376,6 +376,7 @@ if ($action == 'export' && $user->hasRight('blockedlog', 'read')) { // read is
|
|||
$concatenateddata = $block_static->buildKeyForSignature();
|
||||
|
||||
// Version line archive VE1=sha256
|
||||
$signatureexport = '';
|
||||
if ($formatexport == 'VE1') {
|
||||
// Note: The signature on export line is not used. It has been replaced with a global signature on all file.
|
||||
$signatureexport = dol_hash($previoushashexport.$concatenateddata, 'sha256');
|
||||
|
|
@ -777,6 +778,7 @@ if ($action == 'check' || $action == 'checkconfirmed') {
|
|||
|
||||
$reg = array();
|
||||
$period = '';
|
||||
$regnumber = '';
|
||||
$formatexport = '';
|
||||
if (preg_match('/\speriod=([^\s]+)/', $line, $reg)) {
|
||||
$period = $reg[1]; // Get period on first line
|
||||
|
|
@ -884,24 +886,24 @@ if ($action == 'check' || $action == 'checkconfirmed') {
|
|||
$lineanalyzed = 1;
|
||||
$linetech = $line[0];
|
||||
|
||||
$block_static->id = $line[1];
|
||||
$block_static->date_creation = $line[2];
|
||||
$block_static->action = $lineactioncode = $line[3];
|
||||
$block_static->module_source = $line[4];
|
||||
$block_static->id = (int) $line[1];
|
||||
$block_static->date_creation = (string) $line[2];
|
||||
$block_static->action = $lineactioncode = (string) $line[3];
|
||||
$block_static->module_source = (string) $line[4];
|
||||
$block_static->amounts_taxexcl = $lineamountht = $line[5];
|
||||
$block_static->amounts = $lineamountttc = $line[6];
|
||||
$block_static->ref_object = $lineref = $line[7];
|
||||
$block_static->date_object = $line[8];
|
||||
$block_static->user_fullname = $line[9];
|
||||
$block_static->linktoref = $line[10];
|
||||
$block_static->linktype = $line[11];
|
||||
$block_static->object_data = json_decode($line[12]);
|
||||
$block_static->object_version = $line[13];
|
||||
$block_static->object_format = $line[14];
|
||||
$block_static->signature = $line[15];
|
||||
$block_static->ref_object = $lineref = (string) $line[7];
|
||||
$block_static->date_object = (string) $line[8];
|
||||
$block_static->user_fullname = (string) $line[9];
|
||||
$block_static->linktoref = (string) $line[10];
|
||||
$block_static->linktype = (string) $line[11];
|
||||
$block_static->object_data = json_decode((string) $line[12]);
|
||||
$block_static->object_version = (string) $line[13];
|
||||
$block_static->object_format = (string) $line[14];
|
||||
$block_static->signature = (string) $line[15];
|
||||
|
||||
// Status from file: 'Valid' or 'KO'
|
||||
$statusline = $line[16];
|
||||
$statusline = (string) $line[16];
|
||||
|
||||
// Status revalidated from calculation using the HMAC secret key (possible only when we are on the same instance than
|
||||
// the one hosting the initial database of the archive)
|
||||
|
|
|
|||
|
|
@ -1161,7 +1161,7 @@ class BlockedLog
|
|||
{
|
||||
$aaa = null;
|
||||
try {
|
||||
$aaa = (object) jsonOrUnserialize($data);
|
||||
$aaa = (object) jsonOrUnserialize($data, false);
|
||||
} catch (Exception $e) {
|
||||
// print $e->getErrs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1708,7 +1708,6 @@ class Invoices extends DolibarrApi
|
|||
$totalpaid = $this->invoice->getSommePaiement();
|
||||
$totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
|
||||
$totaldeposits = $this->invoice->getSumDepositsUsed();
|
||||
$resteapayer = price2num($this->invoice->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
|
@ -1717,13 +1716,13 @@ class Invoices extends DolibarrApi
|
|||
|
||||
// Clean parameters amount if payment is for a credit note
|
||||
if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
$resteapayer = price2num($resteapayer, 'MT');
|
||||
$resteapayer = price2num($this->invoice->total_ttc + $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
|
||||
$amounts[$id] = (float) price2num(-1 * abs((float) $resteapayer), 'MT');
|
||||
// Multicurrency
|
||||
$newvalue = price2num($this->invoice->multicurrency_total_ttc, 'MT');
|
||||
$multicurrency_amounts[$id] = (float) price2num(-1 * (float) $newvalue, 'MT');
|
||||
} else {
|
||||
$resteapayer = price2num($resteapayer, 'MT');
|
||||
$resteapayer = price2num($this->invoice->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
|
||||
$amounts[$id] = (float) $resteapayer;
|
||||
// Multicurrency
|
||||
$newvalue = price2num($this->invoice->multicurrency_total_ttc, 'MT');
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ $date_endyear = GETPOSTINT('date_endyear');
|
|||
|
||||
$nbofyear = 4;
|
||||
|
||||
// Change this to test different cases of setup
|
||||
// Change this to test different cases of setup.
|
||||
//$conf->global->SOCIETE_FISCAL_MONTH_START = 7;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
$param .= '&search_complete='.urlencode($search_complete);
|
||||
}
|
||||
if ($search_filtert != '') {
|
||||
$param .= '&search_filtert='.urlencode($search_filtert);
|
||||
$param .= '&search_filtert='.urlencode((string) $search_filtert);
|
||||
}
|
||||
if ($search_dateevent_start != '') {
|
||||
$param .= '&dateevent_startyear='.GETPOSTINT('dateevent_startyear');
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ if ($object->id > 0) {
|
|||
$param .= '&search_complete='.urlencode($search_complete);
|
||||
}
|
||||
if ($search_filtert != '') {
|
||||
$param .= '&search_filtert='.urlencode($search_filtert);
|
||||
$param .= '&search_filtert='.urlencode((string) $search_filtert);
|
||||
}
|
||||
if ($search_dateevent_start != '') {
|
||||
$param .= '&dateevent_startyear='.GETPOSTINT('dateevent_startyear');
|
||||
|
|
|
|||
|
|
@ -4943,6 +4943,8 @@ abstract class CommonObject
|
|||
$this->context = array_merge($this->context, array('newstatus' => $status));
|
||||
|
||||
if ($trigkey && $trigkey != 'none') {
|
||||
$this->oldcopy = dol_clone($this);
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger($trigkey, $user);
|
||||
if ($result < 0) {
|
||||
|
|
|
|||
|
|
@ -1335,8 +1335,8 @@ class DolGraph
|
|||
|
||||
|
||||
if ($this->type[$firstlot] == 'piesemicircle') {
|
||||
$this->stringtoshow .= 'circumference: Math.PI,' . "\n";
|
||||
$this->stringtoshow .= 'rotation: -Math.PI,' . "\n";
|
||||
$this->stringtoshow .= 'circumference: 180,' . "\n";
|
||||
$this->stringtoshow .= 'rotation: -90,' . "\n";
|
||||
}
|
||||
$this->stringtoshow .= 'elements: { arc: {' . "\n";
|
||||
// Color of each arc
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2022 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
|
|
@ -7387,7 +7387,7 @@ class Form
|
|||
if (!empty($user) && $user->admin && preg_match('/\'(..)\'/', $country_code, $reg)) {
|
||||
$langs->load("errors");
|
||||
$new_country_code = $reg[1];
|
||||
$country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_pays', 'code', 'rowid');
|
||||
$country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_country', 'code', 'rowid');
|
||||
$this->error .= '<br>'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : ''));
|
||||
}
|
||||
$this->error .= '</span>';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2012-2018 Charlene BENKE <charlie@patas-monkey.com>
|
||||
/* Copyright (C) 2012-2026 Charlene BENKE <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -77,9 +77,10 @@ class FormContract
|
|||
$ret = '';
|
||||
|
||||
// Search all contacts
|
||||
$sql = "SELECT c.rowid, c.ref, c.fk_soc, c.statut,";
|
||||
$sql = "SELECT c.rowid, c.ref, c.fk_soc, c.statut, s.nom,";
|
||||
$sql .= " c.ref_customer, c.ref_supplier";
|
||||
$sql .= " FROM ".$this->db->prefix()."contrat as c";
|
||||
$sql .= " INNER JOIN".$this->db->prefix()."societe as s ON s.rowid = c.fk_soc";
|
||||
$sql .= " WHERE c.entity = ".$conf->entity;
|
||||
//if ($contratListId) $sql.= " AND c.rowid IN (".$this->db->sanitize($contratListId).")";
|
||||
if ($socid > 0) {
|
||||
|
|
@ -115,6 +116,7 @@ class FormContract
|
|||
$labeltoshow = dol_trunc($obj->ref, 18);
|
||||
|
||||
if ($showRef) {
|
||||
$labeltoshow = $labeltoshow." - ".$obj->nom;
|
||||
if ($obj->ref_customer) {
|
||||
$labeltoshow = $labeltoshow." - ".$obj->ref_customer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1937,11 +1937,12 @@ function dol_size($size, $type = '')
|
|||
* @param string $newstr String to replace bad chars with.
|
||||
* @param int $unaccent 1=Remove also accent (default), 0 do not remove them
|
||||
* @param int $includequotes 1=Include simple quotes (double is already included by default)
|
||||
* @param int $allowdash 1=Allow dash char after a space and before a string, 0 do not allow
|
||||
* @return string String cleaned
|
||||
*
|
||||
* @see dol_string_nospecial(), dol_string_unaccent(), dol_sanitizePathName()
|
||||
*/
|
||||
function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1, $includequotes = 0)
|
||||
function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1, $includequotes = 0, $allowdash = 0)
|
||||
{
|
||||
$str = (string) $str;
|
||||
|
||||
|
|
@ -1955,9 +1956,13 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1, $includequotes
|
|||
}
|
||||
$tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars);
|
||||
$tmp = preg_replace('/\-\-+/', '_', $tmp);
|
||||
$tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp);
|
||||
$tmp = preg_replace('/\s+\-$/', '', $tmp);
|
||||
if (empty($allowdash)) {
|
||||
$tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp);
|
||||
$tmp = preg_replace('/\s+\-$/', '', $tmp);
|
||||
}
|
||||
$tmp = str_replace('..', '', $tmp);
|
||||
$tmp = str_replace('~', $newstr, $tmp);
|
||||
$tmp = preg_replace('/\s{2,}/', ' ', $tmp);
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
|
@ -1998,6 +2003,8 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 0, $allowdash = 0
|
|||
}
|
||||
$tmp = str_replace('..', $newstr, $tmp);
|
||||
$tmp = str_replace('~', $newstr, $tmp);
|
||||
$tmp = preg_replace('/\s{2,}/', ' ', $tmp);
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
|
|
@ -12798,7 +12805,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
|
|||
|
||||
// No need to make a return $head. Var is modified as a reference
|
||||
if (!empty($hookmanager)) {
|
||||
$parameters = array('object' => $object, 'mode' => $mode, 'head' => &$head, 'filterorigmodule' => $filterorigmodule);
|
||||
$parameters = array('object' => $object, 'mode' => $mode, 'head' => &$head, 'filterorigmodule' => $filterorigmodule, 'type' => $type);
|
||||
// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
|
||||
$reshook = $hookmanager->executeHooks('completeTabsHead', $parameters, $object);
|
||||
if ($reshook > 0) { // Hook ask to replace completely the array
|
||||
|
|
@ -15703,11 +15710,12 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex
|
|||
* Decode an encoded string. The string can be encoded in json format (recommended) or with serialize (avoid this)
|
||||
*
|
||||
* @param string $stringtodecode String to decode (json or serialize coded)
|
||||
* @param boolean $assoc true=Return is converted into associative array
|
||||
* @return mixed The decoded object.
|
||||
*/
|
||||
function jsonOrUnserialize($stringtodecode)
|
||||
function jsonOrUnserialize($stringtodecode, $assoc = true)
|
||||
{
|
||||
$result = json_decode($stringtodecode);
|
||||
$result = json_decode($stringtodecode, $assoc);
|
||||
if ($result === null) {
|
||||
$result = unserialize($stringtodecode); // For backward compatibility. Is no more used in recent versions.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3214,13 +3214,7 @@ class CommandeFournisseur extends CommonOrder
|
|||
if ($qty < $this->line->packaging) {
|
||||
$qty = $this->line->packaging;
|
||||
} else {
|
||||
// Ensure packaging is numeric, positive, and use fmod instead of %, to prevent error with decimal packaging values (resulting in division by zero)
|
||||
if (
|
||||
!empty($this->line->packaging)
|
||||
&& is_numeric($this->line->packaging)
|
||||
&& (float) $this->line->packaging > 0
|
||||
&& fmod((float) $qty, (float) $this->line->packaging) > 0
|
||||
) {
|
||||
if (!empty($this->line->packaging) && is_numeric($this->line->packaging) && (float) $this->line->packaging > 0 && (fmod((float) $qty, (float) $this->line->packaging) > 0)) {
|
||||
$coeff = intval($qty / $this->line->packaging) + 1;
|
||||
$qty = $this->line->packaging * $coeff;
|
||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||
|
|
|
|||
|
|
@ -1598,6 +1598,11 @@ if (empty($reshook)) {
|
|||
dol_syslog("Try to find source object origin=".$object->origin_type." originid=".$object->origin_id." to add lines");
|
||||
$result = $srcobject->fetch($object->origin_id);
|
||||
if ($result > 0) {
|
||||
if (empty($object->delivery_date)) {
|
||||
$tmpdate = $srcobject->delivery_date;
|
||||
$object->setDeliveryDate($user, $tmpdate);
|
||||
}
|
||||
|
||||
$object->set_id_projet($user, $srcobject->fk_project);
|
||||
|
||||
$lines = $srcobject->lines;
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (1
|
|||
insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '14','0','VAT rate - intermediary',1,__ENTITY__);
|
||||
insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '8','0','VAT rate - reduced', 1,__ENTITY__);
|
||||
insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '3','0','VAT rate - super-reduced', 1,__ENTITY__);
|
||||
insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '16','0','VAT rate - standard',1,__ENTITY__);
|
||||
insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '17','0','VAT rate - standard',1,__ENTITY__);
|
||||
|
||||
-- MALI (id country=147)
|
||||
insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (147, '0','0','VAT rate 0', 1,__ENTITY__);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ SendAskRef=Sending the price request %s
|
|||
SupplierProposalCard=Request card
|
||||
ConfirmDeleteAsk=Are you sure you want to delete this price request <b>%s</b>?
|
||||
ActionsOnSupplierProposal=Events on price request
|
||||
DocModelAuroreDescription=A complete template for a vendor quotation request (old implementation of Sponge template)
|
||||
DocModelAuroreDescription=A complete template for a vendor quotation request (old implementation of Zenith template)
|
||||
DocModelZenithDescription=A complete template for a vendor quotation request
|
||||
CommercialAsk=Price request
|
||||
DefaultModelSupplierProposalCreate=Default model creation
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ if ($object->id > 0) {
|
|||
$param .= '&search_complete='.urlencode($search_complete);
|
||||
}
|
||||
if ($search_filtert != '') {
|
||||
$param .= '&search_filtert='.urlencode($search_filtert);
|
||||
$param .= '&search_filtert='.urlencode((string) $search_filtert);
|
||||
}
|
||||
if ($search_dateevent_start != '') {
|
||||
$param .= '&dateevent_startyear='.GETPOSTINT('dateevent_startyear');
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') ||
|
|||
$param .= '&search_complete='.urlencode($search_complete);
|
||||
}
|
||||
if ($search_filtert != '') {
|
||||
$param .= '&search_filtert='.urlencode($search_filtert);
|
||||
$param .= '&search_filtert='.urlencode((string) $search_filtert);
|
||||
}
|
||||
if ($search_dateevent_start != '') {
|
||||
$param .= '&dateevent_startyear='.GETPOSTINT('dateevent_startyear');
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ if (!empty($object->id)) {
|
|||
$param .= '&search_complete='.urlencode($search_complete);
|
||||
}
|
||||
if ($search_filtert != '') {
|
||||
$param .= '&search_filtert='.urlencode($search_filtert);
|
||||
$param .= '&search_filtert='.urlencode((string) $search_filtert);
|
||||
}
|
||||
if ($search_dateevent_start != '') {
|
||||
$param .= '&dateevent_startyear='.GETPOSTINT('dateevent_startyear');
|
||||
|
|
@ -258,7 +258,7 @@ if (!empty($object->id)) {
|
|||
$param .= '&dateevent_endday='.GETPOSTINT('dateevent_endday');
|
||||
}
|
||||
|
||||
|
||||
// Try to know count of actioncomm from cache
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||
$cachekey = 'count_events_project_'.$object->id;
|
||||
$nbEvent = dol_getcache($cachekey);
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') ||
|
|||
$param .= '&search_complete='.urlencode($search_complete);
|
||||
}
|
||||
if ($search_filtert != '') {
|
||||
$param .= '&search_filtert='.urlencode($search_filtert);
|
||||
$param .= '&search_filtert='.urlencode((string) $search_filtert);
|
||||
}
|
||||
if ($search_dateevent_start != '') {
|
||||
$param .= '&dateevent_startyear='.GETPOSTINT('dateevent_startyear');
|
||||
|
|
|
|||
|
|
@ -1135,8 +1135,9 @@ class Thirdparties extends DolibarrApi
|
|||
$sql = '';
|
||||
if ($mode === 'customer') {
|
||||
$sql = "SELECT f.ref, f.type as factype, re.fk_facture_source, re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc, re.description, re.fk_facture, re.fk_facture_line";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re, ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " WHERE f.rowid = re.fk_facture_source AND re.fk_soc = ".((int) $id);
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = re.fk_facture_source";
|
||||
$sql .= " WHERE re.fk_soc = ".((int) $id);
|
||||
if ($filter == "available") {
|
||||
$sql .= " AND re.fk_facture IS NULL AND re.fk_facture_line IS NULL";
|
||||
}
|
||||
|
|
@ -1145,7 +1146,8 @@ class Thirdparties extends DolibarrApi
|
|||
}
|
||||
} elseif ($mode === 'supplier') {
|
||||
$sql = "SELECT f.ref, f.type as factype, re.fk_invoice_supplier_source, re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc, re.description, re.fk_invoice_supplier, re.fk_invoice_supplier_line";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re, ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = re.fk_invoice_supplier_source";
|
||||
$sql .= " WHERE f.rowid = re.fk_invoice_supplier_source AND re.fk_soc = ".((int) $id);
|
||||
if ($filter == "available") {
|
||||
$sql .= " AND re.fk_invoice_supplier IS NULL AND re.fk_invoice_supplier_line IS NULL";
|
||||
|
|
|
|||
|
|
@ -216,13 +216,13 @@ class Societe extends CommonObject
|
|||
'idprof4' => array('type' => 'varchar(128)', 'label' => 'Idprof4', 'enabled' => 1, 'visible' => -1, 'position' => 205),
|
||||
'idprof5' => array('type' => 'varchar(128)', 'label' => 'Idprof5', 'enabled' => 1, 'visible' => -1, 'position' => 206),
|
||||
'idprof6' => array('type' => 'varchar(128)', 'label' => 'Idprof6', 'enabled' => 1, 'visible' => -1, 'position' => 207),
|
||||
'tva_intra' => array('type' => 'varchar(20)', 'label' => 'Tva intra', 'enabled' => 1, 'visible' => -1, 'position' => 210),
|
||||
'tva_intra' => array('type' => 'varchar(20)', 'label' => 'VATIntra', 'enabled' => 1, 'visible' => -1, 'position' => 210),
|
||||
'capital' => array('type' => 'double(24,8)', 'label' => 'Capital', 'enabled' => 1, 'visible' => -1, 'position' => 215),
|
||||
'fk_stcomm' => array('type' => 'integer', 'label' => 'CommercialStatus', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 220),
|
||||
'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 225),
|
||||
'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 230),
|
||||
'client' => array('type' => 'tinyint(4)', 'label' => 'Client', 'enabled' => 1, 'visible' => -1, 'position' => 240),
|
||||
'fournisseur' => array('type' => 'tinyint(4)', 'label' => 'Fournisseur', 'enabled' => 1, 'visible' => -1, 'position' => 245),
|
||||
'client' => array('type' => 'tinyint(4)', 'label' => 'Customer', 'enabled' => 1, 'visible' => -1, 'position' => 240),
|
||||
'fournisseur' => array('type' => 'tinyint(4)', 'label' => 'Supplier', 'enabled' => 1, 'visible' => -1, 'position' => 245),
|
||||
'supplier_account' => array('type' => 'varchar(32)', 'label' => 'Supplier account', 'enabled' => 1, 'visible' => -1, 'position' => 250),
|
||||
'fk_prospectlevel' => array('type' => 'varchar(12)', 'label' => 'ProspectLevel', 'enabled' => 1, 'visible' => -1, 'position' => 255),
|
||||
'customer_bad' => array('type' => 'tinyint(4)', 'label' => 'Customer bad', 'enabled' => 1, 'visible' => -1, 'position' => 260),
|
||||
|
|
@ -1141,11 +1141,11 @@ class Societe extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
// Ajout du commercial affecte
|
||||
// Addition of the assigned sales representative
|
||||
if ($this->commercial_id != '' && $this->commercial_id != -1) {
|
||||
$this->add_commercial($user, $this->commercial_id);
|
||||
} elseif (!$user->hasRight('societe', 'client', 'voir')) {
|
||||
// si un commercial cree un client il lui est affecte automatiquement
|
||||
// If a sales representative creates a customer, they are automatically assigned to them.
|
||||
$this->add_commercial($user, $user->id);
|
||||
}
|
||||
|
||||
|
|
@ -1506,9 +1506,9 @@ class Societe extends CommonObject
|
|||
$this->order_min_amount = price2num($this->order_min_amount);
|
||||
$this->supplier_order_min_amount = price2num($this->supplier_order_min_amount);
|
||||
|
||||
$this->tva_assuj = (is_numeric($this->tva_assuj)) ? (int) trim((string) $this->tva_assuj) : 0;
|
||||
$this->tva_intra = dol_sanitizeFileName($this->tva_intra ?? '', '');
|
||||
$this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1;
|
||||
$this->tva_assuj = (is_numeric($this->tva_assuj)) ? (int) trim((string) $this->tva_assuj) : 0;
|
||||
$this->tva_intra = trim($this->tva_intra);
|
||||
$this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1;
|
||||
if (empty($this->status)) {
|
||||
$this->status = 0;
|
||||
}
|
||||
|
|
@ -1879,7 +1879,7 @@ class Societe extends CommonObject
|
|||
}
|
||||
} else {
|
||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
// Doublon
|
||||
// Duplicate
|
||||
$this->error = $langs->trans("ErrorDuplicateField");
|
||||
$result = -1;
|
||||
} else {
|
||||
|
|
@ -2179,7 +2179,7 @@ class Societe extends CommonObject
|
|||
$this->order_min_amount = $obj->order_min_amount;
|
||||
$this->supplier_order_min_amount = $obj->supplier_order_min_amount;
|
||||
|
||||
// multiprix
|
||||
// multi price
|
||||
$this->price_level = $obj->price_level;
|
||||
|
||||
// warehouse
|
||||
|
|
@ -2567,7 +2567,7 @@ class Societe extends CommonObject
|
|||
if ($this->id) {
|
||||
$newclient = 1;
|
||||
if (($this->client == 2 || $this->client == 3) && !getDolGlobalInt('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
|
||||
$newclient = 3; //If prospect, we keep prospect tag
|
||||
$newclient = 3; // If prospected, we keep prospect tag
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " SET client = ".((int) $newclient);
|
||||
|
|
@ -3867,7 +3867,7 @@ class Societe extends CommonObject
|
|||
return 1;
|
||||
}
|
||||
if ($mod->code_modifiable) {
|
||||
return 1; // A mettre en dernier
|
||||
return 1; // To be put last
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
|
|
@ -3908,7 +3908,7 @@ class Societe extends CommonObject
|
|||
return 1;
|
||||
}
|
||||
if ($mod->code_modifiable) {
|
||||
return 1; // A mettre en dernier
|
||||
return 1; // To be put last
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
|
|
@ -4701,7 +4701,7 @@ class Societe extends CommonObject
|
|||
|
||||
$this->db->begin();
|
||||
|
||||
// Cree et positionne $this->id
|
||||
// Creates and positions $this->id
|
||||
$result = $this->create($user);
|
||||
|
||||
if ($result >= 0) {
|
||||
|
|
@ -4738,7 +4738,7 @@ class Societe extends CommonObject
|
|||
return -1;
|
||||
}
|
||||
} else {
|
||||
// $this->error deja positionne
|
||||
// $this->error already positioned
|
||||
dol_syslog(get_class($this)."::create_from_member - 2 - ".$this->error." - ".implode(',', $this->errors), LOG_ERR);
|
||||
|
||||
$this->db->rollback();
|
||||
|
|
@ -5440,7 +5440,7 @@ class Societe extends CommonObject
|
|||
$result = $companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
$this->last_main_doc = $companybankaccount->last_main_doc;
|
||||
} else {
|
||||
// Positionne le modele sur le nom du modele a utiliser
|
||||
// Set the model to the name of the model to be used
|
||||
if (!dol_strlen($modele)) {
|
||||
if (getDolGlobalString('COMPANY_ADDON_PDF')) {
|
||||
$modele = getDolGlobalString('COMPANY_ADDON_PDF');
|
||||
|
|
|
|||
|
|
@ -9463,6 +9463,7 @@ include dol_buildpath($path.'/theme/'.$theme.'/progress.inc.php', 0);
|
|||
include dol_buildpath($path.'/theme/'.$theme.'/timeline.inc.php', 0);
|
||||
include dol_buildpath($path.'/theme/'.$theme.'/search-input.inc.css', 0);
|
||||
include dol_buildpath($path.'/theme/'.$theme.'/tooltips.inc.css', 0);
|
||||
include dol_buildpath($path.'/theme/'.$theme.'/input-feedback.css', 0);
|
||||
|
||||
|
||||
// Add custom CSS if defined
|
||||
|
|
|
|||
|
|
@ -9186,6 +9186,7 @@ include dol_buildpath($path.'/theme/'.$theme.'/progress.inc.php', 0);
|
|||
include dol_buildpath($path.'/theme/eldy/timeline.inc.php', 0); // actually md use same style as eldy theme
|
||||
include dol_buildpath($path.'/theme/'.$theme.'/search-input.inc.css', 0); // actually md use same style as eldy theme
|
||||
include dol_buildpath($path.'/theme/'.$theme.'/tooltips.inc.css', 0);
|
||||
include dol_buildpath($path.'/theme/eldy/input-feedback.css', 0); // actually md use same style as eldy theme
|
||||
|
||||
if (getDolGlobalString('THEME_CUSTOM_CSS')) {
|
||||
print getDolGlobalString('THEME_CUSTOM_CSS');
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ if (empty($reshook)) {
|
|||
// Reopen ticket
|
||||
if ($object->fetch(GETPOSTINT('id'), GETPOST('track_id', 'alpha')) >= 0) {
|
||||
$new_status = GETPOSTINT('new_status');
|
||||
//$old_status = $object->status;
|
||||
|
||||
$res = $object->setStatut($new_status, null, '', $triggermodname);
|
||||
if ($res) {
|
||||
$url = 'card.php?track_id=' . $object->track_id;
|
||||
|
|
|
|||
|
|
@ -1717,7 +1717,7 @@ class Ticket extends CommonObject
|
|||
$this->status = Ticket::STATUS_READ;
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."ticket";
|
||||
$sql .= " SET fk_statut = ".Ticket::STATUS_READ.", date_read = '".$this->db->idate(dol_now())."'";
|
||||
$sql .= " SET fk_statut = ".((int) $this->status) .", date_read = '".$this->db->idate(dol_now())."'";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::markAsRead");
|
||||
|
|
@ -1742,7 +1742,9 @@ class Ticket extends CommonObject
|
|||
$this->status = $this->oldcopy->status;
|
||||
|
||||
$this->db->rollback();
|
||||
|
||||
$this->error = implode(',', $this->errors);
|
||||
|
||||
dol_syslog(get_class($this)."::markAsRead ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -2009,8 +2011,11 @@ class Ticket extends CommonObject
|
|||
if ($this->status != Ticket::STATUS_CLOSED && $this->status != Ticket::STATUS_CANCELED) { // not closed
|
||||
$this->db->begin();
|
||||
|
||||
$this->oldcopy = dol_clone($this);
|
||||
$this->status = ($mode ? Ticket::STATUS_CANCELED : Ticket::STATUS_CLOSED);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."ticket";
|
||||
$sql .= " SET fk_statut=".($mode ? Ticket::STATUS_CANCELED : Ticket::STATUS_CLOSED).", progress=100, date_close='".$this->db->idate(dol_now())."'";
|
||||
$sql .= " SET fk_statut = ".((int) $this->status).", progress=100, date_close='".$this->db->idate(dol_now())."'";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::close mode=".$mode);
|
||||
|
|
@ -3068,8 +3073,10 @@ class Ticket extends CommonObject
|
|||
if ((getDolGlobalInt('TICKET_SET_STATUS_ON_ANSWER', -1) < 0
|
||||
&& ($object->status < self::STATUS_IN_PROGRESS && !$user->socid && !$private))
|
||||
|| ($object->status > self::STATUS_IN_PROGRESS && $public_area)) {
|
||||
// Set status
|
||||
$object->setStatut($object::STATUS_IN_PROGRESS, null, '', 'TICKET_MODIFY');
|
||||
} elseif (getDolGlobalInt('TICKET_SET_STATUS_ON_ANSWER', -1) >= 0 && empty($user->socid) && empty($private)) {
|
||||
// Set status
|
||||
$object->setStatut(getDolGlobalInt('TICKET_SET_STATUS_ON_ANSWER'), null, '', 'TICKET_MODIFY');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -298,7 +298,9 @@ if (empty($reshook)) {
|
|||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
|
||||
// Set status
|
||||
$result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED, null, '', 'TICKET_MODIFY');
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue