Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 19, 2025
1 parent 98cc1ac commit 2049d56
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 37 deletions.
14 changes: 7 additions & 7 deletions htdocs/accountancy/bookkeeping/balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
$formaccounting = new FormAccounting($db);
$form = new Form($db);

if (empty($search_date_start) && !GETPOSTISSET('formfilteraction')) {
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('formfilteraction')) {
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
$sql .= " WHERE date_start < '".$db->idate(dol_now())."' AND date_end > '".$db->idate(dol_now())."'";
$sql .= $db->plimit(1);
Expand Down Expand Up @@ -157,17 +157,17 @@
$show_subgroup = '';
$search_date_start = '';
$search_date_end = '';
$search_date_startyear = '';
$search_date_startmonth = '';
$search_date_startday = '';
$search_date_endyear = '';
$search_date_endmonth = '';
$search_date_endday = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$search_not_reconciled = '';
$search_ledger_code = array();
$filter = array();
unset($_SESSION['DOLDATE_search_date_start_accountancy_day']);
unset($_SESSION['DOLDATE_search_date_start_accountancy_month']);
unset($_SESSION['DOLDATE_search_date_start_accountancy_year']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_day']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_month']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_year']);
}

// Must be after the remove filter action, before the export.
Expand Down
36 changes: 6 additions & 30 deletions htdocs/accountancy/bookkeeping/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,44 +257,14 @@
$search_mvt_label = '';
$search_direction = '';
$search_ledger_code = array();
$search_date_startyear = '';
$search_date_startmonth = '';
$search_date_startday = '';
$search_date_endyear = '';
$search_date_endmonth = '';
$search_date_endday = '';
$search_date_start = '';
$search_date_end = '';
$search_date_creation_startyear = '';
$search_date_creation_startmonth = '';
$search_date_creation_startday = '';
$search_date_creation_endyear = '';
$search_date_creation_endmonth = '';
$search_date_creation_endday = '';
$search_date_creation_start = '';
$search_date_creation_end = '';
$search_date_modification_startyear = '';
$search_date_modification_startmonth = '';
$search_date_modification_startday = '';
$search_date_modification_endyear = '';
$search_date_modification_endmonth = '';
$search_date_modification_endday = '';
$search_date_modification_start = '';
$search_date_modification_end = '';
$search_date_export_startyear = '';
$search_date_export_startmonth = '';
$search_date_export_startday = '';
$search_date_export_endyear = '';
$search_date_export_endmonth = '';
$search_date_export_endday = '';
$search_date_export_start = '';
$search_date_export_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_date_validation_start = '';
$search_date_validation_end = '';
// Due date start
Expand All @@ -313,6 +283,12 @@
$search_not_reconciled = '';
$search_import_key = '';
$toselect = array();
unset($_SESSION['DOLDATE_search_date_start_accountancy_day']);
unset($_SESSION['DOLDATE_search_date_start_accountancy_month']);
unset($_SESSION['DOLDATE_search_date_start_accountancy_year']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_day']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_month']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_year']);
}

// Must be after the remove filter action, before the export.
Expand Down
6 changes: 6 additions & 0 deletions htdocs/accountancy/bookkeeping/listbyaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@
$search_not_reconciled = '';
$search_import_key = '';
$toselect = array();
unset($_SESSION['DOLDATE_search_date_start_accountancy_day']);
unset($_SESSION['DOLDATE_search_date_start_accountancy_month']);
unset($_SESSION['DOLDATE_search_date_start_accountancy_year']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_day']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_month']);
unset($_SESSION['DOLDATE_search_date_end_accountancy_year']);
}

if (!empty($socid)) {
Expand Down

0 comments on commit 2049d56

Please sign in to comment.