my $user = SL::DB::Manager::AuthUser->find_by(login => $form->{login});
$user->update_attributes(
config_values => {
- map({ ($_ => $form->{$_}) } SL::DB::AuthUser::CONFIG_VARS()),
- map({ ($_ => do { my $v = $form->{$_}; $v =~ s/\r//g; $v }) } qw(address signature)),
+ map { ($_ => $form->{$_}) } SL::DB::AuthUser::CONFIG_VARS(),
});
$main::lxdebug->leave_sub();
local (*IN, *OUT);
+ my $defaults = SL::DB::Default->get;
my $userspath = $::lx_office_conf{paths}->{userspath};
$self->{"cwd"} = getcwd();
$self->{"notes"} = $self->{ $self->{"formname"} . "notes" };
if (!$self->{employee_id}) {
- map { $self->{"employee_${_}"} = $myconfig->{$_}; } qw(email tel fax name signature company address businessnumber co_ustid taxnumber duns);
+ $self->{"employee_${_}"} = $myconfig->{$_} for qw(email tel fax name signature);
+ $self->{"employee_${_}"} = $defaults->$_ for qw(address businessnumber co_ustid company duns sepa_creditor_id taxnumber);
}
- map { $self->{"${_}"} = $myconfig->{$_}; } qw(co_ustid);
- map { $self->{"myconfig_${_}"} = $myconfig->{$_} } grep { $_ ne 'dbpasswd' } keys %{ $myconfig };
+ $self->{"myconfig_${_}"} = $myconfig->{$_} for grep { $_ ne 'dbpasswd' } keys %{ $myconfig };
+ $self->{$_} = $defaults->$_ for qw(co_ustid);
+ $self->{"myconfig_${_}"} = $defaults->$_ for qw(address businessnumber co_ustid company duns sepa_creditor_id taxnumber);
$self->{copies} = 1 if (($self->{copies} *= 1) <= 0);
my $self = shift;
my %params = @_;
+ my $defaults = SL::DB::Default->get;
Common::check_params(\%params, qw(prefix));
Common::check_params_x(\%params, qw(id));
if ($login) {
my $user = User->new(login => $login);
- map { $self->{$params{prefix} . "_${_}"} = $user->{$_}; } qw(address businessnumber co_ustid company duns email fax name signature taxnumber tel);
+ $self->{$params{prefix} . "_${_}"} = $user->{$_} for qw(email fax name signature tel);
+ $self->{$params{prefix} . "_${_}"} = $defaults->$_ for qw(address businessnumber co_ustid company duns taxnumber);
$self->{$params{prefix} . '_login'} = $login;
$self->{$params{prefix} . '_name'} ||= $login;
die "'media' other than 'email', 'file', 'printer' is not supported yet" unless $self->{media} =~ m/^(?:email|file|printer)$/;
+ # Several fields that used to reside in %::myconfig (stored in
+ # auth.user_config) are now stored in defaults. Copy them over for
+ # compatibility.
+ $self->{$_} = $defaults->$_ for qw(company address taxnumber co_ustid duns sepa_creditor_id);
+
# set shipto from billto unless set
my $has_shipto = any { $self->{"shipto$_"} } qw(name street zipcode city country contact);
if (!$has_shipto && ($self->{type} =~ m/^(?:purchase_order|request_quotation)$/)) {
- $self->{shiptoname} = $::myconfig{company};
- $self->{shiptostreet} = $::myconfig{address};
+ $self->{shiptoname} = $defaults->company;
+ $self->{shiptostreet} = $defaults->address;
}
my $language = $self->{language} ? '_' . $self->{language} : '';
use POSIX qw(strftime);
use SL::CA;
+use SL::DB::Default;
use SL::ReportGenerator;
require "bin/mozilla/reportgenerator.pl";
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
+ my $defaults = SL::DB::Default->get;
$main::auth->assert('report');
$form->{print_date} = $locale->text('Create Date') . " " . $locale->date(\%myconfig, $form->current_date(\%myconfig), 0);
push (@options, $form->{print_date});
- $form->{company} = $locale->text('Company') . " " . $myconfig{company};
+ $form->{company} = $locale->text('Company') . " " . $defaults->company;
push (@options, $form->{company});
my @columns = qw(transdate reference description gegenkonto debit credit ustkonto ustrate balance);
if ($shipto) {
if ( $form->{formname} eq 'purchase_order'
|| $form->{formname} eq 'request_quotation') {
- $form->{shiptoname} = $myconfig{company};
- $form->{shiptostreet} = $myconfig{address};
+ $form->{shiptoname} = $defaults->company;
+ $form->{shiptostreet} = $defaults->address;
} else {
map { $form->{"shipto$_"} = $form->{$_} } @a;
}
. qq| $longcomparetodate|;
}
- # setup variables for the form
- my @a = qw(company address businessnumber);
- map { $form->{$_} = $myconfig{$_} } @a;
-
$form->{IN} = "income_statement.html";
$form->parse_template;
# $::form->{IN} = "balance_sheet.html";
- # setup company variables for the form
- map { $::form->{$_} = $::myconfig{$_} } qw(company address businessnumber nativecurr);
-
$::form->header;
print $::form->parse_html_template('rp/balance_sheet', $data);
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
+ my $defaults = SL::DB::Default->get;
if ($form->{reporttype} eq "custom") {
$form->{print_date} = $locale->text('Create Date') . " " . $locale->date(\%myconfig, $form->current_date(\%myconfig), 0);
push (@options, $form->{print_date});
- $form->{company} = $locale->text('Company') . " " . $myconfig{company};
+ $form->{company} = $locale->text('Company') . " " . $defaults->company;
push (@options, $form->{company});
. qq| $longtodate|;
}
- # setup variables for the form
- my @a = qw(company address businessnumber);
- map { $form->{$_} = $myconfig{$_} } @a;
-
$form->{IN} = "bwa.html";
$form->parse_template;
my $locale = $main::locale;
my $cgi = $::request->{cgi};
my $vc = $form->{vc} eq 'customer' ? 'customer' : 'vendor';
+ my $defaults = SL::DB::Default->get;
- if (!$myconfig->{company}) {
- $form->show_generic_error($locale->text('You have to enter a company name in your user preferences (see the "Program" menu, "Preferences").'), 'back_button' => 1);
+ if (!$defaults->company) {
+ $form->show_generic_error($locale->text('You have to enter a company name in the client configuration.'), 'back_button' => 1);
}
- if (($vc eq 'customer') && !$myconfig->{sepa_creditor_id}) {
- $form->show_generic_error($locale->text('You have to enter the SEPA creditor ID in your user preferences (see the "Program" menu, "Preferences").'), 'back_button' => 1);
+ if (($vc eq 'customer') && !$defaults->sepa_creditor_id) {
+ $form->show_generic_error($locale->text('You have to enter the SEPA creditor ID in the client configuration.'), 'back_button' => 1);
}
my @ids;
my $message_id = strftime('MSG%Y%m%d%H%M%S', localtime) . sprintf('%06d', $$);
- my $sepa_xml = SL::SEPA::XML->new('company' => $myconfig->{company},
- 'creditor_id' => $myconfig->{sepa_creditor_id},
+ my $sepa_xml = SL::SEPA::XML->new('company' => $defaults->company,
+ 'creditor_id' => $defaults->sepa_creditor_id,
'src_charset' => $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-15',
'message_id' => $message_id,
'grouped' => 1,
$::auth->assert('advance_turnover_tax_return');
+ my $defaults = SL::DB::Default->get;
$form->{title} = $locale->text('UStVA');
$form->{kz10} = ''; #Berichtigte Anmeldung? Ja =1 Nein=0
# Hier Einlesen der user-config
# steuernummer entfernt für prerelease
my @a = qw(
- signature name company address businessnumber
+ signature name
tel fax email co_chief co_department
co_custom1 co_custom2 co_custom3 co_custom4 co_custom5
co_name1 co_name2 co_street co_street1 co_zip
co_city co_city1 co_country co_tel co_tel1
co_tel2 co_fax co_fax1 co_email co_email1
- co_url co_url1 ustid duns co_bankname
+ co_url co_url1 co_bankname
co_bankname1 co_bankname2 co_bankname3 co_blz co_blz1
co_blz2 co_blz3 co_accountnr co_accountnr1 co_accountnr2
co_accountnr3
);
- map { $form->{$_} = $myconfig{$_} } @a;
+ $form->{$_} = $myconfig{$_} for @a;
+ $form->{$_} = $defaults->$_ for qw(company address co_ustid duns);
my $openings = $form->{FA_Oeffnungszeiten};
$openings =~ s/\\\\n/<br>/g;
company_given => $company_given,
address_given => $address_given,
taxnumber_given => $taxnumber_given,
- taxnumber => $myconfig{taxnumber},
+ taxnumber => $defaults->taxnumber,
select_year => $select_year,
period_local => $period_local,
method_local => $method_local,
$locale->date(\%myconfig, $form->current_date(\%myconfig), 0, 0, 0);
# setup variables for the form
- my @a = qw(company businessnumber tel fax email
+ my @a = qw(tel fax email
co_chief co_department co_custom1 co_custom2 co_custom3 co_custom4 co_custom5
co_name1 co_name2 co_street co_street1 co_zip co_city co_city1 co_country co_tel co_tel1 co_tel2
- co_fax co_fax1 co_email co_email1 co_url co_url1 ustid duns
+ co_fax co_fax1 co_email co_email1 co_url co_url1
co_bankname co_bankname1 co_bankname2 co_bankname3 co_blz co_blz1
co_blz2 co_blz3 co_accountnr co_accountnr1 co_accountnr2 co_accountnr3);
- map { $form->{$_} = $myconfig{$_} } @a;
+ $form->{$_} = $myconfig{$_} for @a;
+ $form->{$_} = $defaults->$_ for qw(company address co_ustid duns);
if ($form->{address} ne '') {
my $temp = $form->{address};
$form->header();
my $template_ref = {
- taxnumber => $myconfig{taxnumber},
+ taxnumber => $defaults->taxnumber,
};
print($form->parse_html_template('ustva/generic_taxreport', $template_ref));
[%- IF COA_Germany %]
[% input_steuernummer %]
[%- ELSE %]
-[% 'Please enter the taxnumber in the administration menu user preferences' | $T8 %]
+[% 'Please enter the taxnumber in the client configuration.' | $T8 %]
[% 'Current value:' | $T8 %] [% HTML.escape(myconfig_taxnumber) %]
[%- END %]