-
-
Notifications
You must be signed in to change notification settings - Fork 149
/
History.pm
209 lines (129 loc) · 3.74 KB
/
History.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package LedgerSMB::Report::Inventory::History;
=head1 NAME
LedgerSMB::Report::Inventory::History - Sales/Purchase History for Goods
=head1 SYNPOSIS
LedgerSMB::Report::Inventory::History->new(%$request)->render($request);
=cut
use Moose;
use namespace::autoclean;
extends 'LedgerSMB::Report';
with 'LedgerSMB::Report::Dates';
=head1 DESCRIPTION
This
=head1 CRITERIA PROPERTIES
In addition to standard dates, the following criteria are supported:
=over
=item partnumber string
Prefix search on partnumber.
=cut
has partnumber => (is => 'ro', isa => 'Str', required => 0);
=item description string
Full text search on description of part
=cut
has description => (is => 'ro', isa => 'Str', required => 0);
=item serial_number text
This is a serial number of the part, for a prefix search
=cut
has serialnumber => (is => 'ro', isa => 'Str', required => 0);
=item inc_is bool
If true, show parts attached to sales invoices in the specified period
=cut
has inc_is => (is => 'ro', isa => 'Bool', required => 0);
=item inc_ir bool
If true, show parts attached to purchase/vendor invoices in the specified
period.
=cut
has inc_ir => (is => 'ro', isa => 'Bool', required => 0);
=item inc_so
If true, search parts in sales orders in the specified period.
=cut
has inc_so => (is => 'ro', isa => 'Bool', required => 0);
=item inc_po
If true, search purchase orders in the specified period.
=cut
has inc_po => (is => 'ro', isa => 'Bool', required => 0);
=item inc_quo
If true, search quotations in the specified period
=cut
has inc_quo => (is => 'ro', isa => 'Bool', required => 0);
=item inc_rfq
If true, search Requests for Quotations for the specified period
=cut
has inc_rfq => (is => 'ro', isa => 'Bool', required => 0);
=back
=head1 INTERNALS
=head2 columns
=cut
sub columns {
my ($self) = @_;
return [
{col_id => 'id',
type => 'href',
href_base => 'ic.pl?action=edit&id=',
name => $self->Text('ID'),},
{col_id => 'partnumber',
type => 'href',
href_base => 'ic.pl?action=edit&id=',
name => $self->Text('Part Number'),},
{col_id => 'description',
type => 'text',
name => $self->Text('Description'),},
{col_id => 'onhand',
type => 'text',
name => $self->Text('On Hand'),},
{col_id => 'unit',
type => 'text',
name => $self->Text('Unit'),},
{col_id => 'bin',
type => 'text',
name => $self->Text('Bin'),},
{col_id => 'ordnumber',
type => 'href',
name => $self->Text('Order/Invoice'),},
{col_id => 'transdate',
type => 'href',
name => $self->Text('Date'),},
{col_id => 'oe_class',
type => 'href',
name => $self->Text('Type'),},
{col_id => 'sellprice',
type => 'text',
money => 1,
name => $self->Text('Sell Price'),},
{col_id => 'qty',
type => 'text',
name => $self->Text('Qty'),},
{col_id => 'linetotal',
type => 'text',
money => 1,
name => $self->Text('Total'),},
{col_id => 'serialnumber',
type => 'text',
name => $self->Text('Serial Number'),},
];
}
=head2 name
Goods and Services
=cut
sub name {
my ($self) = @_;
return $self->Text('Goods and Services History');
}
=head1 METHODS
=head2 run_report
=cut
sub run_report {
my ($self) = @_;
my @rows = $self->call_dbmethod(funcname => 'goods__history');
return $self->rows(
[ map { { (%$_, (row_id => $_->{id})) } } @rows ]
);
}
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2012 The LedgerSMB Core Team
This file is licensed under the GNU General Public License version 2, or at your
option any later version. A copy of the license should have been included with
your software.
=cut
__PACKAGE__->meta->make_immutable;
1;