[freeside-commits] branch FREESIDE_3_BRANCH updated. 9795489fc19bf7be914d95a0c8dba71361ea327e

Christopher Burger burgerc at 420.am
Thu Aug 3 13:21:14 PDT 2017


The branch, FREESIDE_3_BRANCH has been updated
       via  9795489fc19bf7be914d95a0c8dba71361ea327e (commit)
       via  af68bdd4980052b8ce8c7b4c9b8547341d556133 (commit)
      from  184b8e2c118ef3bd17f36b59f2a3f9690bf3d1bc (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 9795489fc19bf7be914d95a0c8dba71361ea327e
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Aug 3 15:18:35 2017 -0400

    RT# 75595 - made it only available for cust_pkg

diff --git a/FS/FS/part_event/Condition/pkg_contract_date.pm b/FS/FS/part_event/Condition/pkg_contract_date.pm
index 2bf791a..9cb75f6 100644
--- a/FS/FS/part_event/Condition/pkg_contract_date.pm
+++ b/FS/FS/part_event/Condition/pkg_contract_date.pm
@@ -8,12 +8,8 @@ sub description {
 }
 
 sub eventtable_hashref {
-    { 'cust_main'      => 1,
-      'cust_bill'      => 1,
+    {
       'cust_pkg'       => 1,
-      'cust_pay'       => 1,
-      'cust_pay_batch' => 1,
-      'cust_statement' => 1,
     };
 }
 

commit af68bdd4980052b8ce8c7b4c9b8547341d556133
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 |   34 +++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 FS/FS/part_event/Condition/pkg_contract_date.pm




More information about the freeside-commits mailing list