summaryrefslogtreecommitdiff
path: root/site_perl
diff options
context:
space:
mode:
authorivan <ivan>1998-11-15 09:08:15 +0000
committerivan <ivan>1998-11-15 09:08:15 +0000
commit1a354432763a3e699999b81402c42a12a347c10e (patch)
treee2964a60b17a0218dece889cb17f7efcabe17e26 /site_perl
parent8fc1c5f0c2225a5d7a6a2316a9f0b77710cb5a70 (diff)
added clone method to support per-customer pricing
Diffstat (limited to 'site_perl')
-rw-r--r--site_perl/part_pkg.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/site_perl/part_pkg.pm b/site_perl/part_pkg.pm
index d1c12e47e..7434a9b24 100644
--- a/site_perl/part_pkg.pm
+++ b/site_perl/part_pkg.pm
@@ -19,6 +19,8 @@ FS::part_pkg - Object methods for part_pkg objects
$record = create FS::part_pkg \%hash
$record = create FS::part_pkg { 'column' => 'value' };
+ $custom_record = $template_record->clone;
+
$error = $record->insert;
$error = $new_record->replace($old_record);
@@ -74,6 +76,21 @@ sub create {
$proto->new('part_pkg',$hashref);
}
+=item clone
+
+Creates a new billing item definition by duplicating an existing definition.
+A new pkgpart is assigned and "(CUSTOM) " is prepended to the comment field.
+
+=cut
+
+sub clone {
+ my $self = shift;
+ my %hash = $self->hash;
+ $hash{'comment'} = "(CUSTOM) ". $hash{'comment'}
+ unless $hash{'comment'} =~ /^\(CUSTOM\) /;
+ create ( { $self->hash } );
+}
+
=item insert
Adds this billing item definition to the database. If there is an error,
@@ -142,6 +159,10 @@ sub check {
=back
+=head1 VERSION
+
+$Id: part_pkg.pm,v 1.2 1998-11-15 09:08:15 ivan Exp $
+
=head1 BUGS
It doesn't properly override FS::Record yet.
@@ -162,6 +183,11 @@ ivan@sisd.com 97-dec-5
pod ivan@sisd.com 98-sep-21
+$Log: part_pkg.pm,v $
+Revision 1.2 1998-11-15 09:08:15 ivan
+added clone method to support per-customer pricing
+
+
=cut
1;