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

This commit is contained in:
Laurent Destailleur 2022-12-07 13:32:23 +01:00
commit 6b7f1a32f9
6 changed files with 14 additions and 12 deletions

View File

@ -1867,7 +1867,7 @@ if ($resql) {
$remaintopay = 0;
$multicurrency_remaintopay = 0;
}
if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consummed
if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consumed
$remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id);
$remaintopay = -$remaincreditnote;
$totalpay = price2num($facturestatic->total_ttc - $remaintopay);

View File

@ -427,7 +427,7 @@ if (empty($reshook)) {
} else {
$idprod = GETPOST('idprod', 'int');
}
$tva_tx = (GETPOST('tva_tx', 'alpha') ? price2num(preg_replace('/\s*\(.*\)/', '', GETPOST('tva_tx', 'alpha'))) : 0);
$tva_tx = GETPOST('tva_tx', 'alpha');
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef), 2) : 0);
@ -467,7 +467,8 @@ 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'));
// Ecrase $tva_tx par celui du produit
// Ecrase $tva_tx par celui du produit. TODO Remove this once vat selection is open
// Get and check minimum price
if ($idprod > 0) {
$prod = new Product($db);
$prod->fetch($idprod);
@ -557,11 +558,11 @@ if (empty($reshook)) {
// Set unit price to use
if (!empty($price_ht) || $price_ht === '0') {
$pu_ht = price2num($price_ht, 'MU');
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
$pu_ttc = price2num($pu_ht * (1 + ((float) $tmpvat / 100)), 'MU');
$price_base_type = 'HT';
} elseif (!empty($price_ttc) || $price_ttc === '0') {
$pu_ttc = price2num($price_ttc, 'MU');
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
$pu_ht = price2num($pu_ttc / (1 + ((float) $tmpvat / 100)), 'MU');
$price_base_type = 'TTC';
}
}

View File

@ -1565,7 +1565,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
// If no SQL error, we redirect to the request form
if (!$error) {
// Calculcate number of days consummed
// Calculcate number of days consumed
$nbopenedday = num_open_day($objecttmp->date_debut_gmt, $objecttmp->date_fin_gmt, 0, 1, $objecttmp->halfday);
$soldeActuel = $objecttmp->getCpforUser($objecttmp->fk_user, $objecttmp->fk_type);
$newSolde = ($soldeActuel - $nbopenedday);

View File

@ -1117,7 +1117,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$extrafieldsobjectkey = $contactstatic->table_element;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,";
$sql = "SELECT t.rowid, t.entity, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,";
$sql .= " t.civility as civility_id, t.address, t.zip, t.town";
$sql .= ", t.note_private";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
@ -1272,6 +1272,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$contactstatic->email = $obj->email;
$contactstatic->socialnetworks = $obj->socialnetworks;
$contactstatic->photo = $obj->photo;
$contactstatic->entity = $obj->entity;
$country_code = getCountry($obj->country_id, 2);
$contactstatic->country_code = $country_code;

View File

@ -1324,7 +1324,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
if (!empty($arrayfields['timeconsumed']['checked'])) {
// Time spent by everybody
print '<td class="right">';
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
if ($lines[$i]->duration) {
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
print convertSecondToTime($lines[$i]->duration, 'allhourmin');
@ -1730,7 +1730,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
if (!empty($arrayfields['timeconsumed']['checked'])) {
// Time spent by everybody
print '<td class="right">';
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
if ($lines[$i]->duration) {
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
print convertSecondToTime($lines[$i]->duration, 'allhourmin');
@ -2024,7 +2024,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
// Time spent by everybody
print '<td class="right">';
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
if ($lines[$i]->duration) {
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
print convertSecondToTime($lines[$i]->duration, 'allhourmin');

View File

@ -586,7 +586,7 @@ if (empty($reshook)) {
// If no SQL error, we redirect to the request form
if (!$error) {
// Calculcate number of days consummed
// Calculcate number of days consumed
$nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
$soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);
$newSolde = ($soldeActuel - $nbopenedday);
@ -810,7 +810,7 @@ if (empty($reshook)) {
$error++;
}
// Calculcate number of days consummed
// Calculcate number of days consumed
$nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
$soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);