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

Conflicts:
	htdocs/admin/dict.php
	htdocs/comm/action/list.php
	htdocs/compta/bank/releve.php
	htdocs/compta/salaries/card.php
	htdocs/core/actions_addupdatedelete.inc.php
	htdocs/filefunc.inc.php
	htdocs/langs/en_US/boxes.lang
	htdocs/langs/en_US/main.lang
	htdocs/product/class/product.class.php
	htdocs/product/reassort.php
	htdocs/product/stock/product.php
	htdocs/projet/element.php
This commit is contained in:
Laurent Destailleur 2020-01-04 14:20:25 +01:00
commit 38de69f5a9
14 changed files with 76 additions and 17 deletions

View File

@ -2,6 +2,33 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 10.0.5 compared to 10.0.4 *****
FIX: 10.0: add URL param "restore_last_search_values=1" to all backlinks pointing to lists
FIX: 10.0: do not display single-letter values (indicating duration unit without value) in product list
FIX: #12473
FIX: #12481 : fix ticket creation from thirdparty, mission $socid var
FIX: #12482
FIX: #12644
FIX: #12665 Mass invoice validation with stock management
FIX: #12688
FIX: #12745
FIX: add and modify category translate form with posted values on errors
FIX: add URL param "restore_last_search_values=1" to all backlinks that point to a list
FIX: CommandeFournisseurLigne update function must not be able to return other value than 1 if success
FIX: contact card state address selected after filling address
FIX: dol_string_nohtmltag when there is html with windows EOL "<br>\r\n"
FIX: filter language is an array
FIX: first col at wrong position in Export 2007 (new)
FIX: getrights() request
FIX: Invoice Situation integration into Margin
FIX: missing nl2br conversion
FIX: not fee in payout list
FIX: product_fourn_price_id was assigned too late for logPrice() function
FIX: Reduce number of request for list of products
FIX: set due date in object in create invoice
FIX: units traductions for selectUnits() function
FIX: when we need to bill several orders, order lines unit is not on bill lines
NEW: 9.0: allow users to use the mysqldump '--quick' option
***** ChangeLog for 11.0.0 compared to 10.0.0 *****
For Users:

View File

