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

This commit is contained in:
Laurent Destailleur 2021-10-31 14:38:07 +01:00
commit 8064ecce73
6 changed files with 30 additions and 25 deletions

View File

@ -237,7 +237,7 @@ if (empty($mysoc->country_code)) {
$sql = "SELECT taux as vat_rate, t.code as vat_code, t.localtax1 as localtax_rate1, t.localtax2 as localtax_rate2";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <>0 OR t.localtax2 <>0)";
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <> '0' OR t.localtax2 <> '0')";
$sql .= " ORDER BY t.taux ASC";
$resql = $db->query($sql);
if ($resql) {

View File

@ -2084,7 +2084,7 @@ class CommandeFournisseur extends CommonOrder
// Test we can delete
$this->fetchObjectLinked(null, 'order_supplier');
if (!empty($this->linkedObjects)) {
if (!empty($this->linkedObjects) && array_key_exists('reception', $this->linkedObjects)) {
foreach ($this->linkedObjects['reception'] as $element) {
if ($element->statut >= 0) {
$this->errors[] = $langs->trans('ReceptionExist');

View File

@ -255,4 +255,4 @@ MakeMovementsAndClose=Generate movements and close
AutofillWithExpected=Fill real quantity with expected quantity
ShowAllBatchByDefault=By default, show batch details on product "stock" tab
CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration
FieldCannotBeNegative=Field "%s" cannot be negative
FieldCannotBeNegative=Field "%s" cannot be negative

View File

@ -195,6 +195,7 @@ $now = dol_now();
$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
$title = $langs->trans("ListOfWarehouses");
$totalarray = array();
// Build and execute select
// --------------------------------------------------------------------
@ -566,7 +567,6 @@ print '</tr>'."\n";
// Loop on record
// --------------------------------------------------------------------
$i = 0;
$totalarray = array();
$warehouse = new Entrepot($db);

View File

@ -358,12 +358,14 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
$sql .= $hookmanager->resPrint;
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product AND s.fk_entrepot IN ('.$db->sanitize($listofqualifiedwarehousesid).')';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
$list_warehouse = (empty($listofqualifiedwarehousesid) ? '0' : $listofqualifiedwarehousesid);
$sql .= ' AND s.fk_entrepot IN ('.$db->sanitize($list_warehouse) .')';
//$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.((int) $fk_entrepot).')';
}
// Add fields from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListJoin', $parameters); // Note that $action and $object may have been modified by hook
@ -577,6 +579,9 @@ print load_fiche_titre($langs->trans('Replenishment'), '', 'stock');
print dol_get_fiche_head($head, 'replenish', '', -1, '');
print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDesc").'</span>'."\n";
//$link = '<a title=' .$langs->trans("MenuNewWarehouse"). ' href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create">'.$langs->trans("MenuNewWarehouse").'</a>';
if (empty($fk_warhouse) && !empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDescPerWarehouse").'</span>'."\n";
}

View File

@ -1,13 +1,13 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
*
* 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
@ -590,8 +590,8 @@ $listofreferent = array(
'name'=>"Salaries",
'title'=>"ListSalariesAssociatedProject",
'class'=>'Salary',
'table'=>'payment_salary',
'datefieldname'=>'datev',
'table'=>'salary',
'datefieldname'=>'datesp',
'margin'=>'minus',
'disableamount'=>0,
'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id,
@ -816,7 +816,7 @@ foreach ($listofreferent as $key => $value) {
}
// Define $total_ht_by_line
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') {
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') {
$total_ht_by_line = $element->amount;
} elseif ($tablename == 'fichinter') {
$total_ht_by_line = $element->getAmount();
@ -858,7 +858,7 @@ foreach ($listofreferent as $key => $value) {
}
// Define $total_ttc_by_line
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') {
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') {
$total_ttc_by_line = $element->amount;
} elseif ($tablename == 'fichinter') {
$total_ttc_by_line = $element->getAmount();
@ -1075,7 +1075,7 @@ foreach ($listofreferent as $key => $value) {
print ''; // if $key == 'project_task', we don't want details per user
} elseif (in_array($tablename, array('payment_various'))) {
print ''; // if $key == 'payment_various', we don't have any thirdparty
} elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'payment_salary'))) {
} elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'salary'))) {
print $langs->trans("User");
} else {
print $langs->trans("ThirdParty");
@ -1233,8 +1233,8 @@ foreach ($listofreferent as $key => $value) {
$date = $element->date; // No draft status on lines
} elseif ($tablename == 'stock_mouvement') {
$date = $element->datem;
} elseif ($tablename == 'payment_salary') {
$date = $element->datev;
} elseif ($tablename == 'salary') {
$date = $element->datesp;
} elseif ($tablename == 'payment_various') {
$date = $element->datev;
} elseif ($tablename == 'chargesociales') {
@ -1292,7 +1292,7 @@ foreach ($listofreferent as $key => $value) {
$tmpuser = new User($db);
$tmpuser->fetch($expensereport->fk_user_author);
print $tmpuser->getNomUrl(1, '', 48);
} elseif ($tablename == 'payment_salary') {
} elseif ($tablename == 'salary') {
$tmpuser = new User($db);
$tmpuser->fetch($element->fk_user);
print $tmpuser->getNomUrl(1, '', 48);
@ -1320,7 +1320,7 @@ foreach ($listofreferent as $key => $value) {
if (empty($value['disableamount'])) {
$total_ht_by_line = null;
$othermessage = '';
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') {
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') {
$total_ht_by_line = $element->amount;
} elseif ($tablename == 'fichinter') {
$total_ht_by_line = $element->getAmount();
@ -1374,7 +1374,7 @@ foreach ($listofreferent as $key => $value) {
// Amount inc tax
if (empty($value['disableamount'])) {
$total_ttc_by_line = null;
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') {
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') {
$total_ttc_by_line = $element->amount;
} elseif ($tablename == 'fichinter') {
$total_ttc_by_line = $element->getAmount();