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

(-)a/Koha/Acquisition/Order.pm (-11 / +19 lines)
Lines 113-155 sub add_item { Link Here
113
113
114
=head3 basket
114
=head3 basket
115
115
116
    my $basket = Koha::Acquisition::Orders->find( $id )->basket;
116
    my $basket = $order->basket;
117
117
118
Returns the basket associated to the order.
118
Returns the I<Koha::Acquisition::Basket> object for the basket associated
119
to the order.
119
120
120
=cut
121
=cut
121
122
122
sub basket {
123
sub basket {
123
    my ( $self )  = @_;
124
    my ( $self )  = @_;
124
    my $basket_rs = $self->_result->basketno;
125
    my $basket_rs = $self->_result->basket;
125
    return Koha::Acquisition::Basket->_new_from_dbic( $basket_rs );
126
    return Koha::Acquisition::Basket->_new_from_dbic( $basket_rs );
126
}
127
}
127
128
128
=head3 fund
129
=head3 fund
129
130
130
    my $fund = $order->fund
131
    my $fund = $order->fund;
131
132
132
Returns the fund (aqbudgets) associated to the order.
133
Returns the I<Koha::Acquisition::Fund> object for the fund (aqbudgets)
134
associated to the order.
133
135
134
=cut
136
=cut
135
137
136
sub fund {
138
sub fund {
137
    my ( $self )  = @_;
139
    my ( $self )  = @_;
138
    my $fund_rs = $self->_result->budget;
140
    my $fund_rs = $self->_result->fund;
139
    return Koha::Acquisition::Fund->_new_from_dbic( $fund_rs );
141
    return Koha::Acquisition::Fund->_new_from_dbic( $fund_rs );
140
}
142
}
141
143
142
=head3 invoice
144
=head3 invoice
143
145
144
    my $invoice = $order->invoice
146
    my $invoice = $order->invoice;
145
147
146
Returns the invoice associated to the order.
148
Returns the I<Koha::Acquisition::Invoice> object for the invoice associated
149
to the order.
150
151
It returns B<undef> if no linked invoice is found.
147
152
148
=cut
153
=cut
149
154
150
sub invoice {
155
sub invoice {
151
    my ( $self )  = @_;
156
    my ( $self )  = @_;
152
    my $invoice_rs = $self->_result->invoiceid;
157
    my $invoice_rs = $self->_result->invoice;
153
    return unless $invoice_rs;
158
    return unless $invoice_rs;
154
    return Koha::Acquisition::Invoice->_new_from_dbic( $invoice_rs );
159
    return Koha::Acquisition::Invoice->_new_from_dbic( $invoice_rs );
155
}
160
}
Lines 158-170 sub invoice { Link Here
158
163
159
    my $subscription = $order->subscription
164
    my $subscription = $order->subscription
160
165
161
Returns the subscription associated to the order.
166
Returns the I<Koha::Subscription> object for the subscription associated
167
to the order.
168
169
It returns B<undef> if no linked subscription is found.
162
170
163
=cut
171
=cut
164
172
165
sub subscription {
173
sub subscription {
166
    my ( $self )  = @_;
174
    my ( $self )  = @_;
167
    my $subscription_rs = $self->_result->subscriptionid;
175
    my $subscription_rs = $self->_result->subscription;
168
    return unless $subscription_rs;
176
    return unless $subscription_rs;
169
    return Koha::Subscription->_new_from_dbic( $subscription_rs );
177
    return Koha::Subscription->_new_from_dbic( $subscription_rs );
170
}
178
}
(-)a/Koha/Schema/Result/Aqorder.pm (-1 / +43 lines)
Lines 664-669 __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber"); Link Here
664
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-08-31 11:51:37
664
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-08-31 11:51:37
665
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GQEXetlivZm7buQohl8m4A
665
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GQEXetlivZm7buQohl8m4A
666
666
667
__PACKAGE__->belongs_to(
668
  "basket",
669
  "Koha::Schema::Result::Aqbasket",
670
  { "foreign.basketno" => "self.basketno" },
671
  {
672
    is_deferrable => 1,
673
    join_type     => "LEFT",
674
    on_delete     => "CASCADE",
675
    on_update     => "CASCADE",
676
  },
677
);
678
667
__PACKAGE__->belongs_to(
679
__PACKAGE__->belongs_to(
668
  "biblio",
680
  "biblio",
669
  "Koha::Schema::Result::Biblio",
681
  "Koha::Schema::Result::Biblio",
Lines 676-681 __PACKAGE__->belongs_to( Link Here
676
  },
688
  },
677
);
689
);
678
690
691
__PACKAGE__->belongs_to(
692
  "fund",
693
  "Koha::Schema::Result::Aqbudget",
694
  { "foreign.budget_id" => "self.budget_id" },
695
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
696
);
697
698
__PACKAGE__->belongs_to(
699
  "invoice",
700
  "Koha::Schema::Result::Aqinvoice",
701
  { "foreign.invoiceid" => "self.invoiceid" },
702
  {
703
    is_deferrable => 1,
704
    join_type     => "LEFT",
705
    on_delete     => "SET NULL",
706
    on_update     => "CASCADE",
707
  },
708
);
709
710
__PACKAGE__->belongs_to(
711
  "subscription",
712
  "Koha::Schema::Result::Subscription",
713
  { "foreign.subscriptionid" => "self.subscriptionid" },
714
  {
715
    is_deferrable => 1,
716
    join_type     => "LEFT",
717
    on_delete     => "CASCADE",
718
    on_update     => "CASCADE",
719
  },
720
);
721
679
sub koha_objects_class {
722
sub koha_objects_class {
680
    'Koha::Acquisition::Orders';
723
    'Koha::Acquisition::Orders';
681
}
724
}
682
- 

Return to bug 24440