summaryrefslogtreecommitdiff
path: root/LedgerSMB/Batch.pm
blob: 28be86f7bab4dc8e8826a13c8cdf8dc58571f9fd (plain)
  1. package LedgerSMB::Batch;
  2. use base qw(LedgerSMB::DBObject);
  3. sub create {
  4. $self = shift @_;
  5. my ($ref) = $self->exec_method(funcname => 'batch_create');
  6. $self->{id} = $ref->{batch_create};
  7. $self->{dbh}->commit;
  8. return $ref->{id};
  9. }
  10. sub get_search_criteria {
  11. $self = shift @_;
  12. @{$self->{batch_classes}} = $self->exec_method(
  13. funcname => 'batch_list_classes'
  14. );
  15. @{$self->{batch_users}} = $self->exec_method(
  16. funcname => 'batch_get_users'
  17. );
  18. }
  19. sub get_search_results {
  20. my ($self) = @_;
  21. @{$self->{search_results}} = $self->exec_method(funcname => 'batch_search');
  22. return @{$self->{search_results}};
  23. }
  24. 1;