if ($item eq ''){
$form->{ACCOUNT_TAXKEYS}[$i]{select_tax} .= qq|<option value="" selected="selected">-\n|;
}
- elsif ( $item == $taxkey_used->{pos_ustva} ) {
+ elsif ( $item eq $taxkey_used->{pos_ustva} ) {
$form->{ACCOUNT_TAXKEYS}[$i]{select_tax} .= qq|<option value="$item" selected="selected">$item\n|;
}
else {
foreach $ca (@{ $form->{CA} }) {
- $ca->{debit} = " ";
- $ca->{credit} = " ";
+ $ca->{debit} = "";
+ $ca->{credit} = "";
if ($ca->{amount} > 0) {
- $ca->{credit} =
- $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
+ $ca->{credit} = $form->format_amount(\%myconfig, $ca->{amount}, 2);
}
if ($ca->{amount} < 0) {
- $ca->{debit} =
- $form->format_amount(\%myconfig, -1 * $ca->{amount}, 2, " ");
+ $ca->{debit} = $form->format_amount(\%myconfig, -1 * $ca->{amount}, 2);
}
$ca->{heading} = ( $ca->{charttype} eq 'H' ) ? 1:'';
$ca->{link_edit_account} =
."&password=$form->{password}&action=list_account_details&";
- my $pjx = new CGI::Ajax(
- 'list_account_details' => $list_account_details_url
- );
+ my $pjx = new CGI::Ajax('list_account_details' => $list_account_details_url);
# Eneable AJAX debuging
#$pjx->DEBUG(1);
#$pjx->JSDEBUG(1);
push(@ { $form->{AJAX} }, $pjx);
-
+
+ $form->{stylesheets} = "list_accounts.css";
+
$form->header;
};
# Ausgabe des Templates
- print($form->parse_html_template('am/list_accounts', $parameters_ref));
+ print($form->parse_html_template2('am/list_accounts', $parameters_ref));
$lxdebug->leave_sub();
<li>| . $locale->text("<%skonto_amount%> -- The deductible amount")
. qq|</li>
<li>| . $locale->text("<%total%> -- Amount payable")
+. qq|</li>
+ <li>| . $locale->text("<%total_wo_skonto%> -- Amount payable less discount")
. qq|</li>
<li>| . $locale->text("<%invtotal%> -- Invoice total")
+. qq|</li>
+ <li>| . $locale->text("<%invtotal_wo_skonto%> -- Invoice total less discount")
. qq|</li>
<li>| . $locale->text("<%currency%> -- The selected currency")
. qq|</li>
};
# Ausgabe des Templates
- print($form->parse_html_template('am/edit_tax', $parameters_ref));
+ print($form->parse_html_template2('am/edit_tax', $parameters_ref));
$lxdebug->leave_sub();
}
};
# Ausgabe des Templates
- print($form->parse_html_template('am/edit_tax', $parameters_ref));
+ print($form->parse_html_template2('am/edit_tax', $parameters_ref));
$lxdebug->leave_sub();
}
$form->header();
# Ausgabe des Templates
- print($form->parse_html_template('am/list_tax', $parameters_ref));
+ print($form->parse_html_template2('am/list_tax', $parameters_ref));
$lxdebug->leave_sub();
}
sub _get_taxaccount_selection{
- $lxdebug->enter_sub();
+ $lxdebug->enter_sub();
AM->get_tax_accounts(\%myconfig, \%$form);
- my $i = 0;
- foreach my $taxaccount (@{ $form->{ACCOUNTS} } ) {
-
- # Fill in the Taxaxxounts as select options
- if ($form->{chart_id} == $taxaccount->{id}) {
- $form->{ACCOUNTS}[$i]{select_taxaccount} .=
- qq|<option value="$taxaccount->{id}" selected="selected">
- $form->{ACCOUNTS}[$i]{_taxaccount}\n|;
- }
- else {
- $form->{ACCOUNTS}[$i]{select_taxaccount} .=
- qq|<option value="$taxaccount->{id}">
- $form->{ACCOUNTS}[$i]{_taxaccount}<!-- hallo-->\n|;
- }
- $i++;
- }
- return;
+ map { $_->{selected} = $form->{chart_id} == $_->{id} } @{ $form->{ACCOUNTS} };
$lxdebug->leave_sub();
}
sub save_tax {
$lxdebug->enter_sub();
- $form->isblank("chart_id", $locale->text('Tax-O-Matic account missing!'));
$form->isblank("rate", $locale->text('Taxrate missing!'));
$form->isblank("taxdescription", $locale->text('Taxdescription missing!'));
$form->isblank("taxkey", $locale->text('Taxkey missing!'));
$form->{rate} = $form->parse_amount(\%myconfig, $form->{rate});
- if ( $form->{rate} <= 0 || $form->{rate} >= 100 ) {
+ if ( $form->{rate} < 0 || $form->{rate} >= 100 ) {
$form->error($locale->text('Tax Percent is a number between 0 and 100'));
}
- if ( $form->{rate} <= 0.99 && $form->{rate} >= 0 ) {
+ if ( $form->{rate} <= 0.99 && $form->{rate} > 0 ) {
$form->error($locale->text('Tax Percent is a number between 0 and 100'));
}