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