From 12faa24f776c812a16174fd64a479484a0e53778 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 23 May 2016 17:49:02 +0000 Subject: [PATCH] Bug 15878 [QA Followup] Signed-off-by: Kyle M Hall --- C4/Barcodes/hbyymmincr.pm | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/C4/Barcodes/hbyymmincr.pm b/C4/Barcodes/hbyymmincr.pm index 23280d72c4..f963e9a072 100644 --- a/C4/Barcodes/hbyymmincr.pm +++ b/C4/Barcodes/hbyymmincr.pm @@ -75,7 +75,7 @@ sub initial { my $self = shift; # FIXME: populated branch? my $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); # like "2008-07-02" - if ( $self->branch eq '' ) { warn "HBYYMM Barcode was not passed a branch, default is blank" } + warn "HBYYMM Barcode was not passed a branch, default is blank" if ( $self->branch eq '' ); return $self->branch . substr($iso,2,2) . substr($iso,5,2) . sprintf('%' . "$width.$width" . 'd',1); } @@ -110,18 +110,27 @@ sub process_head { # (self,head,whole,specific) } sub new_object { - $debug and warn "hbyymmincr: new_object called"; - my $class_or_object = shift; - my $type = ref($class_or_object) || $class_or_object; - my $from_obj = ref($class_or_object) ? 1 : 0; # are we building off another Barcodes object? - my $self = $class_or_object->default_self('hbyymmincr'); - bless $self, $type; - $self->branch(@_ ? shift : $from_obj ? $class_or_object->branch : $branch); - if ( $self->branch() eq '' ) { warn "HBYYMM Barcode created with no branchcode, default is blank"; } - # take the branch from argument, or existing object, or default - use Data::Dumper; - $debug and print STDERR "(hbyymmincr) new_object: ", Dumper($self), "\n"; - return $self; + $debug and warn "hbyymmincr: new_object called"; + my $class_or_object = shift; + + my $type = ref($class_or_object) || $class_or_object; + + my $from_obj = + ref($class_or_object) + ? 1 + : 0; # are we building off another Barcodes object? + + my $self = $class_or_object->default_self('hbyymmincr'); + bless $self, $type; + + $self->branch( @_ ? shift : $from_obj ? $class_or_object->branch : $branch ); + warn "HBYYMM Barcode created with no branchcode, default is blank" if ( $self->branch() eq '' ); + + # take the branch from argument, or existing object, or default + use Data::Dumper; + $debug and print STDERR "(hbyymmincr) new_object: ", Dumper($self), "\n"; + + return $self; } 1; -- 2.39.5