2 package Koha::Schema::Result::Accountline;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::Accountline
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<accountlines>
22 __PACKAGE__->table("accountlines");
26 =head2 accountlines_id
51 data_type: 'timestamp'
52 datetime_undef_if_invalid: 1
66 =head2 credit_type_code
73 =head2 debit_type_code
86 autogenerated number for credits
100 optional authorised value PAYMENT_TYPE
102 =head2 amountoutstanding
110 data_type: 'timestamp'
111 datetime_undef_if_invalid: 1
112 default_value: current_timestamp
117 data_type: 'mediumtext'
145 the branchcode of the library where a payment was made, a manual invoice created, etc.
149 __PACKAGE__->add_columns(
151 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
153 { data_type => "integer", is_nullable => 1 },
155 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
157 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
160 data_type => "timestamp",
161 datetime_undef_if_invalid => 1,
165 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
167 { data_type => "longtext", is_nullable => 1 },
169 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
171 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
173 { data_type => "varchar", is_nullable => 1, size => 20 },
175 { data_type => "varchar", is_nullable => 1, size => 16 },
177 { data_type => "varchar", is_nullable => 1, size => 80 },
179 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
182 data_type => "timestamp",
183 datetime_undef_if_invalid => 1,
184 default_value => \"current_timestamp",
188 { data_type => "mediumtext", is_nullable => 1 },
190 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
192 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
194 { data_type => "varchar", is_nullable => 0, size => 16 },
196 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
203 =item * L</accountlines_id>
209 __PACKAGE__->set_primary_key("accountlines_id");
213 =head2 account_offsets_credits
217 Related object: L<Koha::Schema::Result::AccountOffset>
221 __PACKAGE__->has_many(
222 "account_offsets_credits",
223 "Koha::Schema::Result::AccountOffset",
224 { "foreign.credit_id" => "self.accountlines_id" },
225 { cascade_copy => 0, cascade_delete => 0 },
228 =head2 account_offsets_debits
232 Related object: L<Koha::Schema::Result::AccountOffset>
236 __PACKAGE__->has_many(
237 "account_offsets_debits",
238 "Koha::Schema::Result::AccountOffset",
239 { "foreign.debit_id" => "self.accountlines_id" },
240 { cascade_copy => 0, cascade_delete => 0 },
243 =head2 article_requests
247 Related object: L<Koha::Schema::Result::ArticleRequest>
251 __PACKAGE__->has_many(
253 "Koha::Schema::Result::ArticleRequest",
254 { "foreign.debit_id" => "self.accountlines_id" },
255 { cascade_copy => 0, cascade_delete => 0 },
258 =head2 borrowernumber
262 Related object: L<Koha::Schema::Result::Borrower>
266 __PACKAGE__->belongs_to(
268 "Koha::Schema::Result::Borrower",
269 { borrowernumber => "borrowernumber" },
273 on_delete => "SET NULL",
274 on_update => "CASCADE",
282 Related object: L<Koha::Schema::Result::Branch>
286 __PACKAGE__->belongs_to(
288 "Koha::Schema::Result::Branch",
289 { branchcode => "branchcode" },
293 on_delete => "SET NULL",
294 on_update => "CASCADE",
298 =head2 credit_type_code
302 Related object: L<Koha::Schema::Result::AccountCreditType>
306 __PACKAGE__->belongs_to(
308 "Koha::Schema::Result::AccountCreditType",
309 { code => "credit_type_code" },
313 on_delete => "RESTRICT",
314 on_update => "CASCADE",
318 =head2 debit_type_code
322 Related object: L<Koha::Schema::Result::AccountDebitType>
326 __PACKAGE__->belongs_to(
328 "Koha::Schema::Result::AccountDebitType",
329 { code => "debit_type_code" },
333 on_delete => "RESTRICT",
334 on_update => "CASCADE",
342 Related object: L<Koha::Schema::Result::Item>
346 __PACKAGE__->belongs_to(
348 "Koha::Schema::Result::Item",
349 { itemnumber => "itemnumber" },
353 on_delete => "SET NULL",
354 on_update => "CASCADE",
362 Related object: L<Koha::Schema::Result::Borrower>
366 __PACKAGE__->belongs_to(
368 "Koha::Schema::Result::Borrower",
369 { borrowernumber => "manager_id" },
373 on_delete => "SET NULL",
374 on_update => "CASCADE",
382 Related object: L<Koha::Schema::Result::CashRegister>
386 __PACKAGE__->belongs_to(
388 "Koha::Schema::Result::CashRegister",
389 { id => "register_id" },
393 on_delete => "SET NULL",
394 on_update => "CASCADE",
399 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-28 20:21:02
400 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PjQR7oUkefiDt+eV69jZ3A
406 Related object: L<Koha::Schema::Result::Branch>
410 __PACKAGE__->belongs_to(
412 "Koha::Schema::Result::Branch",
413 { branchcode => "branchcode" },
417 on_delete => "SET NULL",
418 on_update => "CASCADE",
422 __PACKAGE__->has_many(
423 "additional_field_values",
424 "Koha::Schema::Result::AdditionalFieldValue",
429 "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.accountlines_id" },
431 "$args->{foreign_alias}.field_id" =>
432 { -in => \'(SELECT id FROM additional_fields WHERE tablename LIKE "accountlines:%")' },
435 { cascade_copy => 0, cascade_delete => 0 },
438 sub koha_objects_class {
439 'Koha::Account::Lines';
441 sub koha_object_class {
442 'Koha::Account::Line';