From 284627b693413a8251f11981bd407060b1d162c2 Mon Sep 17 00:00:00 2001 From: trekmorris <78349579+trekmorris@users.noreply.github.com> Date: Fri, 16 Jul 2021 23:55:29 +0800 Subject: [PATCH 01/18] Update opensurvey.lang manually This file is not auto sync from transifex . So update it manually . --- htdocs/langs/zh_TW/opensurvey.lang | 120 ++++++++++++++--------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/htdocs/langs/zh_TW/opensurvey.lang b/htdocs/langs/zh_TW/opensurvey.lang index 51a4283c721..ff927bfc863 100644 --- a/htdocs/langs/zh_TW/opensurvey.lang +++ b/htdocs/langs/zh_TW/opensurvey.lang @@ -1,61 +1,61 @@ # Dolibarr language file - Source file is en_US - opensurvey -Survey=Poll -Surveys=Polls -OrganizeYourMeetingEasily=Organize your meetings and polls easily. First select the type of poll... -NewSurvey=New poll -OpenSurveyArea=Polls area -AddACommentForPoll=You can add a comment into poll... -AddComment=Add comment -CreatePoll=Create poll -PollTitle=Poll title -ToReceiveEMailForEachVote=Receive an email for each vote -TypeDate=Type date -TypeClassic=Type standard -OpenSurveyStep2=Select your dates among the free days (grey). The selected days are green. You can unselect a day previously selected by clicking again on it -RemoveAllDays=Remove all days -CopyHoursOfFirstDay=Copy hours of first day -RemoveAllHours=Remove all hours -SelectedDays=Selected days -TheBestChoice=The best choice currently is -TheBestChoices=The best choices currently are -with=with -OpenSurveyHowTo=If you agree to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line. -CommentsOfVoters=Comments of voters -ConfirmRemovalOfPoll=Are you sure you want to remove this poll (and all votes) -RemovePoll=Remove poll -UrlForSurvey=URL to communicate to get a direct access to poll -PollOnChoice=You are creating a poll to make a multi-choice for a poll. First enter all possible choices for your poll: -CreateSurveyDate=Create a date poll -CreateSurveyStandard=Create a standard poll -CheckBox=Simple checkbox -YesNoList=List (empty/yes/no) -PourContreList=List (empty/for/against) -AddNewColumn=Add new column -TitleChoice=Choice label -ExportSpreadsheet=Export result spreadsheet -ExpireDate=極限日期 -NbOfSurveys=Number of polls -NbOfVoters=No. of voters -SurveyResults=Results -PollAdminDesc=You are allowed to change all vote lines of this poll with button "Edit". You can, as well, remove a column or a line with %s. You can also add a new column with %s. -5MoreChoices=5 more choices -Against=Against -YouAreInivitedToVote=You are invited to vote for this poll -VoteNameAlreadyExists=This name was already used for this poll -AddADate=Add a date -AddStartHour=Add start hour -AddEndHour=Add end hour -votes=vote(s) -NoCommentYet=No comments have been posted for this poll yet -CanComment=Voters can comment in the poll -CanSeeOthersVote=Voters can see other people's vote -SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format:
- empty,
- "8h", "8H" or "8:00" to give a meeting's start hour,
- "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,
- "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes. -BackToCurrentMonth=Back to current month -ErrorOpenSurveyFillFirstSection=You haven't filled the first section of the poll creation -ErrorOpenSurveyOneChoice=Enter at least one choice -ErrorInsertingComment=There was an error while inserting your comment -MoreChoices=Enter more choices for the voters -SurveyExpiredInfo=The poll has been closed or voting delay has expired. -EmailSomeoneVoted=%s has filled a line.\nYou can find your poll at the link: \n%s -ShowSurvey=Show survey -UserMustBeSameThanUserUsedToVote=You must have voted and use the same user name that the one used to vote, to post a comment +Survey=調查 +Surveys=調查 +OrganizeYourMeetingEasily=輕鬆組織會議和調查。首先選擇調查的類型... +NewSurvey=新調查 +OpenSurveyArea=調查區 +AddACommentForPoll=您可以在調查中加入評論... +AddComment=增加評論 +CreatePoll=建立調查 +PollTitle=調查標題 +ToReceiveEMailForEachVote=每次投票都會收到一封電子郵件 +TypeDate=日期類型 +TypeClassic=標準類型 +OpenSurveyStep2=在空閒日中選擇日期(灰色)。所選的日期為綠色。您可以通過再次點擊來取消先前選擇的日期 +RemoveAllDays=全部刪除 +CopyHoursOfFirstDay=複制第一天的時間 +RemoveAllHours=刪除所有時間 +SelectedDays=已選擇的日子 +TheBestChoice=目前最好的選擇是 +TheBestChoices=目前最好的選擇是 +with=與 +OpenSurveyHowTo=如果您同意在此次調查中投票,則必須給出自己的名字,選擇最適合您的值,並使用該行末尾的加號按鈕進行驗證。 +CommentsOfVoters=投票人的評論 +ConfirmRemovalOfPoll=您確定要刪除此調查(以及所有投票)嗎? +RemovePoll=刪除調查 +UrlForSurvey=調查的直接網址 +PollOnChoice=您正在建立多項選擇的調查。首先為您的調查輸入所有可能的選擇: +CreateSurveyDate=建立日期調查 +CreateSurveyStandard=建立標準調查 +CheckBox=簡易勾選框 +YesNoList=清單(空/是/否) +PourContreList=清單(空/支持/反對) +AddNewColumn=增加新欄位 +TitleChoice=選擇標籤 +ExportSpreadsheet=匯出結果表格 +ExpireDate=調查截止日 +NbOfSurveys=投票次數 +NbOfVoters=投票人數 +SurveyResults=結果 +PollAdminDesc=您可以使用“編輯”按鈕更改此民意調查的所有投票行。您也可以使用%s刪除列或行。您也可以使用%s增加新列。 +5MoreChoices=再多5個選項 +Against=反對 +YouAreInivitedToVote=您被邀請參加此項調查 +VoteNameAlreadyExists=此名稱已用於此調查 +AddADate=增加日期 +AddStartHour=增加開始時間 +AddEndHour=增加結束時間 +votes=投票 +NoCommentYet=尚未有此調查的評論 +CanComment=投票者可以在調查中發表評論 +CanSeeOthersVote=投票者可以看到其他人的投票 +SelectDayDesc=對於每個選定的日期,您可以依照以下格式選擇是否選擇開會時間:
-空的
-“ 8h”,“ 8H”或“ 8:00”指定會議的開始時間,
-“ 8-11”,“ 8h-11h”,“ 8H-11H”或“ 8:00-11:00”給出會議的開始和結束時間,
-同樣的用“ 8h15-11h15”,“ 8H15-11H15”或“ 8:15-11:15”表示,但要加上分鐘。 +BackToCurrentMonth=回到目前月份 +ErrorOpenSurveyFillFirstSection=您尚未填寫建立調查的第一部分 +ErrorOpenSurveyOneChoice=輸入至少一個選項 +ErrorInsertingComment=插入您的評論時出錯 +MoreChoices=為投票者輸入更多選項 +SurveyExpiredInfo=投票已關閉或投票已到期。 +EmailSomeoneVoted=%s已填滿一行。\n您可以在以下連結找到您的調查:\n%s +ShowSurvey=顯示調查 +UserMustBeSameThanUserUsedToVote=您必須已投票並使用與投票時相同的用戶名來發表評論 From 922354f36616288ea69d066206d4c775b4c43e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Jul 2021 18:19:27 +0200 Subject: [PATCH 02/18] Update projects.php --- htdocs/projet/ajax/projects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index 0036ae64353..a852ab6bad8 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -63,7 +63,7 @@ if (!GETPOST('mode', 'aZ09') || GETPOST('mode', 'aZ09') != 'gettasks') { // Mode to get list of tasks if (GETPOST('mode', 'aZ09') == 'gettasks') { $formproject = new FormProjets($db); - $formproject->selectTasks((!empty($$socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), ''); + $formproject->selectTasks((!empty($socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), ''); return; } From e93a362a0d585374260be696f91420d922672d4e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 23 Jul 2021 18:33:18 +0200 Subject: [PATCH 03/18] fix: since be62c2f7 commit selectlist from formconfirm were behind the form confirm --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1213c070acc..56316475ab7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1182,7 +1182,7 @@ class Form // mode 1 $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).($showtype ? '&showtype='.urlencode($showtype) : ''); $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); - $out .= ''; + $out .= ''; if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : '; elseif ($hidelabel > 1) { $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; @@ -6052,7 +6052,7 @@ class Form $urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter); // Activate the auto complete using ajax call. $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array()); - $out .= ''; + $out .= ''; if ($placeholder) $placeholder = ' placeholder="'.$placeholder.'"'; $out .= ''; } From bbd84fd13ec2241348d31246125f286c364192d2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 26 Jul 2021 04:08:05 +0200 Subject: [PATCH 04/18] FIX: Missing column Date validation in ledger & subledger --- .../accountancy/bookkeeping/listbyaccount.php | 56 ++++++++++++++++- .../bookkeeping/listbysubaccount.php | 63 ++++++++++++++++--- 2 files changed, 108 insertions(+), 11 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 98c3f14191b..c8364c35ee5 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -2,7 +2,7 @@ /* Copyright (C) 2016 Neil Orley * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2020 Florian Henry - * Copyright (C) 2013-2020 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -56,6 +56,14 @@ $search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); $search_date_export_endday = GETPOST('search_date_export_endday', 'int'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); +$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); +$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); +$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); +$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); +$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); +$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_accountancy_code = GETPOST("search_accountancy_code"); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); @@ -81,7 +89,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_ } // Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -144,6 +152,7 @@ $arrayfields = array( 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), + 't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), ); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { @@ -221,6 +230,14 @@ if (empty($reshook)) { $search_date_export_endyear = ''; $search_date_export_endmonth = ''; $search_date_export_endday = ''; + $search_date_validation_start = ''; + $search_date_validation_end = ''; + $search_date_validation_startyear = ''; + $search_date_validation_startmonth = ''; + $search_date_validation_startday = ''; + $search_date_validation_endyear = ''; + $search_date_validation_endmonth = ''; + $search_date_validation_endday = ''; $search_debit = ''; $search_credit = ''; $search_lettering_code = ''; @@ -301,6 +318,14 @@ if (empty($reshook)) { $filter['t.date_export<='] = $search_date_export_end; $param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear; } + if (!empty($search_date_validation_start)) { + $filter['t.date_validated>='] = $search_date_validation_start; + $param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear; + } + if (!empty($search_date_validation_end)) { + $filter['t.date_validated<='] = $search_date_validation_end; + $param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear; + } } if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) { @@ -564,6 +589,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) { print ''; print ''; } +// Date validation +if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; + print '
'; + print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print ''; +} // Fields from hook $parameters = array('arrayfields'=>$arrayfields); @@ -605,6 +641,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) { if (!empty($arrayfields['t.date_export']['checked'])) { print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); } +if (!empty($arrayfields['t.date_validated']['checked'])) { + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center '); +} // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook @@ -635,7 +674,7 @@ while ($i < min($num, $limit)) { // Is it a break ? if ($accountg != $displayed_account_number || !isset($displayed_account_number)) { $colnumber = 5; - $colnumberend = 7; + $colnumberend = 8; if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) { $colnumber--; @@ -643,6 +682,9 @@ while ($i < min($num, $limit)) { if (empty($arrayfields['t.date_export']['checked'])) { $colnumber--; } + if (empty($arrayfields['t.date_validated']['checked'])) { + $colnumber--; + } $colspan = $totalarray['nbfield'] - $colnumber; $colspanend = $totalarray['nbfield'] - $colnumberend; @@ -845,6 +887,14 @@ while ($i < min($num, $limit)) { } } + // Validated operation date + if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''.dol_print_date($line->date_validation, 'dayhour').''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 20899c693c6..d2e036b1f60 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -2,8 +2,8 @@ /* Copyright (C) 2016 Neil Orley * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2020 Florian Henry - * Copyright (C) 2013-2020 Alexandre Spangaro - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2018-2020 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ $search_date_endyear = GETPOST('search_date_endyear', 'int'); $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); $search_date_endday = GETPOST('search_date_endday', 'int'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); -$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); $search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); $search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); @@ -55,7 +55,15 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); $search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); $search_date_export_endday = GETPOST('search_date_export_endday', 'int'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); -$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); +$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); +$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); +$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); +$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); +$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); +$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_accountancy_code = GETPOST("search_accountancy_code"); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); @@ -144,6 +152,7 @@ $arrayfields = array( 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), + 't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), ); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { @@ -221,6 +230,14 @@ if (empty($reshook)) { $search_date_export_endyear = ''; $search_date_export_endmonth = ''; $search_date_export_endday = ''; + $search_date_validation_start = ''; + $search_date_validation_end = ''; + $search_date_validation_startyear = ''; + $search_date_validation_startmonth = ''; + $search_date_validation_startday = ''; + $search_date_validation_endyear = ''; + $search_date_validation_endmonth = ''; + $search_date_validation_endday = ''; $search_debit = ''; $search_credit = ''; $search_lettering_code = ''; @@ -301,6 +318,14 @@ if (empty($reshook)) { $filter['t.date_export<='] = $search_date_export_end; $param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear; } + if (!empty($search_date_validation_start)) { + $filter['t.date_validated>='] = $search_date_validation_start; + $param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear; + } + if (!empty($search_date_validation_end)) { + $filter['t.date_validated<='] = $search_date_validation_end; + $param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear; + } } if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) { @@ -373,7 +398,6 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("VueByAccountAccou llxHeader('', $title_page); - // List $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { @@ -448,7 +472,6 @@ print ''; print ''; - $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { @@ -568,6 +591,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) { print ''; print ''; } +// Date validation +if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; + print '
'; + print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print ''; +} // Fields from hook $parameters = array('arrayfields'=>$arrayfields); @@ -609,6 +643,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) { if (!empty($arrayfields['t.date_export']['checked'])) { print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); } +if (!empty($arrayfields['t.date_validated']['checked'])) { + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center '); +} // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook @@ -639,7 +676,7 @@ while ($i < min($num, $limit)) { // Is it a break ? if ($accountg != $displayed_account_number || !isset($displayed_account_number)) { $colnumber = 5; - $colnumberend = 7; + $colnumberend = 8; if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) { $colnumber--; @@ -647,10 +684,12 @@ while ($i < min($num, $limit)) { if (empty($arrayfields['t.date_export']['checked'])) { $colnumber--; } + if (empty($arrayfields['t.date_validated']['checked'])) { + $colnumber--; + } $colspan = $totalarray['nbfield'] - $colnumber; $colspanend = $totalarray['nbfield'] - $colnumberend; - // Show a subtotal by accounting account if (isset($displayed_account_number)) { print ''; @@ -859,6 +898,14 @@ while ($i < min($num, $limit)) { } } + // Validated operation date + if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''.dol_print_date($line->date_validation, 'dayhour').''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook From a7cef1aa1595a768353a6d7980f7437eaecd1f49 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 26 Jul 2021 10:20:11 +0200 Subject: [PATCH 05/18] FIX: cannot add time spend when column ref is not displayed --- htdocs/projet/tasks/time.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 3b2e36d34c6..2a4b1d6aeee 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1374,7 +1374,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; if (!$i) $totalarray['nbfield']++; } - } else { + } elseif ($action !== 'createtime') { print ''; } From 712f0b897d66047a3d5d37f90d1ab15896f77129 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 28 Jul 2021 12:02:45 +0200 Subject: [PATCH 06/18] FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT) --- .../class/accountancyexport.class.php | 35 ++++++++++++------- htdocs/accountancy/tpl/export_journal.tpl.php | 6 ++-- htdocs/langs/en_US/accountancy.lang | 2 +- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 6ef54ea3029..aa3e24ab545 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Pierre-Henry Favre - * Copyright (C) 2016-2020 Alexandre Spangaro + * Copyright (C) 2016-2021 Alexandre Spangaro * Copyright (C) 2013-2017 Olivier Geffroy * Copyright (C) 2017 Elarifr. Ari Elbaz * Copyright (C) 2017-2019 Frédéric France @@ -439,33 +439,42 @@ class AccountancyExport } /** - * Export format : CIEL + * Export format : CIEL (Format XIMPORT) + * Format since 2003 compatible CIEL version > 2002 / Sage50 + * + * Help : https://sage50c.online-help.sage.fr/aide-technique/ + * In sage software | Use menu : "Exchange" > "Importing entries..." + * + * If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory : + * use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME * * @param array $TData data * @return void */ public function exportCiel(&$TData) { - global $conf; - $end_line = "\r\n"; $i = 1; - $date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd + foreach ($TData as $data) { - $code_compta = $data->numero_compte; - if (!empty($data->subledger_account)) - $code_compta = $data->subledger_account; + $code_compta = length_accountg($data->numero_compte); + if (!empty($data->subledger_account)) { + $code_compta = length_accounta($data->subledger_account); + } + + $date_creation = dol_print_date($data->date_creation, '%Y%m%d'); + $date_document = dol_print_date($data->doc_date, '%Y%m%d'); $Tab = array(); - $Tab['num_ecriture'] = str_pad($i, 5); + $Tab['num_ecriture'] = str_pad($data->piece_num, 5); $Tab['code_journal'] = str_pad($data->code_journal, 2); - $Tab['date_ecriture'] = $date_ecriture; - $Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12); + $Tab['date_ecriture'] = $date_creation; + $Tab['date_ope'] = $date_document; + $Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12); $Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11); $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25); - $Tab['montant'] = str_pad(abs($data->montant), 13, ' ', STR_PAD_LEFT); + $Tab['montant'] = str_pad(price2fec(abs($data->montant)), 13, ' ', STR_PAD_LEFT); $Tab['type_montant'] = str_pad($data->sens, 1); $Tab['vide'] = str_repeat(' ', 18); $Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34); diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index fb957db2233..c53ec1197f9 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -58,9 +58,9 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$ $endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard'); $completefilename = $siren."FEC".$endaccountingperiod.".txt"; -} -else -{ +} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) { + $completefilename = "XIMPORT.TXT"; +} else { $completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format; } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index fea7bf9d0ef..bf58e28e4f6 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -311,7 +311,7 @@ Modelcsv_normal=Classic export Modelcsv_CEGID=Export for CEGID Expert Comptabilité Modelcsv_COALA=Export for Sage Coala Modelcsv_bob50=Export for Sage BOB 50 -Modelcsv_ciel=Export for Sage Ciel Compta or Compta Evolution +Modelcsv_ciel=Export for Sage50, Ciel Compta or Compta Evo. (Format XIMPORT) Modelcsv_quadratus=Export for Quadratus QuadraCompta Modelcsv_ebp=Export for EBP Modelcsv_cogilog=Export for Cogilog From 7acebd28ca0196f3a720e8226e8e08e95e3e4a2b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 28 Jul 2021 14:08:53 +0200 Subject: [PATCH 07/18] Add information --- htdocs/accountancy/class/accountancyexport.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index aa3e24ab545..009a4c3cb74 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -441,6 +441,7 @@ class AccountancyExport /** * Export format : CIEL (Format XIMPORT) * Format since 2003 compatible CIEL version > 2002 / Sage50 + * Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr) * * Help : https://sage50c.online-help.sage.fr/aide-technique/ * In sage software | Use menu : "Exchange" > "Importing entries..." From cd63ede35a6c3db0ada94c096949abb0da1ddd09 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 28 Jul 2021 16:46:57 +0200 Subject: [PATCH 08/18] Correctif date --- htdocs/accountancy/class/accountancyexport.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 009a4c3cb74..7cd1a153183 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -464,14 +464,14 @@ class AccountancyExport $code_compta = length_accounta($data->subledger_account); } - $date_creation = dol_print_date($data->date_creation, '%Y%m%d'); - $date_document = dol_print_date($data->doc_date, '%Y%m%d'); + $date_document = dol_print_date($data->doc_date, '%Y%m%d'); + $date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d'); $Tab = array(); $Tab['num_ecriture'] = str_pad($data->piece_num, 5); $Tab['code_journal'] = str_pad($data->code_journal, 2); - $Tab['date_ecriture'] = $date_creation; - $Tab['date_ope'] = $date_document; + $Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT); + $Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT); $Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12); $Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11); $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25); From 262dd1600b67fec20c028e4021c12456951e3549 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 29 Jul 2021 06:23:12 +0200 Subject: [PATCH 09/18] FIX: Invoice - Missing button to reopen an abandoned situation invoice --- htdocs/compta/facture/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 519f40c254a..fe5d5c3ab0a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5206,7 +5206,8 @@ elseif ($id > 0 || !empty($ref)) // Reopen a standard paid invoice if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) || ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id)) - || ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))) + || ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)) + || ($object->type == Facture::TYPE_SITUATION && empty($discount->id))) && ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely) { From 12b2ba64eb7a8a2dd5f6b84c0d692e1bdf0e040b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 29 Jul 2021 17:49:37 +0200 Subject: [PATCH 10/18] Fix right check on thirdparty set on ticket card --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index aaf5b29a985..08d9330a4c6 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -449,7 +449,7 @@ if (empty($reshook)) { } // Set parent company - if ($action == 'set_thirdparty' && $user->rights->societe->creer) { + if ($action == 'set_thirdparty' && $user->rights->ticket->write) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { $result = $object->setCustomer(GETPOST('editcustomer', 'int')); $url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha'); From bd35d8626834daac53eee835e220dbbe1a2fada2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jul 2021 17:20:48 +0200 Subject: [PATCH 11/18] Debug v14 --- htdocs/comm/mailing/cibles.php | 7 ++++--- htdocs/core/modules/mailings/contacts1.modules.php | 14 +++++++++----- htdocs/langs/en_US/mails.lang | 4 ++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 08e223ed89f..3f2cfc2974c 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2016 Laurent Destailleur + * Copyright (C) 2005-2021 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2014 Florian Henry * @@ -337,6 +337,7 @@ if ($object->fetch($id) >= 0) { if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { + $reg = array(); if (preg_match("/(.*)\.modules\.php$/i", $file, $reg)) { if ($reg[1] == 'example') { continue; @@ -534,9 +535,9 @@ if ($object->fetch($id) >= 0) { $morehtmlcenter = ''; if ($allowaddtarget) { - $morehtmlcenter = ''.$langs->trans("ToClearAllRecipientsClickHere").' id.'" class="button reposition">'.$langs->trans("TargetsReset").''; + $morehtmlcenter = ''.$langs->trans("ToClearAllRecipientsClickHere").' id.'" class="button reposition smallpaddingimp">'.$langs->trans("TargetsReset").''; } - $morehtmlcenter .= ' id.'">'.$langs->trans("Download").''; + $morehtmlcenter .= '   id.'">'.$langs->trans("Download").''; print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 4bd03593e09..6be129b8815 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -141,15 +141,19 @@ class mailing_contacts1 extends MailingTargets $resql = $this->db->query($sql); $s .= $langs->trans("PostOrFunction").': '; - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); $i = 0; - while ($i < $num) { - $obj = $this->db->fetch_object($resql); - $s .= ''; - $i++; + if ($num > 0) { + while ($i < $num) { + $obj = $this->db->fetch_object($resql); + $s .= ''; + $i++; + } + } else { + $s .= ''; } } else { dol_print_error($this->db); diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 24c86cc885a..1c0dd638eeb 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -162,8 +162,8 @@ AdvTgtDeleteFilter=Delete filter AdvTgtSaveFilter=Save filter AdvTgtCreateFilter=Create filter AdvTgtOrCreateNewFilter=Name of new filter -NoContactWithCategoryFound=No contact/address with a category found -NoContactLinkedToThirdpartieWithCategoryFound=No contact/address with a category found +NoContactWithCategoryFound=No category found linked to some contacts/addresses +NoContactLinkedToThirdpartieWithCategoryFound=No category found linked to some thirdparties OutGoingEmailSetup=Outgoing emails InGoingEmailSetup=Incoming emails OutGoingEmailSetupForEmailing=Outgoing emails (for module %s) From b67487b2ca544d1803642bf176d077f78e67c073 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jul 2021 17:28:43 +0200 Subject: [PATCH 12/18] Fix reposition --- .../modules/mailings/contacts1.modules.php | 20 +++++++++---------- .../core/modules/mailings/pomme.modules.php | 12 +++++------ .../modules/mailings/thirdparties.modules.php | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 6be129b8815..0ca62392c82 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -140,8 +140,8 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY sp.poste"; $resql = $this->db->query($sql); - $s .= $langs->trans("PostOrFunction").': '; - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); @@ -163,7 +163,7 @@ class mailing_contacts1 extends MailingTargets $s .= ' '; // Filter on contact category - $s .= $langs->trans("ContactCategoriesShort").': '; + $s .= $langs->trans("ContactCategoriesShort").' '; $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; $sql .= " FROM "; $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; @@ -179,7 +179,7 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY c.label"; $resql = $this->db->query($sql); - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); @@ -201,8 +201,8 @@ class mailing_contacts1 extends MailingTargets $s .= '
'; // Add prospect of a particular level - $s .= $langs->trans("NatureOfThirdParty").': '; - $s .= ''; $sql = "SELECT code, label"; $sql .= " FROM ".MAIN_DB_PREFIX."c_prospectlevel"; $sql .= " WHERE active > 0"; @@ -238,7 +238,7 @@ class mailing_contacts1 extends MailingTargets $s .= ' '; // Filter on thirdparty category - $s .= $langs->trans("CustomersProspectsCategoriesShort").': '; + $s .= $langs->trans("CustomersProspectsCategoriesShort").' '; $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; $sql .= " FROM "; $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; @@ -254,7 +254,7 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY c.label"; $resql = $this->db->query($sql); - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); @@ -276,7 +276,7 @@ class mailing_contacts1 extends MailingTargets $s .= ' '; // Filter on thirdparty category - $s .= $langs->trans("SuppliersCategoriesShort").': '; + $s .= $langs->trans("SuppliersCategoriesShort").' '; $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; $sql .= " FROM "; $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; @@ -292,7 +292,7 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY c.label"; $resql = $this->db->query($sql); - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index a2a54c02c55..6880452a416 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -20,13 +20,13 @@ /** * \file htdocs/core/modules/mailings/pomme.modules.php * \ingroup mailing - * \brief File of class to offer a selector of emailing targets with Rule 'Pomme'. + * \brief File of class to offer a selector of emailing targets of users. */ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; /** - * Class to offer a selector of emailing targets with Rule 'Peche'. + * Class to offer a selector of emailing targets with Rule 'Pomme'. */ class mailing_pomme extends MailingTargets { @@ -119,16 +119,16 @@ class mailing_pomme extends MailingTargets $langs->load("users"); $s = ''; - $s .= $langs->trans("Status").': '; - $s .= ''; $s .= ''; $s .= ''; $s .= ''; $s .= ''; $s .= ' '; - $s .= $langs->trans("Employee").': '; - $s .= ''; $s .= ''; $s .= ''; $s .= ''; diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index f764c3f5f71..ae26dfc19fd 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -226,8 +226,8 @@ class mailing_thirdparties extends MailingTargets $langs->load("companies"); - $s = $langs->trans("Categories").': '; - $s .= ''; // Show categories $sql = "SELECT rowid, label, type, visible"; @@ -276,7 +276,7 @@ class mailing_thirdparties extends MailingTargets $s .= ' '; $s .= $langs->trans('ProspectCustomer'); - $s .= ': '; $s .= ''; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $s .= ''; @@ -292,7 +292,7 @@ class mailing_thirdparties extends MailingTargets $s .= ' '; $s .= $langs->trans("Status"); - $s .= ': '; $s .= ''; $s .= ''; $s .= ''; From 5256d6e046894a007664b002ef1b1be0ee94c973 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jul 2021 17:34:41 +0200 Subject: [PATCH 13/18] css --- htdocs/accountancy/bookkeeping/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index ce91219c306..bc260c77ed3 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -576,7 +576,7 @@ if (!empty($sortfield)) { // Export into a file with format defined into setup (FEC, CSV, ...) // Must be after definition of $sql if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) { - // TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them. + // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them. $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); if ($result < 0) { @@ -822,7 +822,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) { // Code journal if (!empty($arrayfields['t.code_journal']['checked'])) { print ''; - print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1); + print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth150'); print ''; } // Date document @@ -865,7 +865,7 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) { print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount'); print ''; } else { - print ''; + print ''; } print ''; } From 04fc2c0ce73c2019d552e781eb068ee1e1fd53e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Aug 2021 17:49:27 +0200 Subject: [PATCH 14/18] css --- htdocs/admin/paymentbybanktransfer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 7cf522abc33..be5dc4e76e6 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -150,7 +150,7 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print ""; From 8077fae42e1458e45e7c800512fd9e4726ea0b43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Aug 2021 17:56:58 +0200 Subject: [PATCH 15/18] Code comment --- htdocs/compta/facture/prelevement.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index f5ac0f19509..6fdc74a7539 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -148,12 +148,6 @@ if ($type == 'bank-transfer') { llxHeader('', $title, $helpurl); -/* *************************************************************************** */ -/* */ -/* Mode fiche */ -/* */ -/* *************************************************************************** */ - if ($object->id > 0) { $selleruserevenustamp = $mysoc->useRevenueStamp(); @@ -471,6 +465,7 @@ if ($object->id > 0) { print ""; print ''; + // IBAN of seller or supplier $title = 'CustomerIBAN'; if ($type == 'bank-transfer') { $title = 'SupplierIBAN'; From efda27000eaabc22649a3f5bc1a925e4226feb99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Aug 2021 18:13:35 +0200 Subject: [PATCH 16/18] Fix set of date of rum signature --- .../societe/class/companybankaccount.class.php | 7 ++++--- htdocs/societe/paymentmodes.php | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 6c52359979e..9b767cde34c 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -83,7 +83,7 @@ class CompanyBankAccount extends Account $now = dol_now(); $error = 0; // Correct default_rib to be sure to have always one default - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".$this->socid." AND default_rib = 1 AND type = 'ban'"; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".((int) $this->socid)." AND default_rib = 1 AND type = 'ban'"; $result = $this->db->query($sql); if ($result) { $numrows = $this->db->num_rows($result); @@ -96,7 +96,7 @@ class CompanyBankAccount extends Account } $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_rib (fk_soc, type, datec)"; - $sql .= " VALUES (".$this->socid.", 'ban', '".$this->db->idate($now)."')"; + $sql .= " VALUES (".((int) $this->socid).", 'ban', '".$this->db->idate($now)."')"; $resql = $this->db->query($sql); if ($resql) { if ($this->db->affected_rows($resql)) { @@ -135,6 +135,7 @@ class CompanyBankAccount extends Account public function update(User $user = null, $notrigger = 0) { global $conf; + $error = 0; if (!$this->id) { @@ -160,7 +161,7 @@ class CompanyBankAccount extends Account $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",default_rib = ".((int) $this->default_rib); - if ($conf->prelevement->enabled) { + if (!empty($conf->prelevement->enabled)) { $sql .= ",frstrecur = '".$this->db->escape($this->frstrecur)."'"; $sql .= ",rum = '".$this->db->escape($this->rum)."'"; $sql .= ",date_rum = ".($this->date_rum ? "'".$this->db->idate($this->date_rum)."'" : "null"); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 93c4fbc2202..97d92007885 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -161,9 +161,6 @@ if (empty($reshook)) { if (empty($companybankaccount->rum)) { $companybankaccount->rum = $prelevement->buildRumNumber($object->code_client, $companybankaccount->datec, $companybankaccount->id); } - if (empty($companybankaccount->date_rum)) { - $companybankaccount->date_rum = dol_now(); - } $result = $companybankaccount->update($user); if (!$result) { @@ -268,9 +265,9 @@ if (empty($reshook)) { $companybankaccount->domiciliation = GETPOST('domiciliation', 'alpha'); $companybankaccount->proprio = GETPOST('proprio', 'alpha'); $companybankaccount->owner_address = GETPOST('owner_address', 'alpha'); - $companybankaccount->frstrecur = GETPOST('frstrecur'); + $companybankaccount->frstrecur = GETPOST('frstrecur', 'alpha'); $companybankaccount->rum = GETPOST('rum', 'alpha'); - $companybankaccount->date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear')); + $companybankaccount->date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth', 'int'), GETPOST('date_rumday', 'int'), GETPOST('date_rumyear', 'int')); $companybankaccount->datec = dol_now(); $companybankaccount->status = 1; @@ -300,7 +297,6 @@ if (empty($reshook)) { if (empty($companybankaccount->rum)) { $companybankaccount->rum = $prelevement->buildRumNumber($object->code_client, $companybankaccount->datec, $companybankaccount->id); - $companybankaccount->date_rum = dol_now(); } } @@ -1638,8 +1634,10 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) { print ''; print ''; + $date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear')); + print ''; - print ''; + print ''; print ''; print ''; + $date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear')); + print ''; - print ''; + print ''; print ''; print ''; -print ''; print ''; @@ -225,7 +225,11 @@ print ''; print ''; if ($nb) { if ($pricetowithdraw) { - print $langs->trans('BankToReceiveWithdraw').': '; + $title = print $langs->trans('BankToReceiveWithdraw').': '; + if ($type == 'bank-transfer') { + $title .= $langs->trans('BankToPayCreditTransfer').': '; + } + print $title; $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'id_bankaccount', 0, "courant=1"); print ' - '; From 2deaac0fc4f8e689d9407605cf7f5e0487e83e5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Aug 2021 18:34:38 +0200 Subject: [PATCH 18/18] Fix changelog --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5b296aa88e2..b54d8df615e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -228,8 +228,9 @@ Following changes may create regressions for some external modules, but were nec * If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT) * If your database is MySQL or MariaDB, you need at least version 5.1 * Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules -* removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__) +* Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__) * Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries. +* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8. ***** ChangeLog for 13.0.4 compared to 13.0.3 *****
'.$langs->trans("Parameter").''.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("RUM").'
'.$langs->trans("DateRUM").''.$form->selectDate(GETPOST('date_rum') ?GETPOST('date_rum') : $companybankaccount->date_rum, 'date_rum', 0, 0, 1, 'date_rum').'
'.$form->selectDate($date_rum ? $date_rum : $companybankaccount->date_rum, 'date_rum', 0, 0, 1, 'date_rum', 1, 1).'
'.$langs->trans("WithdrawMode").''; $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); @@ -1800,8 +1798,10 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) { print '
'.$langs->trans("RUM").'
'.$langs->trans("RUMWillBeGenerated").'
'.$langs->trans("DateRUM").''.$form->selectDate(GETPOST('date_rum'), 'date_rum', 0, 0, 1, 'date_rum').'
'.$form->selectDate($date_rum, 'date_rum', 0, 0, 1, 'date_rum', 1, 1).'
'.$langs->trans("WithdrawMode").''; $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); From 61e3a57de701c2ecbe77095bd1fa466fbe31fbaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Aug 2021 18:23:05 +0200 Subject: [PATCH 17/18] Fix label --- htdocs/compta/prelevement/create.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 6793fb0a893..937750648bb 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -206,7 +206,7 @@ print $nb; print '
'.$langs->trans("AmountTotal").''; +print ''; print price($pricetowithdraw); print '