projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged changes up to 2.3.16 into unstable
[fa-stable.git]
/
includes
/
references.inc
diff --git
a/includes/references.inc
b/includes/references.inc
index b67267c5ca41baad6c04e6aaa2e43a863c142865..6a8c7af2d0f87044206bc2fb0f243697e90b1051 100644
(file)
--- a/
includes/references.inc
+++ b/
includes/references.inc
@@
-57,7
+57,7
@@
class references
function save($type, $id, $reference)
{
update_reference($type, $id, $reference); // store in refs table
function save($type, $id, $reference)
{
update_reference($type, $id, $reference); // store in refs table
- if ($reference == $this->get_next($type)) { // if reference was not changed from default
+ if ($reference == $this->get_next($type)) { // if reference was
bigger or
not changed from default
$next = $this->_increment($reference); // increment default
save_next_reference($type, $next);
}
$next = $this->_increment($reference); // increment default
save_next_reference($type, $next);
}
@@
-116,10
+116,10
@@
function is_new_reference($ref, $type, $trans_no=0)
$type = db_escape($type);
if ($db_ref == null) { // journal or bank trans store references in refs table
$type = db_escape($type);
if ($db_ref == null) { // journal or bank trans store references in refs table
- $db_
ref
= TB_PREF."refs";
+ $db_
name
= TB_PREF."refs";
$db_type = 'type';
$db_trans = 'id';
$db_type = 'type';
$db_trans = 'id';
- $
r
b_ref = 'reference';
+ $
d
b_ref = 'reference';
}
if ($db_type != null) {
}
if ($db_type != null) {
@@
-135,10
+135,6
@@
function is_new_reference($ref, $type, $trans_no=0)
WHERE $db_ref=$ref AND ISNULL(v.id)";
}
WHERE $db_ref=$ref AND ISNULL(v.id)";
}
- if ($trans_no)
- {
- $sql .= " AND $db_name.$db_trans != ".db_escape($trans_no);
- }
$result = db_query($sql, "could not test for unique reference");
return (db_num_rows($result) == 0);
$result = db_query($sql, "could not test for unique reference");
return (db_num_rows($result) == 0);