diff options
author | ivan <ivan> | 2008-03-26 01:03:31 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-03-26 01:03:31 +0000 |
commit | ff9bbd7beaa293463e0bc1a1c052a84da051e5f2 (patch) | |
tree | d095350d11917f4fd5a22d699dbed22be3d13071 /httemplate/edit/process | |
parent | 0d03b7e9d5c575ffc50cfd12eaa54dd91ab29711 (diff) |
quick shortcut for easier adding of new 1.7-style invoice events
Diffstat (limited to 'httemplate/edit/process')
-rwxr-xr-x | httemplate/edit/process/part_bill_event.cgi | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi index 3534519fd..eb0529bb8 100755 --- a/httemplate/edit/process/part_bill_event.cgi +++ b/httemplate/edit/process/part_bill_event.cgi @@ -72,21 +72,35 @@ if ( ! $cgi->param('plan_weight_eventcode') ) { $cgi->param('eventcode', $eventcode); $cgi->param('plandata', $plandata); - unless($error){ - my $new = new FS::part_bill_event ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_bill_event'), - } ); - $new->setfield('reason', $rnum); + unless($error) { if ( $eventpart ) { + + my $new = new FS::part_bill_event ( { + map { $_ => scalar($cgi->param($_)) } + fields('part_bill_event'), + } ); + $new->setfield('reason' => $rnum); $error = $new->replace($old); + } else { - $error = $new->insert; - $eventpart = $new->getfield('eventpart'); + + foreach my $payby ( $cgi->param('payby') ) { + my $new = new FS::part_bill_event ( { + map { $_ => scalar($cgi->param($_)) } + grep { $_ ne 'payby' } + fields('part_bill_event') + } ); + $new->setfield('payby' => $payby); + $new->setfield('reason' => $rnum ); + $error = $new->insert; + last if $error; + } + } + } + } </%init> |