use SL::Form;
use SL::User;
use SL::USTVA;
+use SL::Iconv;
use CGI::Ajax;
use CGI;
qq|<option value="$item->{id}" selected="selected">|
. 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|<option value="$item->{id}">|
. 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|;
}
}
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|<option value=$item selected>|. sprintf("%.2d", $item) .qq|. $eur{$item}</option>\n|;
+ $select_eur .= qq|<option value=$item selected>|. sprintf("%.2d", $item) .qq|. $text</option>\n|;
} else {
- $select_eur .= qq|<option value=$item>|. sprintf("%.2d", $item) .qq|. $eur{$item}</option>\n|;
+ $select_eur .= qq|<option value=$item>|. sprintf("%.2d", $item) .qq|. $text</option>\n|;
}
}
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|<option value="$item" selected>|. sprintf("%.2d", $item) .qq|. $bwapos{$item}\n|;
+ $select_bwa .= qq|<option value="$item" selected>|. sprintf("%.2d", $item) .qq|. $text\n|;
} else {
- $select_bwa .= qq|<option value="$item">|. sprintf("%.2d", $item) .qq|. $bwapos{$item}\n|;
+ $select_bwa .= qq|<option value="$item">|. sprintf("%.2d", $item) .qq|. $text\n|;
}
}
$ca->{heading} = ( $ca->{charttype} eq 'H' ) ? 1:'';
$ca->{link_edit_account} =
qq|$form->{script}?action=edit_account&id=$ca->{id}|
- .qq|&path=$form->{path}&login=$form->{login}|
+ .qq|&login=$form->{login}|
.qq|&password=$form->{password}&callback=$callback|;
}
# Ajax
my $list_account_details_url =
- "$form->{script}?login=$form->{login}&path=$form->{path}"
+ "$form->{script}?login=$form->{login}"
."&password=$form->{password}&action=list_account_details&";
# construct callback
$callback =
- "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+ "$form->{script}?action=list_account&login=$form->{login}&password=$form->{password}";
$form->header;
. qq|</th>|;
$column_header{income_accno_0} =
qq|<th class=listheading>|
- . $locale->text('Erlöse Inland')
+ . $locale->text('National Revenues')
. qq|</th>|;
$column_header{expense_accno_0} =
qq|<th class=listheading>|
- . $locale->text('Aufwand Inland')
+ . $locale->text('National Expenses')
. qq|</th>|;
$column_header{income_accno_1} =
qq|<th class=listheading>|
- . $locale->text('Erlöse EU m. UStId')
+ . $locale->text('Revenues EU with UStId')
. qq|</th>|;
$column_header{expense_accno_1} =
qq|<th class=listheading>|
- . $locale->text('Aufwand EU m. UStId')
+ . $locale->text('Expenses EU with UStId')
. qq|</th>|;
$column_header{income_accno_2} =
qq|<th class=listheading>|
- . $locale->text('Erlöse EU o. UStId')
+ . $locale->text('Revenues EU without UStId')
. qq|</th>|;
$column_header{expense_accno_2} =
qq|<th class=listheading>|
- . $locale->text('Aufwand EU o. UStId')
+ . $locale->text('Expenses EU without UStId')
. qq|</th>|;
$column_header{income_accno_3} =
qq|<th class=listheading>|
- . $locale->text('Erlöse Ausland')
+ . $locale->text('Foreign Revenues')
. qq|</th>|;
$column_header{expense_accno_3} =
qq|<th class=listheading>|
- . $locale->text('Aufwand Ausland')
+ . $locale->text('Foreign Expenses')
. qq|</th>|;
$form->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 = (
$linkaccounts .= qq|
<tr>
- <th align=right>| . $locale->text('Erlöse Inland') . qq|</th>
+ <th align=right>| . $locale->text('National Revenues') . qq|</th>
<td><select name=income_accno_id_0>$form->{selectIC_income}</select></td>
</tr>
<tr>
- <th align=right>| . $locale->text('Aufwand Inland') . qq|</th>
+ <th align=right>| . $locale->text('National Expenses') . qq|</th>
<td><select name=expense_accno_id_0>$form->{selectIC_expense}</select></td>
</tr>|;
if ($form->{id}) {
$form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_1}/ value=$form->{expense_accno_id_1} selected/;
}
$linkaccounts .= qq| <tr>
- <th align=right>| . $locale->text('Erlöse EU m. UStId') . qq|</th>
+ <th align=right>| . $locale->text('Revenues EU with UStId') . qq|</th>
<td><select name=income_accno_id_1>$form->{selectIC_income}</select></td>
</tr>
<tr>
- <th align=right>| . $locale->text('Aufwand EU m UStId') . qq|</th>
+ <th align=right>| . $locale->text('Expenses EU with UStId') . qq|</th>
<td><select name=expense_accno_id_1>$form->{selectIC_expense}</select></td>
</tr>|;
}
$linkaccounts .= qq| <tr>
- <th align=right>| . $locale->text('Erlöse EU o. UStId') . qq|</th>
+ <th align=right>| . $locale->text('Revenues EU without UStId') . qq|</th>
<td><select name=income_accno_id_2>$form->{selectIC_income}</select></td>
</tr>
<tr>
- <th align=right>| . $locale->text('Aufwand EU o. UStId') . qq|</th>
+ <th align=right>| . $locale->text('Expenses EU without UStId') . qq|</th>
<td><select name=expense_accno_id_2>$form->{selectIC_expense}</select></td>
</tr>|;
}
$linkaccounts .= qq| <tr>
- <th align=right>| . $locale->text('Erlöse Ausland') . qq|</th>
+ <th align=right>| . $locale->text('Foreign Revenues') . qq|</th>
<td><select name=income_accno_id_3>$form->{selectIC_income}</select></td>
</tr>
<tr>
- <th align=right>| . $locale->text('Aufwand Ausland') . qq|</th>
+ <th align=right>| . $locale->text('Foreign Expenses') . qq|</th>
<td><select name=expense_accno_id_3>$form->{selectIC_expense}</select></td>
</tr>
|;
$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();
}
$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();
}
$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 "")
: ""
)
);
-
+ $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 {