summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-04-22 14:33:22 -0700
committerIvan Kohler <ivan@freeside.biz>2015-04-22 14:33:22 -0700
commit4e3d17eefa30165031b551ddaed03007a7579ceb (patch)
tree3f52618ceeb1d6b7350e589eafa0e4488deeacd8
parent69142462165700cccd2e3e7390530cbfae54fd03 (diff)
fix contact addition in v3 new_customer_minimal, RT#34084
-rw-r--r--FS/FS/cust_main.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 7c26d8960..6aaeac64b 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -541,6 +541,33 @@ sub insert {
}
+ warn " setting contacts\n"
+ if $DEBUG > 1;
+
+ if ( my $contact = delete $options{'contact'} ) {
+
+ foreach my $c ( @$contact ) {
+ $c->custnum($self->custnum);
+ my $error = $c->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ }
+
+ } elsif ( my $contact_params = delete $options{'contact_params'} ) {
+
+ my $error = $self->process_o2m( 'table' => 'contact',
+ 'fields' => FS::contact->cgi_contact_fields,
+ 'params' => $contact_params,
+ );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
warn " setting cust_main_exemption\n"
if $DEBUG > 1;