pkgnum => { op => '>', value => '0' }
});
+ my $warning = '';
foreach my $cust_bill_pkg (@items) {
my $pkgnum = $cust_bill_pkg->pkgnum;
my $cust_pkg = $pkgnum_pkg{$pkgnum} ||= $cust_bill_pkg->cust_pkg;
next if !$sales; #no sales person, no credit
- my $amount = $self->_calc_credit($cust_bill_pkg, $sales);
+ my $amount = $self->_calc_credit($cust_bill_pkg, $sales, \$warning);
if ($amount > 0) {
$salesnum_amount{$salesnum} ||= 0;
my $reasonnum = $self->option('reasonnum');
- my $desc = 'from invoice #'. $cust_bill->display_invnum .
+ my $desc = ' for customer #'.$cust_main->display_custnum.': '.$cust_main->name.' from invoice #'. $cust_bill->display_invnum .
' ('. time2str($date_format, $cust_bill->_date) . ')';
# could also show custnum and pkgnums here?
my $error = $sales_cust_main->credit(
if $error;
} # foreach $salesnum
+ return $warning;
+
}
1;