@ -308,7 +308,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND (a.fk_soc IS
if ($socid > 0) $sql .= " AND s.rowid = ".$socid;
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
if ($type) $sql .= " AND c.id = ".$type;
if ($type) $sql .= " AND c.id = ".(int) $type;
if ($status == '0') { $sql .= " AND a.percent = 0"; }
if ($status == '-1') { $sql .= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql .= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started

View File

@ -38,12 +38,15 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
//show files
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("banks", "categories", "companies", "bills", "trips"));
$langs->loadLangs(array("banks", "categories", "companies", "bills", "trips", "donations", "loan"));
$action = GETPOST('action', 'alpha');
$id = GETPOST('account', 'int');
@ -202,6 +205,9 @@ $paymentvatstatic = new TVA($db);
$bankstatic = new Account($db);
$banklinestatic = new AccountLine($db);
$remisestatic = new RemiseCheque($db);
$paymentdonationstatic=new PaymentDonation($db);
$paymentloanstatic=new PaymentLoan($db);
$paymentvariousstatic=new PaymentVarious($db);
// Must be before button action
$param = '';
@ -512,7 +518,28 @@ else
print '</a>';
$newline = 0;
}
elseif ($links[$key]['type'] == 'banktransfert') {
elseif ($links[$key]['type']=='payment_donation')
{
$paymentdonationstatic->id=$links[$key]['url_id'];
$paymentdonationstatic->ref=$langs->trans("Payment");
print ' '.$paymentdonationstatic->getNomUrl(1);
$newline = 0;
}
elseif ($links[$key]['type']=='payment_loan')
{
$paymentloanstatic->id=$links[$key]['url_id'];
$paymentloanstatic->ref=$langs->trans("Payment");
print ' '.$paymentloanstatic->getNomUrl(1);
$newline = 0;
}
elseif ($links[$key]['type']=='payment_various')
{
$paymentvariousstatic->id=$links[$key]['url_id'];
$paymentvariousstatic->ref=$langs->trans("Payment");
print ' '.$paymentvariousstatic->getNomUrl(1);
$newline = 0;
}
elseif ($links[$key]['type']=='banktransfert') {
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
if ($objp->amount > 0)
{

View File

@ -142,8 +142,8 @@ if ($action == 'update' && !empty($permissiontoadd))
} else {
$value = '';
}
} elseif (in_array($object->fields[$key]['type'], array('price', 'real'))) {
$value = price2num(GETPOST($key));
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
} else {
$value = GETPOST($key, 'alpha');
}

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (c) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (c) 2015-2019 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -98,7 +98,7 @@ class FormMargin
$pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
if ($object->type == Facture::TYPE_SITUATION) {
if ($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) {
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
} else {
$pa = $line->qty * $pa_ht;

View File

@ -208,7 +208,7 @@ class SupplierInvoices extends DolibarrApi
foreach($request_data as $field => $value) {
$this->invoice->$field = $value;
}
if(! array_keys($request_data, 'date')) {
if(! array_key_exists('date', $request_data)) {
$this->invoice->date = dol_now();
}

View File

@ -1012,3 +1012,4 @@ ContactDefault_propal=Proposal
ContactDefault_supplier_proposal=Supplier Proposal
ContactDefault_ticketsup=Ticket
ContactAddedAutomatically=Contact added from contact thirdparty roles
More=More

View File

@ -56,7 +56,7 @@ Notify_BILL_SUPPLIER_PAYED=Vendor invoice paid
Notify_BILL_SUPPLIER_SENTBYMAIL=Vendor invoice sent by mail
Notify_BILL_SUPPLIER_CANCELED=Vendor invoice cancelled
Notify_CONTRACT_VALIDATE=Contract validated
Notify_FICHEINTER_VALIDATE=Intervention validated
Notify_FICHINTER_VALIDATE=Intervention validated
Notify_FICHINTER_ADD_CONTACT=Added contact to Intervention
Notify_FICHINTER_SENTBYMAIL=Intervention sent by mail
Notify_SHIPPING_VALIDATE=Shipping validated
@ -272,4 +272,4 @@ WEBSITE_KEYWORDS=Keywords
LinesToImport=Lines to import
MemoryUsage=Memory usage
RequestDuration=Duration of request
RequestDuration=Duration of request

View File

@ -624,7 +624,7 @@ if ($id > 0)
else
{
print '<td class="nowrap">';
print $langs->trans("LoanAccountancyCapitalCode");
print $langs->trans("LoanAccountancyInsuranceCode");
print '</td><td>';
if (!empty($conf->accounting->enabled))

View File

@ -135,7 +135,7 @@ if ($action == 'convert')
$newlevel=$level;
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n";
$retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvatratclean, $newminprice, $newlevel, $newnpr, 0, 0, $localtaxes_type, $newdefaultvatcode);
$retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvatrateclean, $newminprice, $newlevel, $newnpr, 0, 0, $localtaxes_type, $newdefaultvatcode);
if ($retm < 0)
{
$error++;

View File

@ -1876,6 +1876,9 @@ class Product extends CommonObject
if (empty($newminprice)) {
$newminprice = 0;
}
if (empty($newminprice)) {
$newminprice=0;
}
// Check parameters
if ($newvat == '') {
@ -2677,7 +2680,7 @@ class Product extends CommonObject
* Charge tableau des stats expedition client pour le produit/service
*
* @param int $socid Id societe pour filtrer sur une societe
* @param string $filtrestatut Id statut pour filtrer sur un statut
* @param string $filtrestatut [=''] Ids order status separated by comma
* @param int $forVirtualStock Ignore rights filter for virtual stock calculation.
* @param string $filterShipmentStatus [=''] Ids shipment status separated by comma
* @return int <0 if KO, >0 if OK (Tableau des stats)

View File

@ -122,7 +122,8 @@ $sql .= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desir
$sql .= ' SUM(s.reel) as stock_physique';
if (!empty($conf->global->PRODUCT_USE_UNITS)) $sql .= ', u.short_label as unit_short';
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s on p.rowid = s.fk_product';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON s.fk_entrepot = e.rowid AND e.entity IN ('.getEntity('entrepot').')';
if (!empty($conf->global->PRODUCT_USE_UNITS)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
// We'll need this table joined to the select in order to filter by categ
if ($search_categ) $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";

View File

@ -463,7 +463,7 @@ $listofreferent = array(
'table'=>'projet_task',
'datefieldname'=>'task_date',
'disableamount'=>0,
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?id='.$id,
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id,
'buttonnew'=>'AddTimeSpent',
'testnew'=>$user->rights->projet->creer,
'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
@ -538,7 +538,7 @@ if ($action=="addelement")
elseif ($action == "unlink")
{
$tablename = GETPOST("tablename", "aZ09");
$projectField = GETPOST('projectfield', 'aZ09') ? GETPOST('projectfield', 'aZ09') : 'fk_projet';
$projectField = GETPOSTISSET('projectfield') ? GETPOST('projectfield', 'aZ09') : 'fk_projet';
$elementselectid = GETPOST("elementselect", "int");
$result = $object->remove_element($tablename, $elementselectid, $projectField);

View File

@ -44,7 +44,7 @@ if (! empty($conf->projet->enabled)) $langs->load("projects");
$id = GETPOST("id", 'int');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$accountid = GETPOST("accountid", 'int');
$accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0;
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int'));