projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bbc003b
)
fix display_custnum on reports, RT#
author
ivan
<ivan>
Tue, 15 Sep 2009 20:44:00 +0000
(20:44 +0000)
committer
ivan
<ivan>
Tue, 15 Sep 2009 20:44:00 +0000
(20:44 +0000)
FS/FS/UI/Web.pm
patch
|
blob
|
history
FS/FS/cust_main_Mixin.pm
patch
|
blob
|
history
diff --git
a/FS/FS/UI/Web.pm
b/FS/FS/UI/Web.pm
index
14af6a4
..
148085c
100644
(file)
--- a/
FS/FS/UI/Web.pm
+++ b/
FS/FS/UI/Web.pm
@@
-338,6
+338,8
@@
sub cust_sql_fields {
grep { my $field = $_; grep { $_ eq $field } @cust_fields }
( @add_fields, ( map "ship_$_", @add_fields ), 'payby' );
grep { my $field = $_; grep { $_ eq $field } @cust_fields }
( @add_fields, ( map "ship_$_", @add_fields ), 'payby' );
+ push @fields, 'agent_custid';
+
my @extra_fields = ();
if (grep { $_ eq 'current_balance' } @cust_fields) {
push @extra_fields, FS::cust_main->balance_sql . " AS current_balance";
my @extra_fields = ();
if (grep { $_ eq 'current_balance' } @cust_fields) {
push @extra_fields, FS::cust_main->balance_sql . " AS current_balance";
@@
-595,6
+597,7
@@
sub job_status {
@return = ( 'error', $job ? $job->statustext : $jobnum );
}
@return = ( 'error', $job ? $job->statustext : $jobnum );
}
+ #to_json(\@return); #waiting on deb 5.0 for new JSON.pm?
objToJson(\@return);
}
objToJson(\@return);
}
diff --git
a/FS/FS/cust_main_Mixin.pm
b/FS/FS/cust_main_Mixin.pm
index
ced0a1f
..
86751b1
100644
(file)
--- a/
FS/FS/cust_main_Mixin.pm
+++ b/
FS/FS/cust_main_Mixin.pm
@@
-26,7
+26,12
@@
for example, from a JOINed search. See httemplate/search/ for examples.
=over 4
=over 4
-=item name
+=cut
+
+sub cust_unlinked_msg { '(unlinked)'; }
+sub cust_linked { $_[0]->custnum; }
+
+=item display_custnum
Given an object that contains fields from cust_main (say, from a JOINed
search; see httemplate/search/ for examples), returns the equivalent of the
Given an object that contains fields from cust_main (say, from a JOINed
search; see httemplate/search/ for examples), returns the equivalent of the
@@
-35,8
+40,21
@@
a customer.
=cut
=cut
-sub cust_unlinked_msg { '(unlinked)'; }
-sub cust_linked { $_[0]->custnum; }
+sub display_custnum {
+ my $self = shift;
+ $self->cust_linked
+ ? FS::cust_main::display_custnum($self)
+ : $self->cust_unlinked_msg;
+}
+
+=item name
+
+Given an object that contains fields from cust_main (say, from a JOINed
+search; see httemplate/search/ for examples), returns the equivalent of the
+FS::cust_main I<name> method, or "(unlinked)" if this object is not linked to
+a customer.
+
+=cut
sub name {
my $self = shift;
sub name {
my $self = shift;