[freeside-commits] branch FREESIDE_3_BRANCH updated. 06bbfb407f24b2e32b38d601dd8fceac2b22e426
Ivan
ivan at 420.am
Thu Jan 9 12:32:31 PST 2014
The branch, FREESIDE_3_BRANCH has been updated
via 06bbfb407f24b2e32b38d601dd8fceac2b22e426 (commit)
from 708cd9ef94ccb96955c6b9fe9d2ccdc0b311b556 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 06bbfb407f24b2e32b38d601dd8fceac2b22e426
Author: Ivan Kohler <ivan at freeside.biz>
Date: Thu Jan 9 12:32:29 2014 -0800
no reason for part_pkg.comment to be required, we've had price_info for ages
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 60a143b..db5bad2 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -2063,7 +2063,7 @@ sub tables_hashref {
'columns' => [
'pkgpart', 'serial', '', '', '', '',
'pkg', 'varchar', '', $char_d, '', '',
- 'comment', 'varchar', '', 2*$char_d, '', '',
+ 'comment', 'varchar', 'NULL', 2*$char_d, '', '',
'promo_code', 'varchar', 'NULL', $char_d, '', '',
'freq', 'varchar', '', $char_d, '', '', #billing frequency
'setuptax', 'char', 'NULL', 1, '', '',
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 9ba5bb0..2cccce0 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -603,7 +603,7 @@ sub check {
my $error = $self->ut_numbern('pkgpart')
|| $self->ut_text('pkg')
- || $self->ut_text('comment')
+ || $self->ut_textn('comment')
|| $self->ut_textn('promo_code')
|| $self->ut_alphan('plan')
|| $self->ut_enum('setuptax', [ '', 'Y' ] )
@@ -767,7 +767,8 @@ sub pkg_comment {
#$self->pkg. ' - '. $self->comment;
#$self->pkg. ' ('. $self->comment. ')';
my $pre = $opt{nopkgpart} ? '' : $self->pkgpart. ': ';
- $pre. $self->pkg. ' - '. $self->custom_comment;
+ my $custom_comment = $self->custom_comment(%opt);
+ $pre. $self->pkg. ( $custom_comment ? " - $custom_comment" : '' );
}
sub price_info { # safety, in case a part_pkg hasn't defined price_info
@@ -776,7 +777,11 @@ sub price_info { # safety, in case a part_pkg hasn't defined price_info
sub custom_comment {
my $self = shift;
- ( $self->custom ? '(CUSTOM) ' : '' ). $self->comment . ' ' . $self->price_info;
+ my $price_info = $self->price_info(@_);
+ ( $self->custom ? '(CUSTOM) ' : '' ).
+ $self->comment.
+ ( ( ($self->custom || $self->comment) && $price_info ) ? ' - ' : '' ).
+ $price_info;
}
=item pkg_class
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index dec13ca..b2711b9 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -11,7 +11,8 @@
<A NAME="cust_pkg<% $cust_pkg->pkgnum %>"
ID ="cust_pkg<% $cust_pkg->pkgnum %>"
><% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B></A>
- -
+% my $custom_comment = $part_pkg->custom_comment();
+ <% $custom_comment ? ' - ' : '' %>
<% $part_pkg->custom_comment |h %>
</TD>
</TR>
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Schema.pm | 2 +-
FS/FS/part_pkg.pm | 11 ++++++++---
httemplate/view/cust_main/packages/package.html | 3 ++-
3 files changed, 11 insertions(+), 5 deletions(-)
More information about the freeside-commits
mailing list