View | Details | Raw Unified | Return to bug 13813
Collapse All | Expand All

(-)a/C4/Barcodes/annual.pm (-2 / +2 lines)
Lines 48-54 sub db_max ($;$) { Link Here
48
        $iso = output_pref({ dt => dt_from_string( $input, 'iso' ), dateformat => 'iso', dateonly => 1 }); # try to set the date w/ 2nd arg
48
        $iso = output_pref({ dt => dt_from_string( $input, 'iso' ), dateformat => 'iso', dateonly => 1 }); # try to set the date w/ 2nd arg
49
		unless ($iso) {
49
		unless ($iso) {
50
			warn "Failed to create 'iso' Dates object with input '$input'.  Reverting to today's date.";
50
			warn "Failed to create 'iso' Dates object with input '$input'.  Reverting to today's date.";
51
            $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });	# failover back to today
51
            $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); # failover back to today
52
		}
52
		}
53
	} else {
53
	} else {
54
        $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
54
        $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
Lines 83-89 sub width ($;$) { Link Here
83
sub process_head($$;$$) {	# (self,head,whole,specific)
83
sub process_head($$;$$) {	# (self,head,whole,specific)
84
	my ($self,$head,$whole,$specific) = @_;
84
	my ($self,$head,$whole,$specific) = @_;
85
	$specific and return $head;	# if this is built off an existing barcode, just return the head unchanged.
85
	$specific and return $head;	# if this is built off an existing barcode, just return the head unchanged.
86
    return substr(output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 0, 4 ) . '-';	# else get new YYYY-
86
    return substr(output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 0, 4 ) . '-'; # else get new YYYY-
87
}
87
}
88
88
89
sub new_object {
89
sub new_object {
(-)a/C4/Barcodes/hbyymmincr.pm (-3 / +2 lines)
Lines 75-81 sub db_max { Link Here
75
sub initial {
75
sub initial {
76
	my $self = shift;
76
	my $self = shift;
77
	# FIXME: populated branch?
77
	# FIXME: populated branch?
78
    my $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); 	# like "2008-07-02"
78
    my $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); # like "2008-07-02"
79
	return $self->branch . substr($iso,2,2) . substr($iso,5,2) . sprintf('%' . "$width.$width" . 'd',1);
79
	return $self->branch . substr($iso,2,2) . substr($iso,5,2) . sprintf('%' . "$width.$width" . 'd',1);
80
}
80
}
81
81
Lines 105-111 sub process_head { # (self,head,whole,specific) Link Here
105
	my ($self,$head,$whole,$specific) = @_;
105
	my ($self,$head,$whole,$specific) = @_;
106
	$specific and return $head;	# if this is built off an existing barcode, just return the head unchanged.
106
	$specific and return $head;	# if this is built off an existing barcode, just return the head unchanged.
107
	$head =~ s/\d{4}$//;		# else strip the old yymm
107
	$head =~ s/\d{4}$//;		# else strip the old yymm
108
    my $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); 	# like "2008-07-02"
108
    my $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); # like "2008-07-02"
109
	return $head . substr($iso,2,2) . substr($iso,5,2);
109
	return $head . substr($iso,2,2) . substr($iso,5,2);
110
}
110
}
111
111
112
- 

Return to bug 13813