From: Sven Schöling Date: Wed, 7 Nov 2012 16:05:14 +0000 (+0100) Subject: Merge branch 'master' of vc.linet-services.de:public/lx-office-erp X-Git-Tag: release-3.0.0beta1~36^2 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/a8878ddc44656ff31cd839f43956d2986ac2c99e?hp=f01bf6359050e913b1907f1d9c5d197e7c8c2835 Merge branch 'master' of vc.linet-services.de:public/lx-office-erp --- diff --git a/.gitignore b/.gitignore index 6c00133f2..bc497aea1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ crm /doc/online/*/*.html pod2html* /doc/build/dobudish* +/spool/* diff --git a/SL/IS.pm b/SL/IS.pm index db18d5a43..616e2bf6f 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -2028,7 +2028,7 @@ sub get_pricegroups_for_parts { my $pricegroup_old = $form->{"pricegroup_old_$i"}; - # sellprice has format 13,0000 or 0,00000, can't check for 0 numerically + # sellprice has format 13,0000 or 0,00000, can't check for 0 numerically my $sellprice = $form->{"sellprice_$i"}; my $pricegroup_id = $form->{"pricegroup_id_$i"}; $form->{"new_pricegroup_$i"} = $selectedpricegroup_id; @@ -2130,14 +2130,12 @@ sub get_pricegroups_for_parts { $pkr->{selected} = ' selected'; # unless $form->{selected}; # no customer pricesgroup set - if ($pkr->{price_unfmt} == $pkr->{default_sellprice}) { + if ($pkr->{price_unfmt} == $pkr->{default_sellprice} || $form->{'sellprice_'.$i} * 1 > 1) { $pkr->{price} = $form->{"sellprice_$i"}; } else { -# this sub should not set anything and only return. --sschoeling, 20090506 -# is this correct? put in again... -- grichardson 20110119 $form->{"sellprice_$i"} = $pkr->{price}; } diff --git a/SL/Menu.pm b/SL/Menu.pm index 48ac6229d..57d8b4e8a 100644 --- a/SL/Menu.pm +++ b/SL/Menu.pm @@ -59,7 +59,7 @@ sub new { } sub menuitem_new { - $main::lxdebug->enter_sub(); + $main::lxdebug->enter_sub(LXDebug::DEBUG2()); my ($self, $name, $item) = @_; @@ -84,7 +84,7 @@ sub menuitem_new { $item->{href} .= "&" . $form->escape($key) . "=" . $form->escape($value); } - $main::lxdebug->leave_sub(); + $main::lxdebug->leave_sub(LXDebug::DEBUG2()); } sub access_control { diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 4e4f05321..f9d299ff5 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -426,10 +426,6 @@ sub save_as_new_account { } $form->{id} = 0; - if ($form->{"original_accno"} && - ($form->{"accno"} eq $form->{"original_accno"})) { - $form->error($locale->text('Account Number already used!')); - } $form->redirect($locale->text('Account saved!')) if (AM->save_account(\%myconfig, \%$form)); $form->error($locale->text('Cannot save account!')); diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl index 27b0e3bfa..fe5fa2d27 100644 --- a/bin/mozilla/arap.pl +++ b/bin/mozilla/arap.pl @@ -78,6 +78,7 @@ sub check_name { $form->{"${name}_id"} = $new_id; + _reset_salesman_id(); IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer'); IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor'); @@ -119,6 +120,7 @@ sub check_name { $form->{$name} = $form->{name_list}[0]->{name}; $form->{"old$name"} = qq|$form->{$name}--$form->{"${name}_id"}|; + _reset_salesman_id(); IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer'); IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor'); @@ -266,6 +268,8 @@ sub name_selected { # index for new item my $i = $form->{ndx}; + _reset_salesman_id(); + $form->{ $form->{vc} } = $form->{"new_name_$i"}; $form->{"$form->{vc}_id"} = $form->{"new_id_$i"}; $form->{"old$form->{vc}"} = @@ -286,6 +290,14 @@ sub name_selected { $main::lxdebug->leave_sub(); } +# Reset the $::form field 'salesman_id' to the ID of the currently +# logged in user. Useful when changing to a customer/vendor that has +# no salesman listed in their master data. +sub _reset_salesman_id { + my $current_employee = SL::DB::Manager::Employee->current; + $::form->{salesman_id} = $current_employee->id if $current_employee && exists $::form->{salesman_id}; +} + sub check_project { $main::lxdebug->enter_sub(); diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index b518db00e..37df55461 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -49,6 +49,7 @@ use SL::IO; use SL::DB::Language; use SL::DB::Printer; +use SL::Helper::Flash; require "bin/mozilla/common.pl"; @@ -802,6 +803,7 @@ sub validate_items { # check if items are valid if ($form->{rowcount} == 1) { + flash('warning', $::locale->text('The action you\'ve chosen has not been executed because the document does not contain any item yet.')); &update; ::end_of_request(); } @@ -1536,23 +1538,27 @@ sub print_form { my $emailed = $form->{emailed}; if ($form->{media} eq 'queue') { - my %queued = map { s|.*/|| } split / /, $form->{queued}; + my %queued = map { s|.*[/\\]||; $_ } split / /, $form->{queued}; my $filename; my $suffix = ($form->{postscript}) ? '.ps' : '.pdf'; if ($filename = $queued{ $form->{formname} }) { - $form->{queued} =~ s/\Q$form->{formname} $filename\E//; unlink $::lx_office_conf{paths}->{spool} . "/$filename"; - $filename =~ s/\..*$//g; - $filename .= $suffix; - $form->{OUT} = $::lx_office_conf{paths}->{spool} . "/$filename"; - $form->{OUT_MODE} = '>'; + delete $queued{ $form->{formname} }; + + $form->{queued} = join ' ', %queued; + $filename =~ s/\..*$//g; + $filename .= $suffix; + $form->{OUT} = $::lx_office_conf{paths}->{spool} . "/$filename"; + $form->{OUT_MODE} = '>'; + } else { my $temp_fh; ($temp_fh, $filename) = File::Temp::tempfile( 'kivitendo-spoolXXXXXX', SUFFIX => "$suffix", - DIR => $::lx_office_conf{paths}->{spool}, + DIR => $::lx_office_conf{paths}->{spool}, + UNLINK => 0, ); close $temp_fh; $form->{OUT} = "$filename"; diff --git a/locale/de/all b/locale/de/all index 47b805c11..e567fdbd6 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1874,6 +1874,7 @@ $self->{texts} = { 'The access rights have been saved.' => 'Die Zugriffsrechte wurden gespeichert.', 'The account 3804 already exists, the update will be skipped.' => 'Das Konto 3804 existiert schon, das Update wird übersprungen.', 'The account 3804 will not be added automatically.' => 'Das Konto 3804 wird nicht automatisch hinzugefügt.', + 'The action you\'ve chosen has not been executed because the document does not contain any item yet.' => 'Die von Ihnen ausgewählte Aktion wurde nicht ausgeführt, weil der Beleg noch keine Positionen enthält.', 'The application "#1" was not found on the system.' => 'Die Anwendung "#1" wurde auf dem System nicht gefunden.', 'The assembly has been created.' => 'Das Erzeugnis wurde hergestellt.', 'The assistant could not find anything wrong with #1. Maybe the problem has been solved in the meantime.' => 'Der Korrekturassistent konnte kein Problem bei #1 feststellen. Eventuell wurde das Problem in der Zwischenzeit bereits behoben.', diff --git a/locale/de_DE/all b/locale/de_DE/all index e07e39aca..182d245c8 100644 --- a/locale/de_DE/all +++ b/locale/de_DE/all @@ -2139,7 +2139,7 @@ $self->{texts} = { 'Weight unit' => 'Gewichtseinheit', 'What term you are looking for?' => 'Nach welchem Begriff wollen Sie suchen?', 'What type of item is this?' => 'Was ist dieser Artikel?', - 'Which is located at doc/Lx-Office-Dokumentation.pdf. Click here: ' => 'Zu finden in doc/Lx-Office-Dokumentation.pdf. Oder hier klicken: ', + 'Which is located at doc/kivitendo-Dokumentation.pdf. Click here: ' => 'Zu finden in doc/kivitendo-Dokumentation.pdf. Oder hier klicken: ', 'With Extension Of Time' => 'mit Dauerfristverlängerung', 'Workflow Delivery Order' => 'Workflow Lieferschein', 'Workflow purchase_order' => 'Workflow Lieferantenauftrag', diff --git a/templates/webpages/admin/create_dataset.html b/templates/webpages/admin/create_dataset.html index 191bbec94..94ddf8292 100644 --- a/templates/webpages/admin/create_dataset.html +++ b/templates/webpages/admin/create_dataset.html @@ -57,7 +57,7 @@ - [% '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode" in' | $T8 %] Lx-Office-Dokumentation.pdf. + [% '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode" in' | $T8 %] kivitendo-Dokumentation.pdf. diff --git a/templates/webpages/am/edit_accounts.html b/templates/webpages/am/edit_accounts.html index dcf0be088..1c5e7a969 100644 --- a/templates/webpages/am/edit_accounts.html +++ b/templates/webpages/am/edit_accounts.html @@ -19,7 +19,6 @@ $(function() { -