diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index 4dcc4be7b01..98ecd8e327c 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -229,7 +229,7 @@ if ($resql)
$htmlbuttonadd = '' . $langs->trans("Addanaccount") . '';
- print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd, '', $limit);
+ print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd, '', $limit);
// Box to select active chart of account
print $langs->trans("Selectchartofaccounts") . " : ";
@@ -258,6 +258,7 @@ if ($resql)
print "";
print ajax_combobox("chartofaccounts");
print '';
+
print '
';
print '
';
diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php
index bf26348b50a..68486080ee7 100644
--- a/htdocs/accountancy/admin/fiscalyear.php
+++ b/htdocs/accountancy/admin/fiscalyear.php
@@ -47,16 +47,16 @@ if ($user->societe_id > 0)
accessforbidden();
if (! $user->rights->accounting->fiscalyear) // If we can read accounting records, we shoul be able to see fiscal year.
accessforbidden();
-
+
$error = 0;
// List of status
static $tmpstatut2label = array (
'0' => 'OpenFiscalYear',
- '1' => 'CloseFiscalYear'
+ '1' => 'CloseFiscalYear'
);
$statut2label = array (
- ''
+ ''
);
foreach ( $tmpstatut2label as $key => $val )
$statut2label[$key] = $langs->trans($val);
@@ -100,8 +100,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= $db->plimit($limit+1, $offset);
$result = $db->query($sql);
-if ($result) {
- $var = false;
+if ($result)
+{
$num = $db->num_rows($result);
$i = 0;
@@ -132,8 +132,7 @@ if ($result) {
print '
' . dol_print_date($db->jdate($obj->date_end), 'day') . ' | ';
print '' . $fiscalyearstatic->LibStatut($obj->statut, 5) . ' | ';
print '';
- $var = ! $var;
- $i ++;
+ $i++;
}
} else {
print '| ' . $langs->trans("None") . ' |
';
@@ -143,7 +142,6 @@ if ($result) {
dol_print_error($db);
}
-dol_fiche_end();
// Buttons
print '';
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index 0dea177f00e..1b8934edbcd 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -66,8 +66,8 @@ $formaccounting = new FormAccounting($db);
$formother = new FormOther($db);
$form = new Form($db);
-if (empty($search_date_start)) {
-
+if (empty($search_date_start))
+{
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
$year_start = dol_print_date(dol_now(), '%Y');
$year_end = $year_start + 1;
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index eb991d55543..2cc006db4e1 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Langs
$langs->load("accountancy");
@@ -99,9 +100,19 @@ $formother = new FormOther($db);
$form = new Form($db);
-if ($action != 'export_file' && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && empty($page)) {
- $search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
- $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
+if ($action != 'export_file' && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && empty($page))
+{
+ $month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
+ $year_start = dol_print_date(dol_now(), '%Y');
+ $year_end = $year_start + 1;
+ $month_end = $month_start - 1;
+ if ($month_end < 1)
+ {
+ $month_end = 12;
+ $year_end--;
+ }
+ $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
+ $search_date_end = dol_get_last_day($year_end, $month_end);
}
$arrayfields=array(
@@ -398,18 +409,14 @@ $listofformat=AccountancyExport::getType();
$button = '
';
if (count($filter)) $button.= $langs->trans("ExportFilteredList");
else $button.= $langs->trans("ExportList");
-$button.=' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')';
+//$button.=' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')';
$button.= '';
+
$groupby = '
' . $langs->trans("GroupByAccountAccounting") . '';
+$addbutton = '
' . $langs->trans("NewAccountingMvt") . '';
-print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby, '', $limit);
-
-print '
' . "\n";
-print '
';
-print '
';
-
-print '
';
+print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$addbutton, '', $limit);
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
@@ -696,6 +703,12 @@ if ($num > 0)
print "";
print '
';
+// TODO Replace this with mass action
+print '';
+
+
print '';
llxFooter();
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index efc3d7f0eaa..f73b57b42f3 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Langs
$langs->load("accountancy");
@@ -39,8 +40,22 @@ $page = GETPOST("page");
$sortorder = GETPOST("sortorder");
$sortfield = GETPOST("sortfield");
$action = GETPOST('action', 'alpha');
-$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
-$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
+
+if (empty($search_date_start))
+{
+ $month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
+ $year_start = dol_print_date(dol_now(), '%Y');
+ $year_end = $year_start + 1;
+ $month_end = $month_start - 1;
+ if ($month_end < 1)
+ {
+ $month_end = 12;
+ $year_end--;
+ }
+ $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
+ $search_date_end = dol_get_last_day($year_end, $month_end);
+}
+
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
@@ -177,7 +192,7 @@ $num=count($object->lines);
if ($action == 'delmouv') {
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delmouvconfirm', '', 0, 1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
print $formconfirm;
}
if ($action == 'delbookkeepingyear') {
@@ -208,8 +223,9 @@ if ($action == 'delbookkeepingyear') {
print '