[freeside-commits] freeside/bin import-optigold.pl,1.9,1.10

Jeff Finucane,420,, jeff at wavetail.420.am
Thu Aug 21 11:21:47 PDT 2008


Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail.420.am:/tmp/cvs-serv30494

Modified Files:
	import-optigold.pl 
Log Message:
use options with proper names

Index: import-optigold.pl
===================================================================
RCS file: /home/cvs/cvsroot/freeside/bin/import-optigold.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- import-optigold.pl	8 Aug 2008 20:29:29 -0000	1.9
+++ import-optigold.pl	21 Aug 2008 18:21:41 -0000	1.10
@@ -393,7 +393,7 @@
                                     },
                   'comment'  => 'product_id',
                   'freq'     => sub { pkg_freq(shift) },
-                  'recur'    => sub { my $href = shift;
+                  'recur_fee'=> sub { my $href = shift;
                                       my $price = ( pkg_freq($href)
                                         ? $href->{'unit_price'}
                                         : 0
@@ -448,7 +448,7 @@
                                              $part_pkg->$_('');
                                              ($_ => $v);
                                            }
-                                       qw (setup recur)
+                                       qw (setup_fee recur_fee)
                                      };
                                    my $error =
                                      $part_pkg->insert(options=>$options);
@@ -764,7 +764,7 @@
 
                                             if ($pkg && ($pkg->freq + 0)) {
                                               my $recur = 0;
-                                              $pkg->recur =~ /\s*(\S[\S ]*?)\s*$/ && ($recur = $1);
+                                              $pkg->recur_fee =~ /\s*(\S[\S ]*?)\s*$/ && ($recur = $1);
                                               $recur = eval "$recur + 0";
                                               $pkg = ''
                                                 unless $recur == $price;
@@ -792,13 +792,13 @@
                                             my $recur = sprintf("%.2f", ($month ? $price : 0));
                                             for (@pkgs) {
                                               my %options = $_->options;
-                                              if ($options{recur} eq $recur) {
+                                              if ($options{recur_fee} eq $recur) {
                                                 $pkg = $_;
                                                 last;
                                               }
                                             }
 
-                                            $pkghref->{recur} = $recur
+                                            $pkghref->{recur_fee} = $recur
                                               unless $pkg;
 
                                             my $pkg_svc = {};
@@ -821,7 +821,7 @@
                                                         $pkg->$_('');
                                                         ($_ => $v);
                                                       }
-                                                  qw (setup recur)
+                                                  qw (setup_fee recur_fee)
                                                 };
                                               my $error =
                                                 $pkg->insert(options=>$options);



More information about the freeside-commits mailing list