Revision 9c412887
Von Kivitendo Admin vor mehr als 9 Jahren hinzugefügt
SL/USTVA.pm | ||
---|---|---|
77 | 77 |
|
78 | 78 |
sub get_coa { |
79 | 79 |
|
80 |
my ( $self, $form, $myconfig) = @_; |
|
81 |
|
|
82 |
my $query = q{ SELECT coa FROM defaults }; |
|
83 |
|
|
84 |
my $dbh = $form->dbconnect($myconfig); |
|
85 |
my $sth = $dbh->prepare($query); |
|
86 |
$sth->execute() || $form->dberror($query); |
|
87 |
|
|
88 |
my ($coa) = selectrow_query($form, $dbh, $query); |
|
89 |
|
|
90 |
$sth->finish; |
|
91 |
$dbh->disconnect; |
|
80 |
my ( $self, $form ) = @_; |
|
92 | 81 |
|
82 |
my $coa = $::instance_conf->get_coa; |
|
93 | 83 |
$form->{coa} = $coa; |
94 | 84 |
$form->{"COA_$coa"} = '1'; |
95 | 85 |
$form->{COA_Germany} = '1' if ($coa =~ m/^germany/i); |
... | ... | |
698 | 688 |
foreach my $item (@category_euro) { |
699 | 689 |
$form->{"$item"} = 0; |
700 | 690 |
} |
701 |
my $coa_name = coa_get($dbh);
|
|
691 |
my $coa_name = $::instance_conf->get_coa;
|
|
702 | 692 |
$form->{coa} = $coa_name; |
703 | 693 |
|
704 | 694 |
# Controlvariable for templates |
... | ... | |
772 | 762 |
$main::lxdebug->leave_sub(); |
773 | 763 |
} |
774 | 764 |
|
775 |
sub coa_get { |
|
776 |
|
|
777 |
my ($dbh) = @_; |
|
778 |
my $form = $main::form; |
|
779 |
|
|
780 |
my $query= qq|SELECT coa FROM defaults|; |
|
781 |
|
|
782 |
my $sth = $dbh->prepare($query); |
|
783 |
|
|
784 |
$sth->execute || $form->dberror($query); |
|
785 |
|
|
786 |
my ($ref) = $sth->fetchrow_array; |
|
787 |
|
|
788 |
return $ref; |
|
789 |
|
|
790 |
}; |
|
791 |
|
|
792 | 765 |
sub get_accounts_ustva { |
793 | 766 |
$main::lxdebug->enter_sub(); |
794 | 767 |
|
Auch abrufbar als: Unified diff
USTVA.pm : refactoring von get_coa und coa_get
get_coa benutzt jetzt intern instance_conf und coa_get kann komplett
durch einen instance_conf Zugriff ersetzt werden.