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

This commit is contained in:
Laurent Destailleur 2023-08-24 00:14:55 +02:00
commit bf1549e6e0
17 changed files with 34 additions and 26 deletions

View File

@ -1643,6 +1643,8 @@ if ($id > 0) {
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
$colspan = 0;
// Title line with search input fields
print '<!-- line title to search record -->'."\n";
print '<tr class="liste_titre_filter">';
@ -1658,7 +1660,6 @@ if ($id > 0) {
$colspan++;
}
$colspan = 0;
foreach ($fieldlist as $field => $value) {
if ($value == 'entity') {
continue;

View File

@ -2822,8 +2822,8 @@ if ($action == 'create') {
}
print '</tr>';
print '<tr>';
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
print '<tr>';
print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {

View File

@ -2747,9 +2747,9 @@ if ($action == 'create' && $usercancreate) {
}
print '</tr>';
print '<tr>';
// Amount Local Taxes
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
print '<tr>';
print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {

View File

@ -498,6 +498,7 @@ if (empty($reshook)) {
$date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
$date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
$tva_npr = "";
// Define special_code for special lines
$special_code = 0;
@ -528,7 +529,7 @@ if (empty($reshook)) {
$pu_ht = $datapriceofproduct['pu_ht'];
$pu_ttc = $datapriceofproduct['pu_ttc'];
$price_min = $datapriceofproduct['price_min'];
$price_base_type = $datapriceofproduct['price_base_type'];
$price_base_type = empty($datapriceofproduct['price_base_type']) ? 'HT' : $datapriceofproduct['price_base_type'];
//$tva_tx = $datapriceofproduct['tva_tx'];
//$tva_npr = $datapriceofproduct['tva_npr'];
@ -1184,11 +1185,11 @@ if ($action == 'create') {
if ($object->id > 0) {
$object->fetch_thirdparty();
// Confirmation de la suppression d'une ligne produit
$formconfirm = '';
// Confirmation of deletion of product line
if ($action == 'ask_deleteline') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
}
// Confirm delete of repeatable invoice
if ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_delete', '', 'no', 1);
@ -1724,6 +1725,7 @@ if ($action == 'create') {
$MAXEVENT = 10;
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
$morehtmlcenter = '';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -2168,7 +2168,7 @@ if (empty($reshook)) {
$pu_ttc = $datapriceofproduct['pu_ttc'];
$price_min = $datapriceofproduct['price_min'];
$price_min_ttc = (isset($datapriceofproduct['price_min_ttc'])) ? $datapriceofproduct['price_min_ttc'] : null;
$price_base_type = $datapriceofproduct['price_base_type'];
$price_base_type = empty($datapriceofproduct['price_base_type']) ? 'HT' : $datapriceofproduct['price_base_type'];
//$tva_tx = $datapriceofproduct['tva_tx'];
//$tva_npr = $datapriceofproduct['tva_npr'];

View File

@ -1492,7 +1492,11 @@ while ($i < $imaxinloop) {
if ($obj->socid) {
$objsoc = new Societe($db);
$objsoc->fetch($obj->socid);
print $objsoc->getNomUrl(1, '', 100, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
$option_link = 'customer';
if ($objsoc->client == 0 && $objsoc->fournisseur > 0) {
$option_link = 'supplier';
}
print $objsoc->getNomUrl(1, $option_link, 100, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
} else {
print '&nbsp;';
}

View File

@ -495,9 +495,10 @@ class Translate
if (!$found && !empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
// Overwrite translation with database read
$sql = "SELECT transkey, transvalue FROM " . $db->prefix() . "overwrite_trans where lang='" . $db->escape($this->defaultlang) . "' OR lang IS NULL";
$sql .= " AND entity IN (0, " . getEntity('overwrite_trans') . ")";
$sql = "SELECT transkey, transvalue FROM ".$db->prefix()."overwrite_trans where (lang='".$db->escape($this->defaultlang)."' OR lang IS NULL)";
$sql .= " AND entity IN (0, ".getEntity('overwrite_trans').")";
$sql .= $db->order("lang", "DESC");
$resql = $db->query($sql);
if ($resql) {

View File

@ -927,7 +927,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
}
options += '<option value="'+this.id+'" price="'+this.price+'">'+this.label+'</option>';
});
options += '<option value="inputprice" price="'+defaultprice+'"><?php echo $langs->trans("InputPrice").'...'; ?></option>';
options += '<option value="inputprice" price="'+defaultprice+'"><?php echo dol_escape_js($langs->trans("InputPrice").'...'); ?></option>';
console.log("finally selected defaultkey="+defaultkey+" defaultprice for buying price="+defaultprice);
@ -1103,7 +1103,6 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
$('#tva_tx option').removeAttr('selected');
console.log("stringforvatrateselection="+stringforvatrateselection+" -> value of option label for this key="+$('#tva_tx option[value="'+stringforvatrateselection+'"]').val());
$('#tva_tx option[value="'+stringforvatrateselection+'"]').prop('selected', true);
<?php
if (getDolGlobalInt('PRODUIT_AUTOFILL_DESC') == 1) {
if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) {

View File

@ -268,7 +268,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0;
foreach ($object->linkedObjects['reception'] as $element) {
if ($element->statut == Reception::STATUS_VALIDATED) {
if ($element->statut == Reception::STATUS_VALIDATED || $element->statut == Reception::STATUS_CLOSED) {
$totalonlinkedelements += $element->total_ht;
}
}

View File

@ -2041,7 +2041,7 @@ class EmailCollector extends CommonObject
}
if (get_class($objectemail) != 'Societe') {
$thirdpartyid = $objectemail->fk_soc;
$thirdpartyid = $objectemail->fk_soc ?? $objectemail->socid;
} else {
$thirdpartyid = $objectemail->id;
}

View File

@ -2348,8 +2348,8 @@ if ($action == 'create') {
}
print '</tr>';
print '<tr>';
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
print '<tr>';
print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {

View File

@ -552,7 +552,7 @@ if (empty($reshook)) {
$pu_ht = $datapriceofproduct['pu_ht'];
$pu_ttc = $datapriceofproduct['pu_ttc'];
$price_min = $datapriceofproduct['price_min'];
$price_base_type = $datapriceofproduct['price_base_type'];
$price_base_type = empty($datapriceofproduct['price_base_type']) ? 'HT' : $datapriceofproduct['price_base_type'];
$tva_tx = $datapriceofproduct['tva_tx'];
$tva_npr = $datapriceofproduct['tva_npr'];

View File

@ -554,6 +554,7 @@ if (empty($reshook)) {
}
$id = $objecttmp->id; // For builddoc action
$lastref = $objecttmp->ref; // generated ref
$object =$objecttmp;
// Fac builddoc

View File

@ -1848,8 +1848,8 @@ if ($action == 'create') {
}
print '</tr>';
print '<tr>';
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
print '<tr>';
print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {

View File

@ -494,7 +494,7 @@ if (empty($reshook)) {
$price = $datapriceofproduct['pu_ht'];
$price_ttc = $datapriceofproduct['pu_ttc'];
//$price_min = $datapriceofproduct['price_min'];
$price_base_type = $datapriceofproduct['price_base_type'];
$price_base_type = empty($datapriceofproduct['price_base_type']) ? 'HT' : $datapriceofproduct['price_base_type'];
$tva_tx = $datapriceofproduct['tva_tx'];
$tva_npr = $datapriceofproduct['tva_npr'];

View File

@ -111,12 +111,12 @@ if (!empty($hookmanager->resPrint)) {
<br>
<p class="left">
<?php
$constFreeText = 'TAKEPOS_HEADER'.($_SESSION['takeposterminal'] ?? '0');
if (!empty($conf->global->TAKEPOS_HEADER) || getDolGlobalString($constFreeText)) {
$constFreeText = 'TAKEPOS_HEADER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
if (getDolGlobalString('TAKEPOS_HEADER') || getDolGlobalString($constFreeText)) {
$newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);
if (!empty($conf->global->TAKEPOS_HEADER)) {
$newfreetext .= make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
if (getDolGlobalString('TAKEPOS_HEADER')) {
$newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_HEADER'), $substitutionarray);
}
if (getDolGlobalString($constFreeText)) {
$newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
@ -352,14 +352,14 @@ if (getDolGlobalString('TAKEPOS_PRINT_PAYMENT_METHOD')) {
<br>
<br>
<?php
$constFreeText = 'TAKEPOS_FOOTER'.($_SESSION['takeposterminal'] ?? '0');
if (!empty($conf->global->TAKEPOS_FOOTER) || getDolGlobalString($constFreeText)) {
$constFreeText = 'TAKEPOS_FOOTER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
if (getDolGlobalString('TAKEPOS_FOOTER') || getDolGlobalString($constFreeText)) {
$newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);
if (getDolGlobalString($constFreeText)) {
$newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
}
if (!empty($conf->global->TAKEPOS_FOOTER)) {
if (getDolGlobalString('TAKEPOS_FOOTER')) {
$newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_FOOTER'), $substitutionarray);
}
print $newfreetext;

View File

@ -1663,7 +1663,7 @@ class User extends CommonObject
$this->civility_code = $contact->civility_code;
$this->lastname = $contact->lastname;
$this->firstname = $contact->firstname;
$this->gender = $contact->gender;
//$this->gender = $contact->gender; // contact ha sno gender
$this->email = $contact->email;
$this->socialnetworks = $contact->socialnetworks;
$this->office_phone = $contact->phone_pro;