diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/AccessRight.pm | 1 | ||||
-rw-r--r-- | FS/FS/access_right.pm | 1 | ||||
-rw-r--r-- | FS/FS/cust_main/Billing.pm | 13 |
3 files changed, 11 insertions, 4 deletions
diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm index 51e47adaf..a24d736ee 100644 --- a/FS/FS/AccessRight.pm +++ b/FS/FS/AccessRight.pm @@ -152,6 +152,7 @@ tie my %rights, 'Tie::IxHash', 'View appointments', #NEWNEW 'Make appointment', 'View package definition costs', #NEWNEW + 'Change package start date', ], ### diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm index 0da718c64..57f67ded3 100644 --- a/FS/FS/access_right.pm +++ b/FS/FS/access_right.pm @@ -253,6 +253,7 @@ sub _upgrade_data { # class method 'Generate quotation' => 'Disable quotation', 'Add on-the-fly void credit reason' => 'Add on-the-fly void reason', '_ALL' => 'Employee preference telephony integration', + 'Edit customer package dates' => 'Change package start date', #4.x ); # foreach my $old_acl ( keys %onetime ) { diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index 29535f25c..1157ba98f 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -1042,10 +1042,15 @@ sub _make_lines { } } - $cust_pkg->setfield('setup', $time) - unless $cust_pkg->setup; - #do need it, but it won't get written to the db - #|| $cust_pkg->pkgpart != $real_pkgpart; + if ( $cust_pkg->get('setup') ) { + # don't change it + } elsif ( $cust_pkg->get('start_date') ) { + # this allows start_date to be used to set the first bill date + $cust_pkg->set('setup', $cust_pkg->get('start_date')); + } else { + # if unspecified, start it right now + $cust_pkg->set('setup', $time); + } $cust_pkg->setfield('start_date', '') if $cust_pkg->start_date; |