);
}
+ my $paycode= $options{paycode} || '';
+ my $batch_type = "DEBIT";
+ $batch_type = "CREDIT" if $paycode eq 'C';
+
my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
my %pay_batch = (
'status' => 'O',
'payby' => FS::payby->payby2payment($payby),
+ 'type' => $batch_type,
);
$pay_batch{agentnum} = $self->agentnum if $conf->exists('batch-spoolagent');
),
'exp' => $options{paydate} || $cust_payby->paydate,
'payname' => $options{payname} || $cust_payby->payname,
- 'paytype' => $options{paytype} || $cust_payby->paytype,
+ 'paytype' => $options{paytype} || $cust_payby->{'Hash'}->{'paytype'},
'amount' => $amount, # consolidating
'paycode' => $options{paycode} || '',
} );