diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-07-30 20:26:15 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-07-30 20:26:15 +0000 |
commit | e5dfe76f59198db0d3b6267d5a09e62de14514e6 (patch) | |
tree | 451934eb18f71766cd98379db043a56c8b9eef9d /LedgerSMB | |
parent | 556e1b6f75b3686c408be5e299ac68b834254983 (diff) |
Adding custom batch type handles
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2224 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/Batch.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/LedgerSMB/Batch.pm b/LedgerSMB/Batch.pm index a4c4ecaf..7d25fffa 100644 --- a/LedgerSMB/Batch.pm +++ b/LedgerSMB/Batch.pm @@ -20,9 +20,15 @@ sub delete_voucher { sub get_search_criteria { $self = shift @_; + my ($custom_types) = @_; @{$self->{batch_classes}} = $self->exec_method( funcname => 'batch_list_classes' ); + for (keys %$custom_types){ + if ($custom_types->{$_}->{map_to}){ + push @{$self->{batch_classes}}, {id => $_, class => $_}; + } + } @{$self->{batch_users}} = $self->exec_method( funcname => 'batch_get_users' @@ -37,6 +43,12 @@ sub get_search_results { } else { $search_proc = "batch_search"; } + if ($args->{custom_types}->{$self->{class_id}}->{select_method}){ + $search_proc + = $args->{custom_types}->{$self->{class_id}}->{select_method}; + } elsif ($self->{class_id} =~ /[\D]/){ + $self->error("Invalid Batch Type"); + } @{$self->{search_results}} = $self->exec_method(funcname => $search_proc); return @{$self->{search_results}}; } |