summaryrefslogtreecommitdiff
path: root/LedgerSMB/DBObject/Draft.pm
blob: 2aec59a98d18bca14e5aad0d2a857720dfdd5fad (plain)
  1. package LedgerSMB::DBObject::Draft;
  2. use base qw/LedgerSMB::DBObject/;
  3. sub search {
  4. my ($self) = @_;
  5. @{$self->{draft_results} = $self->exec_method(funcname => 'draft__search');
  6. return @{$self->{draft_results};
  7. }
  8. sub approve {
  9. my ($self) = @_;
  10. if (!$self->{id}){
  11. $self->error($self->{_locale}->text('No ID Set');
  12. }
  13. ($self->{approved}) = $self->exec_method(funcname => 'draft_approve');
  14. return $self->{approved};
  15. }
  16. sub delete {
  17. my ($self) = @_;
  18. if (!$self->{id}){
  19. $self->error($self->{_locale}->text('No ID Set');
  20. }
  21. ($self->{deleted}) = $self->exec_method(funcname => 'draft_delete');
  22. return $self->{deleted};
  23. }