# WARNING: head commit changed in the meantime

Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 15.0
This commit is contained in:
Laurent Destailleur 2022-04-01 14:39:10 +02:00
commit d0ee40e55d
7 changed files with 25 additions and 13 deletions

View File

@ -701,7 +701,7 @@ if (empty($reshook) && $action == 'update') {
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
$object->loadReminders();
$object->loadReminders($remindertype, 0, false);
if (!empty($object->reminders) && $object->datep > dol_now()) {
foreach ($object->reminders as $reminder) {
$reminder->delete($user);

View File

@ -57,6 +57,7 @@ $socid = GETPOST('socid', 'int');
// Category
$selected_cat = (int) GETPOST('search_categ', 'int');
if ($selected_cat == -1) $selected_cat = '';
$subcat = false;
if (GETPOST('subcat', 'alpha') === 'yes') {
$subcat = true;

View File

@ -79,6 +79,9 @@ class box_dolibarr_state_board extends ModeleBoxes
if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) {
$hookmanager = new HookManager($this->db);
$hookmanager->initHooks(array('index'));
$object = new stdClass;
$action = '';
$hookmanager->executeHooks('addStatisticLine', array(), $object, $action);
$boxstatItems = array();
$boxstatFromHook = '';
$boxstatFromHook = $hookmanager->resPrint;

View File

@ -252,7 +252,7 @@ class modResource extends DolibarrModules
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'resource as r';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = r.rowid';
$this->export_sql_end[$r] .= ' AND r.entity IN ('.getEntity('resource').')';
$this->export_sql_end[$r] .= ' WHERE r.entity IN ('.getEntity('resource').')';
// Imports

View File

@ -359,6 +359,8 @@ if (empty($reshook)) {
$db->begin();
$default_ref_supplier=dol_print_date(dol_now(), '%Y%m%d%H%M%S');
foreach ($orders as $id_order) {
$cmd = new CommandeFournisseur($db);
if ($cmd->fetch($id_order) <= 0) {
@ -376,7 +378,8 @@ if (empty($reshook)) {
$objecttmp->fk_project = $cmd->fk_project;
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
if (empty($createbills_onebythird)) {
$objecttmp->ref_client = $cmd->ref_client;
$objecttmp->ref_supplier = !empty($cmd->ref_supplier) ? $cmd->ref_supplier : $default_ref_supplier;
$default_ref_supplier+=1;
}
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));

View File

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
*
* 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
@ -240,7 +240,7 @@ if ($action == "setaskforshippingmet") {
}
}
//Activate "Disable prospect/customer type"
// Activate "Disable prospect/customer type"
if ($action == "setdisableprospectcustomer") {
$setdisableprospectcustomer = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity);

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -1003,23 +1003,28 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$modCodeFournisseur = new $module;
// Define if customer/prospect or supplier status is set or not
if (GETPOST("type") != 'f') {
if (GETPOST("type", 'aZ') != 'f') {
$object->client = -1;
if (!empty($conf->global->THIRDPARTY_CUSTOMERPROSPECT_BY_DEFAULT)) {
$object->client = 3;
}
}
// Prospect / Customer
if (GETPOST("type") == 'c') {
if (GETPOST("type", 'aZ') == 'c') {
if (!empty($conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT)) {
$object->client = $conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT;
} else {
$object->client = 3;
}
}
if (GETPOST("type") == 'p') {
if (GETPOST("type", 'aZ') == 'p') {
$object->client = 2;
}
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS) && $object->client == 3) {
$object->client = 1;
}
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) {
$object->fournisseur = 1;
}