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

This commit is contained in:
Laurent Destailleur 2021-01-06 20:12:17 +01:00
commit 7f21332533
7 changed files with 26 additions and 6 deletions

View File

@ -577,6 +577,7 @@ if ($id == 11)
// 'contract' => $langs->trans('Contract'),
'project' => $langs->trans('Project'),
'project_task' => $langs->trans('Task'),
'ticket' => $langs->trans('Ticket'),
'agenda' => $langs->trans('Agenda'),
'dolresource' => $langs->trans('Resource'),
// old deprecated
@ -1454,6 +1455,7 @@ if ($id)
foreach ($fieldlist as $field => $value)
{
//var_dump($fieldlist);
$class = '';
$showfield = 1;
$valuetoshow = $obj->{$fieldlist[$field]};

View File

@ -116,7 +116,6 @@ if ($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units");
print '</td>';
}

View File

@ -112,7 +112,6 @@ if ($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units");
print '</td>';
}

View File

@ -82,7 +82,7 @@ print '</td>';
if ($conf->global->PRODUCT_USE_UNITS)
{
print '<td class="linecoluseunit nowrap left">';
$label = $line->getLabelOfUnit('short');
$label = $tmpproduct->getLabelOfUnit('short');
if ($label !== '') {
print $langs->trans($label);
}

View File

@ -1107,7 +1107,7 @@ if (empty($reshook))
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
if (GETPOST('price_ht') != '')
if (GETPOST('price_ht') != '' || GETPOST('multicurrency_subprice') != '')
{
$up = price2num(GETPOST('price_ht'));
$price_base_type = 'HT';

View File

@ -466,7 +466,11 @@ if ($resql)
}
}
llxHeader('', $title, $helpurl, '');
foreach ($searchCategoryProductList as $searchCategoryProduct) {
$paramsCat .= "&search_category_product_list[]=".urlencode($searchCategoryProduct);
}
llxHeader('', $title, $helpurl, '', 0, 0, "", "", $paramsCat);
// Displays product removal confirmation
if (GETPOST('delprod')) {

View File

@ -3654,7 +3654,7 @@ class Societe extends CommonObject
public function create_from_member(Adherent $member, $socname = '', $socalias = '', $customercode = '')
{
// phpcs:enable
global $user, $langs;
global $conf, $user, $langs;
dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG);
@ -3687,6 +3687,22 @@ class Societe extends CommonObject
$result = $this->create($user);
if ($result >= 0)
{
// Auto-create contact on thirdparty creation
if (!empty($conf->global->THIRDPARTY_DEFAULT_CREATE_CONTACT))
{
// Fill fields needed by contact
$this->name_bis = $member->lastname;
$this->firstname = $member->firstname;
$this->civility_id = $member->civility_id;
dol_syslog("We ask to create a contact/address too", LOG_DEBUG);
$result = $this->create_individual($user);
if ($result < 0)
{
setEventMessages($this->error, $this->errors, 'errors');
return -1;
}
}
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql .= " SET fk_soc=".$this->id;
$sql .= " WHERE rowid=".$member->id;