]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'master' of ssh://git-jbueren@lx-office.linet-services.de/~/lx-office-erp
authorJan Büren <jan@lx-office-hosting.de>
Fri, 10 Dec 2010 10:57:21 +0000 (11:57 +0100)
committerJan Büren <jan@lx-office-hosting.de>
Fri, 10 Dec 2010 10:57:21 +0000 (11:57 +0100)
bin/mozilla/cp.pl

index d54137e72cc84125ae5ff798fb7024b7c87347f5..b3efdec57d25e0cac2dcd1763300ddb455a32f17 100644 (file)
@@ -34,6 +34,8 @@
 use SL::CP;
 use SL::IS;
 use SL::IR;
+use SL::AR;
+use SL::AP;
 use strict ("vars", "subs");
 #use warnings;
 
@@ -239,6 +241,10 @@ sub form_header {
                 <input type=hidden name="$form->{vc}_id" value="|    . H($form->{"$form->{vc}_id"}) . qq|">
                 <input type=hidden name="old$form->{vc}" value="|    . H($form->{"old$form->{vc}"}) . qq|">
               </tr>
+              <tr>
+                <th align=right>| . $locale->text('Invoice Number') . qq|</th>
+                <td><input name="invnumber" size="35"</td>
+              </tr>
               <tr valign=top>
                 <th align=right nowrap>| . $locale->text('Address') . qq|</th>
                 <td colspan=2>
@@ -518,7 +524,19 @@ sub update {
       }
     }
   }
-
+  # Falls Suche über Rechnungsnummer und kein Kundenname vorhanden
+  if ($form->{invnumber} && !($form->{$form->{vc}})){
+  $form->{open} ='Y'; # nur die offenen rechnungen
+  if ($form->{ARAP} eq 'AR'){
+    AR->ar_transactions(\%myconfig, \%$form);
+    # den ersten treffen nehmen und mit dem namen überschreiben
+    $form->{$form->{vc}} = $form->{AR}[0]{name};
+  } else {
+    # s.o. nur für zahlungsausgang
+    AP->ap_transactions(\%myconfig, \%$form);
+    $form->{$form->{vc}} = $form->{AP}[0]{name};
+    }
+  }
   # get customer and invoices
   $updated = &check_name($form->{vc});
 
@@ -626,7 +644,9 @@ sub post {
   }
 
   # Beim Aktualisieren wird das Konto übernommen
-  $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&type=$form->{type}&account=$form->{account}&$form->{currency}";
+  # und jetzt auch Beleg und Datum
+  $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&type=$form->{type}&account=$form->{account}&$form->{currency}" . 
+                      "&datepaid=$form->{datepaid}&source=$form->{source}";
 
   my $msg1 = "$form->{origtitle} posted!";
   my $msg2 = "Cannot post $form->{origtitle}!";