Bug 20980: DBRev 18.06.00.004
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
8a83f1e1a9
commit
64761e56cc
2
Koha.pm
2
Koha.pm
|
|
@ -29,7 +29,7 @@ use vars qw{ $VERSION };
|
|||
# - #4 : the developer version. The 4th number is the database subversion.
|
||||
# used by developers when the database changes. updatedatabase take care of the changes itself
|
||||
# and is automatically called by Auth.pm when needed.
|
||||
$VERSION = "18.06.00.003";
|
||||
$VERSION = "18.06.00.004";
|
||||
|
||||
sub version {
|
||||
return $VERSION;
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
$DBversion = 'XXX';
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
|
||||
# Add 'Manual Credit' offset type
|
||||
$dbh->do(q{
|
||||
INSERT IGNORE INTO `account_offset_types` (`type`) VALUES ('Manual Credit');
|
||||
});
|
||||
|
||||
# Fix wrong account offsets / Manual credits
|
||||
$dbh->do(q{
|
||||
UPDATE account_offsets
|
||||
SET credit_id=debit_id,
|
||||
debit_id=NULL,
|
||||
type='Manual Credit'
|
||||
WHERE amount < 0 AND
|
||||
type='Manual Debit' AND
|
||||
debit_id IN
|
||||
(SELECT accountlines_id AS debit_id
|
||||
FROM accountlines
|
||||
WHERE accounttype='C');
|
||||
});
|
||||
|
||||
# Fix wrong account offsets / Manually forgiven amounts
|
||||
$dbh->do(q{
|
||||
UPDATE account_offsets
|
||||
SET credit_id=debit_id,
|
||||
debit_id=NULL,
|
||||
type='Writeoff'
|
||||
WHERE amount < 0 AND
|
||||
type='Manual Debit' AND
|
||||
debit_id IN
|
||||
(SELECT accountlines_id AS debit_id
|
||||
FROM accountlines
|
||||
WHERE accounttype='FOR');
|
||||
});
|
||||
|
||||
SetVersion( $DBversion );
|
||||
print "Upgrade to $DBversion done (Bug 20980 - Manual credit offsets are stored as debits)\n";
|
||||
}
|
||||
|
|
@ -16087,6 +16087,46 @@ if( CheckVersion( $DBversion ) ) {
|
|||
print "Upgrade to $DBversion done (Bug 20073 - Add new types for Elasticsearch fields)\n";
|
||||
}
|
||||
|
||||
$DBversion = '18.06.00.004';
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
|
||||
# Add 'Manual Credit' offset type
|
||||
$dbh->do(q{
|
||||
INSERT IGNORE INTO `account_offset_types` (`type`) VALUES ('Manual Credit');
|
||||
});
|
||||
|
||||
# Fix wrong account offsets / Manual credits
|
||||
$dbh->do(q{
|
||||
UPDATE account_offsets
|
||||
SET credit_id=debit_id,
|
||||
debit_id=NULL,
|
||||
type='Manual Credit'
|
||||
WHERE amount < 0 AND
|
||||
type='Manual Debit' AND
|
||||
debit_id IN
|
||||
(SELECT accountlines_id AS debit_id
|
||||
FROM accountlines
|
||||
WHERE accounttype='C');
|
||||
});
|
||||
|
||||
# Fix wrong account offsets / Manually forgiven amounts
|
||||
$dbh->do(q{
|
||||
UPDATE account_offsets
|
||||
SET credit_id=debit_id,
|
||||
debit_id=NULL,
|
||||
type='Writeoff'
|
||||
WHERE amount < 0 AND
|
||||
type='Manual Debit' AND
|
||||
debit_id IN
|
||||
(SELECT accountlines_id AS debit_id
|
||||
FROM accountlines
|
||||
WHERE accounttype='FOR');
|
||||
});
|
||||
|
||||
SetVersion( $DBversion );
|
||||
print "Upgrade to $DBversion done (Bug 20980 - Manual credit offsets are stored as debits)\n";
|
||||
}
|
||||
|
||||
# SEE bug 13068
|
||||
# if there is anything in the atomicupdate, read and execute it.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue