summaryrefslogtreecommitdiff
path: root/LedgerSMB/DBObject/Report.pm
blob: 98385dc000a4289ef09d7bda2b3f5e258e5b32d1 (plain)
  1. =head1:  NAME
  2. LedgerSMB::Report: Stub function for custom reports.
  3. =head1: COPYRIGHT
  4. Copyright (c) 2007. LedgerSMB Core Team
  5. =cut
  6. package LedgerSMB::DBObject::Report;
  7. use base qw(LedgerSMB::DBObject);
  8. use strict;
  9. our $VERSION = '1.0.0';
  10. 1;
  11. =head1 METHODS
  12. =cut
  13. # Place report definitions at the bottom of the file, please. CT
  14. =head1 DEFINED REPORTS
  15. =cut
  16. sub definition_invoice_aging {
  17. my ($self) = @_;
  18. @{$self->{entities}} =
  19. $self->exec_method(funcname => 'payment_get_all_accounts');
  20. my $entity_options = [];
  21. for my $entity (@{$self->{entities}}){
  22. my $option = {};
  23. $option->{value} = $entity->{id};
  24. $option->{label} = $entity->{name};
  25. push @$entity_options, $option;
  26. }
  27. $self->{criteria} = [
  28. {name => 'entity', type => 'select', label => 'Account',
  29. options => $entity_options},
  30. ];
  31. $self->{hidden_elements} = [
  32. {name => 'account_class', value => $self->{account_class}}
  33. ];
  34. $self->{columns} = [
  35. {id => 'entity_id', label => 'Entity ID'},
  36. {id => 'account_number', label => 'Account Number'},
  37. {id => 'name', label => 'Name'},
  38. {id => 'country', label => 'Country'},
  39. {id => 'contact_name', label => 'Contact'},
  40. {id => 'email', label => 'Email'},
  41. {id => 'phone', label => 'Telephone'},
  42. {id => 'fax', label => 'Fax'},
  43. {id => 'invnumber', label => 'Invoice Number'},
  44. {id => 'transdate', label => 'Date'},
  45. {id => 'till', label => 'Till'},
  46. {id => 'ordnumber', label => 'Order Number'},
  47. {id => 'ponumber', label => 'PO Number'},
  48. {id => 'c0', label => 'Current'},
  49. {id => 'c30', label => '30'},
  50. {id => 'c60', label => '60'},
  51. {id => 'c90', label => '90'},
  52. {id => 'duedate', label => 'Due'},
  53. {id => 'curr', label => 'Currency'},
  54. {id => 'exchangerate', label => 'Exchange Rate'},
  55. ];
  56. $self->{report_types} = [
  57. {label => "Detailed", value => "detailed"},
  58. {label => "Summary", value => "summary"},
  59. {label => "Overdue", value => "overdue"},
  60. {label => "Overdue Summary", value => "overdue_summary"},
  61. ];
  62. }
  63. =head1 ADDING DEFINED REPORTS
  64. =cut
  65. 1;