Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bde667c2

Von Moritz Bunkus vor fast 18 Jahren hinzugefügt

  • ID bde667c235b2347bdd1322f118b032a2f0d93367
  • Vorgänger 7e57b1fe
  • Nachfolger ad091a4e

Einkaufs-, Verkaufs-, Debitoren- und Kreditorenrechnungen können als Entwurf gespeichert und später weiter bearbeitet werden. Dabei werden sie nicht gebucht.

Unterschiede anzeigen:

bin/mozilla/ap.pl
37 37

  
38 38
require "$form->{path}/arap.pl";
39 39
require "bin/mozilla/common.pl";
40
require "bin/mozilla/drafts.pl";
40 41

  
41 42
1;
42 43

  
......
73 74
sub add {
74 75
  $lxdebug->enter_sub();
75 76

  
77
  return $lxdebug->leave_sub() if (load_draft_maybe());
78

  
76 79
  $form->{title} = "Add";
77 80

  
78 81
  $form->{callback} =
......
459 462
<input type=hidden name=locked value=$form->{locked}>
460 463
<input type=hidden name=title value="$title">
461 464

  
465
| . ($form->{saved_message} ? qq|<p>$form->{saved_message}</p>| : "") . qq|
466

  
462 467
<table width=100%>
463 468
  <tr class=listtop>
464 469
    <th class=listtop>$form->{title}</th>
......
757 762
<input type=hidden name=path value=$form->{path}>
758 763
<input type=hidden name=login value=$form->{login}>
759 764
<input type=hidden name=password value=$form->{password}>
765
|
766
. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
767
. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}])
768
. qq|
760 769

  
761 770
<br>
762 771
|;
......
789 798
  } elsif (($transdate > $closedto) && !$form->{id}) {
790 799
    print qq|
791 800
      <input class=submit type=submit name=action value="|
792
      . $locale->text('Post') . qq|">|;
801
      . $locale->text('Post') . qq|"> | .
802
      NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'),
803
                       '-class' => 'submit'));
793 804
  }
794 805
  # button for saving history
795 806
  if($form->{id} ne "") {
......
1000 1011
  $form->{taxkey}       = $taxkey;
1001 1012

  
1002 1013
  $form->{id} = 0 if $form->{postasnew};
1003
  # saving the history
1004
  if(!exists $form->{addition} && $form->{id} ne "") {
1005
  	$form->{addition} = "POSTED";
1006
  	$form->save_history($form->dbconnect(\%myconfig));
1007
  }
1008
  # /saving the history 
1009 1014

  
1010
  $form->redirect($locale->text('Transaction posted!'))
1011
    if (AP->post_transaction(\%myconfig, \%$form));
1015
  if (AP->post_transaction(\%myconfig, \%$form)) {
1016
    # saving the history
1017
    if(!exists $form->{addition} && $form->{id} ne "") {
1018
      $form->{addition} = "POSTED";
1019
      $form->save_history($form->dbconnect(\%myconfig));
1020
    }
1021
    # /saving the history 
1022
    remove_draft();
1023
    $form->redirect($locale->text('Transaction posted!'));
1024
  }
1012 1025
  $form->error($locale->text('Cannot post transaction!'));
1013 1026

  
1014 1027
  $lxdebug->leave_sub();

Auch abrufbar als: Unified diff