Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
57e4453e
Commit
57e4453e
authored
10 years ago
by
Florian Henry
Browse files
Options
Downloads
Patches
Plain Diff
Add filter date and total line on bank writing list page
parent
38a05965
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+1
-0
1 addition, 0 deletions
ChangeLog
htdocs/compta/bank/search.php
+51
-11
51 additions, 11 deletions
htdocs/compta/bank/search.php
with
52 additions
and
11 deletions
ChangeLog
+
1
−
0
View file @
57e4453e
...
...
@@ -45,6 +45,7 @@ For users:
- New: Can filter on status for supplier order.
- Fix: Project Task numbering customs rule works.
- Fix: Add actions events not implemented.
- New: Add filter date in bank writing list page
TODO
- New: Predefined product and free product use same form.
...
...
This diff is collapsed.
Click to expand it.
htdocs/compta/bank/search.php
+
51
−
11
View file @
57e4453e
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copytight (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com>
*
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
...
...
@@ -29,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once
DOL_DOCUMENT_ROOT
.
'/societe/class/societe.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/compta/bank/class/account.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/compta/bank/class/bankcateg.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/html.formother.class.php'
;
$langs
->
load
(
"banks"
);
$langs
->
load
(
"categories"
);
...
...
@@ -43,14 +45,18 @@ $credit=GETPOST("credit");
$type
=
GETPOST
(
"type"
);
$account
=
GETPOST
(
"account"
);
$bid
=
GETPOST
(
"bid"
,
"int"
);
$search_dt_start
=
dol_mktime
(
0
,
0
,
0
,
GETPOST
(
'search_start_dtmonth'
,
'int'
),
GETPOST
(
'search_start_dtday'
,
'int'
),
GETPOST
(
'search_start_dtyear'
,
'int'
)
);
$search_dt_end
=
dol_mktime
(
0
,
0
,
0
,
GETPOST
(
'search_end_dtmonth'
,
'int'
),
GETPOST
(
'search_end_dtday'
,
'int'
),
GETPOST
(
'search_end_dtyear'
,
'int'
)
);
$param
=
''
;
if
(
$description
)
$param
.
=
'&description='
.
$description
;
if
(
$type
)
$param
.
=
'&type='
.
$type
;
if
(
$debit
)
$param
.
=
'&debit='
.
$debit
;
if
(
$credit
)
$param
.
=
'&credit='
.
$credit
;
if
(
$account
)
$param
.
=
'&account='
.
$account
;
if
(
$bid
)
$param
.
=
'&bid='
.
$bid
;
if
(
!
empty
(
$description
))
$param
.
=
'&description='
.
$description
;
if
(
!
empty
(
$type
))
$param
.
=
'&type='
.
$type
;
if
(
!
empty
(
$debit
))
$param
.
=
'&debit='
.
$debit
;
if
(
!
empty
(
$credit
))
$param
.
=
'&credit='
.
$credit
;
if
(
!
empty
(
$account
))
$param
.
=
'&account='
.
$account
;
if
(
!
empty
(
$bid
))
$param
.
=
'&bid='
.
$bid
;
if
(
dol_strlen
(
$search_dt_start
)
>
0
)
$param
.
=
'&search_start_dtmonth='
.
GETPOST
(
'search_start_dtmonth'
,
'int'
)
.
'&search_start_dtday='
.
GETPOST
(
'search_start_dtday'
,
'int'
)
.
'&search_start_dtyear='
.
GETPOST
(
'search_start_dtyear'
,
'int'
);
if
(
dol_strlen
(
$search_dt_end
)
>
0
)
$param
.
=
'&search_end_dtmonth='
.
GETPOST
(
'search_end_dtmonth'
,
'int'
)
.
'&search_end_dtday='
.
GETPOST
(
'search_end_dtday'
,
'int'
)
.
'&search_end_dtyear='
.
GETPOST
(
'search_end_dtyear'
,
'int'
);
$sortfield
=
GETPOST
(
"sortfield"
,
'alpha'
);
$sortorder
=
GETPOST
(
"sortorder"
,
'alpha'
);
...
...
@@ -74,6 +80,7 @@ $bankaccountstatic=new Account($db);
llxHeader
();
$form
=
new
Form
(
$db
);
$formother
=
new
FormOther
(
$db
);
if
(
$vline
)
$viewline
=
$vline
;
else
$viewline
=
50
;
...
...
@@ -108,6 +115,13 @@ if (! empty($type))
{
$sql
.
=
" AND b.fk_type = '"
.
$db
->
escape
(
$type
)
.
"' "
;
}
//Search period criteria
if
(
dol_strlen
(
$search_dt_start
)
>
0
)
{
$sql
.
=
" AND b.dateo >= '"
.
$db
->
idate
(
$search_dt_start
)
.
"'"
;
}
if
(
dol_strlen
(
$search_dt_end
)
>
0
)
{
$sql
.
=
" AND b.dateo <= '"
.
$db
->
idate
(
$search_dt_end
)
.
"'"
;
}
// Search criteria amount
$si
=
0
;
$debit
=
price2num
(
str_replace
(
'-'
,
''
,
$debit
));
...
...
@@ -128,6 +142,7 @@ $sql.= $db->order($sortfield,$sortorder);
$sql
.
=
$db
->
plimit
(
$limit
+
1
,
$offset
);
//print $sql;
dol_syslog
(
'compta/bank/search.php:: sql='
.
$sql
);
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
{
...
...
@@ -147,6 +162,19 @@ if ($resql)
print_barre_liste
(
$langs
->
trans
(
"BankTransactions"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
$param
,
$sortfield
,
$sortorder
,
''
,
$num
);
}
print
'<form method="post" action="search.php" name="search_form">'
;
$moreforfilter
.
=
$langs
->
trans
(
'Period'
)
.
' '
.
$langs
->
trans
(
'DateOperationShort'
)
.
': '
;
$moreforfilter
.
=
$form
->
select_date
(
$search_dt_start
,
'search_start_dt'
,
0
,
0
,
1
,
"search_form"
,
1
,
1
,
1
);
$moreforfilter
.
=
$langs
->
trans
(
'PeriodEndDate'
)
.
':'
.
$form
->
select_date
(
$search_dt_end
,
'search_end_dt'
,
0
,
0
,
1
,
"search_form"
,
1
,
1
,
1
);
if
(
$moreforfilter
)
{
print
'<div class="liste_titre">'
;
print
$moreforfilter
;
print
'</div>'
;
}
print
'<table class="liste" width="100%">'
;
print
'<tr class="liste_titre">'
;
print_liste_field_titre
(
$langs
->
trans
(
'Ref'
),
$_SERVER
[
'PHP_SELF'
],
'b.rowid'
,
''
,
$param
,
''
,
$sortfield
,
$sortorder
);
...
...
@@ -161,7 +189,6 @@ if ($resql)
print
'<td class="liste_titre" align="left"> '
.
$langs
->
trans
(
"Account"
)
.
'</td>'
;
print
"</tr>
\n
"
;
print
'<form method="post" action="search.php">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<tr class="liste_titre">'
;
print
'<td class="liste_titre"> </td>'
;
...
...
@@ -189,6 +216,8 @@ if ($resql)
print
'</tr>'
;
// Loop on each record
$total_debit
=
0
;
$total_credit
=
0
;
while
(
$i
<
min
(
$num
,
$limit
))
{
$objp
=
$db
->
fetch_object
(
$resql
);
...
...
@@ -259,10 +288,12 @@ if ($resql)
if
(
$objp
->
amount
<
0
)
{
print
"<td align=
\"
right
\"
>"
.
price
(
$objp
->
amount
*
-
1
)
.
"</td><td> </td>
\n
"
;
$total_debit
+=
$objp
->
amount
;
}
else
{
print
"<td> </td><td align=
\"
right
\"
>"
.
price
(
$objp
->
amount
)
.
"</td>
\n
"
;
$total_credit
+=
$objp
->
amount
;
}
// Bank account
...
...
@@ -275,6 +306,15 @@ if ($resql)
}
$i
++
;
}
if
(
$num
>
0
)
{
print
'<tr class="liste_total">'
;
print
'<td>'
.
$langs
->
trans
(
'Total'
)
.
'</td>'
;
print
'<td colspan="6"></td>'
;
print
'<td align="right">'
.
price
(
$total_debit
*-
1
)
.
'</td>'
;
print
'<td align="right">'
.
price
(
$total_credit
)
.
'</td>'
;
print
'<td></td>'
;
print
'</tr>'
;
}
print
"</table>"
;
...
...
@@ -285,7 +325,7 @@ else
dol_print_error
(
$db
);
}
//
Si acc�s issu d'une recherche et rien de trouv�
//
If no data to display after a search
if
(
$_POST
[
"action"
]
==
"search"
&&
!
$num
)
{
print
$langs
->
trans
(
"NoRecordFound"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment