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

This commit is contained in:
Laurent Destailleur 2023-11-10 14:05:53 +01:00
commit 9714dd6735
5 changed files with 13 additions and 9 deletions

View file

@ -74,11 +74,11 @@ $year = GETPOST('year', 'int'); // this is used for navigation previous/next. I
if (empty($year)) {
$year_current = dol_print_date(dol_now(), "%Y");
$month_current = dol_print_date(dol_now(), "%m");
$year_start = $year_current - ($nbofyear - 1);
$year_start = $year_current;
} else {
$year_current = $year;
$month_current = dol_print_date(dol_now(), "%m");
$year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
$year_start = $year;
}
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
@ -88,14 +88,17 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$q = GETPOST("q") ? GETPOST("q", 'int') : 0;
if ($q == 0) {
// We define date_start and date_end
$year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
$year_end = $year_start;
$month_start = GETPOST("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
if (!GETPOST('month')) {
if (!$year && $month_start > $month_current) {
$year_start--;
$year_end--;
}
$month_end = $month_start - 1;
if (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1) {
$month_end = $month_start - 1;
$year_end = $year_start + 1;
}
if ($month_end < 1) {
$month_end = 12;
}

View file

@ -334,7 +334,7 @@ if (isModEnabled('project')) {
$now = dol_now();
$title = $langs->trans("SocialContribution").' - '.$langs->trans("Card");
$help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:M&oacute;dulo Impuestos y cargas sociales (IVA, impuestos)';
$help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module_Taxes_et_charges_spéciales|ES:M&oacute;dulo Impuestos y cargas sociales (IVA, impuestos)';
llxHeader("", $title, $help_url);

View file

@ -373,7 +373,7 @@ class DiscountAbsolute
if ($this->fk_facture_source) {
$sql = "UPDATE ".$this->db->prefix()."facture";
$sql .= " set paye=0, fk_statut=1";
$sql .= " WHERE (type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_facture_source);
$sql .= " WHERE type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_facture_source);
dol_syslog(get_class($this)."::delete Update credit note or deposit invoice statut", LOG_DEBUG);
$result = $this->db->query($sql);
@ -388,7 +388,7 @@ class DiscountAbsolute
} elseif ($this->fk_invoice_supplier_source) {
$sql = "UPDATE ".$this->db->prefix()."facture_fourn";
$sql .= " set paye=0, fk_statut=1";
$sql .= " WHERE (type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_invoice_supplier_source);
$sql .= " WHERE type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_invoice_supplier_source);
dol_syslog(get_class($this)."::delete Update credit note or deposit invoice statut", LOG_DEBUG);
$result = $this->db->query($sql);

View file

@ -613,7 +613,6 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
}
print '</tr>'."\n";
$totalarray = array();
$totalarray['nbfield'] = 0;
// Fields title label
@ -686,7 +685,6 @@ $warehouse = new Entrepot($db);
// --------------------------------------------------------------------
$i = 0;
$savnbfield = $totalarray['nbfield'];
$totalarray = array();
$totalarray['nbfield'] = 0;
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {

View file

@ -936,6 +936,9 @@ if (!empty($socid)) {
}
if ($search_usage_event_organization == 1) {
$url .= '&usage_organize_event=1';
if (((int) $search_usage_opportunity) < 1) {
$url .= '&usage_opportunity=0';
}
}
$newcardbutton = '';