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

This commit is contained in:
Laurent Destailleur 2025-01-27 03:53:46 +01:00
commit 12f2534a03
4 changed files with 19 additions and 43 deletions

View File

@ -355,7 +355,7 @@ class Members extends DolibarrApi
/**
* Create member object
*
* @param array $request_data Request data
* @param array $request_data Request data
* @phan-param ?array<string,string> $request_data
* @phpstan-param ?array<string,string> $request_data
* @return int ID of member

View File

@ -1098,7 +1098,7 @@ if ($user->hasRight("holiday", "read")) {
$event->transparency = 1;
$event->userownerid = $obj->uid; // user id of owner
$event->userassigned = array($obj->uid => $obj->uid);
$event->userassigned = array($obj->uid => array('id' => $obj->uid, 'transparency' => 1));
if ($obj->status == 3) {
// Show no symbol for leave with state "leave approved"

View File

@ -185,10 +185,22 @@ if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') {
$description .= '<br>' . $langs->trans("RulesVATInServices");
}
if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$description .= '<br>' . $langs->trans("DepositsAreNotIncluded");
if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice' && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {
$description .= '<br>' . $langs->trans("DepositsAreNotIncluded");
} elseif (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice') { // calculate on sale invoice for service only
$description .= '<br>' . $langs->trans("DepositsAreNotIncluded").' (for services)';
} elseif (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') { // calculate on sale invoice for service only
$description .= '<br>' . $langs->trans("DepositsAreNotIncluded").' (for products)';
}
}
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
$description .= $langs->trans("SupplierDepositsAreNotIncluded");
if (getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice' && getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice') {
$description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded");
} elseif (getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice') { // calculate on supplier invoice for service only
$description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded").' (for services)';
} elseif (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice') { // calculate on supplier invoice for product only
$description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded").' (for products)';
}
}
if (isModEnabled('accounting')) {
$description .= '<br>' . $langs->trans("ThisIsAnEstimatedValue");

View File

@ -438,19 +438,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
$sql .= " WHERE f.entity IN (".getEntity($invoicetable).")";
$sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely)
if ($direction == 'buy') {
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (0,1,2,5)";
} else {
$sql .= " AND f.type IN (0,1,2,3,5)";
}
} else {
if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (0,1,2,5)";
} else {
$sql .= " AND f.type IN (0,1,2,3,5)";
}
}
$sql .= " AND f.type IN (0,1,2,3,5)";
$sql .= " AND f.rowid = d.".$fk_facture;
$sql .= " AND s.rowid = f.fk_soc";
$sql .= " AND pf.".$fk_facture2." = f.rowid";
@ -825,19 +813,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
$sql .= " WHERE f.entity IN (".getEntity($invoicetable).")";
$sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely)
if ($direction == 'buy') {
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (0,1,2,5)";
} else {
$sql .= " AND f.type IN (0,1,2,3,5)";
}
} else {
if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (0,1,2,5)";
} else {
$sql .= " AND f.type IN (0,1,2,3,5)";
}
}
$sql .= " AND f.type IN (0,1,2,3,5)";
if ($y && $m) {
$sql .= " AND pa.datep >= '".$db->idate(dol_get_first_day($y, $m, false))."'";
$sql .= " AND pa.datep <= '".$db->idate(dol_get_last_day($y, $m, false))."'";
@ -1026,19 +1002,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
$sql .= " WHERE f.entity IN (".getEntity($invoicetable).")";
$sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely)
if ($direction == 'buy') {
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (0,1,2,5)";
} else {
$sql .= " AND f.type IN (0,1,2,3,5)";
}
} else {
if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (0,1,2,5)";
} else {
$sql .= " AND f.type IN (0,1,2,3,5)";
}
}
$sql .= " AND f.type IN (0,1,2,3,5)";
if ($y && $m) {
$sql .= " AND pa.datep >= '".$db->idate(dol_get_first_day($y, $m, false))."'";
$sql .= " AND pa.datep <= '".$db->idate(dol_get_last_day($y, $m, false))."'";