]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 7 Nov 2012 16:05:14 +0000 (17:05 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 7 Nov 2012 16:05:14 +0000 (17:05 +0100)
.gitignore
SL/IS.pm
SL/Menu.pm
bin/mozilla/am.pl
bin/mozilla/arap.pl
bin/mozilla/io.pl
locale/de/all
locale/de_DE/all
templates/webpages/admin/create_dataset.html
templates/webpages/am/edit_accounts.html

index 6c00133f2a0c25e7f6ccfed95fc21e3f311005c0..bc497aea137eea38d452e2ca1c473603fbba0766 100644 (file)
@@ -9,3 +9,4 @@ crm
 /doc/online/*/*.html
 pod2html*
 /doc/build/dobudish*
+/spool/*
index db18d5a43816a36572fc8988bd55c013df941d16..616e2bf6ffec4193dd96762ddb0c7ba1bdad614b 100644 (file)
--- 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};
           }
 
index 48ac6229daa2b672aa74ad6fb7cdbb24883c1fed..57d8b4e8aa059b1ac044bac668e5df8dfb17f78f 100644 (file)
@@ -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 {
index 4e4f0532181893fa0164e307a2306a97c17967cb..f9d299ff57d456a5408db7739c1249fdc9b53081 100644 (file)
@@ -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!'));
index 27b0e3bfa2003bd48b4d9ce10fc3f47671a943b7..fe5fa2d27634a6a4293f916c9bcab2912b627e07 100644 (file)
@@ -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();
 
index b518db00edb8b35fad6f71d7f2054a7ca417fab3..37df5546164524bd280da2504e09b1dabd3d701f 100644 (file)
@@ -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";
index 47b805c11d18f8c0183f7ca239bbe3eadbcf6dc0..e567fdbd60008ce4d5c715e714a136f4f493b0bb 100644 (file)
@@ -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.',
index e07e39aca956409dd94e448c8ec376bbcd194da8..182d245c8e79344835cec93927775bd77f3fd504 100644 (file)
@@ -2139,7 +2139,7 @@ $self->{texts} = {
   'Weight unit'                 => 'Gewichtseinheit',
   'What <b>term</b> you are looking for?' => 'Nach welchem <b>Begriff</b> 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',
index 191bbec947863a18866bb053e8e3f8c926bd8ddf..94ddf8292deac43670cec252dc59c310b1880bbc 100644 (file)
@@ -57,7 +57,7 @@
       <select name="inventory_system">
        [% FOREACH row = INVENTORY_SYSTEMS %]<option value=[% HTML.escape(row.name) %] [% IF row.selected %]selected[% END %]>[% HTML.escape(row.name) | $T8 %]</option>[% END %]
       </select>
-     [% '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode"  in' | $T8 %] <a href="doc/Lx-Office-Dokumentation.pdf">Lx-Office-Dokumentation.pdf</a>.
+     [% '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode"  in' | $T8 %] <a href="doc/kivitendo-Dokumentation.pdf">kivitendo-Dokumentation.pdf</a>.
      </td>
 
     </tr>
index dcf0be088524ca2e90fe1776bc1d3dd333b594a7..1c5e7a969820c68eedc2f7fbbf18610aeeb7b7d2 100644 (file)
@@ -19,7 +19,6 @@ $(function() {
 <input type="hidden" name="type"               value="account">
 <input type="hidden" name="orphaned"           value="[% HTML.escape(orphaned) %]">
 <input type="hidden" name="new_chart_valid"    value="[% HTML.escape(new_chart_valid) %]">
-<input type="hidden" name="original_accno"    value="[% HTML.escape(accno) %]">
 <input type="hidden" name="inventory_accno_id" value="[% HTML.escape(inventory_accno_id) %]">
 <input type="hidden" name="income_accno_id"    value="[% HTML.escape(income_accno_id) %]">
 <input type="hidden" name="expense_accno_id"   value="[% HTML.escape(expense_accno_id) %]">