Revision ed3be965
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DB/Invoice.pm | ||
---|---|---|
14 | 14 |
use SL::DB::Helper::PriceTaxCalculator; |
15 | 15 |
use SL::DB::Helper::TransNumberGenerator; |
16 | 16 |
use SL::DB::AccTransaction; |
17 |
use SL::DB::Chart; |
|
17 | 18 |
use SL::DB::Employee; |
18 | 19 |
|
19 | 20 |
__PACKAGE__->meta->add_relationship( |
... | ... | |
123 | 124 |
sub post { |
124 | 125 |
my ($self, %params) = @_; |
125 | 126 |
|
126 |
croak("Missing parameter 'ar_id'") unless $params{ar_id}; |
|
127 |
if (!$params{ar_id}) { |
|
128 |
my $chart = SL::DB::Manager::Chart->get_all(query => [ SL::DB::Manager::Chart->link_filter('AR') ], |
|
129 |
sort_by => 'id ASC', |
|
130 |
limit => 1)->[0]; |
|
131 |
croak("No AR chart found and no parameter `ar_id' given") unless $chart; |
|
132 |
$params{ar_id} = $chart->id; |
|
133 |
} |
|
127 | 134 |
|
128 | 135 |
my $worker = sub { |
129 | 136 |
my %data = $self->calculate_prices_and_taxes; |
... | ... | |
241 | 248 |
=item * C<ar_id> |
242 | 249 |
|
243 | 250 |
The ID of the accounds receivable chart the invoices amounts are |
244 |
posted to. |
|
251 |
posted to. If it is not set then the first chart configured for |
|
252 |
accounts receivables is used. |
|
245 | 253 |
|
246 | 254 |
=back |
247 | 255 |
|
Auch abrufbar als: Unified diff
Invoice::post selber ar_id setzen lassen, wenn nicht angegeben