diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index db18500629c..0261be16cb6 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -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 $request_data * @phpstan-param ?array $request_data * @return int ID of member diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index e80e21e8e01..8457f983e5d 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -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" diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index e0ea47ccbd8..0e374c8d5da 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -185,10 +185,22 @@ if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') { $description .= '
' . $langs->trans("RulesVATInServices"); } if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) { - $description .= '
' . $langs->trans("DepositsAreNotIncluded"); + if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice' && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') { + $description .= '
' . $langs->trans("DepositsAreNotIncluded"); + } elseif (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice') { // calculate on sale invoice for service only + $description .= '
' . $langs->trans("DepositsAreNotIncluded").' (for services)'; + } elseif (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') { // calculate on sale invoice for service only + $description .= '
' . $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 .= '
' . $langs->trans("SupplierDepositsAreNotIncluded"); + } elseif (getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice') { // calculate on supplier invoice for service only + $description .= '
' . $langs->trans("SupplierDepositsAreNotIncluded").' (for services)'; + } elseif (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice') { // calculate on supplier invoice for product only + $description .= '
' . $langs->trans("SupplierDepositsAreNotIncluded").' (for products)'; + } } if (isModEnabled('accounting')) { $description .= '
' . $langs->trans("ThisIsAnEstimatedValue"); diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index ed5586ff29d..0050910fced 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -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))."'";