[freeside-commits] branch master updated. 1043f465a4c6a1ab94df2e22823a2a688e102bcd

Christopher Burger burgerc at 420.am
Tue Aug 1 07:34:11 PDT 2017


The branch, master has been updated
       via  1043f465a4c6a1ab94df2e22823a2a688e102bcd (commit)
      from  09a43bd0984104796052ceee7fdae0581612535d (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 1043f465a4c6a1ab94df2e22823a2a688e102bcd
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Aug 1 10:33:45 2017 -0400

    RT# 75595 - Add billing event condition that will trigger when the contract end date is coming up

diff --git a/FS/FS/part_event/Condition/pkg_contract_date.pm b/FS/FS/part_event/Condition/pkg_contract_date.pm
new file mode 100644
index 0000000..2bf791a
--- /dev/null
+++ b/FS/FS/part_event/Condition/pkg_contract_date.pm
@@ -0,0 +1,38 @@
+package FS::part_event::Condition::pkg_contract_date;
+use base qw( FS::part_event::Condition );
+
+use strict;
+
+sub description {
+  'Package contract date nearing';
+}
+
+sub eventtable_hashref {
+    { 'cust_main'      => 1,
+      'cust_bill'      => 1,
+      'cust_pkg'       => 1,
+      'cust_pay'       => 1,
+      'cust_pay_batch' => 1,
+      'cust_statement' => 1,
+    };
+}
+
+sub option_fields {
+  my $class = shift;
+  (
+    'within'  =>  { 'label'   => 'Package contract date with in',
+                    'type'    => 'freq',
+                  },
+  );
+}
+
+sub condition {
+  my( $self, $cust_pkg, %opt ) = @_;
+  
+  my $contract_end_date = $cust_pkg->contract_end ? $cust_pkg->contract_end : 0;
+  my $contract_within_time = $self->option_age_from('within', $contract_end_date );
+
+  $opt{'time'} >= $contract_within_time and $contract_within_time > 0;
+}
+
+1;
\ No newline at end of file

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_event/Condition/pkg_contract_date.pm |   38 +++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 FS/FS/part_event/Condition/pkg_contract_date.pm




More information about the freeside-commits mailing list