|
@@ -105,7 +105,6 @@ if ($action != 'export_csv' && ! isset($_POST['begin']) && ! isset($_GET['begin'
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
/*
|
|
|
* Action
|
|
|
*/
|
|
@@ -132,74 +131,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|
|
$search_date_end = '';
|
|
|
}
|
|
|
|
|
|
-if ($action == 'delbookkeeping') {
|
|
|
-
|
|
|
- $import_key = GETPOST('importkey', 'alpha');
|
|
|
-
|
|
|
- if (! empty($import_key)) {
|
|
|
- $result = $object->deleteByImportkey($import_key);
|
|
|
- if ($result < 0) {
|
|
|
- setEventMessages($object->error, $object->errors, 'errors');
|
|
|
- }
|
|
|
- Header("Location: list.php");
|
|
|
- exit();
|
|
|
- }
|
|
|
-}
|
|
|
-if ($action == 'delbookkeepingyearconfirm') {
|
|
|
-
|
|
|
- $delyear = GETPOST('delyear', 'int');
|
|
|
- if ($delyear==-1) {
|
|
|
- $delyear=0;
|
|
|
- }
|
|
|
- $deljournal = GETPOST('deljournal','alpha');
|
|
|
- if ($deljournal==-1) {
|
|
|
- $deljournal=0;
|
|
|
- }
|
|
|
-
|
|
|
- if (! empty($delyear) || ! empty($deljournal))
|
|
|
- {
|
|
|
- $result = $object->deleteByYearAndJournal($delyear,$deljournal);
|
|
|
- if ($result < 0) {
|
|
|
- setEventMessages($object->error, $object->errors, 'errors');
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- setEventMessages("RecordDeleted", null, 'mesgs');
|
|
|
- }
|
|
|
- Header("Location: list.php");
|
|
|
- exit;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- setEventMessages("NoRecordDeleted", null, 'warnings');
|
|
|
- Header("Location: list.php");
|
|
|
- exit;
|
|
|
- }
|
|
|
-}
|
|
|
-if ($action == 'delmouvconfirm') {
|
|
|
-
|
|
|
- $mvt_num = GETPOST('mvt_num', 'int');
|
|
|
-
|
|
|
- if (! empty($mvt_num)) {
|
|
|
- $result = $object->deleteMvtNum($mvt_num);
|
|
|
- if ($result < 0) {
|
|
|
- setEventMessages($object->error, $object->errors, 'errors');
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
|
|
- }
|
|
|
- Header("Location: list.php");
|
|
|
- exit;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/*
|
|
|
- * View
|
|
|
- */
|
|
|
-
|
|
|
+// Must be after the remove filter action, before the export.
|
|
|
$param = '';
|
|
|
$filter = array ();
|
|
|
if (! empty($search_date_start)) {
|
|
@@ -266,6 +198,68 @@ if (! empty($search_mvt_num)) {
|
|
|
$param .= '&search_mvt_num=' . $search_mvt_num;
|
|
|
}
|
|
|
|
|
|
+if ($action == 'delbookkeeping') {
|
|
|
+
|
|
|
+ $import_key = GETPOST('importkey', 'alpha');
|
|
|
+
|
|
|
+ if (! empty($import_key)) {
|
|
|
+ $result = $object->deleteByImportkey($import_key);
|
|
|
+ if ($result < 0) {
|
|
|
+ setEventMessages($object->error, $object->errors, 'errors');
|
|
|
+ }
|
|
|
+ Header("Location: list.php");
|
|
|
+ exit();
|
|
|
+ }
|
|
|
+}
|
|
|
+if ($action == 'delbookkeepingyearconfirm') {
|
|
|
+
|
|
|
+ $delyear = GETPOST('delyear', 'int');
|
|
|
+ if ($delyear==-1) {
|
|
|
+ $delyear=0;
|
|
|
+ }
|
|
|
+ $deljournal = GETPOST('deljournal','alpha');
|
|
|
+ if ($deljournal==-1) {
|
|
|
+ $deljournal=0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (! empty($delyear) || ! empty($deljournal))
|
|
|
+ {
|
|
|
+ $result = $object->deleteByYearAndJournal($delyear,$deljournal);
|
|
|
+ if ($result < 0) {
|
|
|
+ setEventMessages($object->error, $object->errors, 'errors');
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setEventMessages("RecordDeleted", null, 'mesgs');
|
|
|
+ }
|
|
|
+ Header("Location: list.php");
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setEventMessages("NoRecordDeleted", null, 'warnings');
|
|
|
+ Header("Location: list.php");
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+}
|
|
|
+if ($action == 'delmouvconfirm') {
|
|
|
+
|
|
|
+ $mvt_num = GETPOST('mvt_num', 'int');
|
|
|
+
|
|
|
+ if (! empty($mvt_num)) {
|
|
|
+ $result = $object->deleteMvtNum($mvt_num);
|
|
|
+ if ($result < 0) {
|
|
|
+ setEventMessages($object->error, $object->errors, 'errors');
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
|
|
+ }
|
|
|
+ Header("Location: list.php");
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
if ($action == 'export_csv') {
|
|
|
|
|
|
include DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
|
|
@@ -287,6 +281,11 @@ if ($action == 'export_csv') {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+/*
|
|
|
+ * View
|
|
|
+ */
|
|
|
+
|
|
|
$title_page = $langs->trans("Bookkeeping");
|
|
|
|
|
|
llxHeader('', $title_page);
|