From 77e772f611f080e537d5bc33a661e82dec0c3502 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sun, 16 Nov 2014 19:27:52 -0800 Subject: [PATCH] avoid showing discounts redundantly on invoices, #31273 --- FS/FS/Template_Mixin.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index 29c50b2ee..0928ee52f 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -3036,6 +3036,14 @@ sub _items_cust_bill_pkg { ) { my @discounts = $cust_bill_pkg->cust_bill_pkg_discount; + # special case: if there are old "discount details" on this line + # item, don't show discount line items + if ( FS::cust_bill_pkg_detail->count( + "detail LIKE 'Includes discount%' AND billpkgnum = " . + $cust_bill_pkg->billpkgnum + ) > 0 ) { + @discounts = (); + } if( @discounts ) { warn "$me _items_cust_bill_pkg including discounts for ". $cust_bill_pkg->billpkgnum."\n" -- 2.11.0