summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-11-16 19:27:35 -0800
committerMark Wells <mark@freeside.biz>2014-11-16 19:27:35 -0800
commit462a9a2808f839c1b4ab676ece47d4d1cebec2ef (patch)
treee827613c06da94029c4189126ee516f035dcaecf
parent74e6dd693162bb44bcb9ee45c49f6d48d7b2072e (diff)
avoid showing discounts redundantly on invoices, #31273
-rw-r--r--FS/FS/Template_Mixin.pm8
1 files changed, 8 insertions, 0 deletions
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"