+ if ($cust_pkg_discount) {
+ my $discount = qsearchs(discount => {
+ discountnum => $cust_pkg_discount->discountnum,
+ disabled => 'Y',
+ });
+ if ($discount) {
+ my $descr = $opt{carry_value} eq $discount->discountnum
+ ? $discount->description.' [Continue existing discount]'
+ : $discount->description;
+ push @$post_options, $discount->discountnum, $descr;
+ }
+ }
+}
+
+push @$post_options, -1 => 'Custom discount'
+ if $curuser->access_right('Custom discount customer package')
+ && ! $opt{disable_custom_discount};
+
+my $label_callback = sub {
+ my $rec = shift;
+ if ( $opt{carry_value} eq $rec->discountnum ) {
+ return $rec->description.' [Continue existing discount]';
+ }
+ return $rec->description;
+};
+
+</%init>