diff options
| author | levinse <levinse> | 2011-07-06 04:15:36 +0000 |
|---|---|---|
| committer | levinse <levinse> | 2011-07-06 04:15:36 +0000 |
| commit | 33b372baa48b3799566a37bbd3912520f591c7de (patch) | |
| tree | 5006629bbcedb107af9d51451cde67d4b0afcf35 /FS | |
| parent | ce639adb2033f14b0bb6ef27354e2574dfc55ab7 (diff) | |
modify backdated payment application behaviour, RT11870
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/cust_main/Billing.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index d565a327c..0133164ec 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -2147,11 +2147,14 @@ sub apply_payments { my $amount = min( $payment->unapplied, $owed ); - my $cust_bill_pay = new FS::cust_bill_pay ( { + my $cbp = { 'paynum' => $payment->paynum, 'invnum' => $cust_bill->invnum, 'amount' => $amount, - } ); + }; + $cbp->{_date} = $payment->_date + if $options{'manual'} && $options{'backdate_application'}; + my $cust_bill_pay = new FS::cust_bill_pay($cbp); $cust_bill_pay->pkgnum( $payment->pkgnum ) if $conf->exists('pkg-balances') && $payment->pkgnum; my $error = $cust_bill_pay->insert(%options); |
