]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
moving to cstore for all basic search/retrevial
[Evergreen.git] / Open-ILS / src / perlmods / OpenILS / Application / Circ.pm
1 package OpenILS::Application::Circ;
2 use base qw/OpenSRF::Application/;
3 use strict; use warnings;
4
5 use OpenILS::Application::Circ::Circulate;
6 use OpenILS::Application::Circ::Survey;
7 use OpenILS::Application::Circ::StatCat;
8 use OpenILS::Application::Circ::Holds;
9 use OpenILS::Application::Circ::Money;
10 use OpenILS::Application::Circ::NonCat;
11 use OpenILS::Application::Circ::CopyLocations;
12
13 use DateTime;
14 use DateTime::Format::ISO8601;
15
16 use OpenILS::Application::AppUtils;
17 my $apputils = "OpenILS::Application::AppUtils";
18 my $U = $apputils;
19 use OpenSRF::Utils qw/:datetime/;
20 use OpenILS::Utils::ModsParser;
21 use OpenILS::Event;
22 use OpenSRF::EX qw(:try);
23 use OpenSRF::Utils::Logger qw(:logger);
24 use OpenILS::Utils::Fieldmapper;
25 use OpenILS::Utils::Editor q/:funcs/;
26
27
28 # ------------------------------------------------------------------------
29 # Top level Circ package;
30 # ------------------------------------------------------------------------
31
32 sub initialize {
33         my $self = shift;
34         OpenILS::Application::Circ::Circulate->initialize();
35 }
36
37
38 __PACKAGE__->register_method(
39         method => 'retrieve_circ',
40         api_name        => 'open-ils.circ.retrieve',
41         signature => q/
42                 Retrieve a circ object by id
43                 @param authtoken Login session key
44                 @pararm circid The id of the circ object
45         /
46 );
47 sub retrieve_circ {
48         my( $s, $c, $a, $i ) = @_;
49         my $e = new_editor(authtoken => $a);
50         return $e->event unless $e->checkauth;
51         my $circ = $e->retrieve_action_circulation($i) or return $e->event;
52         if( $e->requestor->id ne $circ->usr ) {
53                 return $e->event unless $e->allowed('VIEW_CIRCULATIONS');
54         }
55         return $circ;
56 }
57
58
59 # ------------------------------------------------------------------------
60 # Returns an array of {circ, record} hashes checked out by the user.
61 # ------------------------------------------------------------------------
62 __PACKAGE__->register_method(
63         method  => "checkouts_by_user",
64         api_name        => "open-ils.circ.actor.user.checked_out",
65         NOTES           => <<"  NOTES");
66         Returns a list of open circulations as a pile of objects.  each object
67         contains the relevant copy, circ, and record
68         NOTES
69
70 sub checkouts_by_user {
71         my( $self, $client, $user_session, $user_id ) = @_;
72
73         my( $requestor, $target, $copy, $record, $evt );
74
75         ( $requestor, $target, $evt ) = 
76                 $apputils->checkses_requestor( $user_session, $user_id, 'VIEW_CIRCULATIONS');
77         return $evt if $evt;
78
79         my $circs = $apputils->simplereq(
80                 'open-ils.cstore',
81                 "open-ils.cstore.direct.action.open_circulation.search.atomic", 
82                 { usr => $target->id, checkin_time => undef } );
83 #               { usr => $target->id } );
84
85         my @results;
86         for my $circ (@$circs) {
87
88                 ( $copy, $evt )  = $apputils->fetch_copy($circ->target_copy);
89                 return $evt if $evt;
90
91                 $logger->debug("Retrieving record for copy " . $circ->target_copy);
92
93                 ($record, $evt) = $apputils->fetch_record_by_copy( $circ->target_copy );
94                 return $evt if $evt;
95
96                 my $mods = $apputils->record_to_mvr($record);
97
98                 push( @results, { copy => $copy, circ => $circ, record => $mods } );
99         }
100
101         return \@results;
102
103 }
104
105
106
107 __PACKAGE__->register_method(
108         method  => "checkouts_by_user_slim",
109         api_name        => "open-ils.circ.actor.user.checked_out.slim",
110         NOTES           => <<"  NOTES");
111         Returns a list of open circulation objects
112         NOTES
113
114 # DEPRECAT ME?? XXX
115 sub checkouts_by_user_slim {
116         my( $self, $client, $user_session, $user_id ) = @_;
117
118         my( $requestor, $target, $copy, $record, $evt );
119
120         ( $requestor, $target, $evt ) = 
121                 $apputils->checkses_requestor( $user_session, $user_id, 'VIEW_CIRCULATIONS');
122         return $evt if $evt;
123
124         $logger->debug( 'User ' . $requestor->id . 
125                 " retrieving checked out items for user " . $target->id );
126
127         # XXX Make the call correct..
128         return $apputils->simplereq(
129                 'open-ils.cstore',
130                 "open-ils.cstore.direct.action.open_circulation.search.atomic", 
131                 { usr => $target->id, checkin_time => undef } );
132 #               { usr => $target->id } );
133 }
134
135
136 __PACKAGE__->register_method(
137         method  => "checkouts_by_user_opac",
138         api_name        => "open-ils.circ.actor.user.checked_out.opac",);
139
140 # XXX Deprecate Me
141 sub checkouts_by_user_opac {
142         my( $self, $client, $auth, $user_id ) = @_;
143
144         my $e = OpenILS::Utils::Editor->new( authtoken => $auth );
145         return $e->event unless $e->checkauth;
146         $user_id ||= $e->requestor->id;
147         return $e->event unless 
148                 my $patron = $e->retrieve_actor_user($user_id);
149
150         my $data;
151         my $search = {usr => $user_id, stop_fines => undef};
152
153         if( $user_id ne $e->requestor->id ) {
154                 $data = $e->search_action_circulation(
155                         $search, {checkperm=>1, permorg=>$patron->home_ou})
156                         or return $e->event;
157
158         } else {
159                 $data = $e->search_action_circulation($search);
160         }
161
162         return $data;
163 }
164
165
166 __PACKAGE__->register_method(
167         method  => "title_from_transaction",
168         api_name        => "open-ils.circ.circ_transaction.find_title",
169         NOTES           => <<"  NOTES");
170         Returns a mods object for the title that is linked to from the 
171         copy from the hold that created the given transaction
172         NOTES
173
174 sub title_from_transaction {
175         my( $self, $client, $login_session, $transactionid ) = @_;
176
177         my( $user, $circ, $title, $evt );
178
179         ( $user, $evt ) = $apputils->checkses( $login_session );
180         return $evt if $evt;
181
182         ( $circ, $evt ) = $apputils->fetch_circulation($transactionid);
183         return $evt if $evt;
184         
185         ($title, $evt) = $apputils->fetch_record_by_copy($circ->target_copy);
186         return $evt if $evt;
187
188         return $apputils->record_to_mvr($title);
189 }
190
191
192 __PACKAGE__->register_method(
193         method  => "set_circ_lost",
194         api_name        => "open-ils.circ.circulation.set_lost",
195         NOTES           => <<"  NOTES");
196         Params are login, barcode
197         login must have SET_CIRC_LOST perms
198         Sets a circulation to lost
199         NOTES
200
201 __PACKAGE__->register_method(
202         method  => "set_circ_lost",
203         api_name        => "open-ils.circ.circulation.set_claims_returned",
204         NOTES           => <<"  NOTES");
205         Params are login, barcode
206         login must have SET_CIRC_MISSING perms
207         Sets a circulation to lost
208         NOTES
209
210 sub set_circ_lost {
211         my( $self, $client, $login, $args ) = @_;
212         my( $user, $circ, $copy, $evt );
213
214         my $barcode             = $$args{barcode};
215         my $backdate    = $$args{backdate};
216
217         ( $user, $evt ) = $U->checkses($login);
218         return $evt if $evt;
219
220         # Grab the related copy
221         ($copy, $evt) = $U->fetch_copy_by_barcode($barcode);
222         return $evt if $evt;
223
224         my $isclaims    = $self->api_name =~ /claims_returned/;
225         my $islost              = $self->api_name =~ /lost/;
226         my $session             = $U->start_db_session(); 
227
228         # grab the circulation
229         ( $circ ) = $U->fetch_open_circulation( $copy->id );
230         return 1 unless $circ;
231
232         if($islost) {
233                 $evt  = _set_circ_lost($copy, $circ, $user, $session) if $islost;
234                 return $evt if $evt;
235         }
236
237         if($isclaims) {
238                 $evt = _set_circ_claims_returned(
239                         $user, $circ, $session, $backdate );
240                 return $evt if $evt;
241
242 #               $evt = $U->check_perms($user->id, $circ->circ_lib, 'SET_CIRC_CLAIMS_RETURNED');
243 #               return $evt if $evt;
244 #               $circ->stop_fines("CLAIMSRETURNED");
245 #
246 #               $logger->activity("user ".$user->id." marking circ".  $circ->id. " as claims returned");
247 #
248 #               # allow the caller to backdate the circulation and void any fines
249 #               # that occurred after the backdate
250 #               if($backdate) {
251 #                       OpenILS::Application::Circ::Circulate::_checkin_handle_backdate(
252 #                               $backdate, $circ, $user, $session );
253 #               }
254 #
255 #               my $patron;
256 #               ($patron, $evt) = $U->fetch_user($circ->usr);
257 #               return $evt if $evt;
258 #               $patron->claims_returned_count( 
259 #                       $patron->claims_returned_count + 1 );
260 #
261 #               my $stat = $U->storagereq(
262 #                       'open-ils.storage.direct.actor.user.update', $patron );
263 #               return $U->DB_UPDATE_FAILED($patron) unless $stat;
264
265         }
266
267         $circ->stop_fines_time('now') unless $circ->stop_fines_time('now');
268         my $s = $session->request(
269                 "open-ils.storage.direct.action.circulation.update", $circ )->gather(1);
270
271         return $U->DB_UPDATE_FAILED($circ) unless defined($s);
272         $U->commit_db_session($session);
273
274         return 1;
275 }
276
277 sub _set_circ_lost {
278         my( $copy, $circ, $reqr, $session ) = @_;
279
280         my $evt = $U->check_perms($reqr->id, $circ->circ_lib, 'SET_CIRC_LOST');
281         return $evt if $evt;
282
283         $logger->activity("user ".$reqr->id." marking copy ".$copy->id.
284                 " lost  for circ ".  $circ->id. " and checking for necessary charges");
285
286         my $newstat = $U->copy_status_from_name('lost');
287         if( $copy->status ne $newstat->id ) {
288
289                 $copy->status($newstat);
290                 $U->update_copy(
291                         copy            => $copy, 
292                         editor  => $reqr->id, 
293                         session => $session);
294         }
295
296         # if the copy has a price defined and/or a processing fee, bill the patron
297
298         my $copy_price = $copy->price || 0;
299
300         # If the copy has a price configured, charge said price to the user
301         if($copy_price) {
302                 $evt = _make_bill($session, $copy_price, 'Lost Materials', $circ->id);
303                 return $evt if $evt;
304         }
305
306         # if the location that owns the copy has a processing fee, charge the user
307         my $owner = $U->fetch_copy_owner($copy->id);
308         $logger->info("circ fetching org settings for $owner to determine processing fee");
309
310         my $settings = $U->simplereq(
311                 'open-ils.actor', 'open-ils.actor.org_unit.settings.retrieve', $owner );
312         my $fee = $settings->{'circ.lost_materials_processing_fee'} || 0;
313
314         if( $fee ) {
315                 $evt = _make_bill($session, $fee, 'Lost Materials Processing Fee', $circ->id);
316                 return $evt if $evt;
317         }
318         
319         $circ->stop_fines("LOST");              
320         return undef;
321 }
322
323 sub _make_bill {
324         my( $session, $amount, $type, $xactid ) = @_;
325
326         $logger->activity("The system is charging $amount ".
327                 " [$type] for lost materials on circulation $xactid");
328
329         my $bill = Fieldmapper::money::billing->new;
330
331         $bill->xact($xactid);
332         $bill->amount($amount);
333         $bill->billing_type($type); # - XXX these strings should be configurable some day
334         $bill->note('SYSTEM GENERATED');
335
336         my $id = $session->request(
337                 'open-ils.storage.direct.money.billing.create', $bill )->gather(1);
338
339         return $U->DB_UPDATE_FAILED($bill) unless defined $id;
340         return undef;
341 }
342
343 sub _set_circ_claims_returned {
344         my( $reqr, $circ, $session, $backdate ) = @_;
345
346         my $evt = $U->check_perms($reqr->id, $circ->circ_lib, 'SET_CIRC_CLAIMS_RETURNED');
347         return $evt if $evt;
348         $circ->stop_fines("CLAIMSRETURNED");
349
350         $logger->activity("user ".$reqr->id.
351                 " marking circ".  $circ->id. " as claims returned");
352
353         # allow the caller to backdate the circulation and void any fines
354         # that occurred after the backdate
355         if($backdate) {
356                 OpenILS::Application::Circ::Circulate::_checkin_handle_backdate(
357                         $backdate, $circ, $reqr, $session );
358         }
359
360         return undef;
361 }
362
363
364
365 __PACKAGE__->register_method (
366         method          => 'set_circ_due_date',
367         api_name                => 'open-ils.circ.circulation.due_date.update',
368         signature       => q/
369                 Updates the due_date on the given circ
370                 @param authtoken
371                 @param circid The id of the circ to update
372                 @param date The timestamp of the new due date
373         /
374 );
375
376 sub set_circ_due_date {
377         my( $s, $c, $authtoken, $circid, $date ) = @_;
378         my ($circ, $evt) = $U->fetch_circulation($circid);
379         return $evt if $evt;
380
381         my $reqr;
382         ($reqr, $evt) = $U->checkses($authtoken);
383         return $evt if $evt;
384
385         $evt = $U->check_perms($reqr->id, $circ->circ_lib, 'CIRC_OVERRIDE_DUE_DATE');
386         return $evt if $evt;
387
388         $date = clense_ISO8601($date);
389         $logger->activity("user ".$reqr->id.
390                 " updating due_date on circ $circid: $date");
391
392         $circ->due_date($date);
393         my $stat = $U->storagereq(
394                 'open-ils.storage.direct.action.circulation.update', $circ);
395         return $U->DB_UPDATE_FAILED unless defined $stat;
396         return $stat;
397 }
398
399
400 __PACKAGE__->register_method(
401         method          => "create_in_house_use",
402         api_name                => 'open-ils.circ.in_house_use.create',
403         signature       =>      q/
404                 Creates an in-house use action.
405                 @param $authtoken The login session key
406                 @param params A hash of params including
407                         'location' The org unit id where the in-house use occurs
408                         'copyid' The copy in question
409                         'count' The number of in-house uses to apply to this copy
410                 @return An array of id's representing the id's of the newly created
411                 in-house use objects or an event on an error
412         /);
413
414 sub create_in_house_use {
415         my( $self, $client, $authtoken, $params ) = @_;
416
417         my( $staff, $evt, $copy );
418         my $org                 = $params->{location};
419         my $copyid              = $params->{copyid};
420         my $count               = $params->{count} || 1;
421         my $use_time    = $params->{use_time} || 'now';
422
423         if(!$copyid) {
424                 my $barcode = $params->{barcode};
425                 ($copy, $evt) = $U->fetch_copy_by_barcode($barcode);
426                 return $evt if $evt;
427                 $copyid = $copy->id;
428         }
429
430         ($staff, $evt) = $U->checkses($authtoken);
431         return $evt if $evt;
432
433         ($copy, $evt) = $U->fetch_copy($copyid) unless $copy;
434         return $evt if $evt;
435
436         $evt = $U->check_perms($staff->id, $org, 'CREATE_IN_HOUSE_USE');
437         return $evt if $evt;
438
439         $logger->activity("User " . $staff->id .
440                 " creating $count in-house use(s) for copy $copyid at location $org");
441
442         if( $use_time ne 'now' ) {
443                 $use_time = clense_ISO8601($use_time);
444                 $logger->debug("in_house_use setting use time to $use_time");
445         }
446
447         my @ids;
448         for(1..$count) {
449                 my $ihu = Fieldmapper::action::in_house_use->new;
450
451                 $ihu->item($copyid);
452                 $ihu->staff($staff->id);
453                 $ihu->org_unit($org);
454                 $ihu->use_time($use_time);
455
456                 my $id = $U->simplereq(
457                         'open-ils.storage',
458                         'open-ils.storage.direct.action.in_house_use.create', $ihu );
459
460                 return $U->DB_UPDATE_FAILED($ihu) unless $id;
461                 push @ids, $id;
462         }
463
464         return \@ids;
465 }
466
467
468
469 __PACKAGE__->register_method(
470         method  => "view_circs",
471         api_name        => "open-ils.circ.copy_checkout_history.retrieve",
472         notes           => q/
473                 Retrieves the last X circs for a given copy
474                 @param authtoken The login session key
475                 @param copyid The copy to check
476                 @param count How far to go back in the item history
477                 @return An array of circ ids
478         /);
479
480
481
482 sub view_circs {
483         my( $self, $client, $authtoken, $copyid, $count ) = @_; 
484
485         my( $requestor, $evt ) = $U->checksesperm(
486                         $authtoken, 'VIEW_COPY_CHECKOUT_HISTORY' );
487         return $evt if $evt;
488
489         return [] unless $count;
490
491         my $circs = $U->cstorereq(
492                 'open-ils.cstore.direct.action.circulation.search.atomic',
493                         { 
494                                 target_copy => $copyid, 
495                         }, 
496                         { 
497                                 limit => $count, 
498                                 order_by => { ac => "xact_start DESC" }
499                         } 
500         );
501
502         return $circs;
503 }
504
505
506 __PACKAGE__->register_method(
507         method  => "circ_count",
508         api_name        => "open-ils.circ.circulation.count",
509         notes           => q/
510                 Returns the number of times the item has circulated
511                 @param copyid The copy to check
512         /);
513
514 sub circ_count {
515         my( $self, $client, $copyid, $range ) = @_; 
516         my $e = OpenILS::Utils::Editor->new;
517         return $e->request('open-ils.storage.asset.copy.circ_count', $copyid, $range);
518 }
519
520
521
522 __PACKAGE__->register_method(
523         method          => 'fetch_notes',
524         api_name                => 'open-ils.circ.copy_note.retrieve.all',
525         signature       => q/
526                 Returns an array of copy note objects.  
527                 @param args A named hash of parameters including:
528                         authtoken       : Required if viewing non-public notes
529                         itemid          : The id of the item whose notes we want to retrieve
530                         pub                     : True if all the caller wants are public notes
531                 @return An array of note objects
532         /);
533
534 __PACKAGE__->register_method(
535         method          => 'fetch_notes',
536         api_name                => 'open-ils.circ.call_number_note.retrieve.all',
537         signature       => q/@see open-ils.circ.copy_note.retrieve.all/);
538
539 __PACKAGE__->register_method(
540         method          => 'fetch_notes',
541         api_name                => 'open-ils.circ.title_note.retrieve.all',
542         signature       => q/@see open-ils.circ.copy_note.retrieve.all/);
543
544
545 # NOTE: VIEW_COPY/VOLUME/TITLE_NOTES perms should always be global
546 sub fetch_notes {
547         my( $self, $connection, $args ) = @_;
548
549         my $id = $$args{itemid};
550         my $authtoken = $$args{authtoken};
551         my( $r, $evt);
552
553         if( $self->api_name =~ /copy/ ) {
554                 if( $$args{pub} ) {
555                         return $U->cstorereq(
556                                 'open-ils.cstore.direct.asset.copy_note.search.atomic',
557                                 { owning_copy => $id, pub => 't' } );
558                 } else {
559                         ( $r, $evt ) = $U->checksesperm($authtoken, 'VIEW_COPY_NOTES');
560                         return $evt if $evt;
561                         return $U->cstorereq(
562                                 'open-ils.cstore.direct.asset.copy_note.search.atomic', {owning_copy => $id} );
563                 }
564
565         } elsif( $self->api_name =~ /call_number/ ) {
566                 if( $$args{pub} ) {
567                         return $U->cstorereq(
568                                 'open-ils.cstore.direct.asset.call_number_note.search.atomic',
569                                 { call_number => $id, pub => 't' } );
570                 } else {
571                         ( $r, $evt ) = $U->checksesperm($authtoken, 'VIEW_VOLUME_NOTES');
572                         return $evt if $evt;
573                         return $U->cstorereq(
574                                 'open-ils.cstore.direct.asset.call_number_note.search.atomic', { call_number => $id } );
575                 }
576
577         } elsif( $self->api_name =~ /title/ ) {
578                 if( $$args{pub} ) {
579                         return $U->cstorereq(
580                                 'open-ils.cstore.direct.bilbio.record_note.search.atomic',
581                                 { record => $id, pub => 't' } );
582                 } else {
583                         ( $r, $evt ) = $U->checksesperm($authtoken, 'VIEW_TITLE_NOTES');
584                         return $evt if $evt;
585                         return $U->cstorereq(
586                                 'open-ils.cstore.direct.biblio.record_note.search.atomic', { record => $id } );
587                 }
588         }
589
590         return undef;
591 }
592
593 __PACKAGE__->register_method(
594         method  => 'has_notes',
595         api_name        => 'open-ils.circ.copy.has_notes');
596 __PACKAGE__->register_method(
597         method  => 'has_notes',
598         api_name        => 'open-ils.circ.call_number.has_notes');
599 __PACKAGE__->register_method(
600         method  => 'has_notes',
601         api_name        => 'open-ils.circ.title.has_notes');
602
603
604 sub has_notes {
605         my( $self, $conn, $authtoken, $id ) = @_;
606         my $editor = OpenILS::Utils::Editor->new(authtoken => $authtoken);
607         return $editor->event unless $editor->checkauth;
608
609         my $n = $editor->search_asset_copy_note(
610                 {owning_copy=>$id}, {idlist=>1}) if $self->api_name =~ /copy/;
611
612         $n = $editor->search_asset_call_number_note(
613                 {call_number=>$id}, {idlist=>1}) if $self->api_name =~ /call_number/;
614
615         $n = $editor->search_biblio_record_note(
616                 {record=>$id}, {idlist=>1}) if $self->api_name =~ /title/;
617
618         return scalar @$n;
619 }
620
621 __PACKAGE__->register_method(
622         method          => 'create_copy_note',
623         api_name                => 'open-ils.circ.copy_note.create',
624         signature       => q/
625                 Creates a new copy note
626                 @param authtoken The login session key
627                 @param note     The note object to create
628                 @return The id of the new note object
629         /);
630
631 sub create_copy_note {
632         my( $self, $connection, $authtoken, $note ) = @_;
633         my( $cnowner, $requestor, $evt );
634
635         ($cnowner, $evt) = $U->fetch_copy_owner($note->owning_copy);
636         return $evt if $evt;
637         ($requestor, $evt) = $U->checkses($authtoken);
638         return $evt if $evt;
639         $evt = $U->check_perms($requestor->id, $cnowner, 'CREATE_COPY_NOTE');
640         return $evt if $evt;
641
642         $note->create_date('now');
643         $note->creator($requestor->id);
644         $note->pub( ($note->pub) ? 't' : 'f' );
645
646         my $id = $U->storagereq(
647                 'open-ils.storage.direct.asset.copy_note.create', $note );
648         return $U->DB_UPDATE_FAILED($note) unless $id;
649
650         $logger->activity("User ".$requestor->id." created a new copy ".
651                 "note [$id] for copy ".$note->owning_copy." with text ".$note->value);
652
653         return $id;
654 }
655
656 __PACKAGE__->register_method(
657         method          => 'delete_copy_note',
658         api_name                =>      'open-ils.circ.copy_note.delete',
659         signature       => q/
660                 Deletes an existing copy note
661                 @param authtoken The login session key
662                 @param noteid The id of the note to delete
663                 @return 1 on success - Event otherwise.
664                 /);
665
666 sub delete_copy_note {
667         my( $self, $conn, $authtoken, $noteid ) = @_;
668         my( $requestor, $note, $owner, $evt );
669
670         ($requestor, $evt) = $U->checkses($authtoken);
671         return $evt if $evt;
672
673         ($note, $evt) = $U->fetch_copy_note($noteid);
674         return $evt if $evt;
675
676         if( $note->creator ne $requestor->id ) {
677                 ($owner, $evt) = $U->fetch_copy_onwer($note->owning_copy);
678                 return $evt if $evt;
679                 $evt = $U->check_perms($requestor->id, $owner, 'DELETE_COPY_NOTE');
680                 return $evt if $evt;
681         }
682
683         my $stat = $U->storagereq(
684                 'open-ils.storage.direct.asset.copy_note.delete', $noteid );
685         return $U->DB_UPDATE_FAILED($noteid) unless $stat;
686
687         $logger->activity("User ".$requestor->id." deleted copy note $noteid");
688         return 1;
689 }
690
691
692 1;