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

(-)a/Koha/Account/DebitType.pm (-1 / +1 lines)
Lines 68-74 sub _library_limits { Link Here
68
=cut
68
=cut
69
69
70
sub _type {
70
sub _type {
71
    return 'AccountDebitType';
71
    return 'AccountDebitTypesBranch';
72
}
72
}
73
73
74
1;
74
1;
(-)a/Koha/Schema/Result/AccountDebitType.pm (-8 / +8 lines)
Lines 27-33 __PACKAGE__->table("account_debit_types"); Link Here
27
27
28
  data_type: 'varchar'
28
  data_type: 'varchar'
29
  is_nullable: 0
29
  is_nullable: 0
30
  size: 64
30
  size: 80
31
31
32
=head2 description
32
=head2 description
33
33
Lines 57-63 __PACKAGE__->table("account_debit_types"); Link Here
57
57
58
__PACKAGE__->add_columns(
58
__PACKAGE__->add_columns(
59
  "code",
59
  "code",
60
  { data_type => "varchar", is_nullable => 0, size => 64 },
60
  { data_type => "varchar", is_nullable => 0, size => 80 },
61
  "description",
61
  "description",
62
  { data_type => "varchar", is_nullable => 1, size => 200 },
62
  { data_type => "varchar", is_nullable => 1, size => 200 },
63
  "can_be_added_manually",
63
  "can_be_added_manually",
Lines 82-98 __PACKAGE__->set_primary_key("code"); Link Here
82
82
83
=head1 RELATIONS
83
=head1 RELATIONS
84
84
85
=head2 ac_debit_types_branches
85
=head2 account_debit_types_branches
86
86
87
Type: has_many
87
Type: has_many
88
88
89
Related object: L<Koha::Schema::Result::AcDebitTypesBranch>
89
Related object: L<Koha::Schema::Result::AccountDebitTypesBranch>
90
90
91
=cut
91
=cut
92
92
93
__PACKAGE__->has_many(
93
__PACKAGE__->has_many(
94
  "ac_debit_types_branches",
94
  "account_debit_types_branches",
95
  "Koha::Schema::Result::AcDebitTypesBranch",
95
  "Koha::Schema::Result::AccountDebitTypesBranch",
96
  { "foreign.debit_type_code" => "self.code" },
96
  { "foreign.debit_type_code" => "self.code" },
97
  { cascade_copy => 0, cascade_delete => 0 },
97
  { cascade_copy => 0, cascade_delete => 0 },
98
);
98
);
Lines 113-120 __PACKAGE__->has_many( Link Here
113
);
113
);
114
114
115
115
116
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-08 11:15:31
116
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33
117
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:a3+iyqpi4NVpNjDkr9HM/w
117
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cDUy38YCBUs7I7mIknaasQ
118
118
119
__PACKAGE__->add_columns(
119
__PACKAGE__->add_columns(
120
    '+is_system' => { is_boolean => 1 }
120
    '+is_system' => { is_boolean => 1 }
(-)a/Koha/Schema/Result/AcDebitTypesBranch.pm (-8 / +8 lines)
Lines 1-12 Link Here
1
use utf8;
1
use utf8;
2
package Koha::Schema::Result::AcDebitTypesBranch;
2
package Koha::Schema::Result::AccountDebitTypesBranch;
3
3
4
# Created by DBIx::Class::Schema::Loader
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
6
7
=head1 NAME
7
=head1 NAME
8
8
9
Koha::Schema::Result::AcDebitTypesBranch
9
Koha::Schema::Result::AccountDebitTypesBranch
10
10
11
=cut
11
=cut
12
12
Lines 15-25 use warnings; Link Here
15
15
16
use base 'DBIx::Class::Core';
16
use base 'DBIx::Class::Core';
17
17
18
=head1 TABLE: C<ac_debit_types_branches>
18
=head1 TABLE: C<account_debit_types_branches>
19
19
20
=cut
20
=cut
21
21
22
__PACKAGE__->table("ac_debit_types_branches");
22
__PACKAGE__->table("account_debit_types_branches");
23
23
24
=head1 ACCESSORS
24
=head1 ACCESSORS
25
25
Lines 28-34 __PACKAGE__->table("ac_debit_types_branches"); Link Here
28
  data_type: 'varchar'
28
  data_type: 'varchar'
29
  is_foreign_key: 1
29
  is_foreign_key: 1
30
  is_nullable: 1
30
  is_nullable: 1
31
  size: 64
31
  size: 80
32
32
33
=head2 branchcode
33
=head2 branchcode
34
34
Lines 41-47 __PACKAGE__->table("ac_debit_types_branches"); Link Here
41
41
42
__PACKAGE__->add_columns(
42
__PACKAGE__->add_columns(
43
  "debit_type_code",
43
  "debit_type_code",
44
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 64 },
44
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
45
  "branchcode",
45
  "branchcode",
46
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
46
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
47
);
47
);
Lines 89-96 __PACKAGE__->belongs_to( Link Here
89
);
89
);
90
90
91
91
92
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-04 07:57:30
92
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33
93
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uVA4axnWjQjFOPqvM0hqyw
93
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HFOAT6jt7WwLp0myHu/dDA
94
94
95
95
96
# You can replace this text with custom code or comments, and it will be preserved on regeneration
96
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/Accountline.pm (-4 / +4 lines)
Lines 74-80 __PACKAGE__->table("accountlines"); Link Here
74
  data_type: 'varchar'
74
  data_type: 'varchar'
75
  is_foreign_key: 1
75
  is_foreign_key: 1
76
  is_nullable: 1
76
  is_nullable: 1
77
  size: 64
77
  size: 80
78
78
79
=head2 status
79
=head2 status
80
80
Lines 151-157 __PACKAGE__->add_columns( Link Here
151
  "accounttype",
151
  "accounttype",
152
  { data_type => "varchar", is_nullable => 1, size => 80 },
152
  { data_type => "varchar", is_nullable => 1, size => 80 },
153
  "debit_type_code",
153
  "debit_type_code",
154
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 64 },
154
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
155
  "status",
155
  "status",
156
  { data_type => "varchar", is_nullable => 1, size => 16 },
156
  { data_type => "varchar", is_nullable => 1, size => 16 },
157
  "payment_type",
157
  "payment_type",
Lines 342-349 __PACKAGE__->belongs_to( Link Here
342
);
342
);
343
343
344
344
345
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-08 11:15:31
345
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33
346
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1Vgkg0JR7RqmkniOmUoUhQ
346
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WZ2Mcd5gwQc69yDSEsJHGA
347
347
348
sub koha_objects_class {
348
sub koha_objects_class {
349
    'Koha::Account::Lines';
349
    'Koha::Account::Lines';
(-)a/Koha/Schema/Result/Branch.pm (-6 / +6 lines)
Lines 211-227 __PACKAGE__->set_primary_key("branchcode"); Link Here
211
211
212
=head1 RELATIONS
212
=head1 RELATIONS
213
213
214
=head2 ac_debit_types_branches
214
=head2 account_debit_types_branches
215
215
216
Type: has_many
216
Type: has_many
217
217
218
Related object: L<Koha::Schema::Result::AcDebitTypesBranch>
218
Related object: L<Koha::Schema::Result::AccountDebitTypesBranch>
219
219
220
=cut
220
=cut
221
221
222
__PACKAGE__->has_many(
222
__PACKAGE__->has_many(
223
  "ac_debit_types_branches",
223
  "account_debit_types_branches",
224
  "Koha::Schema::Result::AcDebitTypesBranch",
224
  "Koha::Schema::Result::AccountDebitTypesBranch",
225
  { "foreign.branchcode" => "self.branchcode" },
225
  { "foreign.branchcode" => "self.branchcode" },
226
  { cascade_copy => 0, cascade_delete => 0 },
226
  { cascade_copy => 0, cascade_delete => 0 },
227
);
227
);
Lines 692-699 __PACKAGE__->has_many( Link Here
692
);
692
);
693
693
694
694
695
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-09-26 15:59:23
695
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33
696
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IiEBfDpMBAi9cv7OqevVRQ
696
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HCQKMSgKhVKtDSrvs1IeRg
697
697
698
__PACKAGE__->add_columns(
698
__PACKAGE__->add_columns(
699
    '+pickup_location' => { is_boolean => 1 }
699
    '+pickup_location' => { is_boolean => 1 }
(-)a/installer/data/mysql/atomicupdate/bug_23049_debit.perl (-6 / +6 lines)
Lines 5-11 if ( CheckVersion($DBversion) ) { Link Here
5
    $dbh->do(
5
    $dbh->do(
6
        qq{
6
        qq{
7
            CREATE TABLE IF NOT EXISTS account_debit_types (
7
            CREATE TABLE IF NOT EXISTS account_debit_types (
8
              code varchar(64) NOT NULL,
8
              code varchar(80) NOT NULL,
9
              description varchar(200) NULL,
9
              description varchar(200) NULL,
10
              can_be_added_manually tinyint(4) NOT NULL DEFAULT 1,
10
              can_be_added_manually tinyint(4) NOT NULL DEFAULT 1,
11
              default_amount decimal(28, 6) NULL,
11
              default_amount decimal(28, 6) NULL,
Lines 15-25 if ( CheckVersion($DBversion) ) { Link Here
15
          }
15
          }
16
    );
16
    );
17
17
18
    # Adding ac_debit_types_branches
18
    # Adding account_debit_types_branches
19
    $dbh->do(
19
    $dbh->do(
20
        qq{
20
        qq{
21
            CREATE TABLE IF NOT EXISTS ac_debit_types_branches (
21
            CREATE TABLE IF NOT EXISTS account_debit_types_branches (
22
                debit_type_code VARCHAR(64),
22
                debit_type_code VARCHAR(80),
23
                branchcode VARCHAR(10),
23
                branchcode VARCHAR(10),
24
                FOREIGN KEY (debit_type_code) REFERENCES account_debit_types(code) ON DELETE CASCADE,
24
                FOREIGN KEY (debit_type_code) REFERENCES account_debit_types(code) ON DELETE CASCADE,
25
                FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
25
                FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
Lines 93-99 if ( CheckVersion($DBversion) ) { Link Here
93
              is_system
93
              is_system
94
            )
94
            )
95
            SELECT
95
            SELECT
96
              SUBSTR(authorised_value, 1, 64),
96
              SUBSTR(authorised_value, 1, 80),
97
              lib,
97
              lib,
98
              authorised_value,
98
              authorised_value,
99
              1,
99
              1,
Lines 111-117 if ( CheckVersion($DBversion) ) { Link Here
111
            qq{
111
            qq{
112
                ALTER IGNORE TABLE accountlines
112
                ALTER IGNORE TABLE accountlines
113
                ADD
113
                ADD
114
                  debit_type_code varchar(64) DEFAULT NULL
114
                  debit_type_code varchar(80) DEFAULT NULL
115
                AFTER
115
                AFTER
116
                  accounttype
116
                  accounttype
117
              }
117
              }
(-)a/installer/data/mysql/kohastructure.sql (-7 / +6 lines)
Lines 2627-2633 CREATE TABLE `cash_registers` ( Link Here
2627
2627
2628
DROP TABLE IF EXISTS `account_debit_types`;
2628
DROP TABLE IF EXISTS `account_debit_types`;
2629
CREATE TABLE `account_debit_types` (
2629
CREATE TABLE `account_debit_types` (
2630
  `code` varchar(64) NOT NULL,
2630
  `code` varchar(80) NOT NULL,
2631
  `description` varchar(200) DEFAULT NULL,
2631
  `description` varchar(200) DEFAULT NULL,
2632
  `can_be_added_manually` tinyint(4) NOT NULL DEFAULT 1,
2632
  `can_be_added_manually` tinyint(4) NOT NULL DEFAULT 1,
2633
  `default_amount` decimal(28,6) DEFAULT NULL,
2633
  `default_amount` decimal(28,6) DEFAULT NULL,
Lines 2636-2647 CREATE TABLE `account_debit_types` ( Link Here
2636
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2636
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2637
2637
2638
--
2638
--
2639
-- Table structure for table `ac_debit_types_branches`
2639
-- Table structure for table `account_debit_types_branches`
2640
--
2640
--
2641
2641
2642
DROP TABLE IF EXISTS `ac_debit_types_branches`;
2642
DROP TABLE IF EXISTS `account_debit_types_branches`;
2643
CREATE TABLE `ac_debit_types_branches` (
2643
CREATE TABLE `account_debit_types_branches` (
2644
    `debit_type_code` VARCHAR(64),
2644
    `debit_type_code` VARCHAR(80),
2645
    `branchcode` VARCHAR(10),
2645
    `branchcode` VARCHAR(10),
2646
    FOREIGN KEY (`debit_type_code`) REFERENCES `account_debit_types` (`code`) ON DELETE CASCADE,
2646
    FOREIGN KEY (`debit_type_code`) REFERENCES `account_debit_types` (`code`) ON DELETE CASCADE,
2647
    FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE
2647
    FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE
Lines 2661-2667 CREATE TABLE `accountlines` ( Link Here
2661
  `amount` decimal(28,6) default NULL,
2661
  `amount` decimal(28,6) default NULL,
2662
  `description` LONGTEXT,
2662
  `description` LONGTEXT,
2663
  `accounttype` varchar(80) default NULL,
2663
  `accounttype` varchar(80) default NULL,
2664
  `debit_type_code` varchar(64) default NULL,
2664
  `debit_type_code` varchar(80) default NULL,
2665
  `status` varchar(16) default NULL,
2665
  `status` varchar(16) default NULL,
2666
  `payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE
2666
  `payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE
2667
  `amountoutstanding` decimal(28,6) default NULL,
2667
  `amountoutstanding` decimal(28,6) default NULL,
2668
- 

Return to bug 23049