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 2734-2783 CREATE TABLE `messages` ( -- circulation messages left via the patron's check ou Link Here
2734
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2735
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2735
2736
2736
--
2737
--
2737
-- Table structure for table `accountlines`
2738
--
2739
2740
DROP TABLE IF EXISTS `accountlines`;
2741
CREATE TABLE `accountlines` (
2742
  `accountlines_id` int(11) NOT NULL AUTO_INCREMENT,
2743
  `borrowernumber` int(11) NOT NULL default 0,
2744
  `accountno` smallint(6) NOT NULL default 0,
2745
  `itemnumber` int(11) default NULL,
2746
  `date` date default NULL,
2747
  `amount` decimal(28,6) default NULL,
2748
  `description` mediumtext,
2749
  `dispute` mediumtext,
2750
  `accounttype` varchar(5) default NULL,
2751
  `amountoutstanding` decimal(28,6) default NULL,
2752
  `lastincrement` decimal(28,6) default NULL,
2753
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2754
  `notify_id` int(11) NOT NULL default 0,
2755
  `notify_level` int(2) NOT NULL default 0,
2756
  `note` text NULL default NULL,
2757
  `manager_id` int(11) NULL,
2758
  PRIMARY KEY (`accountlines_id`),
2759
  KEY `acctsborridx` (`borrowernumber`),
2760
  KEY `timeidx` (`timestamp`),
2761
  KEY `itemnumber` (`itemnumber`),
2762
  CONSTRAINT `accountlines_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2763
  CONSTRAINT `accountlines_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL
2764
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2765
2766
--
2767
-- Table structure for table `accountoffsets`
2768
--
2769
2770
DROP TABLE IF EXISTS `accountoffsets`;
2771
CREATE TABLE `accountoffsets` (
2772
  `borrowernumber` int(11) NOT NULL default 0,
2773
  `accountno` smallint(6) NOT NULL default 0,
2774
  `offsetaccount` smallint(6) NOT NULL default 0,
2775
  `offsetamount` decimal(28,6) default NULL,
2776
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2777
  CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2778
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2779
2780
--
2781
-- Table structure for table `action_logs`
2738
-- Table structure for table `action_logs`
2782
--
2739
--
2783
2740
Lines 3502-3507 CREATE TABLE items_search_fields ( Link Here
3502
    ON DELETE SET NULL ON UPDATE CASCADE
3459
    ON DELETE SET NULL ON UPDATE CASCADE
3503
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3460
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3504
3461
3462
--
3463
-- Table structure for table 'account_credits'
3464
--
3465
DROP TABLE IF EXISTS account_credits;
3466
CREATE TABLE IF account_credits (
3467
    credit_id int(11) NOT NULL AUTO_INCREMENT,     -- The unique id for this credit
3468
    borrowernumber int(11) NOT NULL,               -- The borrower this credit applies to
3469
    `type` varchar(255) NOT NULL,                  -- The type of credit this is ( defined by Koha::Accounts::CreditTypes )
3470
    amount_received decimal(28,6) DEFAULT NULL,    -- If this was a cash payment, the amount of money given
3471
    amount_paid decimal(28,6) NOT NULL,            -- The actual ammount paid, if less than amount_recieved, change was given back
3472
    amount_remaining decimal(28,6) NOT NULL,       -- The amount of this credit that has not been applied to outstanding debits
3473
    amount_voided decimal(28,6) NULL DEFAULT NULL, -- The amount of this credit was for before it was voided
3474
    notes text,                                    -- Misc notes for this credit
3475
    branchcode VARCHAR( 10 ) NULL DEFAULT NULL,    -- Branchcode where the credit was created ( if any )
3476
    manager_id int(11) DEFAULT NULL,               -- The borrowernumber of the user who created this credit ( if any )
3477
    created_on timestamp NULL DEFAULT NULL,        -- Timestamp for when this credit was created
3478
    updated_on timestamp NULL DEFAULT NULL,        -- Timestamp for when this credit was last modified
3479
    PRIMARY KEY (credit_id),
3480
    KEY borrowernumber (borrowernumber),
3481
    KEY branchcode (branchcode)
3482
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3483
3484
--
3485
-- Constraints for table `account_credits`
3486
--
3487
ALTER TABLE `account_credits`
3488
  ADD CONSTRAINT account_credits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
3489
  ADD CONSTRAINT account_credits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE;
3490
3491
--
3492
-- Table structure for table 'account_debits'
3493
--
3494
3495
DROP TABLE IF EXISTS account_debits;
3496
CREATE TABLE account_debits (
3497
    debit_id int(11) NOT NULL AUTO_INCREMENT,           -- The unique id for this debit
3498
    borrowernumber int(11) NOT NULL DEFAULT '0',        -- The borrower this debit applies to
3499
    itemnumber int(11) DEFAULT NULL,                    -- The item related to this debit ( for fines, lost fees, etc )
3500
    issue_id int(11) DEFAULT NULL,                      -- The checkout this debit is related to ( again, for fines, lost fees, etc )
3501
    `type` varchar(255) NOT NULL,                       -- The type of debit this is ( defined by Koha::Accounts::DebitTypes )
3502
    accruing tinyint(1) NOT NULL DEFAULT '0',           -- Boolean flag, tells of if this is a fine that is still accruing
3503
    amount_original decimal(28,6) DEFAULT NULL,         -- The total amount of this debit
3504
    amount_outstanding decimal(28,6) DEFAULT NULL,      -- The amount still owed on this debit
3505
    amount_last_increment decimal(28,6) DEFAULT NULL,   -- The amount by which this debit last changed
3506
    description mediumtext,                             -- The description for this debit
3507
    notes text,                                         -- Misc notes for this debit
3508
    branchcode VARCHAR( 10 ) NULL DEFAULT NULL,         -- Branchcode where the debit was created ( if any )
3509
    manager_id int(11) DEFAULT NULL,                    -- The borrowernumber of the user who created this debit ( if any )
3510
    created_on timestamp NULL DEFAULT NULL,             -- Timestamp for when this credit was created
3511
    updated_on timestamp NULL DEFAULT NULL,             -- Timestamp for when this credit was last modified
3512
    PRIMARY KEY (debit_id),
3513
    KEY acctsborridx (borrowernumber),
3514
    KEY itemnumber (itemnumber),
3515
    KEY borrowernumber (borrowernumber),
3516
    KEY issue_id (issue_id),
3517
    KEY branchcode (branchcode)
3518
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3519
3520
--
3521
-- Constraints for table `account_debits`
3522
--
3523
ALTER TABLE `account_debits`
3524
    ADD CONSTRAINT account_debits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
3525
    ADD CONSTRAINT account_debits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE;
3526
3527
--
3528
-- Table structure for table 'account_offsets'
3529
--
3530
3531
DROP TABLE IF EXISTS account_offsets;
3532
CREATE TABLE account_offsets (
3533
    offset_id int(11) NOT NULL AUTO_INCREMENT,                                              -- Unique id for this offset
3534
    debit_id int(11) DEFAULT NULL,                                                          -- Related debit
3535
    credit_id int(11) DEFAULT NULL,                                                         -- Related credit ( if any )
3536
    `type` varchar(255) DEFAULT NULL,                                                       -- The type of this offset ( defined by Koha::Accounts::OffsetTypes ), if any
3537
    amount decimal(28,6) NOT NULL,                                                          -- The amount of the offset, positive means patron owes more, negative means patron owes less
3538
    created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,    -- Timestamp for when this offset was created
3539
    PRIMARY KEY (offset_id),
3540
    KEY fee_id (debit_id),
3541
    KEY payment_id (credit_id)
3542
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3543
3544
--
3545
-- Constraints for table `account_offsets`
3546
--
3547
ALTER TABLE `account_offsets`
3548
    ADD CONSTRAINT account_offsets_ibfk_1 FOREIGN KEY (debit_id) REFERENCES account_debits (debit_id) ON DELETE CASCADE ON UPDATE CASCADE,
3549
    ADD CONSTRAINT account_offsets_ibfk_2 FOREIGN KEY (credit_id) REFERENCES account_credits (credit_id) ON DELETE CASCADE ON UPDATE CASCADE;
3550
3505
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3551
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3506
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3552
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3507
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3553
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +189 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 9666-9671 if ( CheckVersion($DBversion) ) { Link Here
9666
    $dbh->do(q|SET foreign_key_checks = 1|);;
9668
    $dbh->do(q|SET foreign_key_checks = 1|);;
9667
9669
9668
    print "Upgrade to $DBversion done (Bug 11944 - Convert DB tables to utf8_unicode_ci)\n";
9670
    print "Upgrade to $DBversion done (Bug 11944 - Convert DB tables to utf8_unicode_ci)\n";
9671
    SetVersion($DBversion);
9672
}
9673
9674
$DBversion = "3.19.00.XXX";
9675
if ( CheckVersion($DBversion) ) {
9676
    $dbh->do(q{
9677
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
9678
    });
9679
    $dbh->do(q{
9680
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
9681
    });
9682
    $dbh->do(q{
9683
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
9684
    });
9685
9686
    $dbh->do(q{
9687
        UPDATE accountlines a LEFT JOIN issues i USING ( borrowernumber, itemnumber ) SET accounttype = 'F' WHERE i.issue_id IS NULL
9688
    });
9689
9690
    $dbh->do("
9691
        CREATE TABLE IF NOT EXISTS account_credits (
9692
            credit_id int(11) NOT NULL AUTO_INCREMENT,
9693
            borrowernumber int(11) NOT NULL,
9694
            `type` varchar(255) NOT NULL,
9695
            amount_received decimal(28,6) DEFAULT NULL,
9696
            amount_paid decimal(28,6) NOT NULL,
9697
            amount_remaining decimal(28,6) NOT NULL,
9698
            amount_voided decimal(28,6) NULL DEFAULT NULL,
9699
            notes text,
9700
            branchcode VARCHAR( 10 ) NULL DEFAULT NULL,
9701
            manager_id int(11) DEFAULT NULL,
9702
            created_on timestamp NULL DEFAULT NULL,
9703
            updated_on timestamp NULL DEFAULT NULL,
9704
            PRIMARY KEY (credit_id),
9705
            KEY borrowernumber (borrowernumber),
9706
            KEY branchcode (branchcode)
9707
        ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
9708
    ");
9709
    $dbh->do("
9710
        CREATE TABLE IF NOT EXISTS account_debits (
9711
            debit_id int(11) NOT NULL AUTO_INCREMENT,
9712
            borrowernumber int(11) NOT NULL DEFAULT '0',
9713
            itemnumber int(11) DEFAULT NULL,
9714
            issue_id int(11) DEFAULT NULL,
9715
            `type` varchar(255) NOT NULL,
9716
            accruing tinyint(1) NOT NULL DEFAULT '0',
9717
            amount_original decimal(28,6) DEFAULT NULL,
9718
            amount_outstanding decimal(28,6) DEFAULT NULL,
9719
            amount_last_increment decimal(28,6) DEFAULT NULL,
9720
            description mediumtext,
9721
            notes text,
9722
            branchcode VARCHAR( 10 ) NULL DEFAULT NULL,
9723
            manager_id int(11) DEFAULT NULL,
9724
            created_on timestamp NULL DEFAULT NULL,
9725
            updated_on timestamp NULL DEFAULT NULL,
9726
            PRIMARY KEY (debit_id),
9727
            KEY acctsborridx (borrowernumber),
9728
            KEY itemnumber (itemnumber),
9729
            KEY borrowernumber (borrowernumber),
9730
            KEY issue_id (issue_id),
9731
            KEY branchcode (branchcode)
9732
        ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
9733
    ");
9734
9735
    $dbh->do("
9736
        CREATE TABLE account_offsets (
9737
            offset_id int(11) NOT NULL AUTO_INCREMENT,
9738
            debit_id int(11) DEFAULT NULL,
9739
            credit_id int(11) DEFAULT NULL,
9740
            `type` varchar(255) DEFAULT NULL,
9741
            amount decimal(28,6) NOT NULL COMMENT 'A positive number here represents a payment, a negative is a increase in a fine.',
9742
            created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
9743
            PRIMARY KEY (offset_id),
9744
            KEY fee_id (debit_id),
9745
            KEY payment_id (credit_id)
9746
        ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
9747
    ");
9748
9749
    $dbh->do("
9750
        ALTER TABLE `account_credits`
9751
          ADD CONSTRAINT account_credits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
9752
          ADD CONSTRAINT account_credits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE;
9753
    ");
9754
    $dbh->do("
9755
        ALTER TABLE `account_debits`
9756
          ADD CONSTRAINT account_debits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
9757
          ADD CONSTRAINT account_debits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE;
9758
    ");
9759
    $dbh->do("
9760
        ALTER TABLE `account_offsets`
9761
          ADD CONSTRAINT account_offsets_ibfk_1 FOREIGN KEY (debit_id) REFERENCES account_debits (debit_id) ON DELETE CASCADE ON UPDATE CASCADE,
9762
          ADD CONSTRAINT account_offsets_ibfk_2 FOREIGN KEY (credit_id) REFERENCES account_credits (credit_id) ON DELETE CASCADE ON UPDATE CASCADE;
9763
    ");
9764
9765
    $dbh->do("
9766
        ALTER TABLE borrowers ADD account_balance DECIMAL( 28, 6 ) NOT NULL;
9767
    ");
9768
9769
    my $schema = Koha::Database->new()->schema;
9770
    my $debit_rs = $schema->resultset('AccountDebit');
9771
    my $credit_rs = $schema->resultset('AccountCredit');
9772
    my $issues_rs = $schema->resultset('Issue');
9773
9774
    use Koha::Accounts::DebitTypes;
9775
    use Koha::Accounts::CreditTypes;
9776
9777
    my $debit_types_map = {
9778
        'A'    => Koha::Accounts::DebitTypes::AccountManagementFee,
9779
        'F'    => Koha::Accounts::DebitTypes::Fine,
9780
        'FU'   => Koha::Accounts::DebitTypes::Fine,
9781
        'L'    => Koha::Accounts::DebitTypes::Lost,
9782
        'M'    => Koha::Accounts::DebitTypes::Sundry,
9783
        'N'    => Koha::Accounts::DebitTypes::NewCard,
9784
        'Rent' => Koha::Accounts::DebitTypes::Rental,
9785
    };
9786
9787
    my $credit_types_map = {
9788
        'FOR' => Koha::Accounts::CreditTypes::Forgiven,
9789
        'LR'  => Koha::Accounts::CreditTypes::Found,
9790
        'Pay' => Koha::Accounts::CreditTypes::Payment,
9791
        'PAY' => Koha::Accounts::CreditTypes::Payment,
9792
        'WO'  => Koha::Accounts::CreditTypes::WriteOff,
9793
        'W'   => Koha::Accounts::CreditTypes::WriteOff,
9794
        'C'   => Koha::Accounts::CreditTypes::Credit,
9795
        'CR'  => Koha::Accounts::CreditTypes::Credit,
9796
    };
9797
9798
    my $sth = $dbh->prepare("SELECT * FROM accountlines");
9799
    $sth->execute();
9800
    while ( my $a = $sth->fetchrow_hashref() ) {
9801
        if ( $debit_types_map->{ $a->{accounttype} } ) {
9802
            $debit_rs->create(
9803
                {
9804
                    borrowernumber     => $a->{borrowernumber},
9805
                    itemnumber         => $a->{itemnumber},
9806
                    amount_original    => $a->{amount},
9807
                    amount_outstanding => $a->{amountoutstanding},
9808
                    created_on         => $a->{timestamp},
9809
                    description        => $a->{description},
9810
                    notes              => $a->{note},
9811
                    manager_id         => $a->{manager_id},
9812
                    accruing           => $a->{accounttype} eq 'FU',
9813
                    type     => $debit_types_map->{ $a->{accounttype} },
9814
                    issue_id => $a->{accounttype} eq 'FU'
9815
                    ? $issues_rs->single(
9816
                        {
9817
                            borrowernumber => $a->{borrowernumber},
9818
                            itemnumber     => $a->{itemnumber},
9819
                        }
9820
                      )->issue_id()
9821
                    : undef,
9822
                }
9823
            );
9824
        }
9825
        elsif ( $credit_types_map->{ $a->{accounttype} } ) {
9826
            $credit_rs->create(
9827
                {
9828
                    borrowernumber   => $a->{borrowernumber},
9829
                    amount_paid      => $a->{amount} * -1,
9830
                    amount_remaining => $a->{amountoutstanding} * -1,
9831
                    created_on       => $a->{timestamp},
9832
                    notes            => $a->{note},
9833
                    manager_id       => $a->{manager_id},
9834
                    type => $credit_types_map->{ $a->{accounttype} },
9835
                }
9836
            );
9837
        }
9838
        else {
9839
            # Everything else must be a MANUAL_INV
9840
            $debit_rs->create(
9841
                {
9842
                    borrowernumber     => $a->{borrowernumber},
9843
                    itemnumber         => $a->{itemnumber},
9844
                    amount_original    => $a->{amount},
9845
                    amount_outstanding => $a->{amountoutstanding},
9846
                    created_on         => $a->{timestamp},
9847
                    description        => $a->{description},
9848
                    notes              => $a->{note},
9849
                    manager_id         => $a->{manager_id},
9850
                    type               => Koha::Accounts::DebitTypes::Sundry,
9851
                }
9852
            );
9853
        }
9854
    }
9855
9856
    print "Upgrade to $DBversion done ( Bug 6427 - Rewrite of the accounts system )\n";
9669
    SetVersion ($DBversion);
9857
    SetVersion ($DBversion);
9670
}
9858
}
9671
9859
9672
- 

Return to bug 6427