Merge branch 'develop' into fourn_facture_paiement

This commit is contained in:
Frédéric FRANCE 2024-12-07 08:33:02 +01:00 committed by GitHub
commit bd28d2c533
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 65 additions and 103 deletions

View File

@ -3066,18 +3066,6 @@ parameters:
count: 8
path: ../../htdocs/bom/tpl/objectline_view.tpl.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 1
path: ../../htdocs/bookcal/availabilities_agenda.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../htdocs/bookcal/availabilities_agenda.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse

View File

@ -55,7 +55,7 @@
preg_match('/:([!<>=\s]+|in|notin|like|notlike):/', $tmpcrit, $reg);
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert&token='.newToken().'">'.$langs->trans("TransferStock").'</a>';
print '<span class="opacitymedium">'.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).'</span>';
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->periode), 'day').'</td>';
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->period), 'day').'</td>';
"sme",
$action = 'transfert';
$cle_rib = strtolower(checkES($rib, $CCC));
@ -71,7 +71,7 @@
$reday = GETPOSTINT('reday');
$sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= ", '".$this->db->idate($this->periode)."'";
$sql .= ", '".$this->db->idate($this->period)."'";
$sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key";
$sql .= ", periode = '".$this->db->idate($this->period ? $this->period : $this->periode)."'";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, fk_user, date_creation)";
@ -83,14 +83,12 @@
$title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('Referers');
$title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('Referers');
$title = $langs->transnoentities("Balance")." - ".$langs->transnoentities("AllTime");
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
if (!empty($arrayfields['cs.periode']['checked'])) {
if ($newamount == 0 || empty($this->date_ech) || (empty($this->period) && empty($this->periode))) {
if ($user->hasRight('stock', 'mouvement', 'creer')) {
if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) {
if (empty($reyear) || empty($remonth) || empty($reday)) {
* @param float|string $selectedrate Force preselected vat rate. Can be '8.5' or '8.5 (NOO)' for example. Use '' for no forcing.
$date = $obj->periode;
$datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
$datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
@ -128,7 +126,6 @@
print '<select name="mouvement" id="mouvement" class="minwidth100 valignmiddle">';
print '<td class="left" width="25%">'.$langs->trans("Referers").'</td>';
print '<td class="right">'.$langs->trans("NbOfMembers").' <span class="opacitymedium">('.$langs->trans("AllTime").')</span></td>';
print '<tr><td>'.$langs->trans("Period")."</td><td>".dol_print_date($charge->periode, 'day')."</td></tr>\n";
print ajax_combobox("mouvement");
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname,cs.periode", "", $param, 'class="left"', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['cs.amount']['label'], $_SERVER["PHP_SELF"], "cs.amount,cs.periode", '', $param, 'class="right"', $sortfield, $sortorder);
@ -150,8 +147,8 @@ $permissiontoadd = $user->hasRight('stock', 'mouvement', 'creer');
$permissiontodelete = $user->hasRight('stock', 'mouvement', 'creer'); // There is no deletion permission for stock movement as we should never delete
$permissiontoread = $user->hasRight('stock', 'mouvement', 'lire');
$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode as period, cs.fk_account,";
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total, cs.paye,";
$sql = "SELECT id_users, nom as name, id_sondage, reponses";
$sql = 'SELECT nom as name, reponses';
$title = $langs->trans("Referers", $object->name);

View File

@ -37,6 +37,8 @@
/**
* @var Conf $conf
* @var CommonObject $this
* @var CommonObject $object
* @var CommonObjectLine $line
* @var Translate $langs
* @var User $user

View File

@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
/* Copyright (C) 2017-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -93,16 +92,8 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
}
// There is several ways to check permission.
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
$enablepermissioncheck = 0;
if ($enablepermissioncheck) {
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
} else {
$permissiontoread = 1;
$permissiontoadd = 1;
}
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();

View File

@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
/* Copyright (C) 2007-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -58,16 +57,8 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
// There is several ways to check permission.
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
$enablepermissioncheck = 0;
if ($enablepermissioncheck) {
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
$permission = $user->hasRight('bookcal', 'availabilities', 'write');
} else {
$permissiontoread = 1;
$permission = 1;
}
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
$permission = $user->hasRight('bookcal', 'availabilities', 'write');
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();

View File

@ -1,7 +1,6 @@
<?php
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2007-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -85,16 +84,8 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->bookcal->multidir_output[$object->entity ? $object->entity : $conf->entity]."/availabilities/".get_exdir(0, 0, 0, 1, $object);
}
// There is several ways to check permission.
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
$enablepermissioncheck = 0;
if ($enablepermissioncheck) {
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
} else {
$permissiontoread = 1;
$permissiontoadd = 1;
}
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();

View File

@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
/* Copyright (C) 2007-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -60,19 +59,9 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
}
// There is several ways to check permission.
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
$enablepermissioncheck = 0;
if ($enablepermissioncheck) {
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
$permissionnote = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_setnotes.inc.php
} else {
$permissiontoread = 1;
$permissiontoadd = 1;
$permissionnote = 1;
}
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
$permissionnote = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_setnotes.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();

View File

@ -915,7 +915,7 @@ if ($object->fetch($id) >= 0) {
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center">';
print '<td class="center nowraponall">';
print '<!-- ID mailing_cibles = '.$obj->rowid.' -->';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
@ -926,7 +926,7 @@ if ($object->fetch($id) >= 0) {
}
if ($obj->status == $object::STATUS_DRAFT) { // Not sent yet
if ($user->hasRight('mailing', 'creer')) {
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.((int) $obj->rowid).$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
print '<a class="reposition marginleftonly" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.((int) $obj->rowid).$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
}
}
/*if ($obj->status == -1) // Sent with error
@ -977,14 +977,14 @@ if ($object->fetch($id) >= 0) {
// Date last update
print '<td class="center nowraponall">';
print dol_print_date(dol_stringtotime($obj->tms), 'dayhour');
print dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel');
print '</td>';
// Date sent
print '<td class="center nowraponall">';
if ($obj->status != $object::STATUS_DRAFT) { // If status of target line is not draft
// Date sent
print $obj->date_envoi; // @TODO Must store date in date format
print dol_print_date($db->jdate($obj->date_envoi), 'dayhour', 'tzuserrel'); // @TODO Must store date in date format
}
print '</td>';
@ -999,11 +999,11 @@ if ($object->fetch($id) >= 0) {
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center">';
print '<td class="center nowraponall">';
print '<!-- ID mailing_cibles = '.$obj->rowid.' -->';
if ($obj->status == $object::STATUS_DRAFT) { // If status of target line is not sent yet
if ($user->hasRight('mailing', 'creer')) {
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.((int) $obj->rowid).$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
print '<a class="reposition marginleftonly" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.((int) $obj->rowid).$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
}
}
/*if ($obj->status == -1) // Sent with error

View File

@ -195,7 +195,7 @@ if ($action == 'create') {
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td><a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid.'">'.$chid.'</a></td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$charge->label."</td></tr>\n";
print '<tr><td>'.$langs->trans("Type")."</td><td>".$charge->type_label."</td></tr>\n";
print '<tr><td>'.$langs->trans("Period")."</td><td>".dol_print_date($charge->periode, 'day')."</td></tr>\n";
print '<tr><td>'.$langs->trans("Period")."</td><td>".dol_print_date($charge->period, 'day')."</td></tr>\n";
/*print '<tr><td>'.$langs->trans("DateDue")."</td><td>".dol_print_date($charge->date_ech,'day')."</td></tr>\n";
print '<tr><td>'.$langs->trans("Amount")."</td><td>".price($charge->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';*/

View File

@ -2394,12 +2394,16 @@ class BonPrelevement extends CommonObject
} else {
$instrprty = 'NORM';
}
// Set $categoryPurpose: CORE, TREA, SUPP, ...
$categoryPurpose = getDolGlobalString('PAYMENTBYBANKTRANSFER_CUSTOM_CATEGORY_PURPOSE', 'CORE');
$XML_CREDITOR .= ' <InstrPrty>' . $instrprty . '</InstrPrty>' . $CrLf;
$XML_CREDITOR .= ' <SvcLvl>' . $CrLf;
$XML_CREDITOR .= ' <Cd>SEPA</Cd>' . $CrLf;
$XML_CREDITOR .= ' </SvcLvl>' . $CrLf;
$XML_CREDITOR .= ' <CtgyPurp>' . $CrLf;
$XML_CREDITOR .= ' <Cd>CORE</Cd>' . $CrLf;
$XML_CREDITOR .= ' <Cd>' . $categoryPurpose . '</Cd>' . $CrLf;
$XML_CREDITOR .= ' </CtgyPurp>' . $CrLf;
$XML_CREDITOR .= ' </PmtTpInf>' . $CrLf;
}
@ -2578,6 +2582,7 @@ class BonPrelevement extends CommonObject
$country = explode(':', $configuration->global->MAIN_INFO_SOCIETE_COUNTRY);
$IdBon = sprintf("%05d", $obj->rowid);
$RefBon = $obj->ref;
$localInstrument = getDolGlobalString('PAYMENTBYBANKTRANSFER_CUSTOM_LOCAL_INSTRUMENT', 'CORE');
if (!empty($configuration->global->SEPA_FORCE_TWO_DECIMAL)) {
$total = number_format((float) price2num($total, 'MT'), 2, ".", "");
@ -2596,7 +2601,7 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <Cd>SEPA</Cd>' . $CrLf;
$XML_SEPA_INFO .= ' </SvcLvl>' . $CrLf;
$XML_SEPA_INFO .= ' <LclInstrm>' . $CrLf;
$XML_SEPA_INFO .= ' <Cd>CORE</Cd>' . $CrLf;
$XML_SEPA_INFO .= ' <Cd>' . $localInstrument . '</Cd>' . $CrLf;
$XML_SEPA_INFO .= ' </LclInstrm>' . $CrLf;
$XML_SEPA_INFO .= ' <SeqTp>' . $format . '</SeqTp>' . $CrLf;
$XML_SEPA_INFO .= ' </PmtTpInf>' . $CrLf;
@ -2661,7 +2666,7 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <Cd>SEPA</Cd>' . $CrLf;
$XML_SEPA_INFO .= ' </SvcLvl>' . $CrLf;
$XML_SEPA_INFO .= ' <LclInstrm>' . $CrLf;
$XML_SEPA_INFO .= ' <Cd>CORE</Cd>' . $CrLf;
$XML_SEPA_INFO .= ' <Cd>' . $localInstrument . '</Cd>' . $CrLf;
$XML_SEPA_INFO .= ' </LclInstrm>' . $CrLf;
$XML_SEPA_INFO .= ' <SeqTp>' . $format . '</SeqTp>' . $CrLf;
$XML_SEPA_INFO .= ' </PmtTpInf>' . $CrLf;

View File

@ -293,12 +293,13 @@ if (empty($reshook)) {
$object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm');
} else {
// Note date_ech is often a little bit higher than dateperiod
$newdateech = dol_mktime(0, 0, 0, GETPOSTINT('clone_date_echmonth'), GETPOSTINT('clone_date_echday'), GETPOSTINT('clone_date_echyear')); // = date of creation or due date
$newdateperiod = dol_mktime(0, 0, 0, GETPOSTINT('clone_periodmonth'), GETPOSTINT('clone_periodday'), GETPOSTINT('clone_periodyear'));
$newdateech = dol_mktime(0, 0, 0, GETPOSTINT('clone_date_echmonth'), GETPOSTINT('clone_date_echday'), GETPOSTINT('clone_date_echyear'));
if ($newdateperiod) {
$object->period = $newdateperiod;
if (empty($newdateech)) {
$object->date_ech = $object->periode;
$object->date_ech = $object->period;
}
}
if ($newdateech) {

View File

@ -300,7 +300,7 @@ class ChargeSociales extends CommonObject
$sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : "NULL");
$sql .= ", '".$this->db->escape($this->label ? $this->label : $this->lib)."'";
$sql .= ", '".$this->db->idate($this->date_ech)."'";
$sql .= ", '".$this->db->idate($this->periode)."'";
$sql .= ", '".$this->db->idate($this->period)."'";
$sql .= ", '".price2num($newamount)."'";
$sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : 'NULL');
$sql .= ", ".((int) $conf->entity);

View File

@ -210,7 +210,7 @@ llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist');
$arrayofselected = is_array($toselect) ? $toselect : array();
$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode as period, cs.fk_account,";
if (isModEnabled('project')) {
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
}
@ -748,7 +748,7 @@ while ($i < $imaxinloop) {
// Date end period
if (!empty($arrayfields['cs.periode']['checked'])) {
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->periode), 'day').'</td>';
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->period), 'day').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -154,7 +154,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
$sql = "SELECT c.id, c.libelle as type_label,";
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,";
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total, cs.paye,";
$sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
$sql .= " pct.code as payment_code,";
$sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.login, u.admin, u.statut,";
@ -175,8 +175,8 @@ if ($search_sc_type > 0) {
}
if ($year > 0) {
$sql .= " AND (";
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
// If period defined, we use it as a date criteria, elsewe use the dure date,
// so we are compatible with case where period is not mandatory.
$sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= ")";
@ -296,9 +296,9 @@ while ($i < min($num, $limit)) {
print $socialcontrib->getNomUrl(1, '');
print '</td>';
// Type
print '<td title="'.dol_escape_htmltag($obj->type_label).'" class="tdoverflowmax300">'.$obj->type_label.'</td>';
print '<td title="'.dolPrintHTMLForAttribute($obj->type_label).'" class="tdoverflowmax300">'.dolPrintHTML($obj->type_label).'</td>';
// Date
$date = $obj->periode;
$date = $obj->period;
if (empty($date)) {
$date = $obj->date_ech;
}

View File

@ -204,8 +204,8 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
$sql .= " AND tva.entity = " . $conf->entity;
if ($year > 0) {
$sql .= " AND (";
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
// We'll use the specified period as the date filter, unless it's missing, in which case we'll use the due date.
// This is to handle situations where the period was optional.
$sql .= " (tva.datev IS NOT NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')";
$sql .= " OR (tva.datev IS NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')";
$sql .= ")";

View File

@ -1960,11 +1960,14 @@ class CMailFile
// Check response from Server
if ($_retVal = $this->server_parse($socket, "220")) {
$_retVal = $socket;
} else {
$this->error = ($this->error ? $this->error." - " : "")."Succeed in opening socket but answer 220 not received";
}
} else {
$this->error = utf8_check('Error '.$errno.' - '.$errstr) ? 'Error '.$errno.' - '.$errstr : mb_convert_encoding('Error '.$errno.' - '.$errstr, 'UTF-8', 'ISO-8859-1');
}
}
return $_retVal;
}

View File

@ -1500,9 +1500,9 @@ class ExtraFields
$sqlwhere .= ' AND entity = '.((int) $conf->entity);
}
$sql .= $sqlwhere;
//print $sql;
$sql .= $this->db->order(implode(',', $fields_label));
//print $sql;
dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@ -309,7 +309,7 @@ if (empty($reshook)) {
}
if (!$error && !getDolGlobalString('EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS')) {
$overlappingExpenseReportID = $object->periode_existe($fuser, $object->date_debut, $object->date_fin);
$overlappingExpenseReportID = $object->periodExists($fuser, $object->date_debut, $object->date_fin);
if ($overlappingExpenseReportID > 0) {
$error++;

View File

@ -2378,26 +2378,24 @@ class ExpenseReport extends CommonObject
return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* periode_existe
* periodExists
*
* @param User $fuser User
* @param integer $date_debut Start date
* @param integer $date_fin End date
* @return int Return integer <0 if KO, >0 if OK
*/
public function periode_existe($fuser, $date_debut, $date_fin)
public function periodExists($fuser, $date_debut, $date_fin)
{
global $conf;
// phpcs:enable
$sql = "SELECT rowid, date_debut, date_fin";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE entity = ".((int) $conf->entity); // not shared, only for the current entity
$sql .= " AND fk_user_author = ".((int) $fuser->id);
dol_syslog(get_class($this)."::periode_existe sql=".$sql);
dol_syslog(get_class($this)."::periodExists sql=".$sql);
$result = $this->db->query($sql);
if ($result) {
$num_rows = $this->db->num_rows($result);
@ -2426,7 +2424,7 @@ class ExpenseReport extends CommonObject
}
} else {
$this->error = $this->db->lasterror();
dol_syslog(get_class($this)."::periode_existe Error ".$this->error, LOG_ERR);
dol_syslog(get_class($this)."::periodExists Error ".$this->error, LOG_ERR);
return -1;
}
}

View File

@ -2359,6 +2359,9 @@ td.showDragHandle {
.bodyforlist #id-right {
padding-bottom: 4px;
}
.page-modulehelp div#id-right {
display: flex;
}
/* DOL_XXX For having horizontal scroll into array (like with smartphone) */
@ -2577,6 +2580,9 @@ div.fiche {
print 'margin-bottom: 12px;'."\n";
} ?>
}
.page-modulehelp div.fiche {
width: 100%;
}
body.onlinepaymentbody div.fiche { /* For online payment page */
margin: 20px !important;
}
@ -5418,7 +5424,7 @@ div.info {
background: #eff8fc;
color: #558;
}
div.fiche div.info {
div.fiche div.info, div.fiche div.warning {
box-shadow: 4px 4px 12px #e4e4e4;
margin: 1em 0em 1.2em 0em;
}

View File

@ -5397,7 +5397,7 @@ div.info {
background: #eff8fc;
color: #558;
}
div.fiche div.info {
div.fiche div.info, div.fiche div.warning {
box-shadow: 4px 4px 12px #e4e4e4;
margin: 1em 0em 1.2em 0em;
}