diff options
author | ivan <ivan> | 2009-07-21 18:44:57 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-07-21 18:44:57 +0000 |
commit | 6a7c4ac2fafc9d722c3ee4c5b75f1f8ca83b6c1a (patch) | |
tree | 205cc417302d2147c45a12f24addc37c75de25fd | |
parent | 48214eb5dfdaf96e35a60959d9c227c699a2a3d3 (diff) |
sub-penny termination pricing too, RT#5495
-rw-r--r-- | FS/FS/Schema.pm | 12 | ||||
-rw-r--r-- | FS/FS/part_pkg/cdr_termination.pm | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 419e9ac20..b2f590aec 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -2112,7 +2112,7 @@ sub tables_hashref { # how it was rated internally... 'ratedetailnum', 'int', 'NULL', '', '', '', - 'rated_price', 'decimal', 'NULL', '10,2', '', '', + 'rated_price', 'decimal', 'NULL', '10,4', '', '', 'distance', 'decimal', 'NULL', '', '', '', 'islocal', 'int', 'NULL', '', '', '', # '', '', 0, '' instead? @@ -2156,11 +2156,11 @@ sub tables_hashref { 'cdr_termination' => { 'columns' => [ - 'cdrtermnum', 'bigserial', '', '', '', '', - 'acctid', 'bigint', '', '', '', '', - 'termpart', 'int', '', '', '', '',#future expansion, see below - 'rated_price', @money_typen, '', '', - 'status', 'varchar', 'NULL', 32, '', '', + 'cdrtermnum', 'bigserial', '', '', '', '', + 'acctid', 'bigint', '', '', '', '', + 'termpart', 'int', '', '', '', '',#future use see below + 'rated_price', 'decimal', 'NULL', '10,4', '', '', + 'status', 'varchar', 'NULL', 32, '', '', ], 'primary_key' => 'cdrtermnum', 'unique' => [ [ 'acctid', 'termpart' ] ], diff --git a/FS/FS/part_pkg/cdr_termination.pm b/FS/FS/part_pkg/cdr_termination.pm index a07384655..d99903d77 100644 --- a/FS/FS/part_pkg/cdr_termination.pm +++ b/FS/FS/part_pkg/cdr_termination.pm @@ -164,7 +164,9 @@ sub calc_recur { #add a cdr_termination record and the charges - my $term_price = sprintf('%.2f', $cdr->rated_price * $term_percent / 100 ); + # XXX config? + #my $term_price = sprintf('%.2f', $cdr->rated_price * $term_percent / 100 ); + my $term_price = sprintf('%.4f', $cdr->rated_price * $term_percent / 100 ); my $cdr_termination = new FS::cdr_termination { 'acctid' => $cdr->acctid, |