more datavolume format
[freeside.git] / FS / FS / part_pkg.pm
index e4c13aa..3bd559a 100644 (file)
@@ -600,6 +600,7 @@ sub freqs_href {
     '3'   => 'quarterly (every 3 months)',
     '6'   => 'semiannually (every 6 months)',
     '12'  => 'annually',
+    '13'  => 'every 13 months (annually +1 month)',
     '24'  => 'biannually (every 2 years)',
     '36'  => 'triannually (every 3 years)',
     '48'  => '(every 4 years)',
@@ -816,6 +817,39 @@ sub plan_info {
   \%plans;
 }
 
+=item format OPTION DATA
+
+Returns data formatted according to the function 'format' described
+in the plan info.  Returns DATA if no such function exists.
+
+=cut
+
+sub format {
+  my ($self, $option, $data) = (shift, shift, shift);
+  if (exists($plans{$self->plan}->{fields}->{$option}{format})) {
+    &{$plans{$self->plan}->{fields}->{$option}{format}}($data);
+  }else{
+    $data;
+  }
+}
+
+=item parse OPTION DATA
+
+Returns data parsed according to the function 'parse' described
+in the plan info.  Returns DATA if no such function exists.
+
+=cut
+
+sub parse {
+  my ($self, $option, $data) = (shift, shift, shift);
+  if (exists($plans{$self->plan}->{fields}->{$option}{parse})) {
+    &{$plans{$self->plan}->{fields}->{$option}{parse}}($data);
+  }else{
+    $data;
+  }
+}
+
+
 =back
 
 =head1 NEW PLAN CLASSES