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

Conflicts:
	htdocs/accountancy/bookkeeping/balance.php
	htdocs/accountancy/bookkeeping/list.php
	htdocs/accountancy/bookkeeping/listbyaccount.php
	htdocs/accountancy/bookkeeping/listbysubaccount.php
This commit is contained in:
Laurent Destailleur
2022-11-26 01:43:09 +01:00
12 changed files with 52 additions and 33 deletions

View File

@@ -0,0 +1,3 @@
# Use bzip2 instead of gzip
compression = "bzip2"
compression-level = 9

View File

@@ -239,10 +239,17 @@ if ($action != 'export_csv') {
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
$button = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
if (empty($reshook)) { if (empty($reshook)) {
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />'; $button .= '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
print '<script type="text/javascript"> print '<script type="text/javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {

View File

@@ -944,12 +944,18 @@ if (count($filter)) {
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
if (empty($reshook)) { if (empty($reshook)) {
// Button re-export // Button re-export
if (!empty($conf->global->ACCOUNTING_REEXPORT)) { if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> '; $newcardbutton .= '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
} else { } else {
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> '; $newcardbutton .= '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
} }
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>'; $newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';

View File

@@ -644,6 +644,12 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
if (empty($reshook)) { if (empty($reshook)) {
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param); $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
if ($type == 'sub') { if ($type == 'sub') {

View File

@@ -2375,7 +2375,7 @@ class Adherent extends CommonObject
$labelStatus = $langs->trans("MemberStatusDraft"); $labelStatus = $langs->trans("MemberStatusDraft");
$labelStatusShort = $langs->trans("MemberStatusDraftShort"); $labelStatusShort = $langs->trans("MemberStatusDraftShort");
} elseif ($status >= self::STATUS_VALIDATED) { } elseif ($status >= self::STATUS_VALIDATED) {
if ($need_subscription == 0) { if ($need_subscription === 0) {
$statusType = 'status4'; $statusType = 'status4';
$labelStatus = $langs->trans("MemberStatusNoSubscription"); $labelStatus = $langs->trans("MemberStatusNoSubscription");
$labelStatusShort = $langs->trans("MemberStatusNoSubscriptionShort"); $labelStatusShort = $langs->trans("MemberStatusNoSubscriptionShort");
@@ -3136,7 +3136,8 @@ class Adherent extends CommonObject
if ($listofids) { if ($listofids) {
$listofids .= ']'; $listofids .= ']';
} }
$this->output .= ' ids='.$listofids;
$this->output .= ($listofids ? ' ids='.$listofids : '');
} }
if ($nbko) { if ($nbko) {
$this->output .= ' - Canceled for '.$nbko.' member (no email or email sending error)'; $this->output .= ' - Canceled for '.$nbko.' member (no email or email sending error)';
@@ -3159,7 +3160,7 @@ class Adherent extends CommonObject
if ($listofids) { if ($listofids) {
$listofids .= ']'; $listofids .= ']';
} }
$this->output .= $listofids; $this->output .= ($listofids ? ' ids='.$listofids : '');
} }
} }
} }

View File

@@ -62,7 +62,7 @@ if ($sortfield == "") {
$sortfield = "pl.fk_soc"; $sortfield = "pl.fk_soc";
} }
$type = $object->type;
if ($type == 'bank-transfer') { if ($type == 'bank-transfer') {
$result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
} else { } else {

View File

@@ -375,7 +375,7 @@ class FormProjets
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
$out .= $comboenhancement; $out .= $comboenhancement;
$morecss = 'minwidth200 maxwidth500'; $morecss .= ' minwidth200 maxwidth500';
} }
if (empty($option_only)) { if (empty($option_only)) {

View File

@@ -7610,7 +7610,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
$substitutionarray['__NOTE_PUBLIC__'] = (isset($object->note_public) ? $object->note_public : null); $substitutionarray['__NOTE_PUBLIC__'] = (isset($object->note_public) ? $object->note_public : null);
$substitutionarray['__NOTE_PRIVATE__'] = (isset($object->note_private) ? $object->note_private : null); $substitutionarray['__NOTE_PRIVATE__'] = (isset($object->note_private) ? $object->note_private : null);
if ($object->element == "shipping") {
$substitutionarray['__DATE_DELIVERY__'] = (isset($object->date_delivery) ? dol_print_date($object->date_delivery, 'day', 0, $outputlangs) : '');
} else {
$substitutionarray['__DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : ''); $substitutionarray['__DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
}
$substitutionarray['__DATE_DELIVERY_DAY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%d") : ''); $substitutionarray['__DATE_DELIVERY_DAY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%d") : '');
$substitutionarray['__DATE_DELIVERY_DAY_TEXT__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%A") : ''); $substitutionarray['__DATE_DELIVERY_DAY_TEXT__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%A") : '');
$substitutionarray['__DATE_DELIVERY_MON__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%m") : ''); $substitutionarray['__DATE_DELIVERY_MON__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%m") : '');

View File

@@ -1215,7 +1215,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
} elseif ($yearlen == 2) { } elseif ($yearlen == 2) {
$yearcomp = sprintf("%02d", date("y", $date) + $yearoffset); $yearcomp = sprintf("%02d", date("y", $date) + $yearoffset);
} elseif ($yearlen == 1) { } elseif ($yearlen == 1) {
$yearcomp = substr(date("y", $date), 2, 1) + $yearoffset; $yearcomp = substr(date('y', $date), 1, 1) + $yearoffset;
} }
if ($monthcomp > 1 && empty($resetEveryMonth)) { // Test with month is useless if monthcomp = 0 or 1 (0 is same as 1) (regis: $monthcomp can't equal 0) if ($monthcomp > 1 && empty($resetEveryMonth)) { // Test with month is useless if monthcomp = 0 or 1 (0 is same as 1) (regis: $monthcomp can't equal 0)
if ($yearlen == 4) { if ($yearlen == 4) {

View File

@@ -142,26 +142,18 @@ if ($result < 0) {
exit; exit;
} }
$qualifiedjobs = array();
foreach ($object->lines as $val) {
if (!verifCond($val->test)) {
continue;
}
$qualifiedjobs[] = $val;
}
// TODO Duplicate code. This sequence of code must be shared with code into cron_run_jobs.php script. // TODO Duplicate code. This sequence of code must be shared with code into cron_run_jobs.php script.
// current date // current date
$nbofjobs = count($qualifiedjobs); $nbofjobs = count($object->lines);
$nbofjobslaunchedok = 0; $nbofjobslaunchedok = 0;
$nbofjobslaunchedko = 0; $nbofjobslaunchedko = 0;
if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { if (is_array($object->lines) && (count($object->lines) > 0)) {
$savconf = dol_clone($conf); $savconf = dol_clone($conf);
// Loop over job // Loop over job
foreach ($qualifiedjobs as $line) { foreach ($object->lines as $line) {
dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG); dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG);
echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label; echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label;
@@ -191,6 +183,10 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) {
} }
} }
if (!verifCond($line->test)) {
continue;
}
//If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database //If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database
if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) { if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) {
echo " - qualified"; echo " - qualified";

View File

@@ -243,7 +243,7 @@ class CompanyBankAccount extends Account
if ($id) { if ($id) {
$sql .= " WHERE rowid = ".((int) $id); $sql .= " WHERE rowid = ".((int) $id);
} }
if ($socid) { elseif ($socid) {
$sql .= " WHERE fk_soc = ".((int) $socid); $sql .= " WHERE fk_soc = ".((int) $socid);
if ($default > -1) { if ($default > -1) {
$sql .= " AND default_rib = ".((int) $default); $sql .= " AND default_rib = ".((int) $default);

View File

@@ -189,25 +189,17 @@ if ($result < 0) {
exit(-1); exit(-1);
} }
$qualifiedjobs = array();
foreach ($object->lines as $val) {
if (!verifCond($val->test)) {
continue;
}
$qualifiedjobs[] = $val;
}
// TODO Duplicate code. This sequence of code must be shared with code into public/cron/cron_run_jobs.php php page. // TODO Duplicate code. This sequence of code must be shared with code into public/cron/cron_run_jobs.php php page.
$nbofjobs = count($qualifiedjobs); $nbofjobs = count($object->lines);
$nbofjobslaunchedok = 0; $nbofjobslaunchedok = 0;
$nbofjobslaunchedko = 0; $nbofjobslaunchedko = 0;
if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { if (is_array($object->lines) && (count($object->lines) > 0)) {
$savconf = dol_clone($conf); $savconf = dol_clone($conf);
// Loop over job // Loop over job
foreach ($qualifiedjobs as $line) { foreach ($object->lines as $line) {
dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG); dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG);
echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label; echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label;
@@ -249,6 +241,10 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) {
} }
} }
if (!verifCond($line->test)) {
continue;
}
//If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database //If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database
if ($forcequalified || (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now))) { if ($forcequalified || (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now))) {
echo " - qualified"; echo " - qualified";