Revision 3f924c0f
Von Kivitendo Admin vor etwa 8 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
17 | 17 |
use SL::Controller::CsvImport::Shipto; |
18 | 18 |
use SL::Controller::CsvImport::Project; |
19 | 19 |
use SL::Controller::CsvImport::Order; |
20 |
use SL::Controller::CsvImport::ARTransaction; |
|
20 | 21 |
use SL::JSON; |
21 | 22 |
use SL::Controller::CsvImport::BankTransaction; |
22 | 23 |
use SL::BackgroundJob::CsvImport; |
... | ... | |
224 | 225 |
sub check_type { |
225 | 226 |
my ($self) = @_; |
226 | 227 |
|
227 |
die "Invalid CSV import type" if none { $_ eq $::form->{profile}->{type} } qw(parts inventories customers_vendors addresses contacts projects orders bank_transactions); |
|
228 |
die "Invalid CSV import type" if none { $_ eq $::form->{profile}->{type} } qw(parts inventories customers_vendors addresses contacts projects orders bank_transactions ar_transactions);
|
|
228 | 229 |
$self->type($::form->{profile}->{type}); |
229 | 230 |
} |
230 | 231 |
|
... | ... | |
270 | 271 |
: $self->type eq 'projects' ? $::locale->text('CSV import: projects') |
271 | 272 |
: $self->type eq 'orders' ? $::locale->text('CSV import: orders') |
272 | 273 |
: $self->type eq 'bank_transactions' ? $::locale->text('CSV import: bank transactions') |
274 |
: $self->type eq 'ar_transactions' ? $::locale->text('CSV import: ar transactions') |
|
273 | 275 |
: die; |
274 | 276 |
|
275 |
if ($self->{type} eq 'customers_vendors' or $self->{type} eq 'orders' ) { |
|
277 |
if ($self->{type} eq 'customers_vendors' or $self->{type} eq 'orders' or $self->{type} eq 'ar_transactions' ) {
|
|
276 | 278 |
$self->all_taxzones(SL::DB::Manager::TaxZone->get_all_sorted(query => [ obsolete => 0 ])); |
277 | 279 |
}; |
278 | 280 |
|
... | ... | |
626 | 628 |
: $self->{type} eq 'projects' ? SL::Controller::CsvImport::Project->new(@args) |
627 | 629 |
: $self->{type} eq 'orders' ? SL::Controller::CsvImport::Order->new(@args) |
628 | 630 |
: $self->{type} eq 'bank_transactions' ? SL::Controller::CsvImport::BankTransaction->new(@args) |
631 |
: $self->{type} eq 'ar_transactions' ? SL::Controller::CsvImport::ARTransaction->new(@args) |
|
629 | 632 |
: die "Program logic error"; |
630 | 633 |
} |
631 | 634 |
|
Auch abrufbar als: Unified diff
Debitorenbuchungen als CSV importieren
Ähnlich wie der Auftragsimport wird hier gemultiplexed, d.h. es gibt separate
Zeilen für die Debitorenbuchung (ar) und die Buchungszeilen (acc_trans).
Es handelt sich allerdings nicht exakt um acc_trans-Zeilen, die direkt
als acc_trans Objekte importiert werden, sondern es können die gleichen
Informationen wie bei der Debitorenbuchung übergeben werden, also Konto,
Betrag, Steuerschlüssel und Projekt, und daraus werden dann die
acc_trans-Zeilen generiert, inklusive Steuerautomatik.
Das Forderungskonto muß in der Rechnungszeile übergeben werden, der Betrag wird
dann anhand der Buchungszeilen bestimmt.
Beispiel für Import-Format (siehe auch mehr Beispiele in t/controllers/csvimport/artransactions.t)
datatype,customer_id,taxzone_id,currency_id,invnumber,taxincluded,archart
datatype,accno,amount,taxkey
"Rechnung",960,4,1,"invoice",f,1400
"AccTransaction",8400,159.48,3