+
+sub not_assigned_amount {
+ my ($self) = @_;
+
+ my $not_assigned_amount = $self->amount - $self->invoice_amount;
+ die ("undefined state") if (abs($not_assigned_amount) > abs($self->amount));
+
+ return $not_assigned_amount;
+
+}
+sub closed_period {
+ my ($self) = @_;
+
+ # check for closed period
+ croak t8('Illegal date') unless ref $self->valutadate eq 'DateTime';
+
+
+ my $closedto = $::locale->parse_date_to_object($::instance_conf->get_closedto);
+ if ( ref $closedto && $self->valutadate < $closedto ) {
+ return 1;
+ } else {
+ return 0;
+ }
+}