foreach my $del_obj (
grep { ! $edits{$_->$table_pkey()} }
- qsearch( $table, $hashref )
+ $self->process_o2m_qsearch( $table, $hashref )
) {
my $error = $del_obj->delete;
if ( $error ) {
}
foreach my $pkey_value ( keys %edits ) {
- my $old_obj = qsearchs( $table, { %$hashref, $table_pkey => $pkey_value } ),
+ my $old_obj = $self->process_o2m_qsearchs( $table, { %$hashref, $table_pkey => $pkey_value } );
my $add_param = $edits{$pkey_value};
my %hash = ( $table_pkey => $pkey_value,
map { $_ => $opt{'params'}->{$add_param."_$_"} }
@{ $opt{'fields'} }
);
+ &{ $opt{'hash_callback'} }( \%hash ) if $opt{'hash_callback'};
#next unless grep { $_ =~ /\S/ } values %hash;
my $new_obj = "FS::$table"->new( { %$hashref, %hash } );
my %hash = map { $_ => $opt{'params'}->{$add_param."_$_"} }
@{ $opt{'fields'} };
+ &{ $opt{'hash_callback'} }( \%hash ) if $opt{'hash_callback'};
next unless grep { $_ =~ /\S/ } values %hash;
my $add_obj = "FS::$table"->new( { %$hashref, %hash } );
'';
}
+sub process_o2m_qsearch { my $self = shift; qsearch( @_ ); }
+sub process_o2m_qsearchs { my $self = shift; qsearchs( @_ ); }
+
sub _load_table {
my( $self, $table ) = @_;
eval "use FS::$table";