Bugzilla – Attachment 92058 Details for
Bug 23321
Add 'cash registers' to the accounts system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23321: [DO NOT PUSH] DBIC Classes
Bug-23321-DO-NOT-PUSH-DBIC-Classes.patch (text/plain), 5.86 KB, created by
Martin Renvoize (ashimema)
on 2019-08-08 11:32:04 UTC
(
hide
)
Description:
Bug 23321: [DO NOT PUSH] DBIC Classes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-08-08 11:32:04 UTC
Size:
5.86 KB
patch
obsolete
>From d45befc8697dbf978ab98b65dab96add8b8a3c1c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 16 Jul 2019 17:11:26 +0100 >Subject: [PATCH] Bug 23321: [DO NOT PUSH] DBIC Classes > >--- > Koha/Schema/Result/Accountline.pm | 32 +++++- > Koha/Schema/Result/Branch.pm | 19 +++- > Koha/Schema/Result/CashRegister.pm | 153 +++++++++++++++++++++++++++++ > 3 files changed, 200 insertions(+), 4 deletions(-) > create mode 100644 Koha/Schema/Result/CashRegister.pm > >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >index 6864e00bb0..85530908ec 100644 >--- a/Koha/Schema/Result/Accountline.pm >+++ b/Koha/Schema/Result/Accountline.pm >@@ -105,6 +105,12 @@ __PACKAGE__->table("accountlines"); > is_foreign_key: 1 > is_nullable: 1 > >+=head2 register_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ > =head2 interface > > data_type: 'varchar' >@@ -154,6 +160,8 @@ __PACKAGE__->add_columns( > { data_type => "mediumtext", is_nullable => 1 }, > "manager_id", > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ "register_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "interface", > { data_type => "varchar", is_nullable => 0, size => 16 }, > "branchcode", >@@ -284,9 +292,29 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 register >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::CashRegister> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "register", >+ "Koha::Schema::Result::CashRegister", >+ { id => "register_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 17:00:42 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2NOxgVuaRQ+6oTqgYDqzBg >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-23 13:14:30 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:enYJhnQwgN6g9f25/bxuVw > > sub koha_objects_class { > 'Koha::Account::Lines'; >diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm >index b500147ea4..7f05b17fd6 100644 >--- a/Koha/Schema/Result/Branch.pm >+++ b/Koha/Schema/Result/Branch.pm >@@ -346,6 +346,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 cash_registers >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::CashRegister> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "cash_registers", >+ "Koha::Schema::Result::CashRegister", >+ { "foreign.branch" => "self.branchcode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 categories_branches > > Type: has_many >@@ -647,8 +662,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-29 15:02:52 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:y+tNq5YiUeUOyAwB4r6GHw >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-17 07:15:23 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qGiu+y4MHq5CvBQTj0m8QQ > > __PACKAGE__->add_columns( > '+pickup_location' => { is_boolean => 1 } >diff --git a/Koha/Schema/Result/CashRegister.pm b/Koha/Schema/Result/CashRegister.pm >new file mode 100644 >index 0000000000..ddd6d3e536 >--- /dev/null >+++ b/Koha/Schema/Result/CashRegister.pm >@@ -0,0 +1,153 @@ >+use utf8; >+package Koha::Schema::Result::CashRegister; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::CashRegister >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<cash_registers> >+ >+=cut >+ >+__PACKAGE__->table("cash_registers"); >+ >+=head1 ACCESSORS >+ >+=head2 id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+=head2 name >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 24 >+ >+=head2 description >+ >+ data_type: 'longtext' >+ is_nullable: 0 >+ >+=head2 branch >+ >+ data_type: 'varchar' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ size: 10 >+ >+=head2 branch_default >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ >+=head2 starting_float >+ >+ data_type: 'decimal' >+ is_nullable: 1 >+ size: [28,6] >+ >+=head2 archived >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "name", >+ { data_type => "varchar", is_nullable => 0, size => 24 }, >+ "description", >+ { data_type => "longtext", is_nullable => 0 }, >+ "branch", >+ { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, >+ "branch_default", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ "starting_float", >+ { data_type => "decimal", is_nullable => 1, size => [28, 6] }, >+ "archived", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<name> >+ >+=over 4 >+ >+=item * L</name> >+ >+=item * L</branch> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("name", ["name", "branch"]); >+ >+=head1 RELATIONS >+ >+=head2 accountlines >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Accountline> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "accountlines", >+ "Koha::Schema::Result::Accountline", >+ { "foreign.register_id" => "self.id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+=head2 branch >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Branch> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "branch", >+ "Koha::Schema::Result::Branch", >+ { branchcode => "branch" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-23 13:14:31 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TfGf0U/vWS7IviRlvDdE1w >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23321
:
91596
|
91597
|
91598
|
91599
|
91600
|
91601
|
91602
|
91621
|
92057
|
92058
|
92059
|
92060
|
92061
|
92062
|
92063
|
92064
|
92065
|
92083
|
92084
|
92085
|
92086
|
92087
|
92088
|
92089
|
92090
|
92091
|
92394
|
92395
|
92396
|
92397
|
92398
|
92399
|
92400
|
92401
|
92402
|
92467
|
92468
|
92469
|
92470
|
92471
|
92472
|
92473
|
92474
|
92475
|
92803
|
92804
|
92805
|
92806
|
92807
|
92808
|
92809
|
92810
|
92811
|
92812
|
92813
|
92814
|
92829
|
92879
|
92880
|
92881
|
92882
|
92883
|
92884
|
92885
|
92886
|
92887
|
92888
|
92889
|
93019
|
93020
|
93021
|
93022
|
93023
|
93024
|
93025
|
93026
|
93027
|
93028
|
93029
|
93030
|
93031
|
93032
|
93033
|
93034
|
93035
|
93188