View | Details | Raw Unified | Return to bug 6427
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (-44 / +90 lines)
Lines 265-270 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
268
  `account_balance` decimal(28,6) NOT NULL,
268
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  KEY `categorycode` (`categorycode`),
271
  KEY `categorycode` (`categorycode`),
Lines 2739-2788 CREATE TABLE `messages` ( -- circulation messages left via the patron's check ou Link Here
2739
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2740
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2740
2741
2741
--
2742
--
2742
-- Table structure for table `accountlines`
2743
--
2744
2745
DROP TABLE IF EXISTS `accountlines`;
2746
CREATE TABLE `accountlines` (
2747
  `accountlines_id` int(11) NOT NULL AUTO_INCREMENT,
2748
  `borrowernumber` int(11) NOT NULL default 0,
2749
  `accountno` smallint(6) NOT NULL default 0,
2750
  `itemnumber` int(11) default NULL,
2751
  `date` date default NULL,
2752
  `amount` decimal(28,6) default NULL,
2753
  `description` mediumtext,
2754
  `dispute` mediumtext,
2755
  `accounttype` varchar(5) default NULL,
2756
  `amountoutstanding` decimal(28,6) default NULL,
2757
  `lastincrement` decimal(28,6) default NULL,
2758
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2759
  `notify_id` int(11) NOT NULL default 0,
2760
  `notify_level` int(2) NOT NULL default 0,
2761
  `note` text NULL default NULL,
2762
  `manager_id` int(11) NULL,
2763
  PRIMARY KEY (`accountlines_id`),
2764
  KEY `acctsborridx` (`borrowernumber`),
2765
  KEY `timeidx` (`timestamp`),
2766
  KEY `itemnumber` (`itemnumber`),
2767
  CONSTRAINT `accountlines_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2768
  CONSTRAINT `accountlines_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL
2769
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2770
2771
--
2772
-- Table structure for table `accountoffsets`
2773
--
2774
2775
DROP TABLE IF EXISTS `accountoffsets`;
2776
CREATE TABLE `accountoffsets` (
2777
  `borrowernumber` int(11) NOT NULL default 0,
2778
  `accountno` smallint(6) NOT NULL default 0,
2779
  `offsetaccount` smallint(6) NOT NULL default 0,
2780
  `offsetamount` decimal(28,6) default NULL,
2781
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2782
  CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2783
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2784
2785
--
2786
-- Table structure for table `action_logs`
2743
-- Table structure for table `action_logs`
2787
--
2744
--
2788
2745
Lines 3520-3525 CREATE TABLE items_search_fields ( Link Here
3520
    ON DELETE SET NULL ON UPDATE CASCADE
3477
    ON DELETE SET NULL ON UPDATE CASCADE
3521
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3478
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3522
3479
3480
--
3481
-- Table structure for table 'account_credits'
3482
--
3483
DROP TABLE IF EXISTS account_credits;
3484
CREATE TABLE IF account_credits (
3485
    credit_id int(11) NOT NULL AUTO_INCREMENT,     -- The unique id for this credit
3486
    borrowernumber int(11) NOT NULL,               -- The borrower this credit applies to
3487
    `type` varchar(255) NOT NULL,                  -- The type of credit this is ( defined by Koha::Accounts::CreditTypes )
3488
    amount_received decimal(28,6) DEFAULT NULL,    -- If this was a cash payment, the amount of money given
3489
    amount_paid decimal(28,6) NOT NULL,            -- The actual ammount paid, if less than amount_recieved, change was given back
3490
    amount_remaining decimal(28,6) NOT NULL,       -- The amount of this credit that has not been applied to outstanding debits
3491
    amount_voided decimal(28,6) NULL DEFAULT NULL, -- The amount of this credit was for before it was voided
3492
    notes text,                                    -- Misc notes for this credit
3493
    branchcode VARCHAR( 10 ) NULL DEFAULT NULL,    -- Branchcode where the credit was created ( if any )
3494
    manager_id int(11) DEFAULT NULL,               -- The borrowernumber of the user who created this credit ( if any )
3495
    created_on timestamp NULL DEFAULT NULL,        -- Timestamp for when this credit was created
3496
    updated_on timestamp NULL DEFAULT NULL,        -- Timestamp for when this credit was last modified
3497
    PRIMARY KEY (credit_id),
3498
    KEY borrowernumber (borrowernumber),
3499
    KEY branchcode (branchcode)
3500
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3501
3502
--
3503
-- Constraints for table `account_credits`
3504
--
3505
ALTER TABLE `account_credits`
3506
  ADD CONSTRAINT account_credits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
3507
  ADD CONSTRAINT account_credits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE;
3508
3509
--
3510
-- Table structure for table 'account_debits'
3511
--
3512
3513
DROP TABLE IF EXISTS account_debits;
3514
CREATE TABLE account_debits (
3515
    debit_id int(11) NOT NULL AUTO_INCREMENT,           -- The unique id for this debit
3516
    borrowernumber int(11) NOT NULL DEFAULT '0',        -- The borrower this debit applies to
3517
    itemnumber int(11) DEFAULT NULL,                    -- The item related to this debit ( for fines, lost fees, etc )
3518
    issue_id int(11) DEFAULT NULL,                      -- The checkout this debit is related to ( again, for fines, lost fees, etc )
3519
    `type` varchar(255) NOT NULL,                       -- The type of debit this is ( defined by Koha::Accounts::DebitTypes )
3520
    accruing tinyint(1) NOT NULL DEFAULT '0',           -- Boolean flag, tells of if this is a fine that is still accruing
3521
    amount_original decimal(28,6) DEFAULT NULL,         -- The total amount of this debit
3522
    amount_outstanding decimal(28,6) DEFAULT NULL,      -- The amount still owed on this debit
3523
    amount_last_increment decimal(28,6) DEFAULT NULL,   -- The amount by which this debit last changed
3524
    description mediumtext,                             -- The description for this debit
3525
    notes text,                                         -- Misc notes for this debit
3526
    branchcode VARCHAR( 10 ) NULL DEFAULT NULL,         -- Branchcode where the debit was created ( if any )
3527
    manager_id int(11) DEFAULT NULL,                    -- The borrowernumber of the user who created this debit ( if any )
3528
    created_on timestamp NULL DEFAULT NULL,             -- Timestamp for when this credit was created
3529
    updated_on timestamp NULL DEFAULT NULL,             -- Timestamp for when this credit was last modified
3530
    PRIMARY KEY (debit_id),
3531
    KEY acctsborridx (borrowernumber),
3532
    KEY itemnumber (itemnumber),
3533
    KEY borrowernumber (borrowernumber),
3534
    KEY issue_id (issue_id),
3535
    KEY branchcode (branchcode)
3536
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3537
3538
--
3539
-- Constraints for table `account_debits`
3540
--
3541
ALTER TABLE `account_debits`
3542
    ADD CONSTRAINT account_debits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
3543
    ADD CONSTRAINT account_debits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE;
3544
3545
--
3546
-- Table structure for table 'account_offsets'
3547
--
3548
3549
DROP TABLE IF EXISTS account_offsets;
3550
CREATE TABLE account_offsets (
3551
    offset_id int(11) NOT NULL AUTO_INCREMENT,                                              -- Unique id for this offset
3552
    debit_id int(11) DEFAULT NULL,                                                          -- Related debit
3553
    credit_id int(11) DEFAULT NULL,                                                         -- Related credit ( if any )
3554
    `type` varchar(255) DEFAULT NULL,                                                       -- The type of this offset ( defined by Koha::Accounts::OffsetTypes ), if any
3555
    amount decimal(28,6) NOT NULL,                                                          -- The amount of the offset, positive means patron owes more, negative means patron owes less
3556
    created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,    -- Timestamp for when this offset was created
3557
    PRIMARY KEY (offset_id),
3558
    KEY fee_id (debit_id),
3559
    KEY payment_id (credit_id)
3560
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3561
3562
--
3563
-- Constraints for table `account_offsets`
3564
--
3565
ALTER TABLE `account_offsets`
3566
    ADD CONSTRAINT account_offsets_ibfk_1 FOREIGN KEY (debit_id) REFERENCES account_debits (debit_id) ON DELETE CASCADE ON UPDATE CASCADE,
3567
    ADD CONSTRAINT account_offsets_ibfk_2 FOREIGN KEY (credit_id) REFERENCES account_credits (credit_id) ON DELETE CASCADE ON UPDATE CASCADE;
3568
3523
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3569
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3524
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3570
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3525
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3571
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +190 lines)
Lines 37-42 use Getopt::Long; Link Here
37
use C4::Context;
37
use C4::Context;
38
use C4::Installer;
38
use C4::Installer;
39
use C4::Dates;
39
use C4::Dates;
40
use Koha::Database;
40
41
41
use MARC::Record;
42
use MARC::Record;
42
use MARC::File::XML ( BinaryEncoding => 'utf8' );
43
use MARC::File::XML ( BinaryEncoding => 'utf8' );
Lines 7257-7262 if ( CheckVersion($DBversion) ) { Link Here
7257
7258
7258
    $dbh->{AutoCommit} = 1;
7259
    $dbh->{AutoCommit} = 1;
7259
    $dbh->{RaiseError} = 0;
7260
    $dbh->{RaiseError} = 0;
7261
   SetVersion ($DBversion);
7260
}
7262
}
7261
7263
7262
$DBversion = "3.13.00.031";
7264
$DBversion = "3.13.00.031";
Lines 8814-8820 if ( CheckVersion($DBversion) ) { Link Here
8814
    $dbh->do("ALTER TABLE  `biblioitems` CHANGE  `cn_sort`  `cn_sort` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL");
8816
    $dbh->do("ALTER TABLE  `biblioitems` CHANGE  `cn_sort`  `cn_sort` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL");
8815
    $dbh->do("ALTER TABLE  `deletedbiblioitems` CHANGE  `cn_sort`  `cn_sort` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL");
8817
    $dbh->do("ALTER TABLE  `deletedbiblioitems` CHANGE  `cn_sort`  `cn_sort` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL");
8816
    print "Upgrade to $DBversion done (Bug 12424 - ddc sorting of call numbers truncates long Cutter parts)\n";
8818
    print "Upgrade to $DBversion done (Bug 12424 - ddc sorting of call numbers truncates long Cutter parts)\n";
8817
    SetVersion ($DBversion);
8819
    SetVersion($DBversion);
8818
}
8820
}
8819
8821
8820
$DBversion = "3.17.00.030";
8822
$DBversion = "3.17.00.030";
Lines 9902-9907 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
9902
    SetVersion ($DBversion);
9904
    SetVersion ($DBversion);
9903
}
9905
}
9904
9906
9907
$DBversion = "XXX";
9908
if ( CheckVersion($DBversion) ) {
9909
    $dbh->do(q{
9910
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
9911
    });
9912
    $dbh->do(q{
9913
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
9914
    });
9915
    $dbh->do(q{
9916
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
9917
    });
9918
9919
    $dbh->do(q{
9920
        UPDATE accountlines a LEFT JOIN issues i USING ( borrowernumber, itemnumber ) SET accounttype = 'F' WHERE i.issue_id IS NULL
9921
    });
9922
9923
    $dbh->do("
9924
        CREATE TABLE IF NOT EXISTS account_credits (
9925
            credit_id int(11) NOT NULL AUTO_INCREMENT,
9926
            borrowernumber int(11) NOT NULL,
9927
            `type` varchar(255) NOT NULL,
9928
            amount_received decimal(28,6) DEFAULT NULL,
9929
            amount_paid decimal(28,6) NOT NULL,
9930
            amount_remaining decimal(28,6) NOT NULL,
9931
            amount_voided decimal(28,6) NULL DEFAULT NULL,
9932
            notes text,
9933
            branchcode VARCHAR( 10 ) NULL DEFAULT NULL,
9934
            manager_id int(11) DEFAULT NULL,
9935
            created_on timestamp NULL DEFAULT NULL,
9936
            updated_on timestamp NULL DEFAULT NULL,
9937
            PRIMARY KEY (credit_id),
9938
            KEY borrowernumber (borrowernumber),
9939
            KEY branchcode (branchcode)
9940
        ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
9941
    ");
9942
    $dbh->do("
9943
        CREATE TABLE IF NOT EXISTS account_debits (
9944
            debit_id int(11) NOT NULL AUTO_INCREMENT,
9945
            borrowernumber int(11) NOT NULL DEFAULT '0',
9946
            itemnumber int(11) DEFAULT NULL,
9947
            issue_id int(11) DEFAULT NULL,
9948
            `type` varchar(255) NOT NULL,
9949
            accruing tinyint(1) NOT NULL DEFAULT '0',
9950
            amount_original decimal(28,6) DEFAULT NULL,
9951
            amount_outstanding decimal(28,6) DEFAULT NULL,
9952
            amount_last_increment decimal(28,6) DEFAULT NULL,
9953
            description mediumtext,
9954
            notes text,
9955
            branchcode VARCHAR( 10 ) NULL DEFAULT NULL,
9956
            manager_id int(11) DEFAULT NULL,
9957
            created_on timestamp NULL DEFAULT NULL,
9958
            updated_on timestamp NULL DEFAULT NULL,
9959
            PRIMARY KEY (debit_id),
9960
            KEY acctsborridx (borrowernumber),
9961
            KEY itemnumber (itemnumber),
9962
            KEY borrowernumber (borrowernumber),
9963
            KEY issue_id (issue_id),
9964
            KEY branchcode (branchcode)
9965
        ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
9966
    ");
9967
9968
    $dbh->do("
9969
        CREATE TABLE account_offsets (
9970
            offset_id int(11) NOT NULL AUTO_INCREMENT,
9971
            debit_id int(11) DEFAULT NULL,
9972
            credit_id int(11) DEFAULT NULL,
9973
            `type` varchar(255) DEFAULT NULL,
9974
            amount decimal(28,6) NOT NULL COMMENT 'A positive number here represents a payment, a negative is a increase in a fine.',
9975
            created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
9976
            PRIMARY KEY (offset_id),
9977
            KEY fee_id (debit_id),
9978
            KEY payment_id (credit_id)
9979
        ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
9980
    ");
9981
9982
    $dbh->do("
9983
        ALTER TABLE `account_credits`
9984
          ADD CONSTRAINT account_credits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
9985
          ADD CONSTRAINT account_credits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE;
9986
    ");
9987
    $dbh->do("
9988
        ALTER TABLE `account_debits`
9989
          ADD CONSTRAINT account_debits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
9990
          ADD CONSTRAINT account_debits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE;
9991
    ");
9992
    $dbh->do("
9993
        ALTER TABLE `account_offsets`
9994
          ADD CONSTRAINT account_offsets_ibfk_1 FOREIGN KEY (debit_id) REFERENCES account_debits (debit_id) ON DELETE CASCADE ON UPDATE CASCADE,
9995
          ADD CONSTRAINT account_offsets_ibfk_2 FOREIGN KEY (credit_id) REFERENCES account_credits (credit_id) ON DELETE CASCADE ON UPDATE CASCADE;
9996
    ");
9997
9998
    $dbh->do("
9999
        ALTER TABLE borrowers ADD account_balance DECIMAL( 28, 6 ) NOT NULL;
10000
    ");
10001
10002
    my $schema = Koha::Database->new()->schema;
10003
    my $debit_rs = $schema->resultset('AccountDebit');
10004
    my $credit_rs = $schema->resultset('AccountCredit');
10005
    my $issues_rs = $schema->resultset('Issue');
10006
10007
    use Koha::Accounts::DebitTypes;
10008
    use Koha::Accounts::CreditTypes;
10009
10010
    my $debit_types_map = {
10011
        'A'    => Koha::Accounts::DebitTypes::AccountManagementFee,
10012
        'F'    => Koha::Accounts::DebitTypes::Fine,
10013
        'FU'   => Koha::Accounts::DebitTypes::Fine,
10014
        'L'    => Koha::Accounts::DebitTypes::Lost,
10015
        'M'    => Koha::Accounts::DebitTypes::Sundry,
10016
        'N'    => Koha::Accounts::DebitTypes::NewCard,
10017
        'Rent' => Koha::Accounts::DebitTypes::Rental,
10018
    };
10019
10020
    my $credit_types_map = {
10021
        'FOR' => Koha::Accounts::CreditTypes::Forgiven,
10022
        'LR'  => Koha::Accounts::CreditTypes::Found,
10023
        'Pay' => Koha::Accounts::CreditTypes::Payment,
10024
        'PAY' => Koha::Accounts::CreditTypes::Payment,
10025
        'WO'  => Koha::Accounts::CreditTypes::WriteOff,
10026
        'W'   => Koha::Accounts::CreditTypes::WriteOff,
10027
        'C'   => Koha::Accounts::CreditTypes::Credit,
10028
        'CR'  => Koha::Accounts::CreditTypes::Credit,
10029
    };
10030
10031
    my $sth = $dbh->prepare("SELECT * FROM accountlines");
10032
    $sth->execute();
10033
    while ( my $a = $sth->fetchrow_hashref() ) {
10034
        if ( $debit_types_map->{ $a->{accounttype} } ) {
10035
            $debit_rs->create(
10036
                {
10037
                    borrowernumber     => $a->{borrowernumber},
10038
                    itemnumber         => $a->{itemnumber},
10039
                    amount_original    => $a->{amount},
10040
                    amount_outstanding => $a->{amountoutstanding},
10041
                    created_on         => $a->{timestamp},
10042
                    description        => $a->{description},
10043
                    notes              => $a->{note},
10044
                    manager_id         => $a->{manager_id},
10045
                    accruing           => $a->{accounttype} eq 'FU',
10046
                    type     => $debit_types_map->{ $a->{accounttype} },
10047
                    issue_id => $a->{accounttype} eq 'FU'
10048
                    ? $issues_rs->single(
10049
                        {
10050
                            borrowernumber => $a->{borrowernumber},
10051
                            itemnumber     => $a->{itemnumber},
10052
                        }
10053
                      )->issue_id()
10054
                    : undef,
10055
                }
10056
            );
10057
        }
10058
        elsif ( $credit_types_map->{ $a->{accounttype} } ) {
10059
            $credit_rs->create(
10060
                {
10061
                    borrowernumber   => $a->{borrowernumber},
10062
                    amount_paid      => $a->{amount} * -1,
10063
                    amount_remaining => $a->{amountoutstanding} * -1,
10064
                    created_on       => $a->{timestamp},
10065
                    notes            => $a->{note},
10066
                    manager_id       => $a->{manager_id},
10067
                    type => $credit_types_map->{ $a->{accounttype} },
10068
                }
10069
            );
10070
        }
10071
        else {
10072
            # Everything else must be a MANUAL_INV
10073
            $debit_rs->create(
10074
                {
10075
                    borrowernumber     => $a->{borrowernumber},
10076
                    itemnumber         => $a->{itemnumber},
10077
                    amount_original    => $a->{amount},
10078
                    amount_outstanding => $a->{amountoutstanding},
10079
                    created_on         => $a->{timestamp},
10080
                    description        => $a->{description},
10081
                    notes              => $a->{note},
10082
                    manager_id         => $a->{manager_id},
10083
                    type               => Koha::Accounts::DebitTypes::Sundry,
10084
                }
10085
            );
10086
        }
10087
    }
10088
10089
    print "Upgrade to $DBversion done ( Bug 6427 - Rewrite of the accounts system )\n";
10090
    SetVersion ($DBversion);
10091
}
10092
10093
9905
=head1 FUNCTIONS
10094
=head1 FUNCTIONS
9906
10095
9907
=head2 TableExists($table)
10096
=head2 TableExists($table)
9908
- 

Return to bug 6427