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
c86183e1
Commit
c86183e1
authored
13 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: uniformize code and force paiement type if cash account
parent
1f5a1038
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/compta/bank/account.php
+71
-79
71 additions, 79 deletions
htdocs/compta/bank/account.php
htdocs/core/lib/bank.lib.php
+3
-2
3 additions, 2 deletions
htdocs/core/lib/bank.lib.php
with
74 additions
and
81 deletions
htdocs/compta/bank/account.php
+
71
−
79
View file @
c86183e1
...
...
@@ -3,7 +3,7 @@
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copytight (C) 2005-201
1
Regis Houssin <regis@dolibarr.fr>
* Copytight (C) 2005-201
2
Regis Houssin <regis@dolibarr.fr>
* Copytight (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -37,22 +37,22 @@ require_once(DOL_DOCUMENT_ROOT."/fourn/class/paiementfourn.class.php");
$langs
->
load
(
"bills"
);
$id
=
(
GETPOST
(
'id'
,
'int'
)
?
GETPOST
(
'id'
,
'int'
)
:
GETPOST
(
'account'
,
'int'
));
$ref
=
GETPOST
(
'ref'
,
'alpha'
);
$action
=
GETPOST
(
'action'
,
'alpha'
);
$confirm
=
GETPOST
(
'confirm'
,
'alpha'
);
// Security check
if
(
isset
(
$_GET
[
"account"
])
||
isset
(
$_GET
[
"ref"
]))
{
$id
=
isset
(
$_GET
[
"account"
])
?
$_GET
[
"account"
]
:
(
isset
(
$_GET
[
"ref"
])
?
$_GET
[
"ref"
]
:
''
);
}
$fieldid
=
isset
(
$_GET
[
"ref"
])
?
'ref'
:
'rowid'
;
$fieldvalue
=
(
!
empty
(
$id
)
?
$id
:
(
!
empty
(
$ref
)
?
$ref
:
''
));
$fieldtype
=
(
!
empty
(
$ref
)
?
'ref'
:
'rowid'
);
if
(
$user
->
societe_id
)
$socid
=
$user
->
societe_id
;
$result
=
restrictedArea
(
$user
,
'banque'
,
$
id
,
'bank_account'
,
''
,
''
,
$field
id
);
$result
=
restrictedArea
(
$user
,
'banque'
,
$
fieldvalue
,
'bank_account'
,
''
,
''
,
$field
type
);
$req_nb
=
GETPOST
(
"req_nb"
,
''
,
3
);
$thirdparty
=
GETPOST
(
"thirdparty"
,
''
,
3
);
$account
=
GETPOST
(
"account"
);
$vline
=
GETPOST
(
"vline"
);
$action
=
GETPOST
(
"action"
);
$page
=
isset
(
$_GET
[
"page"
])
?
$_GET
[
"page"
]
:
0
;
$negpage
=
isset
(
$_GET
[
"negpage"
])
?
$_GET
[
"negpage"
]
:
0
;
$page
=
GETPOST
(
'page'
,
'int'
);
$negpage
=
GETPOST
(
'negpage'
,
'int'
);
if
(
$negpage
)
{
$page
=
$_GET
[
"nbpage"
]
-
$negpage
;
...
...
@@ -61,13 +61,14 @@ if ($negpage)
$mesg
=
''
;
$object
=
new
Account
(
$db
);
/*
* Action
*/
$dateop
=-
1
;
if
(
$action
==
'add'
&&
$
account
&&
!
isset
(
$_POST
[
"cancel"
])
&&
$user
->
rights
->
banque
->
modifier
)
if
(
$action
==
'add'
&&
$
id
&&
!
isset
(
$_POST
[
"cancel"
])
&&
$user
->
rights
->
banque
->
modifier
)
{
if
(
price2num
(
$_POST
[
"credit"
])
>
0
)
{
...
...
@@ -90,17 +91,16 @@ if ($action == 'add' && $account && ! isset($_POST["cancel"]) && $user->rights->
if
(
!
$mesg
)
{
$acct
=
new
Account
(
$db
);
$acct
->
fetch
(
$account
);
$insertid
=
$acct
->
addline
(
$dateop
,
$operation
,
$label
,
$amount
,
$num_chq
,
$cat1
,
$user
);
$object
->
fetch
(
$id
);
$insertid
=
$object
->
addline
(
$dateop
,
$operation
,
$label
,
$amount
,
$num_chq
,
$cat1
,
$user
);
if
(
$insertid
>
0
)
{
Header
(
"Location: "
.
$_SERVER
[
'PHP_SELF'
]
.
"?
account="
.
$account
.
"&action=addline"
);
Header
(
"Location: "
.
$_SERVER
[
'PHP_SELF'
]
.
"?
id="
.
$id
.
"&action=addline"
);
exit
;
}
else
{
dol_print_error
(
$db
,
$ac
ct
->
error
)
;
$mesg
=
$obje
ct
->
error
;
}
}
else
...
...
@@ -108,7 +108,7 @@ if ($action == 'add' && $account && ! isset($_POST["cancel"]) && $user->rights->
$action
=
'addline'
;
}
}
if
(
$action
==
'confirm_delete'
&&
$
_POST
[
"
confirm
"
]
==
'yes'
&&
$user
->
rights
->
banque
->
modifier
)
if
(
$action
==
'confirm_delete'
&&
$confirm
==
'yes'
&&
$user
->
rights
->
banque
->
modifier
)
{
$accline
=
new
AccountLine
(
$db
);
$accline
->
fetch
(
$_GET
[
"rowid"
]);
...
...
@@ -131,7 +131,7 @@ $paymentvatstatic=new TVA($db);
$form
=
new
Form
(
$db
);
if
(
$
account
||
$_GET
[
"
ref
"
]
)
if
(
$
id
>
0
||
!
empty
(
$
ref
)
)
{
if
(
$vline
)
{
...
...
@@ -141,16 +141,8 @@ if ($account || $_GET["ref"])
{
$viewline
=
empty
(
$conf
->
global
->
MAIN_SIZE_LISTE_LIMIT
)
?
20
:
$conf
->
global
->
MAIN_SIZE_LISTE_LIMIT
;
}
$acct
=
new
Account
(
$db
);
if
(
$account
)
{
$result
=
$acct
->
fetch
(
$account
);
}
if
(
$_GET
[
"ref"
])
{
$result
=
$acct
->
fetch
(
0
,
$_GET
[
"ref"
]);
$account
=
$acct
->
id
;
}
$result
=
$object
->
fetch
(
$id
,
$ref
);
// Chargement des categories bancaires dans $options
$nbcategories
=
0
;
...
...
@@ -187,22 +179,22 @@ if ($account || $_GET["ref"])
$param
.
=
'&req_nb='
.
urlencode
(
$req_nb
);
$mode_search
=
1
;
}
if
(
$_REQUE
ST
[
"req_desc"
]
)
if
(
GETPO
ST
(
"req_desc"
)
)
{
$sql_rech
.
=
" AND b.label LIKE '%"
.
$db
->
escape
(
$_REQUE
ST
[
"req_desc"
]
)
.
"%'"
;
$param
.
=
'&req_desc='
.
urlencode
(
$_REQUE
ST
[
"req_desc"
]
);
$sql_rech
.
=
" AND b.label LIKE '%"
.
$db
->
escape
(
GETPO
ST
(
"req_desc"
)
)
.
"%'"
;
$param
.
=
'&req_desc='
.
urlencode
(
GETPO
ST
(
"req_desc"
)
);
$mode_search
=
1
;
}
if
(
$_REQUE
ST
[
"req_debit"
]
)
if
(
GETPO
ST
(
"req_debit"
)
)
{
$sql_rech
.
=
" AND b.amount = -"
.
price2num
(
$_REQUE
ST
[
"req_debit"
]
);
$param
.
=
'&req_debit='
.
urlencode
(
$_REQUE
ST
[
"req_debit"
]
);
$sql_rech
.
=
" AND b.amount = -"
.
price2num
(
GETPO
ST
(
"req_debit"
)
);
$param
.
=
'&req_debit='
.
urlencode
(
GETPO
ST
(
"req_debit"
)
);
$mode_search
=
1
;
}
if
(
$_REQUE
ST
[
"req_credit"
]
)
if
(
GETPO
ST
(
"req_credit"
)
)
{
$sql_rech
.
=
" AND b.amount = "
.
price2num
(
$_REQUE
ST
[
"req_credit"
]
);
$param
.
=
'&req_credit='
.
urlencode
(
$_REQUE
ST
[
"req_credit"
]
);
$sql_rech
.
=
" AND b.amount = "
.
price2num
(
GETPO
ST
(
"req_credit"
)
);
$param
.
=
'&req_credit='
.
urlencode
(
GETPO
ST
(
"req_credit"
)
);
$mode_search
=
1
;
}
if
(
$thirdparty
)
...
...
@@ -211,10 +203,10 @@ if ($account || $_GET["ref"])
$param
.
=
'&thirdparty='
.
urlencode
(
$thirdparty
);
$mode_search
=
1
;
}
if
(
$_REQUE
ST
[
"paiementtype"
]
)
if
(
GETPO
ST
(
"paiementtype"
)
)
{
$sql_rech
.
=
" AND b.fk_type = '"
.
$db
->
escape
(
$_REQUE
ST
[
"paiementtype"
]
)
.
"'"
;
$param
.
=
'&paiementtype='
.
urlencode
(
$_REQUE
ST
[
"paiementtype"
]
);
$sql_rech
.
=
" AND b.fk_type = '"
.
$db
->
escape
(
GETPO
ST
(
"paiementtype"
)
)
.
"'"
;
$param
.
=
'&paiementtype='
.
urlencode
(
GETPO
ST
(
"paiementtype"
)
);
$mode_search
=
1
;
}
...
...
@@ -226,7 +218,7 @@ if ($account || $_GET["ref"])
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"bank_url as bu ON bu.fk_bank = b.rowid AND bu.type='company'"
;
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"societe as s ON bu.url_id = s.rowid"
;
}
$sql
.
=
" WHERE b.fk_account = "
.
$
ac
ct
->
id
;
$sql
.
=
" WHERE b.fk_account = "
.
$
obje
ct
->
id
;
$sql
.
=
" AND b.fk_account = ba.rowid"
;
$sql
.
=
" AND ba.entity = "
.
$conf
->
entity
;
$sql
.
=
$sql_rech
;
...
...
@@ -263,7 +255,7 @@ if ($account || $_GET["ref"])
//print $limitsql.'-'.$page.'-'.$viewline;
// Onglets
$head
=
bank_prepare_head
(
$
ac
ct
);
$head
=
bank_prepare_head
(
$
obje
ct
);
dol_fiche_head
(
$head
,
'journal'
,
$langs
->
trans
(
"FinancialAccount"
),
0
,
'account'
);
print
'<table class="border" width="100%">'
;
...
...
@@ -271,12 +263,12 @@ if ($account || $_GET["ref"])
// Ref
print
'<tr><td valign="top" width="25%">'
.
$langs
->
trans
(
"Ref"
)
.
'</td>'
;
print
'<td colspan="3">'
;
print
$form
->
showrefnav
(
$
ac
ct
,
'ref'
,
''
,
1
,
'ref'
);
print
$form
->
showrefnav
(
$
obje
ct
,
'ref'
,
''
,
1
,
'ref'
);
print
'</td></tr>'
;
// Label
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Label"
)
.
'</td>'
;
print
'<td colspan="3">'
.
$
ac
ct
->
label
.
'</td></tr>'
;
print
'<td colspan="3">'
.
$
obje
ct
->
label
.
'</td></tr>'
;
print
'</table>'
;
...
...
@@ -287,7 +279,7 @@ if ($account || $_GET["ref"])
/**
* Search form
*/
$param
.
=
'&account='
.
$
ac
ct
->
id
;
$param
.
=
'&account='
.
$
obje
ct
->
id
;
// Define transaction list navigation string
$navig
=
''
;
...
...
@@ -298,16 +290,16 @@ if ($account || $_GET["ref"])
$navig
.
=
$langs
->
trans
(
"Page"
)
.
" "
;
// ' Page ';
$navig
.
=
'<input type="text" name="negpage" size="1" class="flat" value="'
.
(
$nbpage
-
$page
)
.
'">'
;
$navig
.
=
'<input type="hidden" name="req_nb" value="'
.
$req_nb
.
'">'
;
$navig
.
=
'<input type="hidden" name="req_desc" value="'
.
$_REQUE
ST
[
"req_desc"
]
.
'">'
;
$navig
.
=
'<input type="hidden" name="req_debit" value="'
.
$_REQUE
ST
[
"req_debit"
]
.
'">'
;
$navig
.
=
'<input type="hidden" name="req_credit" value="'
.
$_REQUE
ST
[
"req_credit"
]
.
'">'
;
$navig
.
=
'<input type="hidden" name="req_desc" value="'
.
GETPO
ST
(
"req_desc"
)
.
'">'
;
$navig
.
=
'<input type="hidden" name="req_debit" value="'
.
GETPO
ST
(
"req_debit"
)
.
'">'
;
$navig
.
=
'<input type="hidden" name="req_credit" value="'
.
GETPO
ST
(
"req_credit"
)
.
'">'
;
$navig
.
=
'<input type="hidden" name="thirdparty" value="'
.
$thirdparty
.
'">'
;
$navig
.
=
'<input type="hidden" name="nbpage" value="'
.
$nbpage
.
'">'
;
$navig
.
=
'<input type="hidden" name="
account
" value="'
.
(
$ac
ct
->
id
)
.
'">'
;
$navig
.
=
'<input type="hidden" name="
id
" value="'
.
$obje
ct
->
id
.
'">'
;
$navig
.
=
'/'
.
$nbpage
.
' '
;
if
(
$total_lines
>
$limitsql
)
{
$navig
.
=
'<a href="
account.php
?'
.
$param
.
'&page='
.
(
$page
-
1
)
.
'">'
.
img_next
()
.
'</a>'
;
$navig
.
=
'<a href="
'
.
$_SERVER
[
"PHP_SELF"
]
.
'
?'
.
$param
.
'&page='
.
(
$page
-
1
)
.
'">'
.
img_next
()
.
'</a>'
;
}
$navig
.
=
'</form>'
;
//var_dump($navig);
...
...
@@ -316,7 +308,7 @@ if ($account || $_GET["ref"])
if
(
$action
==
'delete'
)
{
$text
=
$langs
->
trans
(
'ConfirmDeleteTransaction'
);
$ret
=
$form
->
form_confirm
(
$_SERVER
[
'PHP_SELF'
]
.
'?
account='
.
$ac
ct
->
id
.
'&rowid='
.
$_GET
[
"rowid"
],
$langs
->
trans
(
'DeleteTransaction'
),
$text
,
'confirm_delete'
);
$ret
=
$form
->
form_confirm
(
$_SERVER
[
'PHP_SELF'
]
.
'?
id='
.
$obje
ct
->
id
.
'&rowid='
.
$_GET
[
"rowid"
],
$langs
->
trans
(
'DeleteTransaction'
),
$text
,
'confirm_delete'
);
if
(
$ret
==
'html'
)
print
'<br>'
;
}
...
...
@@ -331,11 +323,11 @@ if ($account || $_GET["ref"])
// Form to add a transaction with no invoice
if
(
$user
->
rights
->
banque
->
modifier
&&
$action
==
'addline'
)
{
print
'<form method="
post
" action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'">'
;
print
'<form method="
POST
" action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="add">'
;
print
'<input type="hidden" name="vline" value="'
.
$vline
.
'">'
;
print
'<input type="hidden" name="
account
" value="'
.
$ac
ct
->
id
.
'">'
;
print
'<input type="hidden" name="vline" value="'
.
$vline
.
'">'
;
print
'<input type="hidden" name="
id
" value="'
.
$obje
ct
->
id
.
'">'
;
print
'<tr>'
;
print
'<td align="left" colspan="10"><b>'
.
$langs
->
trans
(
"AddBankRecordLong"
)
.
'</b></td>'
;
...
...
@@ -357,18 +349,18 @@ if ($account || $_GET["ref"])
$form
->
select_date
(
$dateop
,
'op'
,
0
,
0
,
0
,
'transaction'
);
print
'</td>'
;
print
'<td nowrap="nowrap">'
;
$form
->
select_types_paiements
((
isset
(
$_POST
[
"operation"
])
?
$_
POST
[
"
operation
"
]
:
'
'
),
'operation'
,
'1,2'
,
2
,
1
);
$form
->
select_types_paiements
((
$object
->
courant
==
2
?
'LIQ'
:
GET
POST
(
'
operation'
)
),
'operation'
,
'1,2'
,
2
,
1
);
print
'</td><td>'
;
print
'<input name="num_chq" class="flat" type="text" size="4" value="'
.
(
isset
(
$_POST
[
"num_chq"
])
?
$_
POST
[
"num_chq"
]
:
''
)
.
'"></td>'
;
print
'<input name="num_chq" class="flat" type="text" size="4" value="'
.
GET
POST
(
"num_chq"
)
.
'"></td>'
;
print
'<td colspan="2">'
;
print
'<input name="label" class="flat" type="text" size="24" value="'
.
(
isset
(
$_POST
[
"label"
])
?
$_
POST
[
"label"
]
:
''
)
.
'">'
;
print
'<input name="label" class="flat" type="text" size="24" value="'
.
GET
POST
(
"label"
)
.
'">'
;
if
(
$nbcategories
)
{
print
'<br>'
.
$langs
->
trans
(
"Category"
)
.
': <select class="flat" name="cat1">'
.
$options
.
'</select>'
;
}
print
'</td>'
;
print
'<td align=right><input name="debit" class="flat" type="text" size="4" value="'
.
(
isset
(
$_POST
[
"debit"
])
?
$_
POST
[
"debit"
]
:
''
)
.
'"></td>'
;
print
'<td align=right><input name="credit" class="flat" type="text" size="4" value="'
.
(
isset
(
$_POST
[
"credit"
])
?
$_
POST
[
"credit"
]
:
''
)
.
'"></td>'
;
print
'<td align=right><input name="debit" class="flat" type="text" size="4" value="'
.
GET
POST
(
"debit"
)
.
'"></td>'
;
print
'<td align=right><input name="credit" class="flat" type="text" size="4" value="'
.
GET
POST
(
"credit"
)
.
'"></td>'
;
print
'<td colspan="2" align="center">'
;
print
'<input type="submit" name="save" class="button" value="'
.
$langs
->
trans
(
"Add"
)
.
'"><br>'
;
print
'<input type="submit" name="cancel" class="button" value="'
.
$langs
->
trans
(
"Cancel"
)
.
'">'
;
...
...
@@ -394,14 +386,14 @@ if ($account || $_GET["ref"])
print
'<td align="right">'
.
$langs
->
trans
(
"Credit"
)
.
'</td>'
;
print
'<td align="right" width="80">'
.
$langs
->
trans
(
"BankBalance"
)
.
'</td>'
;
print
'<td align="center" width="60">'
;
if
(
$
ac
ct
->
type
!=
2
&&
$
ac
ct
->
rappro
)
print
$langs
->
trans
(
"AccountStatementShort"
);
if
(
$
obje
ct
->
type
!=
2
&&
$
obje
ct
->
rappro
)
print
$langs
->
trans
(
"AccountStatementShort"
);
else
print
' '
;
print
'</td></tr>'
;
print
'<form action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?'
.
$param
.
'" name="search" method="POST">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="search">'
;
print
'<input type="hidden" name="
account
" value="'
.
$ac
ct
->
id
.
'">'
;
print
'<input type="hidden" name="
id
" value="'
.
$obje
ct
->
id
.
'">'
;
print
'<tr class="liste_titre">'
;
print
'<td> </td>'
;
...
...
@@ -412,10 +404,10 @@ if ($account || $_GET["ref"])
print
$form
->
select_types_paiements
(
$_REQUEST
[
'paiementtype'
],
'paiementtype'
,
$filtertype
,
2
,
1
,
1
,
8
);
print
'</td>'
;
print
'<td><input type="text" class="flat" name="req_nb" value="'
.
$req_nb
.
'" size="2"></td>'
;
print
'<td><input type="text" class="flat" name="req_desc" value="'
.
$_REQUE
ST
[
"req_desc"
]
.
'" size="24"></td>'
;
print
'<td><input type="text" class="flat" name="req_desc" value="'
.
GETPO
ST
(
"req_desc"
)
.
'" size="24"></td>'
;
print
'<td><input type="text" class="flat" name="thirdparty" value="'
.
$thirdparty
.
'" size="14"></td>'
;
print
'<td align="right"><input type="text" class="flat" name="req_debit" value="'
.
$_REQUE
ST
[
"req_debit"
]
.
'" size="4"></td>'
;
print
'<td align="right"><input type="text" class="flat" name="req_credit" value="'
.
$_REQUE
ST
[
"req_credit"
]
.
'" size="4"></td>'
;
print
'<td align="right"><input type="text" class="flat" name="req_debit" value="'
.
GETPO
ST
(
"req_debit"
)
.
'" size="4"></td>'
;
print
'<td align="right"><input type="text" class="flat" name="req_credit" value="'
.
GETPO
ST
(
"req_credit"
)
.
'" size="4"></td>'
;
print
'<td align="center"> </td>'
;
print
'<td align="center" width="40"><input type="image" class="liste_titre" src="'
.
DOL_URL_ROOT
.
'/theme/'
.
$conf
->
theme
.
'/img/search.png" value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'" title="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'"></td>'
;
print
"</tr>
\n
"
;
...
...
@@ -461,7 +453,7 @@ if ($account || $_GET["ref"])
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='company'";
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu3.url_id = s.rowid";
}
$sql
.
=
" WHERE b.fk_account="
.
$
ac
ct
->
id
;
$sql
.
=
" WHERE b.fk_account="
.
$
obje
ct
->
id
;
$sql
.
=
" AND b.fk_account = ba.rowid"
;
$sql
.
=
" AND ba.entity = "
.
$conf
->
entity
;
$sql
.
=
$sql_rech
;
...
...
@@ -537,7 +529,7 @@ if ($account || $_GET["ref"])
print
dol_trunc
(
$objp
->
label
,
60
);
}
// Add links after description
$links
=
$
ac
ct
->
get_url
(
$objp
->
rowid
);
$links
=
$
obje
ct
->
get_url
(
$objp
->
rowid
);
foreach
(
$links
as
$key
=>
$val
)
{
if
(
$links
[
$key
][
'type'
]
==
'payment'
)
...
...
@@ -664,14 +656,14 @@ if ($account || $_GET["ref"])
}
// Transaction reconciliated or edit link
if
(
$objp
->
rappro
&&
$
ac
ct
->
canBeConciliated
()
>
0
)
// If line not conciliated and account can be conciliated
if
(
$objp
->
rappro
&&
$
obje
ct
->
canBeConciliated
()
>
0
)
// If line not conciliated and account can be conciliated
{
print
'<td align="center" nowrap>'
;
print
'<a href="'
.
DOL_URL_ROOT
.
'/compta/bank/ligne.php?rowid='
.
$objp
->
rowid
.
'&account='
.
$
ac
ct
->
id
.
'&page='
.
$page
.
'">'
;
print
'<a href="'
.
DOL_URL_ROOT
.
'/compta/bank/ligne.php?rowid='
.
$objp
->
rowid
.
'&account='
.
$
obje
ct
->
id
.
'&page='
.
$page
.
'">'
;
print
img_edit
();
print
'</a>'
;
print
" "
;
print
'<a href="releve.php?num='
.
$objp
->
num_releve
.
'&account='
.
$
ac
ct
->
id
.
'">'
.
$objp
->
num_releve
.
'</a>'
;
print
'<a href="releve.php?num='
.
$objp
->
num_releve
.
'&account='
.
$
obje
ct
->
id
.
'">'
.
$objp
->
num_releve
.
'</a>'
;
print
"</td>"
;
}
else
...
...
@@ -679,17 +671,17 @@ if ($account || $_GET["ref"])
print
'<td align="center">'
;
if
(
$user
->
rights
->
banque
->
modifier
||
$user
->
rights
->
banque
->
consolidate
)
{
print
'<a href="'
.
DOL_URL_ROOT
.
'/compta/bank/ligne.php?rowid='
.
$objp
->
rowid
.
'&account='
.
$
ac
ct
->
id
.
'&page='
.
$page
.
'">'
;
print
'<a href="'
.
DOL_URL_ROOT
.
'/compta/bank/ligne.php?rowid='
.
$objp
->
rowid
.
'&account='
.
$
obje
ct
->
id
.
'&page='
.
$page
.
'">'
;
print
img_edit
();
print
'</a>'
;
}
else
{
print
'<a href="'
.
DOL_URL_ROOT
.
'/compta/bank/ligne.php?rowid='
.
$objp
->
rowid
.
'&account='
.
$
ac
ct
->
id
.
'&page='
.
$page
.
'">'
;
print
'<a href="'
.
DOL_URL_ROOT
.
'/compta/bank/ligne.php?rowid='
.
$objp
->
rowid
.
'&account='
.
$
obje
ct
->
id
.
'&page='
.
$page
.
'">'
;
print
img_view
();
print
'</a>'
;
}
if
(
$
ac
ct
->
canBeConciliated
()
>
0
&&
empty
(
$objp
->
rappro
))
if
(
$
obje
ct
->
canBeConciliated
()
>
0
&&
empty
(
$objp
->
rappro
))
{
if
(
$db
->
jdate
(
$objp
->
dv
)
<
(
$now
-
$conf
->
bank
->
rappro
->
warning_delay
))
{
...
...
@@ -699,7 +691,7 @@ if ($account || $_GET["ref"])
print
' '
;
if
(
$user
->
rights
->
banque
->
modifier
)
{
print
'<a href="'
.
DOL_URL_ROOT
.
'/compta/bank/account.php
?action=delete&rowid='
.
$objp
->
rowid
.
'&
account='
.
$ac
ct
->
id
.
'&page='
.
$page
.
'">'
;
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'
?action=delete&rowid='
.
$objp
->
rowid
.
'&
id='
.
$obje
ct
->
id
.
'&page='
.
$page
.
'">'
;
print
img_delete
();
print
'</a>'
;
}
...
...
@@ -742,11 +734,11 @@ if ($account || $_GET["ref"])
{
print
'<div class="tabsAction">'
;
if
(
$
ac
ct
->
type
!=
2
&&
$
ac
ct
->
rappro
)
// If not cash account and can be reconciliate
if
(
$
obje
ct
->
type
!=
2
&&
$
obje
ct
->
rappro
)
// If not cash account and can be reconciliate
{
if
(
$user
->
rights
->
banque
->
consolidate
)
{
print
'<a class="butAction" href="'
.
DOL_URL_ROOT
.
'/compta/bank/rappro.php?account='
.
$
ac
ct
->
id
.
'">'
.
$langs
->
trans
(
"Conciliate"
)
.
'</a>'
;
print
'<a class="butAction" href="'
.
DOL_URL_ROOT
.
'/compta/bank/rappro.php?account='
.
$
obje
ct
->
id
.
'">'
.
$langs
->
trans
(
"Conciliate"
)
.
'</a>'
;
}
else
{
...
...
@@ -758,7 +750,7 @@ if ($account || $_GET["ref"])
{
if
(
$user
->
rights
->
banque
->
modifier
)
{
print
'<a class="butAction" href="
account.php
?action=addline&
account='
.
$ac
ct
->
id
.
'&page='
.
$page
.
'">'
.
$langs
->
trans
(
"AddBankRecord"
)
.
'</a>'
;
print
'<a class="butAction" href="
'
.
$_SERVER
[
"PHP_SELF"
]
.
'
?action=addline&
id='
.
$obje
ct
->
id
.
'&page='
.
$page
.
'">'
.
$langs
->
trans
(
"AddBankRecord"
)
.
'</a>'
;
}
else
{
...
...
@@ -776,7 +768,7 @@ else
print
$langs
->
trans
(
"ErrorBankAccountNotFound"
);
}
$db
->
close
();
llxFooter
();
$db
->
close
();
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
htdocs/core/lib/bank.lib.php
+
3
−
2
View file @
c86183e1
<?php
/* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
...
...
@@ -47,7 +48,7 @@ function bank_prepare_head($object)
$h
++
;
}
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/compta/bank/account.php?
account
="
.
$object
->
id
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/compta/bank/account.php?
id
="
.
$object
->
id
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Transactions"
);
$head
[
$h
][
2
]
=
'journal'
;
$h
++
;
...
...
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