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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
f07b6397
Commit
f07b6397
authored
Feb 13, 2012
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: test if type of paiement is cash for cash account
parent
c86183e1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/compta/bank/account.php
+3
-3
3 additions, 3 deletions
htdocs/compta/bank/account.php
htdocs/compta/bank/ligne.php
+93
-74
93 additions, 74 deletions
htdocs/compta/bank/ligne.php
with
96 additions
and
77 deletions
htdocs/compta/bank/account.php
+
3
−
3
View file @
f07b6397
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copy
t
ight (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copy
r
ight (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copy
t
ight (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copy
r
ight (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copy
t
ight (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
* Copy
r
ight (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
*
*
* This program is free software; you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License as published by
...
...
This diff is collapsed.
Click to expand it.
htdocs/compta/bank/ligne.php
+
93
−
74
View file @
f07b6397
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
* Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
* Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
*
* This program is free software; you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License as published by
...
@@ -26,21 +27,25 @@
...
@@ -26,21 +27,25 @@
require
(
"./pre.inc.php"
);
require
(
"./pre.inc.php"
);
if
(
!
$user
->
rights
->
banque
->
lire
&&
!
$user
->
rights
->
banque
->
consolidate
)
accessforbidden
();
$langs
->
load
(
"banks"
);
$langs
->
load
(
"banks"
);
$langs
->
load
(
"compta"
);
$langs
->
load
(
"compta"
);
$langs
->
load
(
"bills"
);
$langs
->
load
(
"bills"
);
$langs
->
load
(
"categories"
);
$langs
->
load
(
"categories"
);
if
(
$conf
->
adherent
->
enabled
)
$langs
->
load
(
"members"
);
if
(
$conf
->
adherent
->
enabled
)
$langs
->
load
(
"members"
);
$action
=
GETPOST
(
'action'
);
$rowid
=
GETPOST
(
"rowid"
);
$id
=
(
GETPOST
(
'id'
,
'int'
)
?
GETPOST
(
'id'
,
'int'
)
:
GETPOST
(
'account'
,
'int'
));
$ref
=
GETPOST
(
"ref"
);
$ref
=
GETPOST
(
'ref'
,
'alpha'
);
$action
=
GETPOST
(
'action'
,
'alpha'
);
$confirm
=
GETPOST
(
'confirm'
,
'alpha'
);
$rowid
=
GETPOST
(
"rowid"
,
'int'
);
$orig_account
=
GETPOST
(
"orig_account"
);
$orig_account
=
GETPOST
(
"orig_account"
);
$accountid
=
GETPOST
(
'accountid'
);
$confirm
=
GETPOST
(
'confirm'
);
// Security check
$fieldvalue
=
(
!
empty
(
$id
)
?
$id
:
(
!
empty
(
$ref
)
?
$ref
:
''
));
$fieldtype
=
(
!
empty
(
$ref
)
?
'ref'
:
'rowid'
);
if
(
$user
->
societe_id
)
$socid
=
$user
->
societe_id
;
$result
=
restrictedArea
(
$user
,
'banque'
,
$fieldvalue
,
'bank_account'
,
''
,
''
,
$fieldtype
);
$form
=
new
Form
(
$db
);
$form
=
new
Form
(
$db
);
...
@@ -48,16 +53,16 @@ $form = new Form($db);
...
@@ -48,16 +53,16 @@ $form = new Form($db);
* Actions
* Actions
*/
*/
if
(
$user
->
rights
->
banque
->
consolidate
&&
$
_GET
[
"
action
"
]
==
'dvnext'
)
if
(
$user
->
rights
->
banque
->
consolidate
&&
$action
==
'dvnext'
)
{
{
$ac
=
new
Account
(
$db
);
$ac
=
new
Account
(
$db
);
$ac
->
datev_next
(
$
_GET
[
"
rowid
"
]
);
$ac
->
datev_next
(
$rowid
);
}
}
if
(
$user
->
rights
->
banque
->
consolidate
&&
$
_GET
[
"
action
"
]
==
'dvprev'
)
if
(
$user
->
rights
->
banque
->
consolidate
&&
$action
==
'dvprev'
)
{
{
$ac
=
new
Account
(
$db
);
$ac
=
new
Account
(
$db
);
$ac
->
datev_previous
(
$
_GET
[
"
rowid
"
]
);
$ac
->
datev_previous
(
$rowid
);
}
}
if
(
$action
==
'confirm_delete_categ'
&&
$confirm
==
"yes"
&&
$user
->
rights
->
banque
->
modifier
)
if
(
$action
==
'confirm_delete_categ'
&&
$confirm
==
"yes"
&&
$user
->
rights
->
banque
->
modifier
)
...
@@ -77,7 +82,7 @@ if ($action == 'class')
...
@@ -77,7 +82,7 @@ if ($action == 'class')
dol_print_error
(
$db
);
dol_print_error
(
$db
);
}
}
$sql
=
"INSERT INTO "
.
MAIN_DB_PREFIX
.
"bank_class (lineid, fk_categ) VALUES ("
.
$
_GET
[
"
rowid
"
]
.
", "
.
$_POST
[
"cat1"
]
.
")"
;
$sql
=
"INSERT INTO "
.
MAIN_DB_PREFIX
.
"bank_class (lineid, fk_categ) VALUES ("
.
$rowid
.
", "
.
$_POST
[
"cat1"
]
.
")"
;
if
(
!
$db
->
query
(
$sql
))
if
(
!
$db
->
query
(
$sql
))
{
{
dol_print_error
(
$db
);
dol_print_error
(
$db
);
...
@@ -85,6 +90,19 @@ if ($action == 'class')
...
@@ -85,6 +90,19 @@ if ($action == 'class')
}
}
if
(
$action
==
"update"
)
if
(
$action
==
"update"
)
{
$error
=
0
;
$ac
=
new
Account
(
$db
);
$ac
->
fetch
(
$id
);
if
(
$ac
->
courant
==
2
&&
$_POST
[
'value'
]
!=
'LIQ'
)
{
$mesg
=
'<div class="error">'
.
$langs
->
trans
(
"ErrorCashAccountAcceptsOnlyCashMoney"
)
.
'</div>'
;
$error
++
;
}
if
(
!
$error
)
{
{
// Avant de modifier la date ou le montant, on controle si ce n'est pas encore rapproche
// Avant de modifier la date ou le montant, on controle si ce n'est pas encore rapproche
$conciliated
=
0
;
$conciliated
=
0
;
...
@@ -116,7 +134,7 @@ if ($action == "update")
...
@@ -116,7 +134,7 @@ if ($action == "update")
if
(
isset
(
$_POST
[
'dateomonth'
]))
$sql
.
=
" dateo = '"
.
$db
->
idate
(
$dateop
)
.
"',"
;
if
(
isset
(
$_POST
[
'dateomonth'
]))
$sql
.
=
" dateo = '"
.
$db
->
idate
(
$dateop
)
.
"',"
;
if
(
isset
(
$_POST
[
'datevmonth'
]))
$sql
.
=
" datev = '"
.
$db
->
idate
(
$dateval
)
.
"',"
;
if
(
isset
(
$_POST
[
'datevmonth'
]))
$sql
.
=
" datev = '"
.
$db
->
idate
(
$dateval
)
.
"',"
;
}
}
$sql
.
=
" fk_account = "
.
$
account
id
;
$sql
.
=
" fk_account = "
.
$id
;
$sql
.
=
" WHERE rowid = "
.
$rowid
;
$sql
.
=
" WHERE rowid = "
.
$rowid
;
$result
=
$db
->
query
(
$sql
);
$result
=
$db
->
query
(
$sql
);
...
@@ -131,6 +149,7 @@ if ($action == "update")
...
@@ -131,6 +149,7 @@ if ($action == "update")
dol_print_error
(
$db
);
dol_print_error
(
$db
);
}
}
}
}
}
// Reconcile
// Reconcile
if
(
$user
->
rights
->
banque
->
consolidate
&&
(
$action
==
'num_releve'
||
$action
==
'setreconcile'
))
if
(
$user
->
rights
->
banque
->
consolidate
&&
(
$action
==
'num_releve'
||
$action
==
'setreconcile'
))
...
@@ -202,12 +221,12 @@ $var=False;
...
@@ -202,12 +221,12 @@ $var=False;
$h
=
0
;
$h
=
0
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
'/compta/bank/ligne.php
?rowid='
.
$
_GET
[
"
rowid
"
]
;
$head
[
$h
][
0
]
=
$_SERVER
[
'PHP_SELF'
]
.
'
?rowid='
.
$rowid
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
'Card'
);
$head
[
$h
][
1
]
=
$langs
->
trans
(
'Card'
);
$hselected
=
$h
;
$hselected
=
$h
;
$h
++
;
$h
++
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
'/compta/bank/info.php?rowid='
.
$
_GET
[
"
rowid
"
]
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
'/compta/bank/info.php?rowid='
.
$rowid
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Info"
);
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Info"
);
$h
++
;
$h
++
;
...
@@ -244,15 +263,15 @@ if ($result)
...
@@ -244,15 +263,15 @@ if ($result)
// Confirmations
// Confirmations
if
(
$action
==
'delete_categ'
)
if
(
$action
==
'delete_categ'
)
{
{
$ret
=
$form
->
form_confirm
(
"ligne.php
?rowid="
.
$rowid
.
"&cat1="
.
GETPOST
(
"fk_categ"
)
.
"&orig_account="
.
$orig_account
,
$langs
->
trans
(
"RemoveFromRubrique"
),
$langs
->
trans
(
"RemoveFromRubriqueConfirm"
),
"confirm_delete_categ"
,
''
,
'yes'
,
1
);
$ret
=
$form
->
form_confirm
(
$_SERVER
[
'PHP_SELF'
]
.
"
?rowid="
.
$rowid
.
"&cat1="
.
GETPOST
(
"fk_categ"
)
.
"&orig_account="
.
$orig_account
,
$langs
->
trans
(
"RemoveFromRubrique"
),
$langs
->
trans
(
"RemoveFromRubriqueConfirm"
),
"confirm_delete_categ"
,
''
,
'yes'
,
1
);
if
(
$ret
==
'html'
)
print
'<br>'
;
if
(
$ret
==
'html'
)
print
'<br>'
;
}
}
print
'<form name="update" method="
post
" action="
ligne.php
?rowid='
.
$rowid
.
'">'
;
print
'<form name="update" method="
POST
" action="
'
.
$_SERVER
[
'PHP_SELF'
]
.
'
?rowid='
.
$rowid
.
'">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="update">'
;
print
'<input type="hidden" name="action" value="update">'
;
print
'<input type="hidden" name="orig_account" value="'
.
$orig_account
.
'">'
;
print
'<input type="hidden" name="orig_account" value="'
.
$orig_account
.
'">'
;
print
'<input type="hidden" name="
account
id" value="'
.
$acct
->
id
.
'">'
;
print
'<input type="hidden" name="id" value="'
.
$acct
->
id
.
'">'
;
print
'<table class="border" width="100%">'
;
print
'<table class="border" width="100%">'
;
...
@@ -424,9 +443,9 @@ if ($result)
...
@@ -424,9 +443,9 @@ if ($result)
if
(
!
$objp
->
rappro
)
if
(
!
$objp
->
rappro
)
{
{
print
' '
;
print
' '
;
print
'<a href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?action=dvprev&
account='
.
$_GET
[
"account"
]
.
'&rowid='
.
$objp
->
rowid
.
'">'
;
print
'<a href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?action=dvprev&
id='
.
$id
.
'&rowid='
.
$objp
->
rowid
.
'">'
;
print
img_edit_remove
()
.
"</a> "
;
print
img_edit_remove
()
.
"</a> "
;
print
'<a href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?action=dvnext&
account='
.
$_GET
[
"account"
]
.
'&rowid='
.
$objp
->
rowid
.
'">'
;
print
'<a href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?action=dvnext&
id='
.
$id
.
'&rowid='
.
$objp
->
rowid
.
'">'
;
print
img_edit_add
()
.
"</a>"
;
print
img_edit_add
()
.
"</a>"
;
}
}
print
'</td>'
;
print
'</td>'
;
...
@@ -497,10 +516,10 @@ if ($result)
...
@@ -497,10 +516,10 @@ if ($result)
{
{
print
'<br>'
.
"
\n
"
;
print
'<br>'
.
"
\n
"
;
print_fiche_titre
(
$langs
->
trans
(
"Reconciliation"
),
''
,
''
);
print_fiche_titre
(
$langs
->
trans
(
"Reconciliation"
),
''
,
''
);
print
"
<form method=
\"
post
\
"
action=
\"
ligne.php
?rowid=
$objp->rowid
\
"
>
"
;
print
'
<form method=
"POST
" action=
"'
.
$_SERVER
[
'PHP_SELF'
]
.
'
?rowid=
'
.
$objp
->
rowid
.
'
">
'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="setreconcile">'
;
print
'<input type="hidden" name="action" value="setreconcile">'
;
print
"
<input type=
\
"
hidden
\
"
name=
\
"
orig_account
\
"
value=
\"
"
.
$orig_account
.
"
\
"
>
"
;
print
'
<input type="hidden" name="orig_account" value="
'
.
$orig_account
.
'
">
'
;
print
'<table class="border" width="100%">'
;
print
'<table class="border" width="100%">'
;
...
@@ -556,12 +575,12 @@ print '</div>';
...
@@ -556,12 +575,12 @@ print '</div>';
print
'<br>'
;
print
'<br>'
;
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
print
"
<form method=
\"
post
\
"
action=
\"
ligne.php
?rowid=
$rowid
&
account=
$account
\
"
>
"
;
print
'
<form method=
"POST
" action=
"'
.
$_SERVER
[
'PHP_SELF'
]
.
'
?rowid=
'
.
$rowid
.
'
&
id='
.
$id
.
'
">
'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
"
<input type=
\
"
hidden
\
"
name=
\
"
action
\
"
value=
\
"
class
\
"
>
"
;
print
'
<input type="hidden" name="action" value="class">
'
;
print
"
<input type=
\
"
hidden
\
"
name=
\
"
orig_account
\
"
value=
\"
"
.
$orig_account
.
"
\
"
>
"
;
print
'
<input type="hidden" name="orig_account" value="
'
.
$orig_account
.
'
">
'
;
print
"
<tr class=
\
"
liste_titre
\
"
><td>
"
.
$langs
->
trans
(
"Rubriques"
)
.
"
</td><td colspan=
\
"
2
\
"
>
"
;
print
'
<tr class="liste_titre"><td>
'
.
$langs
->
trans
(
"Rubriques"
)
.
'
</td><td colspan="2">
'
;
print
"
<select class=
\
"
flat
\
"
name=
\
"
cat1
\
"
>
"
.
$options
.
"
</select>
"
;
print
'
<select class="flat" name="cat1">
'
.
$options
.
'
</select>
'
;
print
'<input type="submit" class="button" value="'
.
$langs
->
trans
(
"Add"
)
.
'"></td>'
;
print
'<input type="submit" class="button" value="'
.
$langs
->
trans
(
"Add"
)
.
'"></td>'
;
print
"</tr>"
;
print
"</tr>"
;
print
"</form>"
;
print
"</form>"
;
...
@@ -587,7 +606,7 @@ if ($result)
...
@@ -587,7 +606,7 @@ if ($result)
print
"<td align=
\"
center
\"
><a href=
\"
budget.php?bid="
.
$objp
->
rowid
.
"
\"
>"
.
$langs
->
trans
(
"ListBankTransactions"
)
.
"</a></td>"
;
print
"<td align=
\"
center
\"
><a href=
\"
budget.php?bid="
.
$objp
->
rowid
.
"
\"
>"
.
$langs
->
trans
(
"ListBankTransactions"
)
.
"</a></td>"
;
if
(
$user
->
rights
->
banque
->
modifier
)
if
(
$user
->
rights
->
banque
->
modifier
)
{
{
print
"
<td align=
\
"
right
\
"
><a href=
\"
ligne.php
?action=delete_categ&rowid=
"
.
$rowid
.
"
&fk_categ=
$objp->rowid
\
"
>
"
.
img_delete
(
$langs
->
trans
(
"Remove"
))
.
"
</a></td>
"
;
print
'
<td align="right"><a href=
"'
.
$_SERVER
[
'PHP_SELF'
]
.
'
?action=delete_categ&rowid=
'
.
$rowid
.
'
&fk_categ=
'
.
$objp
->
rowid
.
'
">
'
.
img_delete
(
$langs
->
trans
(
"Remove"
))
.
'
</a></td>
'
;
}
}
print
"</tr>"
;
print
"</tr>"
;
...
@@ -597,7 +616,7 @@ if ($result)
...
@@ -597,7 +616,7 @@ if ($result)
}
}
print
"</table>"
;
print
"</table>"
;
$db
->
close
();
llxFooter
();
llxFooter
();
$db
->
close
();
?>
?>
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