+ 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|">
+
+ </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!'));
+ $form->{discount} = $form->parse_amount(\%myconfig, $form->{discount}) / 100;
+ 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 output_numberformat output_dateformat output_longdates);
+
+ $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>|;
+ $column_header{output_numberformat} =
+ qq|<th class=listheading>|
+ . $locale->text('Number Format')
+ . qq|</th>|;
+ $column_header{output_dateformat} =
+ qq|<th class=listheading>|
+ . $locale->text('Date Format')
+ . qq|</th>|;
+ $column_header{output_longdates} =
+ qq|<th class=listheading>|
+ . $locale->text('Long Dates')
+ . 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>|;
+ $column_data{output_numberformat} =
+ "<td nowrap>" .
+ ($ref->{output_numberformat} ? $ref->{output_numberformat} :
+ $locale->text("use program settings")) .
+ "</td>";
+ $column_data{output_dateformat} =
+ "<td nowrap>" .
+ ($ref->{output_dateformat} ? $ref->{output_dateformat} :
+ $locale->text("use program settings")) .
+ "</td>";
+ $column_data{output_longdates} =
+ "<td nowrap>" .
+ ($ref->{output_longdates} ? $locale->text("Yes") : $locale->text("No")) .
+ "</td>";
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;