change calculation method for prepaid income report, #13289
[freeside.git] / FS / FS / Mason.pm
index 6cc32bd..cc501c0 100644 (file)
@@ -55,7 +55,7 @@ if ( -e $addl_handler_use_file ) {
 
   #use CGI::Carp qw(fatalsToBrowser);
   use CGI::Cookie;
-  use List::Util qw( max min );
+  use List::Util qw( max min sum );
   use Data::Dumper;
   use Date::Format;
   use Time::Local;
@@ -303,6 +303,9 @@ if ( -e $addl_handler_use_file ) {
   use FS::discount_plan;
   use FS::tower;
   use FS::tower_sector;
+  use FS::sales;
+  use FS::access_groupsales;
+  use FS::contact_class;
   # Sammath Naur
 
   if ( $FS::Mason::addl_handler_use ) {
@@ -546,6 +549,8 @@ sub mason_interps {
     ${$_[0]} =~ s/(['\\])/\\$1/g;
     ${$_[0]} =~ s/\r/\\r/g;
     ${$_[0]} =~ s/\n/\\n/g;
+    # prevent premature termination of the script
+    ${$_[0]} =~ s[</script>][<\\/script>]ig;
     ${$_[0]} = "'". ${$_[0]}. "'";
   };