Revision 9a795b85
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
300 | 300 |
return $rc; |
301 | 301 |
} |
302 | 302 |
|
303 |
sub gifi_accounts { |
|
304 |
$main::lxdebug->enter_sub(); |
|
305 |
|
|
306 |
my ($self, $myconfig, $form) = @_; |
|
307 |
|
|
308 |
# connect to database |
|
309 |
my $dbh = $form->dbconnect($myconfig); |
|
310 |
|
|
311 |
my $query = qq|SELECT accno, description |
|
312 |
FROM gifi |
|
313 |
ORDER BY accno|; |
|
314 |
|
|
315 |
$sth = $dbh->prepare($query); |
|
316 |
$sth->execute || $form->dberror($query); |
|
317 |
|
|
318 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
|
319 |
push @{ $form->{ALL} }, $ref; |
|
320 |
} |
|
321 |
|
|
322 |
$sth->finish; |
|
323 |
$dbh->disconnect; |
|
324 |
|
|
325 |
$main::lxdebug->leave_sub(); |
|
326 |
} |
|
327 |
|
|
328 |
sub get_gifi { |
|
329 |
$main::lxdebug->enter_sub(); |
|
330 |
|
|
331 |
my ($self, $myconfig, $form) = @_; |
|
332 |
|
|
333 |
# connect to database |
|
334 |
my $dbh = $form->dbconnect($myconfig); |
|
335 |
|
|
336 |
my $query = qq|SELECT g.accno, g.description |
|
337 |
FROM gifi g |
|
338 |
WHERE g.accno = '$form->{accno}'|; |
|
339 |
my $sth = $dbh->prepare($query); |
|
340 |
$sth->execute || $form->dberror($query); |
|
341 |
|
|
342 |
my $ref = $sth->fetchrow_hashref(NAME_lc); |
|
343 |
|
|
344 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
|
345 |
|
|
346 |
$sth->finish; |
|
347 |
|
|
348 |
# check for transactions |
|
349 |
$query = qq|SELECT count(*) FROM acc_trans a, chart c, gifi g |
|
350 |
WHERE c.gifi_accno = g.accno |
|
351 |
AND a.chart_id = c.id |
|
352 |
AND g.accno = '$form->{accno}'|; |
|
353 |
$sth = $dbh->prepare($query); |
|
354 |
$sth->execute || $form->dberror($query); |
|
355 |
|
|
356 |
($form->{orphaned}) = $sth->fetchrow_array; |
|
357 |
$sth->finish; |
|
358 |
$form->{orphaned} = !$form->{orphaned}; |
|
359 |
|
|
360 |
$dbh->disconnect; |
|
361 |
|
|
362 |
$main::lxdebug->leave_sub(); |
|
363 |
} |
|
364 |
|
|
365 |
sub save_gifi { |
|
366 |
$main::lxdebug->enter_sub(); |
|
367 |
|
|
368 |
my ($self, $myconfig, $form) = @_; |
|
369 |
|
|
370 |
# connect to database |
|
371 |
my $dbh = $form->dbconnect($myconfig); |
|
372 |
|
|
373 |
$form->{description} =~ s/\'/\'\'/g; |
|
374 |
|
|
375 |
# id is the old account number! |
|
376 |
if ($form->{id}) { |
|
377 |
$query = qq|UPDATE gifi SET |
|
378 |
accno = '$form->{accno}', |
|
379 |
description = '$form->{description}' |
|
380 |
WHERE accno = '$form->{id}'|; |
|
381 |
} else { |
|
382 |
$query = qq|INSERT INTO gifi |
|
383 |
(accno, description) |
|
384 |
VALUES ('$form->{accno}', '$form->{description}')|; |
|
385 |
} |
|
386 |
$dbh->do($query) || $form->dberror($query); |
|
387 |
|
|
388 |
$dbh->disconnect; |
|
389 |
|
|
390 |
$main::lxdebug->leave_sub(); |
|
391 |
} |
|
392 |
|
|
393 |
sub delete_gifi { |
|
394 |
$main::lxdebug->enter_sub(); |
|
395 |
|
|
396 |
my ($self, $myconfig, $form) = @_; |
|
397 |
|
|
398 |
# connect to database |
|
399 |
my $dbh = $form->dbconnect($myconfig); |
|
400 |
|
|
401 |
# id is the old account number! |
|
402 |
$query = qq|DELETE FROM gifi |
|
403 |
WHERE accno = '$form->{id}'|; |
|
404 |
$dbh->do($query) || $form->dberror($query); |
|
405 |
|
|
406 |
$dbh->disconnect; |
|
407 |
|
|
408 |
$main::lxdebug->leave_sub(); |
|
409 |
} |
|
410 |
|
|
411 | 303 |
sub warehouses { |
412 | 304 |
$main::lxdebug->enter_sub(); |
413 | 305 |
|
bin/mozilla/am.pl | ||
---|---|---|
635 | 635 |
$lxdebug->leave_sub(); |
636 | 636 |
} |
637 | 637 |
|
638 |
sub list_gifi { |
|
639 |
$lxdebug->enter_sub(); |
|
640 |
|
|
641 |
@{ $form->{fields} } = (accno, description); |
|
642 |
$form->{table} = "gifi"; |
|
643 |
$form->{sortorder} = "accno"; |
|
644 |
|
|
645 |
AM->gifi_accounts(\%myconfig, \%$form); |
|
646 |
|
|
647 |
$form->{title} = $locale->text('GIFI'); |
|
648 |
|
|
649 |
# construct callback |
|
650 |
$callback = |
|
651 |
"$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}"; |
|
652 |
|
|
653 |
@column_index = qw(accno description); |
|
654 |
|
|
655 |
$column_header{accno} = qq|<th>| . $locale->text('GIFI') . qq|</a></th>|; |
|
656 |
$column_header{description} = |
|
657 |
qq|<th>| . $locale->text('Description') . qq|</a></th>|; |
|
658 |
|
|
659 |
$form->header; |
|
660 |
$colspan = $#column_index + 1; |
|
661 |
|
|
662 |
print qq| |
|
663 |
<body> |
|
664 |
|
|
665 |
<table width=100%> |
|
666 |
<tr> |
|
667 |
<th class=listtop colspan=$colspan>$form->{title}</th> |
|
668 |
</tr> |
|
669 |
<tr height="5"></tr> |
|
670 |
<tr class=listheading> |
|
671 |
|; |
|
672 |
|
|
673 |
map { print "$column_header{$_}\n" } @column_index; |
|
674 |
|
|
675 |
print qq| |
|
676 |
</tr> |
|
677 |
|; |
|
678 |
|
|
679 |
# escape callback |
|
680 |
$callback = $form->escape($callback); |
|
681 |
|
|
682 |
foreach $ca (@{ $form->{ALL} }) { |
|
683 |
|
|
684 |
$i++; |
|
685 |
$i %= 2; |
|
686 |
|
|
687 |
print qq| |
|
688 |
<tr valign=top class=listrow$i>|; |
|
689 |
|
|
690 |
$column_data{accno} = |
|
691 |
qq|<td><a href=$form->{script}?action=edit_gifi&coa=1&accno=$ca->{accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</td>|; |
|
692 |
$column_data{description} = qq|<td>$ca->{description} </td>|; |
|
693 |
|
|
694 |
map { print "$column_data{$_}\n" } @column_index; |
|
695 |
|
|
696 |
print "</tr>\n"; |
|
697 |
} |
|
698 |
|
|
699 |
print qq| |
|
700 |
<tr> |
|
701 |
<td colspan=$colspan><hr size=3 noshade></td> |
|
702 |
</tr> |
|
703 |
</table> |
|
704 |
|
|
705 |
</body> |
|
706 |
</html> |
|
707 |
|; |
|
708 |
|
|
709 |
$lxdebug->leave_sub(); |
|
710 |
} |
|
711 |
|
|
712 |
sub add_gifi { |
|
713 |
$lxdebug->enter_sub(); |
|
714 |
|
|
715 |
$form->{title} = "Add"; |
|
716 |
|
|
717 |
# construct callback |
|
718 |
$form->{callback} = |
|
719 |
"$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}"; |
|
720 |
|
|
721 |
$form->{coa} = 1; |
|
722 |
|
|
723 |
&gifi_header; |
|
724 |
&gifi_footer; |
|
725 |
|
|
726 |
$lxdebug->leave_sub(); |
|
727 |
} |
|
728 |
|
|
729 |
sub edit_gifi { |
|
730 |
$lxdebug->enter_sub(); |
|
731 |
|
|
732 |
$form->{title} = "Edit"; |
|
733 |
|
|
734 |
AM->get_gifi(\%myconfig, \%$form); |
|
735 |
|
|
736 |
&gifi_header; |
|
737 |
&gifi_footer; |
|
738 |
|
|
739 |
$lxdebug->leave_sub(); |
|
740 |
} |
|
741 |
|
|
742 |
sub gifi_header { |
|
743 |
$lxdebug->enter_sub(); |
|
744 |
|
|
745 |
$form->{title} = $locale->text("$form->{title} GIFI"); |
|
746 |
|
|
747 |
# $locale->text('Add GIFI') |
|
748 |
# $locale->text('Edit GIFI') |
|
749 |
|
|
750 |
$form->{description} =~ s/\"/"/g; |
|
751 |
|
|
752 |
$form->header; |
|
753 |
|
|
754 |
print qq| |
|
755 |
<body> |
|
756 |
|
|
757 |
<form method=post action=$form->{script}> |
|
758 |
|
|
759 |
<input type=hidden name=id value=$form->{accno}> |
|
760 |
<input type=hidden name=type value=gifi> |
|
761 |
|
|
762 |
<table width=100%> |
|
763 |
<tr> |
|
764 |
<th class=listtop>$form->{title}</th> |
|
765 |
</tr> |
|
766 |
<tr height="5"></tr> |
|
767 |
<tr> |
|
768 |
<td> |
|
769 |
<table> |
|
770 |
<tr> |
|
771 |
<th align=right>| . $locale->text('GIFI') . qq|</th> |
|
772 |
<td><input name=accno size=20 value=$form->{accno}></td> |
|
773 |
</tr> |
|
774 |
<tr> |
|
775 |
<th align=right>| . $locale->text('Description') . qq|</th> |
|
776 |
<td><input name=description size=60 value="$form->{description}"></td> |
|
777 |
</tr> |
|
778 |
</table> |
|
779 |
</td> |
|
780 |
</tr> |
|
781 |
<tr> |
|
782 |
<td colspan=2><hr size=3 noshade></td> |
|
783 |
</tr> |
|
784 |
</table> |
|
785 |
|; |
|
786 |
|
|
787 |
$lxdebug->leave_sub(); |
|
788 |
} |
|
789 |
|
|
790 |
sub gifi_footer { |
|
791 |
$lxdebug->enter_sub(); |
|
792 |
|
|
793 |
print qq| |
|
794 |
|
|
795 |
<input name=callback type=hidden value="$form->{callback}"> |
|
796 |
|
|
797 |
<input type=hidden name=path value=$form->{path}> |
|
798 |
<input type=hidden name=login value=$form->{login}> |
|
799 |
<input type=hidden name=password value=$form->{password}> |
|
800 |
|
|
801 |
<br><input type=submit class=submit name=action value="| |
|
802 |
. $locale->text('Save') . qq|">|; |
|
803 |
|
|
804 |
if ($form->{coa}) { |
|
805 |
print qq| |
|
806 |
<input type=submit class=submit name=action value="| |
|
807 |
. $locale->text('Copy to COA') . qq|"> |
|
808 |
|; |
|
809 |
|
|
810 |
if ($form->{accno} && $form->{orphaned}) { |
|
811 |
print qq|<input type=submit class=submit name=action value="| |
|
812 |
. $locale->text('Delete') . qq|">|; |
|
813 |
} |
|
814 |
} |
|
815 |
|
|
816 |
print qq| |
|
817 |
</form> |
|
818 |
|
|
819 |
</body> |
|
820 |
</html> |
|
821 |
|; |
|
822 |
|
|
823 |
$lxdebug->leave_sub(); |
|
824 |
} |
|
825 |
|
|
826 |
sub save_gifi { |
|
827 |
$lxdebug->enter_sub(); |
|
828 |
|
|
829 |
$form->isblank("accno", $locale->text('GIFI missing!')); |
|
830 |
AM->save_gifi(\%myconfig, \%$form); |
|
831 |
$form->redirect($locale->text('GIFI saved!')); |
|
832 |
|
|
833 |
$lxdebug->leave_sub(); |
|
834 |
} |
|
835 |
|
|
836 |
sub copy_to_coa { |
|
837 |
$lxdebug->enter_sub(); |
|
838 |
|
|
839 |
$form->isblank("accno", $locale->text('GIFI missing!')); |
|
840 |
|
|
841 |
AM->save_gifi(\%myconfig, \%$form); |
|
842 |
|
|
843 |
delete $form->{id}; |
|
844 |
$form->{gifi_accno} = $form->{accno}; |
|
845 |
$form->{title} = "Add"; |
|
846 |
$form->{charttype} = "A"; |
|
847 |
|
|
848 |
&account_header; |
|
849 |
&form_footer; |
|
850 |
|
|
851 |
$lxdebug->leave_sub(); |
|
852 |
} |
|
853 |
|
|
854 |
sub delete_gifi { |
|
855 |
$lxdebug->enter_sub(); |
|
856 |
|
|
857 |
AM->delete_gifi(\%myconfig, \%$form); |
|
858 |
$form->redirect($locale->text('GIFI deleted!')); |
|
859 |
|
|
860 |
$lxdebug->leave_sub(); |
|
861 |
} |
|
862 |
|
|
863 | 638 |
sub add_department { |
864 | 639 |
$lxdebug->enter_sub(); |
865 | 640 |
|
locale/de/all | ||
---|---|---|
90 | 90 |
'Add Department' => 'Abteilung erfassen', |
91 | 91 |
'Add Dunning' => 'Mahnung erzeugen', |
92 | 92 |
'Add Exchangerate' => 'Wechselkurs erfassen', |
93 |
'Add GIFI' => 'GIFI erfassen', |
|
94 | 93 |
'Add General Ledger Transaction' => 'Dialogbuchen', |
95 | 94 |
'Add Group' => 'Warengruppe erfassen', |
96 | 95 |
'Add Language' => 'Sprache hinzuf?gen', |
... | ... | |
272 | 271 |
'Continue' => 'Weiter', |
273 | 272 |
'Contra' => 'gegen', |
274 | 273 |
'Copies' => 'Kopien', |
275 |
'Copy to COA' => 'In Kontenplan kopieren', |
|
276 | 274 |
'Cost Center' => 'Kostenstelle', |
277 | 275 |
'Costs' => 'Kosten', |
278 | 276 |
'Could not copy %s to %s. Reason: %s' => 'Die Datei "%s" konnte nicht nach "%s" kopiert werden. Grund: %s', |
... | ... | |
413 | 411 |
'Edit Department' => 'Abteilung bearbeiten', |
414 | 412 |
'Edit Dunning' => 'Mahnungen konfigurieren', |
415 | 413 |
'Edit Dunning Process Config' => 'Mahnwesenkonfiguration bearbeiten', |
416 |
'Edit GIFI' => 'GIFI editieren', |
|
417 | 414 |
'Edit General Ledger Transaction' => 'Buchung im Hauptbuch bearbeiten', |
418 | 415 |
'Edit Group' => 'Warengruppe editieren', |
419 | 416 |
'Edit Language' => 'Sprache bearbeiten', |
... | ... | |
489 | 486 |
'Fristsetzung' => 'Fristsetzung', |
490 | 487 |
'From' => 'Von', |
491 | 488 |
'GIFI' => 'GIFI', |
492 |
'GIFI deleted!' => 'GIFI gel?scht!', |
|
493 |
'GIFI missing!' => 'GIFI fehlt!', |
|
494 |
'GIFI saved!' => 'GIFI gespeichert!', |
|
495 | 489 |
'GL Transaction' => 'Dialogbuchung', |
496 | 490 |
'General Ledger' => 'Finanzbuchhaltung', |
497 | 491 |
'Gesch?ftsvolumen' => 'Gesch?ftsvolumen', |
locale/de/am | ||
---|---|---|
47 | 47 |
'Add Buchungsgruppe' => 'Buchungsgruppe erfassen', |
48 | 48 |
'Add Business' => 'Kunden-/Lieferantentyp erfassen', |
49 | 49 |
'Add Department' => 'Abteilung erfassen', |
50 |
'Add GIFI' => 'GIFI erfassen', |
|
51 | 50 |
'Add Language' => 'Sprache hinzuf?gen', |
52 | 51 |
'Add Lead' => 'Kundenquelle erfassen', |
53 | 52 |
'Add Payment Terms' => 'Zahlungskonditionen hinzuf?gen', |
... | ... | |
89 | 88 |
'Code missing!' => 'kode fehlt!', |
90 | 89 |
'Company' => 'Firma', |
91 | 90 |
'Continue' => 'Weiter', |
92 |
'Copy to COA' => 'In Kontenplan kopieren', |
|
93 | 91 |
'Cost Center' => 'Kostenstelle', |
94 | 92 |
'Costs' => 'Kosten', |
95 | 93 |
'Customer Number' => 'Kundennummer', |
... | ... | |
116 | 114 |
'Edit Buchungsgruppe' => 'Buchungsgruppe bearbeiten', |
117 | 115 |
'Edit Business' => 'Kunden-/Lieferantentyp bearbeiten', |
118 | 116 |
'Edit Department' => 'Abteilung bearbeiten', |
119 |
'Edit GIFI' => 'GIFI editieren', |
|
120 | 117 |
'Edit Language' => 'Sprache bearbeiten', |
121 | 118 |
'Edit Lead' => 'Kundenquelle bearbeiten', |
122 | 119 |
'Edit Payment Terms' => 'Zahlungskonditionen bearbeiten', |
... | ... | |
142 | 139 |
'Foreign Exchange Gain' => 'Wechselkursertr?ge', |
143 | 140 |
'Foreign Exchange Loss' => 'Wechselkursaufwendungen', |
144 | 141 |
'Form details (second row)' => 'Formulardetails (zweite Positionszeile)', |
145 |
'GIFI' => 'GIFI', |
|
146 |
'GIFI deleted!' => 'GIFI gel?scht!', |
|
147 |
'GIFI missing!' => 'GIFI fehlt!', |
|
148 |
'GIFI saved!' => 'GIFI gespeichert!', |
|
149 | 142 |
'G?ltig ab' => 'G?ltig ab', |
150 | 143 |
'Heading' => '?berschrift', |
151 | 144 |
'Hide by default' => 'Standardmäßig verstecken', |
... | ... | |
343 | 336 |
'add_buchungsgruppe' => 'add_buchungsgruppe', |
344 | 337 |
'add_business' => 'add_business', |
345 | 338 |
'add_department' => 'add_department', |
346 |
'add_gifi' => 'add_gifi', |
|
347 | 339 |
'add_language' => 'add_language', |
348 | 340 |
'add_lead' => 'add_lead', |
349 | 341 |
'add_payment' => 'add_payment', |
... | ... | |
359 | 351 |
'calculate_qty' => 'calculate_qty', |
360 | 352 |
'config' => 'config', |
361 | 353 |
'continue' => 'continue', |
362 |
'copy_to_coa' => 'copy_to_coa', |
|
363 | 354 |
'delete' => 'delete', |
364 | 355 |
'delete_account' => 'delete_account', |
365 | 356 |
'delete_buchungsgruppe' => 'delete_buchungsgruppe', |
366 | 357 |
'delete_business' => 'delete_business', |
367 | 358 |
'delete_department' => 'delete_department', |
368 |
'delete_gifi' => 'delete_gifi', |
|
369 | 359 |
'delete_language' => 'delete_language', |
370 | 360 |
'delete_lead' => 'delete_lead', |
371 | 361 |
'delete_payment' => 'delete_payment', |
... | ... | |
382 | 372 |
'edit_buchungsgruppe' => 'edit_buchungsgruppe', |
383 | 373 |
'edit_business' => 'edit_business', |
384 | 374 |
'edit_department' => 'edit_department', |
385 |
'edit_gifi' => 'edit_gifi', |
|
386 | 375 |
'edit_language' => 'edit_language', |
387 | 376 |
'edit_lead' => 'edit_lead', |
388 | 377 |
'edit_payment' => 'edit_payment', |
... | ... | |
394 | 383 |
'employee_selection_internal' => 'employee_selection_internal', |
395 | 384 |
'form_footer' => 'form_footer', |
396 | 385 |
'format_dates' => 'format_dates', |
397 |
'gifi_footer' => 'gifi_footer', |
|
398 |
'gifi_header' => 'gifi_header', |
|
399 | 386 |
'language_header' => 'language_header', |
400 | 387 |
'lead_header' => 'lead_header', |
401 | 388 |
'list_account' => 'list_account', |
402 | 389 |
'list_buchungsgruppe' => 'list_buchungsgruppe', |
403 | 390 |
'list_business' => 'list_business', |
404 | 391 |
'list_department' => 'list_department', |
405 |
'list_gifi' => 'list_gifi', |
|
406 | 392 |
'list_language' => 'list_language', |
407 | 393 |
'list_lead' => 'list_lead', |
408 | 394 |
'list_payment' => 'list_payment', |
... | ... | |
421 | 407 |
'save_business' => 'save_business', |
422 | 408 |
'save_department' => 'save_department', |
423 | 409 |
'save_form' => 'save_form', |
424 |
'save_gifi' => 'save_gifi', |
|
425 | 410 |
'save_language' => 'save_language', |
426 | 411 |
'save_lead' => 'save_lead', |
427 | 412 |
'save_payment' => 'save_payment', |
... | ... | |
446 | 431 |
'erfassen' => 'add', |
447 | 432 |
'konto_erfassen' => 'add_account', |
448 | 433 |
'weiter' => 'continue', |
449 |
'in_kontenplan_kopieren' => 'copy_to_coa', |
|
450 | 434 |
'l?schen' => 'delete', |
451 | 435 |
'bearbeiten' => 'edit', |
452 | 436 |
'kontodaten_bearbeiten' => 'edit_account', |
Auch abrufbar als: Unified diff
"GIFI"-Verwaltungsfunktionen entfernt.