);
my %header2align = (
'Cust. Status' => 'c',
+ 'Cust#' => 'r',
);
my $cust_fields;
cust_header(@_);
#inefficientish, but tiny lists and only run once per page
+
+ my @add_fields = qw( address1 address2 city state zip daytime night fax );
push @fields,
grep { my $field = $_; grep { $_ eq $field } @cust_fields }
- qw( address1 address2 city state zip daytime night fax payby );
+ ( @add_fields, ( map "ship_$_", @add_fields ), 'payby' );
+
+ push @fields, 'agent_custid';
my @extra_fields = ();
if (grep { $_ eq 'current_balance' } @cust_fields) {
my $seen_unlinked = 0;
map {
if ( $record->custnum ) {
- warn " $record -> $_"
- if $DEBUG > 1;
+ warn " $record -> $_" if $DEBUG > 1;
$record->$_(@_);
} else {
- warn " ($record unlinked)"
- if $DEBUG > 1;
+ warn " ($record unlinked)" if $DEBUG > 1;
$seen_unlinked++ ? '' : '(unlinked)';
}
} @cust_fields;
my @return;
if ( $job && $job->status ne 'failed' ) {
- @return = ( 'progress', $job->statustext );
+ my ($progress, $action) = split ',', $job->statustext, 2;
+ $action ||= 'Server processing job';
+ @return = ( 'progress', $progress, $action );
} elsif ( !$job ) { #handle job gone case : job successful
# so close popup, redirect parent window...
@return = ( 'complete' );
@return = ( 'error', $job ? $job->statustext : $jobnum );
}
+ #to_json(\@return); #waiting on deb 5.0 for new JSON.pm?
objToJson(\@return);
}