diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-06-13 17:00:38 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-06-13 17:00:38 -0700 |
commit | d040dd06eb4b4bd1d5991445038296f952a38d13 (patch) | |
tree | 688363bcf479f1d5e28e9a0fbdc05dedbbaf8387 /FS/FS | |
parent | 8a28145d78b44e2f51a5a71dc805bee977ac0738 (diff) |
charge for printing usage
Diffstat (limited to 'FS/FS')
-rw-r--r-- | FS/FS/part_pkg/fsinc_print.pm | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/FS/FS/part_pkg/fsinc_print.pm b/FS/FS/part_pkg/fsinc_print.pm new file mode 100644 index 000000000..8f4cfb18d --- /dev/null +++ b/FS/FS/part_pkg/fsinc_print.pm @@ -0,0 +1,47 @@ +package FS::part_pkg::fsinc_print; + +use strict; +use vars qw( %info ); +use FS::Record; + +%info = ( + 'name' => 'Usage from Freeside Inc. web services', + 'shortname' => 'Freeside web services', + 'weight' => '99', +); + +sub price_info { + my $self = shift; + return 'printing usage'; +} + +sub base_setup { 0; } +sub calc_setup { 0; } + +sub base_recur { 0; } +sub calc_recur { + #my $self = shift; + #my($self, $cust_pkg, $sdate, $details, $param ) = @_; + my( $self, $cust_pkg ) = @_; + + my $custnum = $cust_pkg->custnum; + + #false laziness w/ClientAPI/Freeside.pm and webservice_log.pm + my $color = 1.10; + my $page = 0.10; + + FS::Record->scalar_sql(" + UPDATE webservice_log SET status = 'done' + WHERE custnum = $custnum + AND method = 'print' + AND status IS NULL + RETURNING SUM ( $color + quantity * $page ) + "); + +} + +sub can_discount { 0; } + +sub is_free { 0; } + +1; |