[freeside] Service numbers and legacybillingdata

ivan ivan at 420.am
Wed Nov 22 03:03:18 PST 2000


On Wed, Nov 22, 2000 at 07:44:25PM +1000, Tim McCullagh wrote:
> Hi Ivan,
> 
> Can you telll me whether I understand the Template_cust_main
> LegacyBillingData variable correctly.
> 
> In my legacy_file (legacy billing data to be imported), I have a field
> LegacyBillingData.  This legacy billing data field  has the name of one of
> my  packages ie " Hours Bulk "  etc.   Should this be an interger value?

It doesn't matter what it is, as long as you define corresponding
pkgpart's for all values that it could be in the %pkgpart hash.

> or
> should it be reading the corresponding value associated with it  in the
> my(%pkgpart) say => 1
> 
> eg
> 
> my(%pkgpart)=(                               
>   'Hours Bulk '                => 1,
> 
> 
> Do I understand the Template_cust_main correctly when I read the 
> 
> my($cust_pkg)=new FS::cust_pkg ( {                  
>   'custnum' => $svc{'custnum'},                     
>   'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}}, <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>   'setup'   => '',                                  
> 
> 
> The pkgpart variable is an interger value made up from the my(%pkgpart)
> number and the $svc{'LegacyBillingData' number.

Hua?  You need to read the basic perl docs on hashes.  See the `perldata'
manpage.  This mailing list is *NOT* for general Perl help.

> This seems to be where my errors are originating.   For some reason the
> pkgpart number being returned is 0 for all imported legacy accounts
> 
> What am I doing wrong do you think?

None of the keys you put in the %pkgpart hash match any of the values of
the LegacyBillingData in your data.

You need to suppily keys in the %pkgpart hash for all of the possible
values of LegacyBillingData.

-- 
meow
_ivan



More information about the freeside-users mailing list