From: Jan Büren Date: Thu, 8 Nov 2012 15:15:08 +0000 (+0100) Subject: Merge branch 'master' of vc.linet-services.de:public/lx-office-erp X-Git-Tag: release-3.0.0beta1~14^2~2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4a6f0b74c08f02cd04adfe2429eb9965e770c2ba;hp=b404450189bc6a99c69fbf9f8b3e89c10dbcfda5;p=kivitendo-erp.git Merge branch 'master' of vc.linet-services.de:public/lx-office-erp --- diff --git a/SL/AM.pm b/SL/AM.pm index 6862eb773..0e64e5a66 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -244,11 +244,18 @@ sub save_account { } $query = ' - SELECT - accno + SELECT accno FROM chart WHERE accno = ?'; - my ($accno) = selectrow_query($form, $dbh, $query, $form->{accno}); + + my @values = ($form->{accno}); + + if ( $form->{id} ) { + $query .= ' AND NOT id = ?'; + push(@values, $form->{id}); + } + + my ($accno) = selectrow_query($form, $dbh, $query, @values); if ($accno) { $form->error($::locale->text('Account number not unique!')); diff --git a/SL/Auth.pm b/SL/Auth.pm index ddd8233d3..b9840fc08 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -492,6 +492,9 @@ sub read_user { # The XUL/XML backed menu has been removed. $user_data{menustyle} = 'v3' if lc($user_data{menustyle} || '') eq 'xml'; + # Set default language if selected language does not exist (anymore). + $user_data{countrycode} = $::lx_office_conf{system}->{language} unless $user_data{countrycode} && -d "locale/$user_data{countrycode}"; + $sth->finish(); $main::lxdebug->leave_sub(); diff --git a/SL/CT.pm b/SL/CT.pm index 93c3fcea2..082afdf25 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -552,7 +552,18 @@ sub _save_contact { my @columns = qw(cp_title cp_givenname cp_name cp_email cp_phone1 cp_phone2 cp_abteilung cp_fax cp_mobile1 cp_mobile2 cp_satphone cp_satfax cp_project cp_privatphone cp_privatemail cp_birthday cp_gender cp_street cp_zipcode cp_city); - my @values = map { $_ eq 'cp_gender' ? ($form->{$_} eq 'f' ? 'f' : 'm') : $form->{$_} } @columns; + my @values = map( + { + if ( $_ eq 'cp_gender' ) { + $form->{$_} eq 'f' ? 'f' : 'm'; + } elsif ( $_ eq 'cp_birthday' && $form->{cp_birthday} eq '' ) { + undef; + } else { + $form->{$_}; + } + } + @columns + ); my ($query, $cp_id); if ($form->{cp_id}) { diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index aaed72fc5..41c19ee80 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -18,7 +18,7 @@ sub action_edit { $self->{payment_options} = [ { title => $::locale->text("never"), value => 0 }, { title => $::locale->text("every time"), value => 1 }, { title => $::locale->text("on the same day"), value => 2 }, ]; - $self->{accounting_options} = [ { title => $::locale->text("accrual"), value => "accrual" }, + $self->{accounting_options} = [ { title => $::locale->text("Accrual"), value => "accrual" }, { title => $::locale->text("cash"), value => "cash" }, ]; $self->{inventory_options} = [ { title => $::locale->text("perpetual"), value => "perpetual" }, { title => $::locale->text("periodic"), value => "periodic" }, ]; diff --git a/SL/DB/MetaSetup/Contact.pm b/SL/DB/MetaSetup/Contact.pm index 2eb4fa5e7..322f82647 100644 --- a/SL/DB/MetaSetup/Contact.pm +++ b/SL/DB/MetaSetup/Contact.pm @@ -28,9 +28,12 @@ __PACKAGE__->meta->setup( cp_project => { type => 'text' }, cp_privatphone => { type => 'text' }, cp_privatemail => { type => 'text' }, - cp_birthday => { type => 'text' }, cp_abteilung => { type => 'text' }, cp_gender => { type => 'character', length => 1 }, + cp_street => { type => 'text' }, + cp_zipcode => { type => 'text' }, + cp_city => { type => 'text' }, + cp_birthday => { type => 'date' }, ], primary_key_columns => [ 'cp_id' ], diff --git a/SL/DB/MetaSetup/Customer.pm b/SL/DB/MetaSetup/Customer.pm index 51779f377..82d808cf9 100644 --- a/SL/DB/MetaSetup/Customer.pm +++ b/SL/DB/MetaSetup/Customer.pm @@ -53,7 +53,7 @@ __PACKAGE__->meta->setup( iban => { type => 'varchar', length => 100 }, bic => { type => 'varchar', length => 100 }, direct_debit => { type => 'boolean', default => 'false' }, - curr => { type => 'character', length => 3 }, + curr => { type => 'text' }, taxincluded_checked => { type => 'boolean' }, ], diff --git a/SL/DB/MetaSetup/DeliveryOrder.pm b/SL/DB/MetaSetup/DeliveryOrder.pm index 66596543d..fb4b82818 100644 --- a/SL/DB/MetaSetup/DeliveryOrder.pm +++ b/SL/DB/MetaSetup/DeliveryOrder.pm @@ -39,7 +39,7 @@ __PACKAGE__->meta->setup( taxzone_id => { type => 'integer' }, taxincluded => { type => 'boolean' }, terms => { type => 'integer' }, - curr => { type => 'character', length => 3 }, + curr => { type => 'text' }, ], primary_key_columns => [ 'id' ], diff --git a/SL/DB/MetaSetup/Exchangerate.pm b/SL/DB/MetaSetup/Exchangerate.pm index 95ea23c17..44bce842b 100644 --- a/SL/DB/MetaSetup/Exchangerate.pm +++ b/SL/DB/MetaSetup/Exchangerate.pm @@ -10,7 +10,7 @@ __PACKAGE__->meta->setup( table => 'exchangerate', columns => [ - curr => { type => 'character', length => 3 }, + curr => { type => 'text' }, transdate => { type => 'date' }, buy => { type => 'numeric', precision => 5, scale => 15 }, sell => { type => 'numeric', precision => 5, scale => 15 }, diff --git a/SL/DB/MetaSetup/Invoice.pm b/SL/DB/MetaSetup/Invoice.pm index d300a7e6a..854b9c7e3 100644 --- a/SL/DB/MetaSetup/Invoice.pm +++ b/SL/DB/MetaSetup/Invoice.pm @@ -26,7 +26,7 @@ __PACKAGE__->meta->setup( shippingpoint => { type => 'text' }, terms => { type => 'integer', default => '0' }, notes => { type => 'text' }, - curr => { type => 'character', length => 3 }, + curr => { type => 'text' }, ordnumber => { type => 'text' }, employee_id => { type => 'integer' }, quonumber => { type => 'text' }, diff --git a/SL/DB/MetaSetup/PurchaseInvoice.pm b/SL/DB/MetaSetup/PurchaseInvoice.pm index 448b2a6e0..eb18f7058 100644 --- a/SL/DB/MetaSetup/PurchaseInvoice.pm +++ b/SL/DB/MetaSetup/PurchaseInvoice.pm @@ -23,7 +23,7 @@ __PACKAGE__->meta->setup( duedate => { type => 'date' }, invoice => { type => 'boolean', default => 'false' }, ordnumber => { type => 'text' }, - curr => { type => 'character', length => 3 }, + curr => { type => 'text' }, notes => { type => 'text' }, employee_id => { type => 'integer' }, quonumber => { type => 'text' }, diff --git a/SL/DB/MetaSetup/RMA.pm b/SL/DB/MetaSetup/RMA.pm index 20790e360..beae23228 100644 --- a/SL/DB/MetaSetup/RMA.pm +++ b/SL/DB/MetaSetup/RMA.pm @@ -21,7 +21,7 @@ __PACKAGE__->meta->setup( taxincluded => { type => 'boolean' }, shippingpoint => { type => 'text' }, notes => { type => 'text' }, - curr => { type => 'character', length => 3 }, + curr => { type => 'text' }, employee_id => { type => 'integer' }, closed => { type => 'boolean', default => 'false' }, quotation => { type => 'boolean', default => 'false' }, diff --git a/SL/DB/MetaSetup/Vendor.pm b/SL/DB/MetaSetup/Vendor.pm index 387b2d857..cc9366339 100644 --- a/SL/DB/MetaSetup/Vendor.pm +++ b/SL/DB/MetaSetup/Vendor.pm @@ -53,7 +53,7 @@ __PACKAGE__->meta->setup( iban => { type => 'varchar', length => 100 }, bic => { type => 'varchar', length => 100 }, direct_debit => { type => 'boolean', default => 'false' }, - curr => { type => 'character', length => 3 }, + curr => { type => 'text' }, ], primary_key_columns => [ 'id' ], diff --git a/SL/DBUpgrade2.pm b/SL/DBUpgrade2.pm index a39ef931b..83210316c 100644 --- a/SL/DBUpgrade2.pm +++ b/SL/DBUpgrade2.pm @@ -25,12 +25,17 @@ sub init { $params{path_suffix} ||= ''; $params{schema} ||= ''; + $params{path} = "sql/" . $params{dbdriver} . "-upgrade2" . $params{path_suffix}; map { $self->{$_} = $params{$_} } keys %params; return $self; } +sub path { + $_[0]{path}; +} + sub parse_dbupdate_controls { $::lxdebug->enter_sub(); @@ -42,7 +47,7 @@ sub parse_dbupdate_controls { local *IN; my %all_controls; - my $path = "sql/" . $self->{dbdriver} . "-upgrade2" . $self->{path_suffix}; + my $path = $self->path; foreach my $file_name (<$path/*.sql>, <$path/*.pl>) { next unless (open(IN, $file_name)); @@ -164,7 +169,7 @@ sub process_query { pop(@quote_chars); } elsif (length $quote_chars[-1] > 1 && substr($_, $i, length $quote_chars[-1]) eq $quote_chars[-1]) { - $i += length $quote_chars[-1] - 1; + $i += length($quote_chars[-1]) - 1; $char = $quote_chars[-1]; pop(@quote_chars); } diff --git a/SL/Form.pm b/SL/Form.pm index ce887c347..3e9704fd2 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1607,7 +1607,7 @@ sub get_exchangerate { my ($self, $dbh, $curr, $transdate, $fld) = @_; my ($query); - unless ($transdate) { + unless ($transdate && $curr) { $main::lxdebug->leave_sub(); return 1; } diff --git a/SL/IC.pm b/SL/IC.pm index 0f4187094..f5f014b9d 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -1008,7 +1008,7 @@ sub all_parts { $joins_needed{makemodel} = 1 if grep { $form->{$_} || $form->{"l_$_"} } @makemodel_filters; $joins_needed{mv} = 1 if $joins_needed{makemodel}; $joins_needed{cv} = 1 if $bsooqr; - $joins_needed{apoe} = 1 if $joins_needed{cv} || grep { $form->{$_} || $form->{"l_$_"} } @apoe_filters; + $joins_needed{apoe} = 1 if $joins_needed{project} || $joins_needed{cv} || grep { $form->{$_} || $form->{"l_$_"} } @apoe_filters; $joins_needed{invoice_oi} = 1 if $joins_needed{project} || $joins_needed{apoe} || grep { $form->{$_} || $form->{"l_$_"} } @invoice_oi_filters; # special case for description search. @@ -1565,6 +1565,11 @@ sub retrieve_accounts { } else { $transdate = $form->{deliverydate}; } + } elsif (($form->{type} eq "credit_note") and $form->{deliverydate}) { + # if credit_note has a deliverydate, use this instead of invdate + # useful for credit_notes of invoices from an old period with different tax + # if there is no deliverydate then invdate is used, old default (see next elsif) + $transdate = $form->{deliverydate}; } elsif (($form->{type} eq "credit_note") || ($form->{script} eq 'ir.pl')) { $transdate = $form->{invdate}; } else { diff --git a/SL/RP.pm b/SL/RP.pm index 01f0be929..0ea40ec02 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -1685,12 +1685,12 @@ sub bwa { $form->{ "$key" . "gesamtkosten" }; $form->{ "$key" . "neutraleraufwand" } = $form->{30}{$key} + $form->{31}{$key}; - $form->{ "$key" . "neutralertrag" } = + $form->{ "$key" . "neutralerertrag" } = $form->{32}{$key} + $form->{33}{$key} + $form->{34}{$key}; $form->{ "$key" . "ergebnisvorsteuern" } = $form->{ "$key" . "betriebsergebnis" } - $form->{ "$key" . "neutraleraufwand" } + - $form->{ "$key" . "neutralertrag" }; + $form->{ "$key" . "neutralerertrag" }; $form->{ "$key" . "ergebnis" } = $form->{ "$key" . "ergebnisvorsteuern" } - $form->{35}{$key}; diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index f9d299ff5..500547597 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -940,7 +940,7 @@ sub edit_defaults { # default language my $all_languages = SL::DB::Manager::Language->get_all; -# EÜR = cash, Bilanzierung = accrual +# cash = IST-Versteuerung, accrual = SOLL-Versteuerung foreach my $key (keys %{ $form->{IC} }) { foreach my $accno (sort keys %{ $form->{IC}->{$key} }) { diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index b86623b51..9ee6e604b 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1586,7 +1586,7 @@ sub form_header { IC->retrieve_buchungsgruppen(\%myconfig, $form); @{ $form->{BUCHUNGSGRUPPEN} } = grep { $_->{id} eq $form->{buchungsgruppen_id} || ($form->{id} && $form->{orphaned}) || !$form->{id} } @{ $form->{BUCHUNGSGRUPPEN} }; - if (!SL::TransNumber->new(number => $form->{partnumber}, type => $form->{item}, id => $form->{id})->is_unique) { + if (($form->{partnumber} ne '') && !SL::TransNumber->new(number => $form->{partnumber}, type => $form->{item}, id => $form->{id})->is_unique) { flash('info', $::locale->text('This partnumber is not unique. You should change it.')); } diff --git a/config/kivitendo.conf.default b/config/kivitendo.conf.default index 96a7d4290..7d83d6c33 100644 --- a/config/kivitendo.conf.default +++ b/config/kivitendo.conf.default @@ -61,8 +61,8 @@ bind_dn = bind_password = [system] -# Set language for login and admin forms. Currently "de" (German), -# "de_DE" (new German) and "en" (English, not perfect) are available. +# Set language for login and admin forms. Currently "de" (German) +# and "en" (English, not perfect) are available. language = de # The database charset. Must match the encoding of the database cluster you want to diff --git a/css/kivitendo/menu.css b/css/kivitendo/menu.css index 3523c7491..b5819a6cc 100644 --- a/css/kivitendo/menu.css +++ b/css/kivitendo/menu.css @@ -29,12 +29,6 @@ body.menuv4 { margin: 0; padding: 0.3em 1em; } -#menuv4 h2:before { - content: " "; -} -#menuv4 h2:after { - content: " "; -} #menuv4 h2 { background-color: #ffffff; color: #000000; @@ -318,3 +312,10 @@ div#menuv3 li:hover ul, div#menuv3 li li:hover ul, div#menuv3 li li li:hover ul, #html-menu div.s2 { padding-left: 16px } body { margin: 0 } + +@media print { + #menuv3, #menuv4, #html-menu, #frame-header, #js-menu { /* items with this class won't print */ + display: none; + } + #content.html-menu { margin-left: 0; } +} diff --git a/css/lx-office-erp/menu.css b/css/lx-office-erp/menu.css index 19f98b20c..469d9de1f 100644 --- a/css/lx-office-erp/menu.css +++ b/css/lx-office-erp/menu.css @@ -115,13 +115,11 @@ position:absolute; z-index:500; top:auto; display:none; -background:#000; } #menuv3 ul ul ul { top:0; left:100%; -background:#000; } /* Begin non-anchor hover selectors */ @@ -176,12 +174,6 @@ margin:0; padding:1px 0 1px 3px; } -#menuv4 h2:before { - content:" "; -} -#menuv4 h2:after { - content:" "; -} #menuv4 h2 { color:#fff; padding:2px 10px; @@ -223,11 +215,6 @@ float:none; border:0; } -#menuv4 li.sub { -left:-25px; -top:-3px; -} - /* IE6 spacing bug fix,
  • s without a bottom border get spaced to far * correction: the bug will change the height of the parent element! this will also cause the whole menu to grow * so the only method to get this pile of crap going is to add a bottom border to the
  • s, where the enclosing