Merge remote-tracking branch 'origin/14.0' into fix_lost_superadmin_grade_after_edit_user
This commit is contained in:
commit
564badc61b
@ -943,7 +943,7 @@ if ($rowid > 0) {
|
|||||||
}
|
}
|
||||||
if (!$datefrom) {
|
if (!$datefrom) {
|
||||||
$datefrom = $object->datevalid;
|
$datefrom = $object->datevalid;
|
||||||
if ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) < dol_now()) {
|
if ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) > dol_now()) {
|
||||||
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
|
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
|
||||||
} else {
|
} else {
|
||||||
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
|
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
|
||||||
|
|||||||
@ -175,7 +175,6 @@ $object->fields = dol_sort_array($object->fields, 'position');
|
|||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -266,13 +265,15 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$param = 'action=reconcile&contextpage=banktransactionlist&id='.$id.'&search_account='.$id;
|
$param = 'action=reconcile&contextpage=banktransactionlist&id='.$id.'&search_account='.$id;
|
||||||
$param .= '&search_conciliated='.urlencode($search_conciliated);
|
|
||||||
if ($page) {
|
if ($page) {
|
||||||
$param .= '&page='.urlencode($page);
|
$param .= '&page='.urlencode($page);
|
||||||
}
|
}
|
||||||
if ($offset) {
|
if ($offset) {
|
||||||
$param .= '&offset='.urlencode($offset);
|
$param .= '&offset='.urlencode($offset);
|
||||||
}
|
}
|
||||||
|
if ($search_conciliated != '' && $search_conciliated != '-1') {
|
||||||
|
$param .= '&search_conciliated='.urlencode($search_conciliated);
|
||||||
|
}
|
||||||
if ($search_thirdparty_user) {
|
if ($search_thirdparty_user) {
|
||||||
$param .= '&search_thirdparty='.urlencode($search_thirdparty_user);
|
$param .= '&search_thirdparty='.urlencode($search_thirdparty_user);
|
||||||
}
|
}
|
||||||
@ -415,7 +416,6 @@ $banklinestatic = new AccountLine($db);
|
|||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
|
|
||||||
// Must be before button action
|
// Must be before button action
|
||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
@ -748,7 +748,7 @@ if ($resql) {
|
|||||||
// Confirmation delete
|
// Confirmation delete
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
$text = $langs->trans('ConfirmDeleteTransaction');
|
$text = $langs->trans('ConfirmDeleteTransaction');
|
||||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"), $langs->trans('DeleteTransaction'), $text, 'confirm_delete', null, '', 1);
|
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid", 'int'), $langs->trans('DeleteTransaction'), $text, 'confirm_delete', null, '', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lines of title fields
|
// Lines of title fields
|
||||||
@ -1189,7 +1189,7 @@ if ($resql) {
|
|||||||
$objforbalance = $db->fetch_object($resqlforbalance);
|
$objforbalance = $db->fetch_object($resqlforbalance);
|
||||||
if ($objforbalance) {
|
if ($objforbalance) {
|
||||||
// If sort is desc,desc,desc then total of previous date + amount is the balancebefore of the previous line before the line to show
|
// If sort is desc,desc,desc then total of previous date + amount is the balancebefore of the previous line before the line to show
|
||||||
if ($sortfield == 'b.datev,b.dateo,b.rowid' && $sortorder == 'desc,desc,desc') {
|
if ($sortfield == 'b.datev,b.dateo,b.rowid' && ($sortorder == 'desc' || $sortorder == 'desc,desc' || $sortorder == 'desc,desc,desc')) {
|
||||||
$balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
|
$balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
|
||||||
} else {
|
} else {
|
||||||
// If sort is asc,asc,asc then total of previous date is balance of line before the next line to show
|
// If sort is asc,asc,asc then total of previous date is balance of line before the next line to show
|
||||||
@ -1274,8 +1274,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($sortfield == 'b.datev,b.dateo,b.rowid' && ($sortorder == 'desc' || $sortorder == 'desc,desc' || $sortorder == 'desc,desc,desc')) {
|
||||||
if ($sortfield == 'b.datev,b.dateo,b.rowid' && $sortorder == 'desc,desc,desc') {
|
|
||||||
$balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc)
|
$balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc)
|
||||||
$balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT');
|
$balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -61,8 +61,8 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
$dateo = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
$dateo = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$amount = price2num(GETPOST('amount', 'alpha'), 'MT');
|
$amount = price2num(GETPOST('amount', 'alpha'), 'MT', 2);
|
||||||
$amountto = price2num(GETPOST('amountto', 'alpha'), 'MT');
|
$amountto = price2num(GETPOST('amountto', 'alpha'), 'MT', 2);
|
||||||
|
|
||||||
if (!$label) {
|
if (!$label) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -5329,13 +5329,16 @@ function price2num($amount, $rounding = '', $option = 0)
|
|||||||
if ($thousand != ',' && $thousand != '.') {
|
if ($thousand != ',' && $thousand != '.') {
|
||||||
$amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
$amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
||||||
}
|
}
|
||||||
|
|
||||||
$amount = str_replace(' ', '', $amount); // To avoid spaces
|
$amount = str_replace(' ', '', $amount); // To avoid spaces
|
||||||
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||||
$amount = str_replace($dec, '.', $amount);
|
$amount = str_replace($dec, '.', $amount);
|
||||||
|
|
||||||
|
$amount = preg_replace('/[^0-9\-\.]/', '', $amount); // Clean non numeric chars (so it clean some UTF8 spaces for example.
|
||||||
}
|
}
|
||||||
//print ' XX'.$amount.' '.$rounding;
|
//print ' XX'.$amount.' '.$rounding;
|
||||||
|
|
||||||
// Now, make a rounding if required
|
// Now, $amount is a real PHP float number. We make a rounding if required.
|
||||||
if ($rounding) {
|
if ($rounding) {
|
||||||
$nbofdectoround = '';
|
$nbofdectoround = '';
|
||||||
if ($rounding == 'MU') {
|
if ($rounding == 'MU') {
|
||||||
@ -5375,9 +5378,12 @@ function price2num($amount, $rounding = '', $option = 0)
|
|||||||
if ($thousand != ',' && $thousand != '.') {
|
if ($thousand != ',' && $thousand != '.') {
|
||||||
$amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
$amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
||||||
}
|
}
|
||||||
|
|
||||||
$amount = str_replace(' ', '', $amount); // To avoid spaces
|
$amount = str_replace(' ', '', $amount); // To avoid spaces
|
||||||
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||||
$amount = str_replace($dec, '.', $amount);
|
$amount = str_replace($dec, '.', $amount);
|
||||||
|
|
||||||
|
$amount = preg_replace('/[^0-9\-\.]/', '', $amount); // Clean non numeric chars (so it clean some UTF8 spaces for example.
|
||||||
}
|
}
|
||||||
|
|
||||||
return $amount;
|
return $amount;
|
||||||
|
|||||||
@ -269,11 +269,11 @@ class DataPolicy
|
|||||||
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
if ($message) {
|
if ($message) {
|
||||||
if ($sendtocc) {
|
if ($sendtocc) {
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
|
||||||
}
|
}
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $message);
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send mail
|
// Send mail
|
||||||
@ -311,7 +311,6 @@ class DataPolicy
|
|||||||
|
|
||||||
$sendto = $adherent->email;
|
$sendto = $adherent->email;
|
||||||
|
|
||||||
|
|
||||||
$code = md5($adherent->email);
|
$code = md5($adherent->email);
|
||||||
if (!empty($adherent->default_lang)) {
|
if (!empty($adherent->default_lang)) {
|
||||||
$l = $adherent->default_lang;
|
$l = $adherent->default_lang;
|
||||||
@ -343,11 +342,11 @@ class DataPolicy
|
|||||||
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
if ($message) {
|
if ($message) {
|
||||||
if ($sendtocc) {
|
if ($sendtocc) {
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
|
||||||
}
|
}
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $message);
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -150,6 +150,7 @@ if ($object->usage_bill_time) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
|
$extrafieldsobjectkey = $taskstatic->table_element;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||||
|
|
||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
@ -845,7 +846,6 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$extrafieldsobjectkey = $taskstatic->table_element;
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
|
|||||||
@ -799,9 +799,11 @@ $( document ).ready(function() {
|
|||||||
if ($_SESSION["takeposterminal"] == "") {
|
if ($_SESSION["takeposterminal"] == "") {
|
||||||
print "ModalBox('ModalTerminal');";
|
print "ModalBox('ModalTerminal');";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDolGlobalString('TAKEPOS_CONTROL_CASH_OPENING')) {
|
if (getDolGlobalString('TAKEPOS_CONTROL_CASH_OPENING')) {
|
||||||
$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
||||||
$sql .= " entity = ".$conf->entity." AND ";
|
$sql .= " entity = ".((int) $conf->entity)." AND ";
|
||||||
|
$sql .= " posnumber = ".((int) $_SESSION["takeposterminal"])." AND ";
|
||||||
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
@ -1081,7 +1083,8 @@ if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT rowid, status, entity FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
$sql = "SELECT rowid, status, entity FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
||||||
$sql .= " entity = ".$conf->entity." AND ";
|
$sql .= " entity = ".((int) $conf->entity)." AND ";
|
||||||
|
$sql .= " posnumber = ".((int) $_SESSION["takeposterminal"])." AND ";
|
||||||
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user