forked from Wavyzz/dolibarr
Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0
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:
@@ -238,10 +238,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() {
|
||||||
|
|||||||
@@ -876,12 +876,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>';
|
||||||
|
|
||||||
|
|||||||
@@ -604,6 +604,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') {
|
||||||
|
|||||||
@@ -2331,7 +2331,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");
|
||||||
|
|||||||
@@ -61,7 +61,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 {
|
||||||
|
|||||||
@@ -7416,7 +7416,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") : '');
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -269,10 +269,13 @@ if (empty($reshook)) {
|
|||||||
if ($ret == -3) {
|
if ($ret == -3) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|
||||||
$object->fetch($object->product_id_already_linked);
|
$tmpobject = new Product($db);
|
||||||
$productLink = $object->getNomUrl(1, 'supplier');
|
$tmpobject->fetch($object->product_id_already_linked);
|
||||||
|
$productLink = $tmpobject->getNomUrl(1, 'supplier');
|
||||||
|
|
||||||
setEventMessages($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct", $productLink), null, 'errors');
|
$texttoshow = $langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct", '{s1}');
|
||||||
|
$texttoshow = str_replace('{s1}', $productLink, $texttoshow);
|
||||||
|
setEventMessages($texttoshow, null, 'errors');
|
||||||
} elseif ($ret < 0) {
|
} elseif ($ret < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -233,7 +233,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);
|
||||||
|
|||||||
@@ -185,25 +185,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;
|
||||||
|
|
||||||
@@ -245,6 +237,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";
|
||||||
|
|||||||
Reference in New Issue
Block a user