projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add waive setup fee upon package order feature, RT12568
[freeside.git]
/
FS
/
FS
/
cust_pkg.pm
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
c183a49
..
6c985cf
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-194,6
+194,8
@@
Previous pkgpart
Previous locationnum
Previous locationnum
+=item waive_setup
+
=back
Note: setup, last_bill, bill, adjourn, susp, expire, cancel and change_date
=back
Note: setup, last_bill, bill, adjourn, susp, expire, cancel and change_date
@@
-594,9
+596,14
@@
sub check {
|| $self->ut_numbern('adjourn')
|| $self->ut_numbern('expire')
|| $self->ut_enum('no_auto', [ '', 'Y' ])
|| $self->ut_numbern('adjourn')
|| $self->ut_numbern('expire')
|| $self->ut_enum('no_auto', [ '', 'Y' ])
+ || $self->ut_enum('waive_setup', [ '', 'Y' ])
+ || $self->ut_numbern('agent_pkgid')
;
return $error if $error;
;
return $error if $error;
+ return "A package with both start date (future start) and setup date (already started) will never bill"
+ if $self->start_date && $self->setup;
+
$self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum;
if ( $self->dbdef_table->column('manual_flag') ) {
$self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum;
if ( $self->dbdef_table->column('manual_flag') ) {
@@
-757,6
+764,8
@@
sub cancel {
map { [ $_, $_->svc_x->table_info->{'cancel_weight'} ]; }
qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
) {
map { [ $_, $_->svc_x->table_info->{'cancel_weight'} ]; }
qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
) {
+ my $part_svc = $cust_svc->part_svc;
+ next if ( defined($part_svc) and $part_svc->preserve );
my $error = $cust_svc->cancel( %svc_cancel_opt );
if ( $error ) {
my $error = $cust_svc->cancel( %svc_cancel_opt );
if ( $error ) {
@@
-2195,7
+2204,8
@@
sub _labels_short {
while ( @values ) {
my $detail = "$label: ";
$detail .= shift(@values). ', '
while ( @values ) {
my $detail = "$label: ";
$detail .= shift(@values). ', '
- while @values && length($detail.$values[0]) < 78;
+ while @values
+ && ( length($detail.$values[0]) < 78 || $detail eq "$label: " );
$detail =~ s/, $//;
push @labels, $detail;
}
$detail =~ s/, $//;
push @labels, $detail;
}