- $form->{callback} =
- "$form->{script}?action=list_business&path=$form->{path}&login=$form->{login}&password=$form->{password}";
-
- $callback = $form->escape($form->{callback});
-
- $form->{title} = $locale->text('Type of Business');
-
- @column_index = qw(description discount customernumberinit);
-
- $column_header{description} =
- qq|<th class=listheading width=60%>|
- . $locale->text('Description')
- . qq|</th>|;
- $column_header{discount} =
- qq|<th class=listheading width=10%>|
- . $locale->text('Discount')
- . qq| %</th>|;
- $column_header{customernumberinit} =
- qq|<th class=listheading>|
- . $locale->text('Customernumberinit')
- . 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>
-|;
-
- foreach $ref (@{ $form->{ALL} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
- $discount =
- $form->format_amount(\%myconfig, $ref->{discount} * 100, 1, " ");
- $description =
- ($ref->{salesman})
- ? "<b>$ref->{description}</b>"
- : "$ref->{description}";
- $column_data{description} =
- qq|<td><a href=$form->{script}?action=edit_business&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$description</td>|;
- $column_data{discount} = qq|<td align=right>$discount</td>|;
- $column_data{customernumberinit} =
- qq|<td align=right>$ref->{customernumberinit}</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=$form->{script}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=type value=business>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
-
- </form>
-
- </body>
- </html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub business_header {
- $lxdebug->enter_sub();
-
- $form->{title} = $locale->text("$form->{title} Business");
- $form->{salesman} = "checked" if $form->{salesman};
-
- # $locale->text('Add Business')
- # $locale->text('Edit Business')
-
- $form->{description} =~ s/\"/"/g;
- $form->{discount} =
- $form->format_amount(\%myconfig, $form->{discount} * 100);
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<input type=hidden name=id value=$form->{id}>
-<input type=hidden name=type value=business>
-
-<table width=100%>
- <tr>
- <th class=listtop colspan=2>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <th align=right>| . $locale->text('Type of Business') . qq|</th>
- <td><input name=description size=30 value="$form->{description}"></td>
- <tr>
- <tr>
- <th align=right>| . $locale->text('Discount') . qq| %</th>
- <td><input name=discount size=5 value=$form->{discount}></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Customernumberinit') . qq|</th>
- <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
- </tr>
- <tr>
- <td align=right>| . $locale->text('Salesman') . qq|</td>
- <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
- </tr>
- <td colspan=2><hr size=3 noshade></td>
- </tr>
-</table>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub save_business {
- $lxdebug->enter_sub();
-
- $form->isblank("description", $locale->text('Description missing!'));
- AM->save_business(\%myconfig, \%$form);
- $form->redirect($locale->text('Business saved!'));
-
- $lxdebug->leave_sub();
-}
-
-sub delete_business {
- $lxdebug->enter_sub();
-
- AM->delete_business(\%myconfig, \%$form);
- $form->redirect($locale->text('Business deleted!'));
-
- $lxdebug->leave_sub();
-}
-
-sub add_language {
- $lxdebug->enter_sub();
-
- $form->{title} = "Add";
-
- $form->{callback} =
- "$form->{script}?action=add_language&path=$form->{path}&login=$form->{login}&password=$form->{password}"
- unless $form->{callback};
-
- &language_header;
- &form_footer;
-
- $lxdebug->leave_sub();
-}
-
-sub edit_language {
- $lxdebug->enter_sub();
-
- $form->{title} = "Edit";
-
- AM->get_language(\%myconfig, \%$form);
-
- &language_header;
-
- $form->{orphaned} = 1;
- &form_footer;
-
- $lxdebug->leave_sub();
-}
-
-sub list_language {
- $lxdebug->enter_sub();
-
- AM->language(\%myconfig, \%$form);
-
- $form->{callback} =
- "$form->{script}?action=list_language&path=$form->{path}&login=$form->{login}&password=$form->{password}";
-
- $callback = $form->escape($form->{callback});
-
- $form->{title} = $locale->text('Languages');
-
- @column_index = qw(description template_code article_code);
-
- $column_header{description} =
- qq|<th class=listheading width=60%>|
- . $locale->text('Description')
- . qq|</th>|;
- $column_header{template_code} =
- qq|<th class=listheading width=10%>|
- . $locale->text('Template Code')
- . qq|</th>|;
- $column_header{article_code} =
- qq|<th class=listheading>|
- . $locale->text('Article 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>
-|;
-
- foreach $ref (@{ $form->{ALL} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
-
- $column_data{description} =
- qq|<td><a href=$form->{script}?action=edit_language&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
- $column_data{template_code} = qq|<td align=right>$ref->{template_code}</td>|;
- $column_data{article_code} =
- qq|<td align=right>$ref->{article_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=$form->{script}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=type value=language>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
-
- </form>
-
- </body>
- </html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub language_header {
- $lxdebug->enter_sub();
-
- $form->{title} = $locale->text("$form->{title} Language");
-
- # $locale->text('Add Language')
- # $locale->text('Edit Language')
-
- $form->{description} =~ s/\"/"/g;
- $form->{template_code} =~ s/\"/"/g;
- $form->{article_code} =~ s/\"/"/g;
-
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<input type=hidden name=id value=$form->{id}>
-<input type=hidden name=type value=language>
-
-<table width=100%>
- <tr>
- <th class=listtop colspan=2>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <th align=right>| . $locale->text('Language') . qq|</th>
- <td><input name=description size=30 value="$form->{description}"></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>
- <tr>
- <th align=right>| . $locale->text('Article Code') . qq|</th>
- <td><input name=article_code size=10 value=$form->{article_code}></td>
- </tr>
- <td colspan=2><hr size=3 noshade></td>
- </tr>
-</table>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub save_language {
- $lxdebug->enter_sub();
-
- $form->isblank("description", $locale->text('Language missing!'));
- $form->isblank("template_code", $locale->text('Template Code missing!'));
- $form->isblank("article_code", $locale->text('Article Code missing!'));
- AM->save_language(\%myconfig, \%$form);
- $form->redirect($locale->text('Language saved!'));
-
- $lxdebug->leave_sub();
-}
-
-sub delete_language {
- $lxdebug->enter_sub();
-
- AM->delete_language(\%myconfig, \%$form);
- $form->redirect($locale->text('Language deleted!'));
-
- $lxdebug->leave_sub();
-}
-
-
-sub add_buchungsgruppe {
- $lxdebug->enter_sub();
-
- # $locale->text("Add Buchungsgruppe")
- # $locale->text("Edit Buchungsgruppe")
- $form->{title} = "Add";
-
- $form->{callback} =
- "$form->{script}?action=add_buchungsgruppe&path=$form->{path}&login=$form->{login}&password=$form->{password}"
- unless $form->{callback};
- AM->get_buchungsgruppe(\%myconfig, \%$form);
-
- &buchungsgruppe_header;
- &form_footer;
-
- $lxdebug->leave_sub();
-}
-
-sub edit_buchungsgruppe {
- $lxdebug->enter_sub();
-
- $form->{title} = "Edit";
-
- AM->get_buchungsgruppe(\%myconfig, \%$form);
-
- &buchungsgruppe_header;
-
- &form_footer;
-
- $lxdebug->leave_sub();
-}
-
-sub list_buchungsgruppe {
- $lxdebug->enter_sub();
-
- AM->buchungsgruppe(\%myconfig, \%$form);
-
- $form->{callback} =
- "$form->{script}?action=list_buchungsgruppe&path=$form->{path}&login=$form->{login}&password=$form->{password}";
-
- $callback = $form->escape($form->{callback});
-
- $form->{title} = $locale->text('Buchungsgruppen');
-
- @column_index = qw(description inventory_accno income_accno_0 expense_accno_0 income_accno_1 expense_accno_1 income_accno_2 expense_accno_2 income_accno_3 expense_accno_3 );
-
- $column_header{description} =
- qq|<th class=listheading width=60%>|
- . $locale->text('Description')
- . qq|</th>|;
- $column_header{inventory_accno} =
- qq|<th class=listheading width=10%>|
- . $locale->text('Bestandskonto')
- . qq|</th>|;
- $column_header{income_accno_0} =
- qq|<th class=listheading>|
- . $locale->text('Erlöse Inland')
- . qq|</th>|;
- $column_header{expense_accno_0} =
- qq|<th class=listheading>|
- . $locale->text('Aufwand Inland')
- . qq|</th>|;
- $column_header{income_accno_1} =
- qq|<th class=listheading>|
- . $locale->text('Erlöse EU o. UStId')
- . qq|</th>|;
- $column_header{expense_accno_1} =
- qq|<th class=listheading>|
- . $locale->text('Aufwand EU o. UStId')
- . qq|</th>|;
- $column_header{income_accno_2} =
- qq|<th class=listheading>|
- . $locale->text('Erlöse EU m. UStId')
- . qq|</th>|;
- $column_header{expense_accno_2} =
- qq|<th class=listheading>|
- . $locale->text('Aufwand EU m. UStId')
- . qq|</th>|;
- $column_header{income_accno_3} =
- qq|<th class=listheading>|
- . $locale->text('Erlöse Ausland')
- . qq|</th>|;
- $column_header{expense_accno_3} =
- qq|<th class=listheading>|
- . $locale->text('Aufwand Ausland')
- . 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>
-|;
-
- foreach $ref (@{ $form->{ALL} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
-
- $column_data{description} =
- qq|<td><a href=$form->{script}?action=edit_buchungsgruppe&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
- $column_data{inventory_accno} = qq|<td align=right>$ref->{inventory_accno}</td>|;
- $column_data{income_accno_0} =
- qq|<td align=right>$ref->{income_accno_0}</td>|;
- $column_data{expense_accno_0} = qq|<td align=right>$ref->{expense_accno_0}</td>|;
- $column_data{income_accno_1} =
- qq|<td align=right>$ref->{income_accno_1}</td>|;
- $column_data{expense_accno_1} = qq|<td align=right>$ref->{expense_accno_1}</td>|;
- $column_data{income_accno_2} =
- qq|<td align=right>$ref->{income_accno_2}</td>|;
- $column_data{expense_accno_2} = qq|<td align=right>$ref->{expense_accno_2}</td>|;
- $column_data{income_accno_3} =
- qq|<td align=right>$ref->{income_accno_3}</td>|;
- $column_data{expense_accno_3} = qq|<td align=right>$ref->{expense_accno_3}</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=$form->{script}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=type value=buchungsgruppe>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
-
- </form>
-
- </body>
- </html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub buchungsgruppe_header {
- $lxdebug->enter_sub();
-
- $form->{title} = $locale->text("$form->{title} Buchungsgruppe");
-
- # $locale->text('Buchungsgruppe hinzufügen')
- # $locale->text('Buchungsgruppe bearbeiten')
-
- $form->{description} =~ s/\"/"/g;
-
- # build the popup menus
- $form->{taxaccounts} = "";
- foreach $key (keys %{ $form->{IC_links} }) {
- foreach $ref (@{ $form->{IC_links}{$key} }) {
-
- # if this is a tax field
- if ($key =~ /IC_tax/) {
- if ($key =~ /$item/) {
- $form->{taxaccounts} .= "$ref->{accno} ";
- $form->{"IC_tax_$ref->{accno}_description"} =
- "$ref->{accno}--$ref->{description}";
-
- if ($form->{id}) {
- if ($form->{amount}{ $ref->{accno} }) {
- $form->{"IC_tax_$ref->{accno}"} = "checked";
- }
- } else {
- $form->{"IC_tax_$ref->{accno}"} = "checked";
- }
- }
- } else {
-
- $form->{"select$key"} .=
- "<option value=$ref->{id} $ref->{selected}>$ref->{accno}--$ref->{description}\n";
- if (($key eq "IC") && ($ref->{selected} eq "selected")) {
- $form->{IC_default} = $ref->{id};
- }
- if ($form->{amount}{$key} eq $ref->{accno}) {
- $form->{$key} = "$ref->{accno}--$ref->{description}";
- }
-
- }
- }
- }
- $form->{selectIC_income} = $form->{selectIC_sale};
- $form->{selectIC_expense} = $form->{selectIC_cogs};
- $form->{IC_income} = $form->{IC_sale};
- $form->{IC_expense} = $form->{IC_cogs};
-
- if ($form->{id}) {
- $form->{selectIC} =~ s/selected//g;
- $form->{selectIC} =~ s/ value=\$form->{inventory_accno_id}/ value=\$form->{inventory_accno_id} selected/;
- $form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_0}/ value=$form->{income_accno_id_0} selected/;
- $form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_0}/ value=$form->{expense_accno_id_0} selected/;
- }
-
- if (!$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>|;
- } else {
- $linkaccounts = qq|
- <input type=hidden name=inventory_accno_id value=1>|;
- }
-
-
- $linkaccounts .= qq|
- <tr>
- <th align=right>| . $locale->text('Erlöse Inland') . 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>
- <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=$form->{income_accno_id_1}/ value=$form->{income_accno_id_1} selected/;
- $form->{selectIC_expense} =~ s/selected//g;
- $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>
- <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>
- <td><select name=expense_accno_id_1>$form->{selectIC_expense}</select></td>
- </tr>|;
-
- if ($form->{id}) {
- $form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_2}/ value=$form->{income_accno_id_2} selected/;
- $form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_2}/ value=$form->{expense_accno_id_2} selected/;
- }
-
- $linkaccounts .= qq| <tr>
- <th align=right>| . $locale->text('Erlöse EU o. 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>
- <td><select name=expense_accno_id_2>$form->{selectIC_expense}</select></td>
- </tr>|;
-
- if ($form->{id}) {
- $form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_3}/ value=$form->{income_accno_id_3} selected/;
- $form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_3}/ value=$form->{expense_accno_id_3} selected/;
- }
-
- $linkaccounts .= qq| <tr>
- <th align=right>| . $locale->text('Erlöse Ausland') . 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>
- <td><select name=expense_accno_id_3>$form->{selectIC_expense}</select></td>
- </tr>
-|;
-
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<input type=hidden name=id value=$form->{id}>
-<input type=hidden name=type value=buchungsgruppe>
-
-<table width=100%>
- <tr>
- <th class=listtop colspan=2>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <th align=right>| . $locale->text('Buchungsgruppe') . qq|</th>
- <td><input name=description size=30 value="$form->{description}"></td>
- <tr>
- $linkaccounts
- <td colspan=2><hr size=3 noshade></td>
- </tr>
-</table>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub save_buchungsgruppe {
- $lxdebug->enter_sub();
-
- $form->isblank("description", $locale->text('Description missing!'));
-
- AM->save_buchungsgruppe(\%myconfig, \%$form);
- $form->redirect($locale->text('Buchungsgruppe gespeichert!'));
-
- $lxdebug->leave_sub();
-}
-
-sub delete_buchungsgruppe {
- $lxdebug->enter_sub();
-
- AM->delete_buchungsgruppe(\%myconfig, \%$form);
- $form->redirect($locale->text('Buchungsgruppe gelöscht!'));
-
- $lxdebug->leave_sub();
-}
-
-
-sub add_printer {
- $lxdebug->enter_sub();
-
- $form->{title} = "Add";
-
- $form->{callback} =
- "$form->{script}?action=add_printer&path=$form->{path}&login=$form->{login}&password=$form->{password}"
- unless $form->{callback};
-
- &printer_header;
- &form_footer;
-
- $lxdebug->leave_sub();
-}
-
-sub edit_printer {
- $lxdebug->enter_sub();
-
- $form->{title} = "Edit";
-
- AM->get_printer(\%myconfig, \%$form);
-
- &printer_header;
-
- $form->{orphaned} = 1;
- &form_footer;
-
- $lxdebug->leave_sub();
-}
-
-sub list_printer {
- $lxdebug->enter_sub();
-
- AM->printer(\%myconfig, \%$form);
-
- $form->{callback} =
- "$form->{script}?action=list_printer&path=$form->{path}&login=$form->{login}&password=$form->{password}";
-
- $callback = $form->escape($form->{callback});
-
- $form->{title} = $locale->text('Printer');
-
- @column_index = qw(printer_description printer_command template_code);
-
- $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>
-|;
-
- foreach $ref (@{ $form->{ALL} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
-
- $column_data{printer_description} =
- qq|<td><a href=$form->{script}?action=edit_printer&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&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=$form->{script}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=type value=printer>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
-
- </form>
-
- </body>
- </html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub printer_header {
- $lxdebug->enter_sub();
-
- $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=$form->{script}>
-
-<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>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub save_printer {
- $lxdebug->enter_sub();
-
- $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!'));
-
- $lxdebug->leave_sub();
-}
-
-sub delete_printer {
- $lxdebug->enter_sub();
-
- AM->delete_printer(\%myconfig, \%$form);
- $form->redirect($locale->text('Printer deleted!'));
-
- $lxdebug->leave_sub();
-}
-
-
-sub add_payment {
- $lxdebug->enter_sub();
-
- $form->{title} = "Add";
-
- $form->{callback} =
- "$form->{script}?action=add_payment&path=$form->{path}&login=$form->{login}&password=$form->{password}"
- unless $form->{callback};
-
- &payment_header;
- &form_footer;
-
- $lxdebug->leave_sub();
-}
-
-sub edit_payment {
- $lxdebug->enter_sub();
-
- $form->{title} = "Edit";
-
- AM->get_payment(\%myconfig, \%$form);
-
- &payment_header;
-
- $form->{orphaned} = 1;
- &form_footer;
-
- $lxdebug->leave_sub();
-}
-
-sub list_payment {
- $lxdebug->enter_sub();
-
- AM->payment(\%myconfig, \%$form);
-
- $form->{callback} =
- "$form->{script}?action=list_payment&path=$form->{path}&login=$form->{login}&password=$form->{password}";
-
- $callback = $form->escape($form->{callback});
-
- $form->{title} = $locale->text('Payment Terms');
-
- @column_index = qw(description description_long terms_netto terms_skonto percent_skonto);
-
- $column_header{description} =
- qq|<th class=listheading>|
- . $locale->text('Description')
- . qq|</th>|;
- $column_header{description_long} =
- qq|<th class=listheading>|
- . $locale->text('Long Description')
- . qq|</th>|;
- $column_header{terms_netto} =
- qq|<th class=listheading>|
- . $locale->text('Netto Terms')
- . qq|</th>|;
- $column_header{terms_skonto} =
- qq|<th class=listheading>|
- . $locale->text('Skonto Terms')
- . qq|</th>|;
- $column_header{percent_skonto} =
- qq|<th class=listheading>|
- . $locale->text('Skonto')
- . 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>
-|;
-
- foreach $ref (@{ $form->{ALL} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
-
- $column_data{description} =
- qq|<td><a href=$form->{script}?action=edit_payment&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
- $column_data{description_long} = qq|<td align=right>$ref->{description_long}</td>|;
- $column_data{terms_netto} =
- qq|<td align=right>$ref->{terms_netto}</td>|;
- $column_data{terms_skonto} =
- qq|<td align=right>$ref->{terms_skonto}</td>|;
- $column_data{percent_skonto} =
- qq|<td align=right>$ref->{percent_skonto} %</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=$form->{script}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=type value=business>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
-
- </form>
-
- </body>
- </html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub payment_header {
- $lxdebug->enter_sub();
-
- $form->{title} = $locale->text("$form->{title} Payment Terms");
-
- # $locale->text('Add Payment Terms')
- # $locale->text('Edit Payment Terms')
-
- $form->{description} =~ s/\"/"/g;