From 3802d198c02975cb1c76ddbe2feb0b0ea6f88c49 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 (cherry picked from commit 12faa24f776c812a16174fd64a479484a0e53778) Signed-off-by: Julian Maurice --- 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 d1e2498166..532c7931f2 100644 --- a/C4/Barcodes/hbyymmincr.pm +++ b/C4/Barcodes/hbyymmincr.pm @@ -76,7 +76,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); } @@ -111,18 +111,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