use SL::Iconv;
use SL::TODO;
use SL::Printer;
-use CGI::Ajax;
use CGI;
-use Data::Dumper;
-
require "bin/mozilla/common.pl";
use strict;
}
+ # account where AR_tax or AP_tax is set are not orphaned if they are used as
+ # tax-o-matic account
+ if ( $form->{id} && !$form->{orphaned} && ($form->{link} =~ m/(AP_tax|AR_tax)/) ) {
+ if (SL::DB::Manager::Tax->find_by(chart_id => $form->{id})) {
+ $form->{orphaned} = 0;
+ }
+ }
+
my $ChartTypeIsAccount = ($form->{charttype} eq "A") ? "1":"";
+ my $AccountIsPosted = ($form->{orphaned} ) ? "":"1";
$form->header();
my $parameters_ref = {
ChartTypeIsAccount => $ChartTypeIsAccount,
+ AccountIsPosted => $AccountIsPosted,
select_category => $select_category,
select_charttype => $select_charttype,
select_bwa => $select_bwa,
$ca->{link_edit_account} = $link_edit_account . '&id=' . E($ca->{id});
}
- # Ajax
- my $pjx = new CGI::Ajax('list_account_details' => build_std_url('action=list_account_details'));
-
- # Eneable AJAX debuging
- #$pjx->DEBUG(1);
- #$pjx->JSDEBUG(1);
-
- push(@ { $form->{AJAX} }, $pjx);
-
$form->use_stylesheet("list_accounts.css");
$form->{title} = $locale->text('Chart of Accounts');
: ( $link eq 'IC_income' ) ? $locale->text('Account Link IC_income')
: ( $link eq 'IC_expense' ) ? $locale->text('Account Link IC_expense')
: ( $link eq 'IC_taxservice' ) ? $locale->text('Account Link IC_taxservice')
-# : ( $link eq 'CT_tax' ) ? $locale->text('Account Link CT_tax')
: $locale->text('Unknown Link') . ': ' . $link;
$ca->{link} .= ($link ne '') ? "[$link] ":'';
}
}
$form->{title} = $locale->text('Chart of Accounts');
- $form->header();
- print $form->parse_html_template('am/list_account_details');
+ print $form->ajax_response_header, $form->parse_html_template('am/list_account_details');
$main::lxdebug->leave_sub();
}
my $linkaccounts;
- if (!$::lx_office_conf{system}->{eur}) {
+ if ( $::instance_conf->get_inventory_system eq 'perpetual' ) { # was !$::lx_office_conf{system}->{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 {
+ } elsif ( $::instance_conf->get_inventory_system eq 'periodic' ) {
+ # don't allow choice of inventory accno and don't show that line
$linkaccounts = qq|
<input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>|;
- }
+ };
$linkaccounts .= qq|
map { $form->{"defaults_${_}"} = $form->{defaults}->{$_} } keys %{ $form->{defaults} };
+ # default language
+ my $all_languages = SL::DB::Manager::Language->get_all;
+
+# EÜR = cash, Bilanzierung = accrual
+
foreach my $key (keys %{ $form->{IC} }) {
foreach my $accno (sort keys %{ $form->{IC}->{$key} }) {
my $array = "ACCNOS_" . uc($key);
$form->{title} = $locale->text('Ranges of numbers and default accounts');
$form->header();
- print $form->parse_html_template('am/edit_defaults');
+ print $form->parse_html_template('am/edit_defaults',
+ { ALL_LANGUAGES => $all_languages, });
$main::lxdebug->leave_sub();
}
{ 'name' => $locale->text('Queue'), 'value' => 'queue', 'selected' => $selected{queue}, },
];
- $form->{PRINTERS} = [];
- foreach my $printer (SL::Printer->all_printers(%::myconfig)) {
- push @{ $form->{PRINTERS} }, {
- 'name' => $printer->{printer_description},
- 'value' => $printer->{id},
- 'selected' => $printer->{id} == $myconfig{default_printer_id},
- };
- }
+ $form->{PRINTERS} = [ SL::Printer->all_printers(%::myconfig) ];
my %countrycodes = User->country_codes;
my $dbh = $form->dbconnect(\%myconfig);
- my $restriction = qq| AND (| . join(' OR ', map { " addition = " . $dbh->quote($_) } split(m/\,/, $form->{einschraenkungen})) . qq|)| if $form->{einschraenkungen};
+ my $restriction;
+ $restriction = qq| AND (| . join(' OR ', map { " addition = " . $dbh->quote($_) } split(m/\,/, $form->{einschraenkungen})) . qq|)| if $form->{einschraenkungen};
$restriction .= qq| AND h.itime::date >= | . conv_dateq($form->{fromdate}) if $form->{fromdate};
$restriction .= qq| AND h.itime::date <= | . conv_dateq($form->{todate}) if $form->{todate};
if ($form->{mitarbeiter} =~ m/^\d+$/) {