Lines 77-82
sub store {
Link Here
|
77 |
|
77 |
|
78 |
# if these parameters are missing, we can't continue |
78 |
# if these parameters are missing, we can't continue |
79 |
for my $key (qw( basketno quantity biblionumber budget_id )) { |
79 |
for my $key (qw( basketno quantity biblionumber budget_id )) { |
|
|
80 |
next if $key eq 'biblionumber' && ($self->orderstatus // q{}) eq 'cancelled'; # cancelled order might have biblionumber NULL |
80 |
croak "Cannot insert order: Mandatory parameter $key is missing" |
81 |
croak "Cannot insert order: Mandatory parameter $key is missing" |
81 |
unless $self->$key; |
82 |
unless $self->$key; |
82 |
} |
83 |
} |
Lines 105-112
sub store {
Link Here
|
105 |
=head3 cancel |
106 |
=head3 cancel |
106 |
|
107 |
|
107 |
$order->cancel( |
108 |
$order->cancel( |
108 |
{ [ reason => $reason, |
109 |
{ |
109 |
delete_biblio => $delete_biblio ] |
110 |
[ |
|
|
111 |
reason => $reason, |
112 |
delete_biblio => $delete_biblio |
113 |
] |
110 |
} |
114 |
} |
111 |
); |
115 |
); |
112 |
|
116 |
|
Lines 158-163
sub cancel {
Link Here
|
158 |
payload => { biblio => $biblio, reason => $error } |
162 |
payload => { biblio => $biblio, reason => $error } |
159 |
} |
163 |
} |
160 |
) if $error; |
164 |
) if $error; |
|
|
165 |
$self->biblionumber(undef) unless $error; # constraint cleared biblionumber in db already |
161 |
} |
166 |
} |
162 |
else { |
167 |
else { |
163 |
|
168 |
|
164 |
- |
|
|