RT#28246: Add more details to Change History for Discounts [better error handling]
authorJonathan Prykop <jonathan@freeside.biz>
Thu, 19 Feb 2015 21:05:07 +0000 (15:05 -0600)
committerJonathan Prykop <jonathan@freeside.biz>
Thu, 19 Feb 2015 21:05:07 +0000 (15:05 -0600)
httemplate/elements/change_history_common.html

index 9fc85aa..c858ec1 100644 (file)
@@ -191,6 +191,8 @@ my %h_table_labelsub = (
 my $discounts = {};
 my $discount_descripsub = sub {
   my($item) = @_;
+  die "Could not find part_pkg for pkgpart " . $item->pkgpart
+    unless $item->part_pkg;
   $pkgpart{$item->pkgpart} ||= $item->part_pkg->pkg;
   my $dnum = $item->discountnum;
   $discounts->{$dnum} ||= qsearchs({