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
6732c129
Commit
6732c129
authored
14 years ago
by
Juanjo Menent
Browse files
Options
Downloads
Patches
Plain Diff
Task #11003: checkbox on checks to deposit
parent
38b3518d
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
htdocs/compta/paiement/cheque/class/remisecheque.class.php
+22
-11
22 additions, 11 deletions
htdocs/compta/paiement/cheque/class/remisecheque.class.php
htdocs/compta/paiement/cheque/fiche.php
+37
-32
37 additions, 32 deletions
htdocs/compta/paiement/cheque/fiche.php
with
59 additions
and
43 deletions
htdocs/compta/paiement/cheque/class/remisecheque.class.php
+
22
−
11
View file @
6732c129
...
...
@@ -2,6 +2,7 @@
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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
...
...
@@ -117,9 +118,10 @@ class RemiseCheque extends CommonObject
* @param user User making creation
* @param account_id Bank account for cheque receipt
* @param limit Limit number of cheque to this
* @param toRemise array with cheques to remise
* @return int <0 if KO, >0 if OK
*/
function
create
(
$user
,
$account_id
,
$limit
=
40
)
function
create
(
$user
,
$account_id
,
$limit
=
40
,
$toRemise
)
{
global
$conf
;
...
...
@@ -207,19 +209,28 @@ class RemiseCheque extends CommonObject
}
if
(
$this
->
id
>
0
&&
$this
->
errno
==
0
)
{
{
foreach
(
$lines
as
$lineid
)
{
$
sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"bank"
;
$sql
.
=
" SET fk_bordereau = "
.
$this
->
id
;
$sql
.
=
" WHERE rowid = "
.
$lineid
;
dol_syslog
(
"RemiseCheque::Create sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
!
$resql
)
$
checkremise
=
false
;
foreach
(
$toRemise
as
$linetoremise
)
{
if
(
$linetoremise
==
$lineid
)
$checkremise
=
true
;
}
if
(
$checkremise
==
true
)
{
$this
->
errno
=
-
18
;
dol_syslog
(
"RemiseCheque::Create Error update bank "
.
$this
->
errno
,
LOG_ERR
);
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"bank"
;
$sql
.
=
" SET fk_bordereau = "
.
$this
->
id
;
$sql
.
=
" WHERE rowid = "
.
$lineid
;
dol_syslog
(
"RemiseCheque::Create sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
!
$resql
)
{
$this
->
errno
=
-
18
;
dol_syslog
(
"RemiseCheque::Create Error update bank "
.
$this
->
errno
,
LOG_ERR
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/compta/paiement/cheque/fiche.php
+
37
−
32
View file @
6732c129
...
...
@@ -84,42 +84,42 @@ if ($_POST['action'] == 'setdate' && $user->rights->banque->cheque)
}
}
if
(
$_
GE
T
[
'action'
]
==
'create'
&&
$_
GE
T
[
"accountid"
]
>
0
&&
$user
->
rights
->
banque
->
cheque
)
if
(
$_
POS
T
[
'action'
]
==
'create'
&&
$_
POS
T
[
"accountid"
]
>
0
&&
$user
->
rights
->
banque
->
cheque
)
{
$remisecheque
=
new
RemiseCheque
(
$db
);
//$result = $remisecheque->create($user, $_GET["accountid"], 0);
if
(
is_array
(
$_POST
[
'toRemise'
]))
$result
=
$remisecheque
->
create
(
$user
,
$_GET
[
"accountid"
],
0
);
// $result = $remisecheque->create($user, $_GET["accountid"], 0, $_POST['toRemise']);
else
$result
=
$remisecheque
->
create
(
$user
,
$_GET
[
"accountid"
],
0
);
if
(
$result
>
0
)
{
if
(
$remisecheque
->
statut
==
1
)
// If statut is validated, we build doc
{
$remisecheque
->
fetch
(
$remisecheque
->
id
);
// To force to reload all properties in correct property name
// Define output language
$outputlangs
=
$langs
;
$newlang
=
''
;
if
(
$conf
->
global
->
MAIN_MULTILANGS
&&
empty
(
$newlang
)
&&
!
empty
(
$_REQUEST
[
'lang_id'
]))
$newlang
=
$_REQUEST
[
'lang_id'
];
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if
(
!
empty
(
$newlang
))
{
$outputlangs
=
new
Translate
(
""
,
$conf
);
$outputlangs
->
setDefaultLang
(
$newlang
);
}
$result
=
$remisecheque
->
generatePdf
(
$_POST
[
"model"
],
$outputlangs
);
}
Header
(
"Location: "
.
$_SERVER
[
"PHP_SELF"
]
.
"?id="
.
$remisecheque
->
id
);
exit
;
$remisecheque
=
new
RemiseCheque
(
$db
);
$result
=
$remisecheque
->
create
(
$user
,
$_POST
[
"accountid"
],
0
,
$_POST
[
'toRemise'
]);
if
(
$result
>
0
)
{
if
(
$remisecheque
->
statut
==
1
)
// If statut is validated, we build doc
{
$remisecheque
->
fetch
(
$remisecheque
->
id
);
// To force to reload all properties in correct property name
// Define output language
$outputlangs
=
$langs
;
$newlang
=
''
;
if
(
$conf
->
global
->
MAIN_MULTILANGS
&&
empty
(
$newlang
)
&&
!
empty
(
$_REQUEST
[
'lang_id'
]))
$newlang
=
$_REQUEST
[
'lang_id'
];
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if
(
!
empty
(
$newlang
))
{
$outputlangs
=
new
Translate
(
""
,
$conf
);
$outputlangs
->
setDefaultLang
(
$newlang
);
}
$result
=
$remisecheque
->
generatePdf
(
$_POST
[
"model"
],
$outputlangs
);
}
Header
(
"Location: "
.
$_SERVER
[
"PHP_SELF"
]
.
"?id="
.
$remisecheque
->
id
);
exit
;
}
else
{
$mesg
=
'<div class="error">'
.
$remisecheque
->
error
.
'</div>'
;
}
}
else
{
$mesg
=
'<div class="error">'
.
$remisecheque
->
error
.
'</div>'
;
Header
(
"Location: "
.
$_SERVER
[
"PHP_SELF"
]
.
"?action=new"
);
exit
;
}
}
...
...
@@ -343,7 +343,11 @@ if ($_GET['action'] == 'new')
foreach
(
$accounts
as
$bid
=>
$account_label
)
{
$num
=
$db
->
num_rows
(
$resql
);
print
'<form action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'" method="POST">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="create">'
;
print
'<input type="hidden" name="accountid" value="'
.
$bid
.
'">'
;
print
'<table class="noborder" width="100%">'
;
print
'<tr class="liste_titre">'
;
print
'<td style="min-width: 120px">'
.
$langs
->
trans
(
"DateChequeReceived"
)
.
" </td>
\n
"
;
...
...
@@ -384,13 +388,14 @@ if ($_GET['action'] == 'new')
print
'<div class="tabsAction">'
;
if
(
$user
->
rights
->
banque
->
cheque
)
{
print
'<
a class="butAction" href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=create&accountid='
.
$bid
.
'">
'
.
$langs
->
trans
(
'NewCheckDepositOn'
,
$account_label
)
.
'
</a
>'
;
print
'<
input type="submit" class="button" value="
'
.
$langs
->
trans
(
'NewCheckDepositOn'
,
$account_label
)
.
'
"
>'
;
}
else
{
print
'<a class="butActionRefused" href="#" title="'
.
$langs
->
trans
(
"NotEnoughPermissions"
)
.
'">'
.
$langs
->
trans
(
'NewCheckDepositOn'
,
$account_label
)
.
'</a>'
;
}
print
'</div><br>'
;
print
'</form>'
;
}
}
...
...
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