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
d4466a65
Commit
d4466a65
authored
9 years ago
by
Juanjo Menent
Browse files
Options
Downloads
Plain Diff
Merge pull request #4288 from marcosgdf/bug-4182
FIX #4182 SQL error when deleting an unexisting bank entry
parents
c9e8c362
8b633aee
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/class/account.class.php
+3
-3
3 additions, 3 deletions
htdocs/compta/bank/class/account.class.php
htdocs/compta/bank/rappro.php
+8
-5
8 additions, 5 deletions
htdocs/compta/bank/rappro.php
with
11 additions
and
8 deletions
htdocs/compta/bank/class/account.class.php
+
3
−
3
View file @
d4466a65
...
@@ -1277,12 +1277,12 @@ class AccountLine extends CommonObject
...
@@ -1277,12 +1277,12 @@ class AccountLine extends CommonObject
$nbko
++
;
$nbko
++
;
}
}
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"bank_class WHERE lineid="
.
$this
->
rowid
;
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"bank_class WHERE lineid="
.
(
int
)
$this
->
rowid
;
dol_syslog
(
get_class
(
$this
)
.
"::delete"
,
LOG_DEBUG
);
dol_syslog
(
get_class
(
$this
)
.
"::delete"
,
LOG_DEBUG
);
$result
=
$this
->
db
->
query
(
$sql
);
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
$result
)
$nbko
++
;
if
(
!
$result
)
$nbko
++
;
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"bank WHERE rowid="
.
$this
->
rowid
;
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"bank WHERE rowid="
.
(
int
)
$this
->
rowid
;
dol_syslog
(
get_class
(
$this
)
.
"::delete"
,
LOG_DEBUG
);
dol_syslog
(
get_class
(
$this
)
.
"::delete"
,
LOG_DEBUG
);
$result
=
$this
->
db
->
query
(
$sql
);
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
$result
)
$nbko
++
;
if
(
!
$result
)
$nbko
++
;
...
@@ -1319,7 +1319,7 @@ class AccountLine extends CommonObject
...
@@ -1319,7 +1319,7 @@ class AccountLine extends CommonObject
$this
->
db
->
begin
();
$this
->
db
->
begin
();
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"bank_url WHERE fk_bank="
.
$this
->
rowid
;
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"bank_url WHERE fk_bank="
.
(
int
)
$this
->
rowid
;
dol_syslog
(
get_class
(
$this
)
.
"::delete_urls"
,
LOG_DEBUG
);
dol_syslog
(
get_class
(
$this
)
.
"::delete_urls"
,
LOG_DEBUG
);
$result
=
$this
->
db
->
query
(
$sql
);
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
$result
)
$nbko
++
;
if
(
!
$result
)
$nbko
++
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/compta/bank/rappro.php
+
8
−
5
View file @
d4466a65
...
@@ -99,11 +99,14 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
...
@@ -99,11 +99,14 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
if
(
$action
==
'del'
)
if
(
$action
==
'del'
)
{
{
$bankline
=
new
AccountLine
(
$db
);
$bankline
=
new
AccountLine
(
$db
);
$bankline
->
fetch
(
$_GET
[
"rowid"
]);
$result
=
$bankline
->
delete
(
$user
);
if
(
$bankline
->
fetch
(
$_GET
[
"rowid"
])
>
1
)
{
if
(
$result
<
0
)
$result
=
$bankline
->
delete
(
$user
);
{
if
(
$result
<
0
)
{
dol_print_error
(
$db
,
$bankline
->
error
);
dol_print_error
(
$db
,
$bankline
->
error
);
}
}
else
{
setEventMessage
(
$langs
->
trans
(
'ErrorRecordNotFound'
),
'errors'
);
}
}
}
}
...
...
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