[freeside-commits] branch FREESIDE_3_BRANCH updated. abc56e03d9cff03757f9a2f8a3d8f35e97cbb7c5

Jeremy Davis jeremyd at 420.am
Mon Nov 24 09:55:42 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  abc56e03d9cff03757f9a2f8a3d8f35e97cbb7c5 (commit)
      from  b5037970e79b6488263ccd196ddc07f3d38e802a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit abc56e03d9cff03757f9a2f8a3d8f35e97cbb7c5
Author: Jeremy Davis <jeremyd at freeside.biz>
Date:   Mon Nov 24 12:55:18 2014 -0500

    Ticket #32336 Unit prices not showing on quotations

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 7018223..2fae464 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2729,6 +2729,8 @@ sub _items_cust_bill_pkg {
             'pkgnum'      => $cust_bill_pkg->pkgpart, #so it displays in Ref
             'description' => $description,
             'amount'      => sprintf("%.2f", $cust_bill_pkg->setup),
+            'unit_amount'   => sprintf("%.2f", $cust_bill_pkg->unitsetup),
+            'quantity'    => $cust_bill_pkg->quantity,
             'preref_html' => ( $opt{preref_callback}
                                  ? &{ $opt{preref_callback} }( $cust_bill_pkg )
                                  : ''
@@ -2740,6 +2742,8 @@ sub _items_cust_bill_pkg {
             'pkgnum'      => $cust_bill_pkg->pkgpart, #so it displays in Ref
             'description' => "$desc (". $cust_bill_pkg->part_pkg->freq_pretty.")",
             'amount'      => sprintf("%.2f", $cust_bill_pkg->recur),
+            'unit_amount'   => sprintf("%.2f", $cust_bill_pkg->unitrecur),
+            'quantity'    => $cust_bill_pkg->quantity,
 	    'preref_html' => ( $opt{preref_callback}
                                  ? &{ $opt{preref_callback} }( $cust_bill_pkg )
                                  : ''
diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm
index 83c7320..cc45a85 100644
--- a/FS/FS/quotation_pkg.pm
+++ b/FS/FS/quotation_pkg.pm
@@ -164,6 +164,26 @@ sub recur {
   sprintf('%.2f', $recur);
 }
 
+sub unitsetup {
+  my $self = shift;
+  return '0.00' if $self->waive_setup eq 'Y' || $self->{'_NO_SETUP_KLUDGE'};
+  my $part_pkg = $self->part_pkg;
+  my $setup = $part_pkg->option('setup_fee');
+
+  #XXX discounts
+  sprintf('%.2f', $setup);
+}
+
+sub unitrecur {
+  my $self = shift;
+  return '0.00' if $self->{'_NO_RECUR_KLUDGE'};
+  my $part_pkg = $self->part_pkg;
+  my $recur = $part_pkg->can('base_recur') ? $part_pkg->base_recur
+                                           : $part_pkg->option('recur_fee');
+  #XXX discounts
+  sprintf('%.2f', $recur);
+}
+
 =item cust_bill_pkg_display [ type => TYPE ]
 
 =cut

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Template_Mixin.pm |    4 ++++
 FS/FS/quotation_pkg.pm  |   20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)




More information about the freeside-commits mailing list