X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=6294a18973d59da69a30fdf927830f2629af9cac;hb=480c67096c7aab3ccfe6b55e8d981975c7f08578;hp=094e32a7dc8baccba621369ab9cc47603a95391b;hpb=bd34eaeac9e09277148172dc634c0cd71bff91a8;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 094e32a7d..6294a1897 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -36,6 +36,7 @@ use SL::CA; use SL::Form; use SL::User; use SL::USTVA; +use SL::Iconv; use CGI::Ajax; use CGI; @@ -141,16 +142,16 @@ sub account_header { qq|| . sprintf("%.2d", $item->{taxkey}) . qq|. $item->{taxdescription} ($item->{rate}) | - . $locale->text('Tax-o-matic Account: ') - . qq|$item->{chart_accno}\n|; + . $locale->text('Tax-o-matic Account') + . qq|: $item->{chart_accno}\n|; } else { $form->{ACCOUNT_TAXKEYS}[$i]{selecttaxkey} .= qq|| . sprintf("%.2d", $item->{taxkey}) . qq|. $item->{taxdescription} ($item->{rate}) | - . $locale->text('Tax-o-matic Account: ') - . qq|$item->{chart_accno}\n|; + . $locale->text('Tax-o-matic Account') + . qq|: $item->{chart_accno}\n|; } } @@ -223,10 +224,11 @@ sub account_header { 30 => "Ausserordentlicher Aufwand", 31 => "Betriebliche Steuern"); foreach $item (sort({ $a <=> $b } keys(%eur))) { + my $text = H(SL::Iconv::convert("ISO-8859-15", $dbcharset, $eur{$item})); if ($item == $form->{pos_eur}) { - $select_eur .= qq||. sprintf("%.2d", $item) .qq|. $eur{$item}\n|; + $select_eur .= qq||. sprintf("%.2d", $item) .qq|. $text\n|; } else { - $select_eur .= qq||. sprintf("%.2d", $item) .qq|. $eur{$item}\n|; + $select_eur .= qq||. sprintf("%.2d", $item) .qq|. $text\n|; } } @@ -256,10 +258,11 @@ sub account_header { 34 => 'Verr.kalk.Kosten', 35 => 'Steuern Eink.u.Ertr.'); foreach $item (sort({ $a <=> $b } keys %bwapos)) { + my $text = H(SL::Iconv::convert("ISO-8859-15", $dbcharset, $bwapos{$item})); if ($item == $form->{pos_bwa}) { - $select_bwa .= qq||. sprintf("%.2d", $item) .qq|. $bwapos{$item}\n|; + $select_bwa .= qq||. sprintf("%.2d", $item) .qq|. $text\n|; } else { - $select_bwa .= qq||. sprintf("%.2d", $item) .qq|. $bwapos{$item}\n|; + $select_bwa .= qq||. sprintf("%.2d", $item) .qq|. $text\n|; } } @@ -1509,35 +1512,35 @@ sub list_buchungsgruppe { . qq||; $column_header{income_accno_0} = qq|| - . $locale->text('Erlöse Inland') + . $locale->text('National Revenues') . qq||; $column_header{expense_accno_0} = qq|| - . $locale->text('Aufwand Inland') + . $locale->text('National Expenses') . qq||; $column_header{income_accno_1} = qq|| - . $locale->text('Erlöse EU m. UStId') + . $locale->text('Revenues EU with UStId') . qq||; $column_header{expense_accno_1} = qq|| - . $locale->text('Aufwand EU m. UStId') + . $locale->text('Expenses EU with UStId') . qq||; $column_header{income_accno_2} = qq|| - . $locale->text('Erlöse EU o. UStId') + . $locale->text('Revenues EU without UStId') . qq||; $column_header{expense_accno_2} = qq|| - . $locale->text('Aufwand EU o. UStId') + . $locale->text('Expenses EU without UStId') . qq||; $column_header{income_accno_3} = qq|| - . $locale->text('Erlöse Ausland') + . $locale->text('Foreign Revenues') . qq||; $column_header{expense_accno_3} = qq|| - . $locale->text('Aufwand Ausland') + . $locale->text('Foreign Expenses') . qq||; $form->header; @@ -1658,8 +1661,8 @@ sub buchungsgruppe_header { $form->{title} = $locale->text("$form->{title} Buchungsgruppe"); - # $locale->text('Buchungsgruppe hinzufügen') - # $locale->text('Buchungsgruppe bearbeiten') + # $locale->text('Add Accounting Group') + # $locale->text('Edit Accounting Group') my ($acc_inventory, $acc_income, $acc_expense) = ({}, {}, {}); my %acc_type_map = ( @@ -1709,11 +1712,11 @@ sub buchungsgruppe_header { $linkaccounts .= qq| - | . $locale->text('Erlöse Inland') . qq| + | . $locale->text('National Revenues') . qq| $form->{selectIC_income} - | . $locale->text('Aufwand Inland') . qq| + | . $locale->text('National Expenses') . qq| $form->{selectIC_expense} |; if ($form->{id}) { @@ -1723,11 +1726,11 @@ sub buchungsgruppe_header { $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_1}/ value=$form->{expense_accno_id_1} selected/; } $linkaccounts .= qq| - | . $locale->text('Erlöse EU m. UStId') . qq| + | . $locale->text('Revenues EU with UStId') . qq| $form->{selectIC_income} - | . $locale->text('Aufwand EU m UStId') . qq| + | . $locale->text('Expenses EU with UStId') . qq| $form->{selectIC_expense} |; @@ -1739,11 +1742,11 @@ sub buchungsgruppe_header { } $linkaccounts .= qq| - | . $locale->text('Erlöse EU o. UStId') . qq| + | . $locale->text('Revenues EU without UStId') . qq| $form->{selectIC_income} - | . $locale->text('Aufwand EU o. UStId') . qq| + | . $locale->text('Expenses EU without UStId') . qq| $form->{selectIC_expense} |; @@ -1755,11 +1758,11 @@ sub buchungsgruppe_header { } $linkaccounts .= qq| - | . $locale->text('Erlöse Ausland') . qq| + | . $locale->text('Foreign Revenues') . qq| $form->{selectIC_income} - | . $locale->text('Aufwand Ausland') . qq| + | . $locale->text('Foreign Expenses') . qq| $form->{selectIC_expense} |; @@ -1799,7 +1802,7 @@ sub save_buchungsgruppe { $form->isblank("description", $locale->text('Description missing!')); AM->save_buchungsgruppe(\%myconfig, \%$form); - $form->redirect($locale->text('Buchungsgruppe gespeichert!')); + $form->redirect($locale->text('Accounting Group saved!')); $lxdebug->leave_sub(); } @@ -1808,7 +1811,7 @@ sub delete_buchungsgruppe { $lxdebug->enter_sub(); AM->delete_buchungsgruppe(\%myconfig, \%$form); - $form->redirect($locale->text('Buchungsgruppe gelöscht!')); + $form->redirect($locale->text('Accounting Group deleted!')); $lxdebug->leave_sub(); } @@ -3058,7 +3061,6 @@ sub show_am_history { $restriction .= " OR addition = '" . $_ . "'"; } } - $restriction .= (($form->{transdate} ne "" && $form->{reqdate} ne "") ? qq| AND st.itime::date >= '| . $form->{transdate} . qq|' AND st.itime::date <= '| . $form->{reqdate} . qq|'| : (($form->{transdate} ne "" && $form->{reqdate} eq "") @@ -3068,39 +3070,48 @@ sub show_am_history { : "" ) ); - + $restriction .= ($form->{mitarbeiter} eq "" ? "" + : ($form->{mitarbeiter} =~ /^[0-9]*$/ + ? " AND employee_id = " . $form->{mitarbeiter} + : " AND employee_id = " . &get_employee_id($form->{mitarbeiter}, $dbh))); + my $dbh = $form->dbconnect(\%myconfig); - my $searchSNumber = $searchNo{$form->{'what2search'}} . qq|_| . $form->{'searchid'}; - $restriction .= ($form->{mitarbeiter} eq "" ? "" - : ($form->{mitarbeiter} =~ /^[0-9]*$/ - ? " AND employee_id = " . $form->{mitarbeiter} - : " AND employee_id = " . &get_employee_id($form->{mitarbeiter}, $dbh))); - my $query = qq|SELECT trans_id AS id FROM history_erp WHERE sNumbers = '$searchSNumber' |; + my $query = qq|SELECT trans_id AS id FROM history_erp | . + ($form->{'searchid'} ? + qq| WHERE snumbers = '| . $searchNo{$form->{'what2search'}} . qq|_| . $form->{'searchid'} . qq|'| : + qq| WHERE snumbers ~ '^| . $searchNo{$form->{'what2search'}} . qq|'|); my $sth = $dbh->prepare($query); $sth->execute() || $form->dberror($query); - - if($sth->fetch() <= 0) { - $sth->finish(); - my $query = qq|SELECT id FROM $search{$form->{what2search}} - WHERE $searchNo{$form->{'what2search'}} ILIKE '$form->{"searchid"}' - |; - } - $sth->execute() || $form->dberror($query); - $form->{title} = $locale->text("History Search"); + + $form->{title} = $locale->text("History Search"); $form->header(); - my $daten = ""; - while(my $hash_ref = $sth->fetchrow_hashref()){ - $daten = $form->get_history($dbh,$hash_ref->{id},$restriction); + + my $i = 1; + my $daten = qq||; + while(my $hash_ref = $sth->fetchrow_hashref()){ + if($i) { + $daten .= $hash_ref->{id}; + $i = 0; + } + else { + $daten .= " OR trans_id = " . $hash_ref->{id}; + } } - $dbh->disconnect(); + + my ($sort, $sortby) = split(/\-\-/, $form->{order}); + $sort =~ s/.*\.(.*)$/$1/; + print $form->parse_html_template("/common/show_history", - {"DATEN" => $daten, - "SUCCESS" => ($daten != 0 ? 1 : 0), - "NONEWWINDOW" => 1 + {"DATEN" => $form->get_history($dbh, $daten, $restriction, $form->{order}), + "SUCCESS" => ($form->get_history($dbh, $daten, $restriction, $form->{order}) ne "0"), + "NONEWWINDOW" => 1, + uc($sort) => 1, + uc($sort)."BY" => $sortby }); - $lxdebug->leave_sub(); + $dbh->disconnect(); + $lxdebug->leave_sub(); } sub get_employee_id {