# WARNING: head commit changed in the meantime
Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 15.0
This commit is contained in:
commit
f8a5749fc4
@ -66,7 +66,7 @@ function printDropdownBookmarksList()
|
||||
|
||||
|
||||
// Url to list bookmark
|
||||
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('Bookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
||||
$listbtn = '<a class="top-menu-dropdown-link" title="'.dol_escape_htmltag($langs->trans('Bookmarks')).'" href="'.DOL_URL_ROOT.'/bookmarks/list.php">';
|
||||
$listbtn .= img_picto('', 'bookmark', 'class="paddingright"').$langs->trans('Bookmarks').'</a>';
|
||||
|
||||
// Url to go on create new bookmark page
|
||||
|
||||
@ -1955,7 +1955,7 @@ if ($action == 'create') {
|
||||
|
||||
// We verify whether the object is provisionally numbering
|
||||
$ref = substr($object->ref, 1, 4);
|
||||
if ($ref == 'PROV') {
|
||||
if ($ref == 'PROV' || $ref == '') {
|
||||
$numref = $object->getNextNumRef($soc);
|
||||
if (empty($numref)) {
|
||||
$error++;
|
||||
|
||||
@ -1902,8 +1902,12 @@ if ($action == 'create' && $usercancreate) {
|
||||
if ($action == 'validate') {
|
||||
// We check that object has a temporary ref
|
||||
$ref = substr($object->ref, 1, 4);
|
||||
if ($ref == 'PROV') {
|
||||
if ($ref == 'PROV' || $ref == '') {
|
||||
$numref = $object->getNextNumRef($soc);
|
||||
if (empty($numref)) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
$numref = $object->ref;
|
||||
}
|
||||
@ -1954,8 +1958,9 @@ if ($action == 'create' && $usercancreate) {
|
||||
if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
|
||||
|
||||
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
|
||||
if (!$error) {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
|
||||
}
|
||||
}
|
||||
|
||||
// Confirm back to draft status
|
||||
|
||||
@ -934,33 +934,29 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
//$column = 's.dateep'; // We use the date of salary
|
||||
$column = 'p.datep';
|
||||
$column = 's.dateep'; // We use the date of end of period of salary
|
||||
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, s.label as label, date_format($column,'%Y-%m') as dm, sum(s.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
|
||||
$sql .= " WHERE s.entity IN (".getEntity('salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, s.label, dm";
|
||||
} else {
|
||||
$column = 'p.datep';
|
||||
}
|
||||
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user";
|
||||
$sql .= " WHERE s.entity IN (".getEntity('salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid = p.fk_salary";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm";
|
||||
}
|
||||
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm";
|
||||
|
||||
// For backward compatibility with old module salary
|
||||
$column = 'p.datep';
|
||||
$sql .= " UNION ";
|
||||
$sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
|
||||
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') {
|
||||
@ -975,7 +971,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
$sql .= $db->order($newsortfield, $sortorder);
|
||||
}
|
||||
|
||||
dol_syslog("get payment salaries");
|
||||
dol_syslog("get salaries");
|
||||
$result = $db->query($sql);
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
|
||||
@ -615,23 +615,31 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
|
||||
|
||||
if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
//$column = 's.dateep'; // we use the date of salary
|
||||
$column = 'p.datep';
|
||||
$column = 's.dateep'; // we use the date of end of period of salary
|
||||
|
||||
$sql = "SELECT s.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(s.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||
$sql .= " WHERE s.entity IN (".getEntity('salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql .= " GROUP BY s.label, dm";
|
||||
}
|
||||
if ($modecompta == "RECETTES-DEPENSES") {
|
||||
$column = 'p.datep';
|
||||
|
||||
$sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON p.fk_salary = s.rowid";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql .= " GROUP BY p.label, dm";
|
||||
}
|
||||
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
$sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p, ".MAIN_DB_PREFIX."salary as s";
|
||||
$sql .= " WHERE p.fk_salary = s.rowid";
|
||||
$sql .= " AND s.entity IN (".getEntity('salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql .= " GROUP BY p.label, dm";
|
||||
|
||||
dol_syslog("get social salaries payments");
|
||||
$result = $db->query($sql);
|
||||
|
||||
@ -1393,7 +1393,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
$note = $prodser->multilangs[$outputlangs->defaultlang]["other"];
|
||||
}
|
||||
}
|
||||
} elseif ($object->element == 'facture' || $object->element == 'facturefourn') {
|
||||
} elseif (($object->element == 'facture' || $object->element == 'facturefourn') && preg_match('/^\(DEPOSIT\).+/', $desc)) { // We must not replace '(DEPOSIT)' when it is alone, it will be translated and detailed later
|
||||
$desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc);
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write &&
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'holiday', $object->id, 'holiday');
|
||||
$result = restrictedArea($user, 'holiday', $object->id, 'holiday', '', '', 'rowid', $object->statut);
|
||||
|
||||
|
||||
/*
|
||||
@ -1414,7 +1414,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
|
||||
// Confirmation messages
|
||||
if ($action == 'delete') {
|
||||
if ($user->rights->holiday->delete) {
|
||||
if ($candelete) {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("TitleDeleteCP"), $langs->trans("ConfirmDeleteCP"), "confirm_delete", '', 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user