#
#======================================================================
+use utf8;
+
use SL::Auth;
use SL::AM;
use SL::CA;
use SL::USTVA;
use SL::Iconv;
use SL::TODO;
+use SL::Printer;
use CGI::Ajax;
use CGI;
}
# Newaccount Folgekonto
- if (@{ $form->{NEWACCOUNT} }) {
+ if (@{ $form->{NEWACCOUNT} || [] }) {
if (!$form->{new_chart_valid}) {
$form->{selectnewaccount} = qq|<option value=""> |. $locale->text('None') .q|</option>|;
}
my $select_eur = q|<option value=""> |. $locale->text('None') .q|</option>\n|;
my %eur = (
- 1 => "Umsatzerlöse",
- 2 => "sonstige Erlöse",
+ 1 => "Umsatzerlöse",
+ 2 => "sonstige Erlöse",
3 => "Privatanteile",
- 4 => "Zinserträge",
- 5 => "Ausserordentliche Erträge",
+ 4 => "Zinserträge",
+ 5 => "Ausserordentliche Erträge",
6 => "Vereinnahmte Umsatzst.",
7 => "Umsatzsteuererstattungen",
- 8 => "Wareneingänge",
- 9 => "Löhne und Gehälter",
+ 8 => "Wareneingänge",
+ 9 => "Löhne und Gehälter",
10 => "Gesetzl. sozialer Aufw.",
11 => "Mieten",
12 => "Gas, Strom, Wasser",
13 => "Instandhaltung",
- 14 => "Steuern, Versich., Beiträge",
+ 14 => "Steuern, Versich., Beiträge",
15 => "Kfz-Steuern",
16 => "Kfz-Versicherungen",
17 => "Sonst. Fahrzeugkosten",
18 => "Werbe- und Reisekosten",
19 => "Instandhaltung u. Werkzeuge",
- 20 => "Fachzeitschriften, Bücher",
- 21 => "Miete für Einrichtungen",
+ 20 => "Fachzeitschriften, Bücher",
+ 21 => "Miete für Einrichtungen",
22 => "Rechts- und Beratungskosten",
- 23 => "Bürobedarf, Porto, Telefon",
+ 23 => "Bürobedarf, Porto, Telefon",
24 => "Sonstige Aufwendungen",
25 => "Abschreibungen auf Anlagever.",
26 => "Abschreibungen auf GWG",
30 => "Ausserordentlicher Aufwand",
31 => "Betriebliche Steuern");
foreach my $item (sort({ $a <=> $b } keys(%eur))) {
- my $text = H(SL::Iconv::convert("ISO-8859-15", $main::dbcharset, $eur{$item}));
+ my $text = H($::locale->{iconv_utf8}->convert($eur{$item}));
if ($item == $form->{pos_eur}) {
$select_eur .= qq|<option value=$item selected>|. sprintf("%.2d", $item) .qq|. $text</option>\n|;
} else {
my $select_bwa = q|<option value=""> |. $locale->text('None') .q|</option>\n|;
my %bwapos = (
- 1 => 'Umsatzerlöse',
+ 1 => 'Umsatzerlöse',
2 => 'Best.Verdg.FE/UE',
3 => 'Aktiv.Eigenleistung',
4 => 'Mat./Wareneinkauf',
- 5 => 'So.betr.Erlöse',
+ 5 => 'So.betr.Erlöse',
10 => 'Personalkosten',
11 => 'Raumkosten',
12 => 'Betriebl.Steuern',
- 13 => 'Vers./Beiträge',
+ 13 => 'Vers./Beiträge',
14 => 'Kfz.Kosten o.St.',
15 => 'Werbe-Reisek.',
16 => 'Kosten Warenabgabe',
17 => 'Abschreibungen',
18 => 'Rep./instandhlt.',
- 19 => 'Übrige Steuern',
+ 19 => 'Übrige Steuern',
20 => 'Sonst.Kosten',
30 => 'Zinsauwand',
31 => 'Sonst.neutr.Aufw.',
- 32 => 'Zinserträge',
+ 32 => 'Zinserträge',
33 => 'Sonst.neutr.Ertrag',
34 => 'Verr.kalk.Kosten',
35 => 'Steuern Eink.u.Ertr.');
foreach my $item (sort({ $a <=> $b } keys %bwapos)) {
- my $text = H(SL::Iconv::convert("ISO-8859-15", $main::dbcharset, $bwapos{$item}));
+ my $text = H($::locale->{iconv_utf8}->convert($bwapos{$item}));
if ($item == $form->{pos_bwa}) {
$select_bwa .= qq|<option value="$item" selected>|. sprintf("%.2d", $item) .qq|. $text\n|;
} else {
}
-# Wieder hinzugefügt zu evaluationszwecken (us) 09.03.2007
+# Wieder hinzugefügt zu evaluationszwecken (us) 09.03.2007
my $select_bilanz = q|<option value=""> |. $locale->text('None') .q|</option>\n|;
foreach my $item ((1, 2, 3, 4)) {
if ($item == $form->{pos_bilanz}) {
my %charttype = (
'A' => $locale->text('Account'),
- 'H' => $locale->text('Header'),
+ 'H' => $locale->text('Heading'),
);
foreach my $item ( sort({ $a <=> $b } keys %charttype) ) {
map { print "$column_data{$_}\n" } @column_index;
print qq|
- </tr>
+ </tr>
|;
}
map { print "$column_header{$_}\n" } @column_index;
print qq|
- </tr>
+ </tr>
|;
my ($i, %column_data);
$i %= 2;
print qq|
- <tr valign=top class=listrow$i>
+ <tr valign=top class=listrow$i>
|;
-# $lead = $ref->{lead};
+# $lead = $ref->{lead};
$column_data{description} = qq|<td><a href="am.pl?action=edit_lead&id=$ref->{id}&callback=$callback">$ref->{lead}</td>|;
map { print "$column_data{$_}\n" } @column_index;
print qq|
- </tr>
+ </tr>
|;
}
$form->{title} = $locale->text('Type of Business');
my @column_index = qw(description discount customernumberinit);
+ push @column_index, 'salesman' if $::vertreter;
my %column_header;
$column_header{description} =
qq|<th class=listheading width=60%>|
qq|<th class=listheading>|
. $locale->text('Customernumberinit')
. qq|</th>|;
+ $column_header{salesman} =
+ qq|<th class=listheading>|
+ . $locale->text('Representative')
+ . qq|</th>|;
$form->header;
$column_data{discount} = qq|<td align=right>$discount</td>|;
$column_data{customernumberinit} =
qq|<td align=right>$ref->{customernumberinit}</td>|;
+ $column_data{salesman} = '<td>' . ($ref->{salesman} ? $::locale->text('Yes') : $::locale->text('No')) . '</td>';
map { print "$column_data{$_}\n" } @column_index;
print qq|
- </tr>
+ </tr>
|;
}
$form->{discount} =
$form->format_amount(\%myconfig, $form->{discount} * 100);
+ my $salesman_code;
+ if ($::vertreter) {
+ $salesman_code = qq|
+ <tr>
+ <th align="right">| . $locale->text('Representative') . qq|</th>
+ <td>| . $::cgi->checkbox(-name => "salesman", -value => 1, -label => '', 'checked' => $form->{salesman} ? 1 : 0) . qq|</td>
+ </tr>
+|;
+ } else {
+ $salesman_code = $::cgi->hidden(-name => 'salesman', -value => $form->{salesman} ? 1 : 0);
+ }
+
$form->header;
print qq|
<th align=right>| . $locale->text('Customernumberinit') . qq|</th>
<td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
</tr>
+$salesman_code
<td colspan=2><hr size=3 noshade></td>
</tr>
</table>
map { print "$column_data{$_}\n" } @column_index;
print qq|
- </tr>
+ </tr>
|;
}
map { print "$column_data{$_}\n" } @column_index;
print qq|
- </tr>
+ </tr>
|;
$row++;
if (!$main::eur) {
$linkaccounts = qq|
<tr>
- <th align=right>| . $locale->text('Inventory') . qq|</th>
- <td><select name=inventory_accno_id>$form->{selectIC}</select></td>
- <input name=selectIC type=hidden value="$form->{selectIC}">
- </tr>|;
+ <th align=right>| . $locale->text('Inventory') . qq|</th>
+ <td><select name=inventory_accno_id>$form->{selectIC}</select></td>
+ <input name=selectIC type=hidden value="$form->{selectIC}">
+ </tr>|;
} else {
$linkaccounts = qq|
<input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>|;
$linkaccounts .= qq|
- <tr>
- <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('National Expenses') . qq|</th>
- <td><select name=expense_accno_id_0>$form->{selectIC_expense}</select></td>
- </tr>|;
+ <tr>
+ <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('National Expenses') . qq|</th>
+ <td><select name=expense_accno_id_0>$form->{selectIC_expense}</select></td>
+ </tr>|;
if ($form->{id}) {
$form->{selectIC_income} =~ s/selected//g;
$form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_1}\E/ value=$form->{income_accno_id_1} selected/;
$form->{selectIC_expense} =~ s/selected//g;
$form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_1}\E/ value=$form->{expense_accno_id_1} selected/;
}
- $linkaccounts .= qq| <tr>
- <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('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('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('Expenses EU with UStId') . qq|</th>
+ <td><select name=expense_accno_id_1>$form->{selectIC_expense}</select></td>
+ </tr>|;
if ($form->{id}) {
$form->{selectIC_income} =~ s/selected//g;
$form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_2}\E/ value=$form->{expense_accno_id_2} selected/;
}
- $linkaccounts .= qq| <tr>
- <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('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('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('Expenses EU without UStId') . qq|</th>
+ <td><select name=expense_accno_id_2>$form->{selectIC_expense}</select></td>
+ </tr>|;
if ($form->{id}) {
$form->{selectIC_income} =~ s/selected//g;
$form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_3}\E/ value=$form->{expense_accno_id_3} selected/;
}
- $linkaccounts .= qq| <tr>
- <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('Foreign Expenses') . qq|</th>
- <td><select name=expense_accno_id_3>$form->{selectIC_expense}</select></td>
- </tr>
+ $linkaccounts .= qq| <tr>
+ <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('Foreign Expenses') . qq|</th>
+ <td><select name=expense_accno_id_3>$form->{selectIC_expense}</select></td>
+ </tr>
|;
$main::lxdebug->leave_sub();
}
-
-sub add_printer {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
-
- $main::auth->assert('config');
-
- $form->{title} = "Add";
-
- $form->{callback} = "am.pl?action=add_printer" unless $form->{callback};
-
- &printer_header;
- &form_footer;
-
- $main::lxdebug->leave_sub();
-}
-
-sub edit_printer {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
-
- $main::auth->assert('config');
-
- $form->{title} = "Edit";
-
- AM->get_printer(\%myconfig, \%$form);
-
- &printer_header;
-
- $form->{orphaned} = 1;
- &form_footer;
-
- $main::lxdebug->leave_sub();
-}
-
-sub list_printer {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- AM->printer(\%myconfig, \%$form);
-
- $form->{callback} = "am.pl?action=list_printer";
-
- my $callback = $form->escape($form->{callback});
-
- $form->{title} = $locale->text('Printer');
-
- my @column_index = qw(printer_description printer_command template_code);
- my %column_header;
- $column_header{printer_description} =
- qq|<th class=listheading width=60%>|
- . $locale->text('Printer Description')
- . qq|</th>|;
- $column_header{printer_command} =
- qq|<th class=listheading width=10%>|
- . $locale->text('Printer Command')
- . qq|</th>|;
- $column_header{template_code} =
- qq|<th class=listheading>|
- . $locale->text('Template Code')
- . qq|</th>|;
-
- $form->header;
-
- print qq|
-<body>
-
-<table width=100%>
- <tr>
- <th class=listtop>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <td>
- <table width=100%>
- <tr class=listheading>
-|;
-
- map { print "$column_header{$_}\n" } @column_index;
-
- print qq|
- </tr>
-|;
-
- my ($i, %column_data);
- foreach my $ref (@{ $form->{ALL} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
-
- $column_data{printer_description} = qq|<td><a href="am.pl?action=edit_printer&id=$ref->{id}&callback=$callback">$ref->{printer_description}</td>|;
- $column_data{printer_command} = qq|<td align=right>$ref->{printer_command}</td>|;
- $column_data{template_code} =
- qq|<td align=right>$ref->{template_code}</td>|;
-
- map { print "$column_data{$_}\n" } @column_index;
-
- print qq|
- </tr>
-|;
- }
-
- print qq|
- </table>
- </td>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-
-<br>
-<form method=post action=am.pl>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=type value=printer>
-
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">
-
- </form>
-
- </body>
- </html>
-|;
-
- $main::lxdebug->leave_sub();
-}
-
-sub printer_header {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->{title} = $locale->text("$form->{title} Printer");
-
- # $locale->text('Add Printer')
- # $locale->text('Edit Printer')
-
- $form->{printer_description} =~ s/\"/"/g;
- $form->{template_code} =~ s/\"/"/g;
- $form->{printer_command} =~ s/\"/"/g;
-
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=am.pl>
-
-<input type=hidden name=id value=$form->{id}>
-<input type=hidden name=type value=printer>
-
-<table width=100%>
- <tr>
- <th class=listtop colspan=2>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <th align=right>| . $locale->text('Printer') . qq|</th>
- <td><input name=printer_description size=30 value="$form->{printer_description}"></td>
- <tr>
- <tr>
- <th align=right>| . $locale->text('Printer Command') . qq|</th>
- <td><input name=printer_command size=30 value="$form->{printer_command}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Template Code') . qq|</th>
- <td><input name=template_code size=5 value="$form->{template_code}"></td>
- </tr>
- <td colspan=2><hr size=3 noshade></td>
- </tr>
-</table>
-|;
-
- $main::lxdebug->leave_sub();
-}
-
-sub save_printer {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->isblank("printer_description", $locale->text('Description missing!'));
- $form->isblank("printer_command", $locale->text('Printer Command missing!'));
- AM->save_printer(\%myconfig, \%$form);
- $form->redirect($locale->text('Printer saved!'));
-
- $main::lxdebug->leave_sub();
-}
-
-sub delete_printer {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- AM->delete_printer(\%myconfig, \%$form);
- $form->redirect($locale->text('Printer deleted!'));
-
- $main::lxdebug->leave_sub();
-}
-
sub add_payment {
$main::lxdebug->enter_sub();
map { print "$column_data{$_}\n" } @column_index;
print qq|
- </tr>
+ </tr>
|;
$row++;
}
"with discount")
. qq|</li>
<li>| . $locale->text("<%skonto_amount%> -- The deductible amount")
+. qq|</li>
+ <li>| . $locale->text("<%skonto_in_percent%> -- The discount in percent")
. qq|</li>
<li>| . $locale->text("<%total%> -- Amount payable")
. qq|</li>
{ 'name' => $locale->text('Queue'), 'value' => 'queue', 'selected' => $selected{queue}, },
];
- AM->printer(\%myconfig, $form);
-
$form->{PRINTERS} = [];
- foreach my $printer (@{$form->{"ALL"}}) {
+ foreach my $printer (SL::Printer->all_printers(%::myconfig)) {
push @{ $form->{PRINTERS} }, {
'name' => $printer->{printer_description},
'value' => $printer->{id},
}
$form->{STYLESHEETS} = [];
- foreach my $item (qw(lx-office-erp.css Win2000.css)) {
+ foreach my $item (qw(lx-office-erp.css Win2000.css Mobile.css)) {
push @{ $form->{STYLESHEETS} }, {
'name' => $item,
'value' => $item,
<tr>
<td>
<table>
- <tr>
- <th>| . $locale->text('Close Books up to') . qq|</th>
- <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
- </tr>
+ <tr>
+ <th>| . $locale->text('Close Books up to') . qq|</th>
+ <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
+ </tr>
</table>
</td>
</tr>
my %searchNo = ( "Artikelnummer" => "partnumber",
"Kundennummer" => "customernumber",
"Lieferantennummer" => "vendornumber",
- "Projektnummer" => "projectnummer",
+ "Projektnummer" => "projectnumber",
"Buchungsnummer" => "ordnumber",
"Eingangsrechnungnummer" => "invnumber",
"Ausgangsrechnungnummer" => "invnumber",
$form->header();
print $form->parse_html_template('am/confirm_delete_warehouse');
- exit 0;
+ ::end_of_request();
}
if (AM->delete_warehouse(\%myconfig, $form)) {