summaryrefslogtreecommitdiff
path: root/FS/FS/Template_Mixin.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-11-16 19:27:52 -0800
committerMark Wells <mark@freeside.biz>2014-11-16 19:27:52 -0800
commit77e772f611f080e537d5bc33a661e82dec0c3502 (patch)
treed71103a3d5a9976d4cd582a1f8757df94f39c167 /FS/FS/Template_Mixin.pm
parentbb22f46481173b008fc9cb98b108ef1da9c1dc4d (diff)
avoid showing discounts redundantly on invoices, #31273
Diffstat (limited to 'FS/FS/Template_Mixin.pm')
-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"