Revision 1f9b0c55
Von Kivitendo Admin vor mehr als 10 Jahren hinzugefügt
SL/Controller/CsvImport/Part.pm | ||
---|---|---|
258 | 258 |
my ($self, $entry) = @_; |
259 | 259 |
|
260 | 260 |
my $bg = $self->bg_by->{id}->{ $entry->{object}->buchungsgruppen_id }; |
261 |
$bg ||= SL::DB::Buchungsgruppe->new(inventory_accno_id => 1, income_accno_id_0 => 1, expense_accno_id_0 => 1);
|
|
261 |
$bg ||= SL::DB::Buchungsgruppe->new(inventory_accno_id => 1); # does this case ever occur?
|
|
262 | 262 |
|
263 | 263 |
my $type = $self->settings->{parts_type}; |
264 | 264 |
if ($type eq 'mixed') { |
... | ... | |
270 | 270 |
|
271 | 271 |
$entry->{object}->assembly($type eq 'assembly'); |
272 | 272 |
|
273 |
$entry->{object}->income_accno_id( $bg->income_accno_id_0 ); |
|
273 |
# when saving income_accno_id or expense_accno_id use ids from the selected |
|
274 |
# $bg according to the default tax_zone (the one with the highest sort |
|
275 |
# order). Alternatively one could use the ids from defaults, but they might |
|
276 |
# not all be set. |
|
277 |
|
|
278 |
$entry->{object}->income_accno_id( $bg->income_accno_id( SL::DB::Manager::TaxZone->get_default->id ) ); |
|
274 | 279 |
|
275 | 280 |
if ($type eq 'part' || $type eq 'service') { |
276 |
$entry->{object}->expense_accno_id( $bg->expense_accno_id_0 );
|
|
281 |
$entry->{object}->expense_accno_id( $bg->expense_accno_id( SL::DB::Manager::TaxZone->get_default->id ) );
|
|
277 | 282 |
} |
278 | 283 |
|
279 | 284 |
if ($type eq 'part') { |
280 | 285 |
$entry->{object}->inventory_accno_id( $bg->inventory_accno_id ); |
281 | 286 |
} |
282 | 287 |
|
283 |
|
|
284 | 288 |
if (none { $_ eq $type } qw(part service assembly)) { |
285 | 289 |
push @{ $entry->{errors} }, $::locale->text('Error: Invalid part type'); |
286 | 290 |
return 0; |
Auch abrufbar als: Unified diff
CsvImport - Part : Anpassung für neue Steuerzonen
statt income/expense_accno_id_0 werden jetzt bei importierten
Waren/Dienstleistungen die Konten-IDs der Standardsteuerzone verwendet.
(Wobei die genau ID ja egal ist, wichtig ist, ob etwas gesetzt ist).