projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1d15c69
)
add waive setup fee upon package order feature, RT12568
author
levinse
<levinse>
Mon, 25 Apr 2011 04:37:41 +0000
(
04:37
+0000)
committer
levinse
<levinse>
Mon, 25 Apr 2011 04:37:41 +0000
(
04:37
+0000)
FS/FS/AccessRight.pm
patch
|
blob
|
history
FS/FS/Schema.pm
patch
|
blob
|
history
FS/FS/cust_main/Billing.pm
patch
|
blob
|
history
FS/FS/cust_pkg.pm
patch
|
blob
|
history
httemplate/edit/process/quick-cust_pkg.cgi
patch
|
blob
|
history
httemplate/misc/order_pkg.html
patch
|
blob
|
history
diff --git
a/FS/FS/AccessRight.pm
b/FS/FS/AccessRight.pm
index
aa59e7d
..
c3aeb2d
100644
(file)
--- a/
FS/FS/AccessRight.pm
+++ b/
FS/FS/AccessRight.pm
@@
-144,6
+144,7
@@
tie my %rights, 'Tie::IxHash',
'Edit customer package invoice details', #NEW
'Edit customer package comments', #NEW
'Qualify service', #NEW
'Edit customer package invoice details', #NEW
'Edit customer package comments', #NEW
'Qualify service', #NEW
+ 'Waive setup fee', #NEW
],
###
],
###
diff --git
a/FS/FS/Schema.pm
b/FS/FS/Schema.pm
index
deb3995
..
983edec
100644
(file)
--- a/
FS/FS/Schema.pm
+++ b/
FS/FS/Schema.pm
@@
-1443,6
+1443,7
@@
sub tables_hashref {
'no_auto', 'char', 'NULL', 1, '', '',
'quantity', 'int', 'NULL', '', '', '',
'agent_pkgid', 'int', 'NULL', '', '', '',
'no_auto', 'char', 'NULL', 1, '', '',
'quantity', 'int', 'NULL', '', '', '',
'agent_pkgid', 'int', 'NULL', '', '', '',
+ 'waive_setup', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'pkgnum',
'unique' => [],
],
'primary_key' => 'pkgnum',
'unique' => [],
diff --git
a/FS/FS/cust_main/Billing.pm
b/FS/FS/cust_main/Billing.pm
index
b710f33
..
1bf7b02
100644
(file)
--- a/
FS/FS/cust_main/Billing.pm
+++ b/
FS/FS/cust_main/Billing.pm
@@
-846,13
+846,16
@@
sub _make_lines {
{
warn " bill setup\n" if $DEBUG > 1;
{
warn " bill setup\n" if $DEBUG > 1;
- $lineitems++;
- $setup = eval { $cust_pkg->calc_setup( $time, \@details ) };
- return "$@ running calc_setup for $cust_pkg\n"
- if $@;
+ unless ( $cust_pkg->waive_setup ) {
+ $lineitems++;
+
+ $setup = eval { $cust_pkg->calc_setup( $time, \@details ) };
+ return "$@ running calc_setup for $cust_pkg\n"
+ if $@;
- $unitsetup = $cust_pkg->part_pkg->unit_setup || $setup; #XXX uuh
+ $unitsetup = $cust_pkg->part_pkg->unit_setup || $setup; #XXX uuh
+ }
$cust_pkg->setfield('setup', $time)
unless $cust_pkg->setup;
$cust_pkg->setfield('setup', $time)
unless $cust_pkg->setup;
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
13a3b6e
..
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,6
+596,7
@@
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;
|| $self->ut_numbern('agent_pkgid')
;
return $error if $error;
diff --git
a/httemplate/edit/process/quick-cust_pkg.cgi
b/httemplate/edit/process/quick-cust_pkg.cgi
index
a6449b8
..
bf5087c
100644
(file)
--- a/
httemplate/edit/process/quick-cust_pkg.cgi
+++ b/
httemplate/edit/process/quick-cust_pkg.cgi
@@
-95,6
+95,7
@@
my $cust_pkg = new FS::cust_pkg {
? parse_datetime($cgi->param('contract_end'))
: ''
),
? parse_datetime($cgi->param('contract_end'))
: ''
),
+ 'waive_setup' => ( $cgi->param('waive_setup') eq 'Y' ? 'Y' : '' ),
#'discountnum_disabled' => scalar($cgi->param('discountnum_disabled')),
};
#'discountnum_disabled' => scalar($cgi->param('discountnum_disabled')),
};
diff --git
a/httemplate/misc/order_pkg.html
b/httemplate/misc/order_pkg.html
index
964441a
..
4f511cc
100644
(file)
--- a/
httemplate/misc/order_pkg.html
+++ b/
httemplate/misc/order_pkg.html
@@
-64,6
+64,13
@@
%>
% }
%>
% }
+% if ( $curuser->access_right('Waive setup fee') ) {
+ <TR>
+ <TH ALIGN="right">Waive setup fee </TH>
+ <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="waive_setup" VALUE="Y"></TD>
+ </TR>
+% }
+
% if ( $conf->exists('pkg_referral') ) {
<% include('/elements/tr-select-part_referral.html',
'curr_value' => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum,
% if ( $conf->exists('pkg_referral') ) {
<% include('/elements/tr-select-part_referral.html',
'curr_value' => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum,