backup the schema for tables we don't need the data from. RT#85959
[freeside.git] / FS / FS / part_pkg / fsinc_print.pm
1 package FS::part_pkg::fsinc_print;
2
3 use strict;
4 use vars qw( %info );
5 use FS::Record;
6
7 %info = (
8   'name'      => 'Usage from Freeside Inc. web services',
9   'shortname' => 'Freeside web services',
10   'weight'    => '99',
11 );
12
13 sub price_info {
14   my $self = shift;
15   return 'printing usage';
16 }
17
18 sub base_setup { 0; }
19 sub calc_setup { 0; }
20
21 sub base_recur { 0; }
22 sub calc_recur {
23   #my $self = shift;
24   #my($self, $cust_pkg, $sdate, $details, $param ) = @_;
25   my( $self, $cust_pkg ) = @_;
26
27   my $custnum = $cust_pkg->custnum;
28
29   #false laziness w/ClientAPI/Freeside.pm and webservice_log.pm
30   my $color = 1.10;
31   my $page = 0.10;
32
33   FS::Record->scalar_sql("
34     UPDATE webservice_log SET status = 'done'
35       WHERE custnum = $custnum
36         AND method = 'print'
37         AND status IS NULL 
38     RETURNING SUM ( $color + quantity * $page )
39   ");
40
41 }
42
43 sub can_discount { 0; }
44
45 sub is_free { 0; }
46
47 1;