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

Return to bug 6427