Revision 39f3d12c
Von Moritz Bunkus vor etwa 18 Jahren hinzugefügt
SL/DATEV.pm | ||
---|---|---|
83 | 83 |
$main::lxdebug->enter_sub(); |
84 | 84 |
|
85 | 85 |
my ($self, $myconfig, $form) = @_; |
86 |
my $rc;
|
|
86 |
my @rc;
|
|
87 | 87 |
|
88 | 88 |
if ($form->{exporttype} == 0) { |
89 |
$rc = &kne_buchungsexport($myconfig, $form);
|
|
89 |
@rc = &kne_buchungsexport($myconfig, $form);
|
|
90 | 90 |
} else { |
91 |
$rc = &kne_stammdatenexport($myconfig, $form);
|
|
91 |
@rc = &kne_stammdatenexport($myconfig, $form);
|
|
92 | 92 |
} |
93 | 93 |
|
94 | 94 |
$main::lxdebug->leave_sub(); |
95 | 95 |
|
96 |
return $rc;
|
|
96 |
return @rc;
|
|
97 | 97 |
} |
98 | 98 |
|
99 | 99 |
sub obe_export { |
... | ... | |
583 | 583 |
|
584 | 584 |
my ($myconfig, $form) = @_; |
585 | 585 |
|
586 |
my $export_path = "datev/"; |
|
586 |
my @filenames; |
|
587 |
|
|
588 |
my $export_path = $main::userspath . "/"; |
|
587 | 589 |
my $filename = "ED00000"; |
588 | 590 |
my $evfile = "EV01"; |
589 | 591 |
my @ed_versionsets; |
... | ... | |
611 | 613 |
my $buchungssatz = ""; |
612 | 614 |
$filename++; |
613 | 615 |
my $ed_filename = $export_path . $filename; |
616 |
push(@filenames, $filename); |
|
614 | 617 |
open(ED, "> $ed_filename") or die "can't open outputfile: $!\n"; |
615 | 618 |
$header = &make_kne_data_header($myconfig, $form, $fromto); |
616 | 619 |
$remaining_bytes -= length($header); |
... | ... | |
822 | 825 |
#Make EV Verwaltungsdatei |
823 | 826 |
$ev_header = &make_ev_header($form, $fileno); |
824 | 827 |
$ev_filename = $export_path . $evfile; |
828 |
push(@filenames, $evfile); |
|
825 | 829 |
open(EV, "> $ev_filename") or die "can't open outputfile: EV01\n"; |
826 | 830 |
print(EV $ev_header); |
827 | 831 |
|
... | ... | |
829 | 833 |
print(EV $ed_versionset[$file]); |
830 | 834 |
} |
831 | 835 |
close(EV); |
832 |
print qq|<br>Done. <br></body> |
|
833 |
</html> |
|
836 |
print qq|<br>Done. <br> |
|
834 | 837 |
|; |
835 | 838 |
### |
836 | 839 |
$main::lxdebug->leave_sub(); |
840 |
|
|
841 |
return @filenames; |
|
837 | 842 |
} |
838 | 843 |
|
839 | 844 |
sub kne_stammdatenexport { |
... | ... | |
842 | 847 |
my ($myconfig, $form) = @_; |
843 | 848 |
$form->{abrechnungsnr} = "99"; |
844 | 849 |
|
845 |
my $export_path = "datev/"; |
|
850 |
$form->header; |
|
851 |
print qq| |
|
852 |
<html> |
|
853 |
<body>Export in Bearbeitung<br> |
|
854 |
|; |
|
855 |
|
|
856 |
my @filenames; |
|
857 |
|
|
858 |
my $export_path = $main::userspath . "/"; |
|
846 | 859 |
my $filename = "ED00000"; |
847 | 860 |
my $evfile = "EV01"; |
848 | 861 |
my @ed_versionsets; |
... | ... | |
854 | 867 |
my $buchungssatz = ""; |
855 | 868 |
$filename++; |
856 | 869 |
my $ed_filename = $export_path . $filename; |
870 |
push(@filenames, $filename); |
|
857 | 871 |
open(ED, "> $ed_filename") or die "can't open outputfile: $!\n"; |
858 | 872 |
$header = &make_kne_data_header($myconfig, $form, ""); |
859 | 873 |
$remaining_bytes -= length($header); |
... | ... | |
911 | 925 |
|
912 | 926 |
$ev_header = &make_ev_header($form, $fileno); |
913 | 927 |
$ev_filename = $export_path . $evfile; |
928 |
push(@filenames, $evfile); |
|
914 | 929 |
open(EV, "> $ev_filename") or die "can't open outputfile: EV01\n"; |
915 | 930 |
print(EV $ev_header); |
916 | 931 |
|
... | ... | |
922 | 937 |
$dbh->disconnect; |
923 | 938 |
### |
924 | 939 |
|
940 |
print qq|<br>Done. <br> |
|
941 |
|; |
|
942 |
|
|
925 | 943 |
$main::lxdebug->leave_sub(); |
944 |
|
|
945 |
return @filenames; |
|
926 | 946 |
} |
927 | 947 |
|
928 | 948 |
1; |
bin/mozilla/datev.pl | ||
---|---|---|
25 | 25 |
# |
26 | 26 |
#====================================================================== |
27 | 27 |
|
28 |
use POSIX qw(strftime getcwd); |
|
29 |
use Archive::Zip qw(:ERROR_CODES :CONSTANTS); |
|
30 |
|
|
31 |
use SL::Common; |
|
28 | 32 |
use SL::DATEV; |
29 | 33 |
|
30 | 34 |
1; |
... | ... | |
80 | 84 |
<td><input name=datentraegernr size=5 maxlength=3 value="$form->{datentraegernr}"></td> |
81 | 85 |
</tr> |
82 | 86 |
<tr> |
83 |
<td><input checked name=kne type=checkbox class=checkbox value=1> |
|
|
84 |
. $locale->text("Kontonummernerweiterung (KNE)") . qq|</td>
|
|
87 |
| . # OBE-Export noch nicht implementiert! <td><input checked name=kne type=checkbox class=checkbox value=1> | . $locale->text("Kontonummernerweiterung (KNE)") . qq|</td>
|
|
88 |
qq|<td><input type="hidden" name="kne" value="1"></td>
|
|
85 | 89 |
<td></td> |
86 | 90 |
|
87 | 91 |
<td align=left nowrap>| . $locale->text("Abrechnungsnummer") . qq|</td> |
88 | 92 |
<td><input name=abrechnungsnr size=5 maxlength=3 value="$form->{abrechnungsnr}"></td> |
89 | 93 |
</tr> |
94 |
|
|
90 | 95 |
<tr> |
91 | 96 |
<td><input name=exporttype type=radio class=radio value=0 checked> | |
92 | 97 |
. $locale->text("Export Buchungsdaten") . qq|</td> |
... | ... | |
321 | 326 |
|
322 | 327 |
DATEV->save_datev_stamm(\%myconfig, \%$form); |
323 | 328 |
|
329 |
my $link = $form->{"script"} . "?"; |
|
330 |
map({ $link .= "${_}=" . $form->escape($form->{$_}) . "&"; } qw(path login password)); |
|
331 |
$link .= "action=download"; |
|
332 |
|
|
324 | 333 |
if ($form->{kne}) { |
325 |
if (DATEV->kne_export(\%myconfig, \%$form)) { |
|
326 |
$form->redirect($locale->text('KNE Export erfolgreich!')); |
|
334 |
my @filenames = DATEV->kne_export(\%myconfig, \%$form); |
|
335 |
if (@filenames) { |
|
336 |
print(qq|<br><b>| . $locale->text('KNE-Export erfolgreich!') . qq|</b><br>|); |
|
337 |
$link .= "&filenames=" . $form->escape(join(":", @filenames)); |
|
338 |
print(qq|<br><a href="$link">Download</a>|); |
|
339 |
} else { |
|
340 |
$form->error("KNE-Export schlug fehl."); |
|
327 | 341 |
} |
328 | 342 |
} else { |
329 |
if (DATEV->obe_export(\%myconfig, \%$form)) { |
|
330 |
$form->redirect($locale->text('OBE Export erfolgreich!')); |
|
343 |
my @filenames = DATEV->obe_export(\%myconfig, \%$form); |
|
344 |
if (@filenames) { |
|
345 |
print(qq|<br><b>| . $locale->text('OBE-Export erfolgreich!') . qq|</b><br>|); |
|
346 |
$link .= "&filenames=" . $form->escape(join(":", @filenames)); |
|
347 |
print(qq|<br><a href="$link">Download</a>|); |
|
348 |
} else { |
|
349 |
$form->error("OBE-Export schlug fehl."); |
|
331 | 350 |
} |
332 | 351 |
} |
352 |
|
|
353 |
print("</body></html>"); |
|
354 |
|
|
355 |
$lxdebug->leave_sub(); |
|
356 |
} |
|
357 |
|
|
358 |
sub download { |
|
359 |
$lxdebug->enter_sub(); |
|
360 |
|
|
361 |
my $tmp_name = Common->tmpname(); |
|
362 |
my $zip_name = strftime("lx-office-datev-export-%Y%m%d.zip", |
|
363 |
localtime(time())); |
|
364 |
|
|
365 |
my $cwd = getcwd(); |
|
366 |
chdir("users") || die("chdir users"); |
|
367 |
|
|
368 |
my @filenames = split(/:/, $form->{"filenames"}); |
|
369 |
map({ s|.*/||; $form->error("Eine der KNE-Exportdateien wurde nicht " . |
|
370 |
"gefunden. Wurde der Export bereits " . |
|
371 |
"durchgeführt?") unless (-f $_); } |
|
372 |
@filenames); |
|
373 |
|
|
374 |
my $zip = Archive::Zip->new(); |
|
375 |
map({ $zip->addFile($_); } @filenames); |
|
376 |
$zip->writeToFileNamed($tmp_name); |
|
377 |
chdir($cwd); |
|
378 |
|
|
379 |
open(IN, $tmp_name) || die("open $tmp_name"); |
|
380 |
print("Content-Type: application/zip\n"); |
|
381 |
print("Content-Disposition: attachment; filename=\"${zip_name}\"\n\n"); |
|
382 |
while (<IN>) { |
|
383 |
print($_); |
|
384 |
} |
|
385 |
close(IN); |
|
386 |
|
|
387 |
unlink($tmp_name); |
|
388 |
|
|
333 | 389 |
$lxdebug->leave_sub(); |
334 | 390 |
} |
locale/de/all | ||
---|---|---|
217 | 217 |
'Character Set' => 'Zeichensatz', |
218 | 218 |
'Chart of Accounts' => 'Konten?bersicht', |
219 | 219 |
'Chart of accounts' => 'Kontenrahmen', |
220 |
'Check' => 'Scheck', |
|
221 | 220 |
'Checks' => 'Schecks', |
222 | 221 |
'Choose Customer' => 'Endkunde w?hlen:', |
223 | 222 |
'Choose Vendor' => 'H?ndler w?hlen', |
... | ... | |
475 | 474 |
'Groups' => 'Warengruppen', |
476 | 475 |
'G?ltig ab' => 'G?ltig ab', |
477 | 476 |
'HTML' => 'HTML', |
478 |
'HTML Templates' => 'HTML-Vorlagen', |
|
479 | 477 |
'Heading' => '?berschrift', |
480 | 478 |
'Help' => 'Hilfe', |
481 | 479 |
'Help:' => 'Hilfe:', |
... | ... | |
548 | 546 |
'July' => 'Juli', |
549 | 547 |
'Jun' => 'Jun', |
550 | 548 |
'June' => 'Juni', |
551 |
'KNE Export erfolgreich!' => 'KNE-Export erfolgreich!',
|
|
549 |
'KNE-Export erfolgreich!' => 'KNE-Export erfolgreich!',
|
|
552 | 550 |
'KNr. beim Kunden' => 'KNr. beim Kunden', |
553 | 551 |
'Kein Firmenname hinterlegt!' => 'Kein Firmenname hinterlegt!', |
554 | 552 |
'Keine Firmenadresse hinterlegt!' => 'Keine Firmenadresse hinterlegt!', |
... | ... | |
561 | 559 |
'Kreditinstitut' => 'Kreditinstitut', |
562 | 560 |
'Kundennummer' => 'Kundennummer', |
563 | 561 |
'L' => 'L', |
564 |
'LaTeX Templates' => 'LaTeX-Vorlagen', |
|
565 | 562 |
'Language' => 'Sprache', |
566 | 563 |
'Language Values' => 'Sprach?bersetzungen', |
567 | 564 |
'Language deleted!' => 'Sprache gel?scht!', |
... | ... | |
679 | 676 |
'Number missing in Row' => 'Nummer fehlt in Zeile', |
680 | 677 |
'Number of copies' => 'Anzahl Kopien', |
681 | 678 |
'O' => 'O', |
682 |
'OBE Export erfolgreich!' => 'OBE-Export erfolgreich!',
|
|
679 |
'OBE-Export erfolgreich!' => 'OBE-Export erfolgreich!',
|
|
683 | 680 |
'Obsolete' => 'Ung?ltig', |
684 | 681 |
'Oct' => 'Okt', |
685 | 682 |
'October' => 'Oktober', |
... | ... | |
1017 | 1014 |
'USTVA-Hint: Tax Authoritys' => 'Bitte das Bundesland UND die Stadt bzw. den Einzugsbereich Ihres zust?ndigen Finanzamts ausw?hlen.', |
1018 | 1015 |
'USt-IdNr.' => 'USt-IdNr.', |
1019 | 1016 |
'UStVA' => 'UStVA', |
1020 |
'UStVA 2004' => 'UStVA 2004', |
|
1021 |
'UStVA 2005' => 'UStVA 2005', |
|
1022 |
'UStVA 2006' => 'UStVA 2006', |
|
1023 | 1017 |
'UStVA als PDF-Dokument' => 'UStVa als PDF-Dokument', |
1024 | 1018 |
'UStVA-Nr. 35' => 'Kz. 35', |
1025 | 1019 |
'UStVA-Nr. 36' => 'Kz. 36', |
locale/de/datev | ||
---|---|---|
22 | 22 |
'January' => 'Januar', |
23 | 23 |
'July' => 'Juli', |
24 | 24 |
'June' => 'Juni', |
25 |
'KNE Export erfolgreich!' => 'KNE-Export erfolgreich!',
|
|
25 |
'KNE-Export erfolgreich!' => 'KNE-Export erfolgreich!',
|
|
26 | 26 |
'Konten' => 'Konten', |
27 | 27 |
'Kontonummernerweiterung (KNE)' => 'Kontonummernerweiterung (KNE)', |
28 | 28 |
'Mandantennummer' => 'Mandantennummer', |
... | ... | |
30 | 30 |
'May' => 'Mai', |
31 | 31 |
'Monat' => 'Monat', |
32 | 32 |
'November' => 'November', |
33 |
'OBE Export erfolgreich!' => 'OBE-Export erfolgreich!',
|
|
33 |
'OBE-Export erfolgreich!' => 'OBE-Export erfolgreich!',
|
|
34 | 34 |
'October' => 'Oktober', |
35 | 35 |
'Password' => 'Passwort', |
36 | 36 |
'Quartal' => 'Quartal', |
... | ... | |
42 | 42 |
|
43 | 43 |
$self->{subs} = { |
44 | 44 |
'continue' => 'continue', |
45 |
'download' => 'download', |
|
45 | 46 |
'export' => 'export', |
46 | 47 |
'export2' => 'export2', |
47 | 48 |
'export3' => 'export3', |
locale/de/menu | ||
---|---|---|
41 | 41 |
'Buchungsgruppen' => 'Buchungsgruppen', |
42 | 42 |
'Cash' => 'Zahlungsverkehr', |
43 | 43 |
'Chart of Accounts' => 'Konten?bersicht', |
44 |
'Check' => 'Scheck', |
|
45 | 44 |
'Checks' => 'Schecks', |
46 | 45 |
'Contacts' => 'Kontakte', |
47 | 46 |
'Customer' => 'Kunde', |
... | ... | |
53 | 52 |
'Edit Dunning' => 'Mahnungen konfigurieren', |
54 | 53 |
'General Ledger' => 'Finanzbuchhaltung', |
55 | 54 |
'Groups' => 'Warengruppen', |
56 |
'HTML Templates' => 'HTML-Vorlagen', |
|
57 | 55 |
'Import CSV' => 'Import CSV', |
58 | 56 |
'Income Statement' => 'GuV', |
59 |
'Invoice' => 'Rechnung', |
|
60 | 57 |
'Invoices' => 'Rechnungen', |
61 | 58 |
'Journal' => 'Buchungsjournal', |
62 |
'LaTeX Templates' => 'LaTeX-Vorlagen', |
|
63 | 59 |
'Languages' => 'Sprachen', |
64 | 60 |
'Lead' => 'Kundenquelle', |
65 | 61 |
'Licenses' => 'Lizenzen', |
... | ... | |
74 | 70 |
'List Printer' => 'Drucker anzeigen', |
75 | 71 |
'Logout' => 'Abmeldung', |
76 | 72 |
'Master Data' => 'Stammdaten', |
77 |
'Packing List' => 'Lieferschein', |
|
78 | 73 |
'Packing Lists' => 'Lieferschein', |
79 | 74 |
'Parts' => 'Waren', |
80 | 75 |
'Payment' => 'Zahlungsausgang', |
... | ... | |
86 | 81 |
'Programm' => 'Programm', |
87 | 82 |
'Projects' => 'Projekte', |
88 | 83 |
'Projecttransactions' => 'Projektbuchungen', |
89 |
'Purchase Order' => 'Lieferantenauftrag', |
|
90 | 84 |
'Purchase Orders' => 'Lieferantenauftr?ge', |
91 |
'Quotation' => 'Angebot', |
|
92 | 85 |
'Quotations' => 'Angebote', |
93 |
'RFQ' => 'Anfrage', |
|
94 | 86 |
'RFQs' => 'Anfragen', |
95 | 87 |
'Receipt' => 'Zahlungseingang', |
96 | 88 |
'Receipts' => 'Zahlungseing?nge', |
97 | 89 |
'Reconciliation' => 'Kontenabgleich', |
98 | 90 |
'Reports' => 'Berichte', |
99 | 91 |
'Sales Invoices' => 'Kundenrechnung', |
100 |
'Sales Order' => 'Kundenauftrag', |
|
101 | 92 |
'Sales Orders' => 'Auftr?ge', |
102 | 93 |
'Service units' => 'Dienstleistungseinheiten', |
103 | 94 |
'Services' => 'Dienstleistungen', |
104 | 95 |
'Shipto' => 'Lieferanschriften', |
105 |
'Statement' => 'Sammelrechnung', |
|
106 | 96 |
'Stylesheet' => 'Stilvorlage', |
107 | 97 |
'System' => 'System', |
108 | 98 |
'Trial Balance' => 'Saldenbilanz', |
109 | 99 |
'Type of Business' => 'Kundentyp', |
110 |
'UStVA' => 'UStVA', |
|
111 |
'UStVA 2004' => 'UStVA 2004', |
|
112 |
'UStVA 2005' => 'UStVA 2005', |
|
113 |
'UStVA 2006' => 'UStVA 2006', |
|
114 | 100 |
'UStVa' => 'UStVa', |
115 | 101 |
'UStVa Einstellungen' => 'UStVa Einstellungen', |
116 | 102 |
'Units' => 'Einheiten', |
locale/de/menunew | ||
---|---|---|
40 | 40 |
'Buchungsgruppen' => 'Buchungsgruppen', |
41 | 41 |
'Cash' => 'Zahlungsverkehr', |
42 | 42 |
'Chart of Accounts' => 'Konten?bersicht', |
43 |
'Check' => 'Scheck', |
|
44 | 43 |
'Checks' => 'Schecks', |
45 | 44 |
'Contacts' => 'Kontakte', |
46 | 45 |
'Customer' => 'Kunde', |
... | ... | |
52 | 51 |
'Edit Dunning' => 'Mahnungen konfigurieren', |
53 | 52 |
'General Ledger' => 'Finanzbuchhaltung', |
54 | 53 |
'Groups' => 'Warengruppen', |
55 |
'HTML Templates' => 'HTML-Vorlagen', |
|
56 | 54 |
'Import CSV' => 'Import CSV', |
57 | 55 |
'Income Statement' => 'GuV', |
58 |
'Invoice' => 'Rechnung', |
|
59 | 56 |
'Invoices' => 'Rechnungen', |
60 | 57 |
'Journal' => 'Buchungsjournal', |
61 |
'LaTeX Templates' => 'LaTeX-Vorlagen', |
|
62 | 58 |
'Languages' => 'Sprachen', |
63 | 59 |
'Lead' => 'Kundenquelle', |
64 | 60 |
'Licenses' => 'Lizenzen', |
... | ... | |
73 | 69 |
'List Printer' => 'Drucker anzeigen', |
74 | 70 |
'Logout' => 'Abmeldung', |
75 | 71 |
'Master Data' => 'Stammdaten', |
76 |
'Packing List' => 'Lieferschein', |
|
77 | 72 |
'Packing Lists' => 'Lieferschein', |
78 | 73 |
'Parts' => 'Waren', |
79 | 74 |
'Payment' => 'Zahlungsausgang', |
... | ... | |
85 | 80 |
'Programm' => 'Programm', |
86 | 81 |
'Projects' => 'Projekte', |
87 | 82 |
'Projecttransactions' => 'Projektbuchungen', |
88 |
'Purchase Order' => 'Lieferantenauftrag', |
|
89 | 83 |
'Purchase Orders' => 'Lieferantenauftr?ge', |
90 |
'Quotation' => 'Angebot', |
|
91 | 84 |
'Quotations' => 'Angebote', |
92 |
'RFQ' => 'Anfrage', |
|
93 | 85 |
'RFQs' => 'Anfragen', |
94 | 86 |
'Receipt' => 'Zahlungseingang', |
95 | 87 |
'Receipts' => 'Zahlungseing?nge', |
96 | 88 |
'Reconciliation' => 'Kontenabgleich', |
97 | 89 |
'Reports' => 'Berichte', |
98 | 90 |
'Sales Invoices' => 'Kundenrechnung', |
99 |
'Sales Order' => 'Kundenauftrag', |
|
100 | 91 |
'Sales Orders' => 'Auftr?ge', |
101 | 92 |
'Service units' => 'Dienstleistungseinheiten', |
102 | 93 |
'Services' => 'Dienstleistungen', |
103 | 94 |
'Shipto' => 'Lieferanschriften', |
104 |
'Statement' => 'Sammelrechnung', |
|
105 | 95 |
'Stylesheet' => 'Stilvorlage', |
106 | 96 |
'System' => 'System', |
107 | 97 |
'Trial Balance' => 'Saldenbilanz', |
108 | 98 |
'Type of Business' => 'Kundentyp', |
109 |
'UStVA' => 'UStVA', |
|
110 |
'UStVA 2004' => 'UStVA 2004', |
|
111 |
'UStVA 2005' => 'UStVA 2005', |
|
112 |
'UStVA 2006' => 'UStVA 2006', |
|
113 | 99 |
'UStVa' => 'UStVa', |
114 | 100 |
'UStVa Einstellungen' => 'UStVa Einstellungen', |
115 | 101 |
'Units' => 'Einheiten', |
Auch abrufbar als: Unified diff
Der Datevexport wird nicht mehr in Dateien im datev/-Verzeichnis geschrieben, sondern dem Benutzer als ZIP-Archiv zum Download angeboten.