[freeside-commits] branch FREESIDE_3_BRANCH updated. 01f9e027252b87d21c76b8dad737a761e61bb1f7
Ivan
ivan at 420.am
Wed Mar 8 21:24:26 PST 2017
The branch, FREESIDE_3_BRANCH has been updated
via 01f9e027252b87d21c76b8dad737a761e61bb1f7 (commit)
from 83e3b2399bbdf0530c00c1d23fe41089f473a71a (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 01f9e027252b87d21c76b8dad737a761e61bb1f7
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed Mar 8 21:24:25 2017 -0800
End of Month invoice terms, RT#74050
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 8009b65..8d575a6 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -696,8 +696,8 @@ logo.eps
'',
'Payable upon receipt',
'Net 0', 'Net 3', 'Net 5', 'Net 7', 'Net 9', 'Net 10', 'Net 14',
- 'Net 15', 'Net 18', 'Net 20', 'Net 21', 'Net 25', 'Net 30', 'Net 45',
- 'Net 60', 'Net 90'
+ 'Net 15', 'Net 18', 'Net 20', 'Net 21', 'Net 25', 'End of Month', 'Net 30',
+ 'Net 45', 'Net 60', 'Net 90'
);
my %msg_template_options = (
@@ -6261,6 +6261,14 @@ and customer address. Include units.',
{ key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
+ {
+ 'key' => 'selfservice-db_profile',
+ 'section' => 'development',
+ 'description' => 'Enable collection and logging of database profiling information for self-service servers. This has significant overhead, do not leave enabled in production beyond that necessary to collect profiling data.',
+ 'type' => 'checkbox',
+ },
+
+
# for internal use only; test databases should declare this option and
# everyone else should pretend it doesn't exist
#{
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 229c3ad..8734a78 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -10,6 +10,7 @@ use vars qw( $invoice_lines @buf ); #yuck
use List::Util qw(sum); #can't import first, it conflicts with cust_main.first
use Date::Format;
use Date::Language;
+use Time::Local qw( timelocal );
use Text::Template 1.20;
use File::Temp 0.14;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
@@ -1919,6 +1920,12 @@ sub due_date {
my $duedate = '';
if ( $self->terms =~ /^\s*Net\s*(\d+)\s*$/ ) {
$duedate = $self->_date() + ( $1 * 86400 );
+ } elsif ( $self->terms =~ /^End of Month$/ ) {
+ my ($mon,$year) = (localtime($self->_date) )[4,5];
+ $mon++;
+ until ( $mon < 12 ) { $mon -= 12; $year++; }
+ my $nextmonth_first = timelocal(0,0,0,1,$mon,$year);
+ $duedate = $nextmonth_first - 86400;
}
$duedate;
}
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Conf.pm | 12 ++++++++++--
FS/FS/Template_Mixin.pm | 7 +++++++
2 files changed, 17 insertions(+), 2 deletions(-)
More information about the freeside-commits
mailing list