Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6d544157

Von Sven Schöling vor mehr als 17 Jahren hinzugefügt

  • ID 6d544157899560b2b38d3407ce9874ef5694165b
  • Vorgänger 44718f3e
  • Nachfolger f0949805

Storno fuer Kreditorenbuchungen

Unterschiede anzeigen:

bin/mozilla/ap.pl
33 33

  
34 34
use SL::AP;
35 35
use SL::IR;
36
use SL::IS;
36 37
use SL::PE;
37 38

  
38 39
require "bin/mozilla/arap.pl";
......
850 851
  $transdate = $form->datetonum($form->{transdate}, \%myconfig);
851 852
  $closedto  = $form->datetonum($form->{closedto},  \%myconfig);
852 853

  
853
  print qq|<input class="submit" type="submit" name="action" id="update_button" value="|
854
    . $locale->text('Update') . qq|">|;
854
  # ToDO: - insert a global check for stornos, so that a storno is only possible a limited time after saving it
855
  print qq|<input class=submit type=submit name=action value="| . $locale->text('Storno') . qq|">|
856
    if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap') && !$form->{paid_1});
855 857

  
856
  if ($form->{id}) {
858
  print qq|<input class="submit" type="submit" name="action" id="update_button" value="| . $locale->text('Update') . qq|">|;
857 859

  
858
    #     print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
859
    # |;
860
  if ($form->{id}) {
860 861
    if ($form->{radier}) {
861
      print qq|
862
	<input class=submit type=submit name=action value="|
863
          . $locale->text('Post') . qq|">
864
	<input class=submit type=submit name=action value="|
865
          . $locale->text('Delete') . qq|">
862
      print qq| <input class=submit type=submit name=action value="| . $locale->text('Post') . qq|">
863
                <input class=submit type=submit name=action value="| . $locale->text('Delete') . qq|">
866 864
|;
867 865
    }
868 866

  
869
    print qq|
870
<input class=submit type=submit name=action value="|
871
        . $locale->text('Use As Template') . qq|">
872
<input class=submit type=submit name=action value="|
873
        . $locale->text('Post Payment') . qq|">
867
    print qq| <input class=submit type=submit name=action value="| . $locale->text('Use As Template') . qq|">
868
              <input class=submit type=submit name=action value="| . $locale->text('Post Payment') . qq|">
874 869
|;
875 870
  } elsif (($transdate > $closedto) && !$form->{id}) {
876 871
    print qq|
877
      <input class=submit type=submit name=action value="|
878
      . $locale->text('Post') . qq|"> | .
879
      NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'),
880
                       '-class' => 'submit'));
872
      <input class=submit type=submit name=action value="| . $locale->text('Post') . qq|"> | .
873
      NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit'));
881 874
  }
882 875
  # button for saving history
883 876
  if($form->{id} ne "") {
884
    print qq|
885
  	  <input type="button" class="submit" onclick="set_history_window(|
886
  	  . $form->{id} 
887
  	  . qq|);" name="history" id="history" value="|
888
  	  . $locale->text('history') 
889
  	  . qq|">|;
877
    print qq| <input type="button" class="submit" onclick="set_history_window($form->{id});" name="history" id="history" value="| . $locale->text('history') . qq|">|;
890 878
  }
891 879
  # /button for saving history
892 880
  print "
......
1745 1733

  
1746 1734
  $lxdebug->leave_sub();
1747 1735
}
1736

  
1737
sub storno {
1738
  $lxdebug->enter_sub();
1739

  
1740
  if (IS->has_storno(\%myconfig, $form, 'ap')) {
1741
    $form->{title} = $locale->text("Cancel Accounts Payables Transaction");
1742
    $form->error($locale->text("Transaction has already been cancelled!"));
1743
  }
1744

  
1745
  # negate amount/taxes
1746
  for my $i (1 .. $form->{rowcount}) {
1747
    $form->{"amount_$i"} *= -1;
1748
    $form->{"tax_$i"}    *= -1; 
1749
  }
1750

  
1751
  # format things
1752
  for my $i (1 .. $form->{rowcount}) {
1753
    for (qw(amount tax)) {
1754
      $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) if $form->{"${_}_$i"};
1755
    }
1756
  }
1757

  
1758
  $form->{storno}      = 1;
1759
  $form->{storno_id}   = $form->{id};
1760
  $form->{id}          = 0;
1761

  
1762
  $form->{invnumber}   = "Storno-" . $form->{invnumber};
1763

  
1764
  post();
1765

  
1766
  # saving the history
1767
  if(!exists $form->{addition} && $form->{id} ne "") {
1768
    $form->{snumbers} = "ordnumber_$form->{ordnumber}";
1769
    $form->{addition} = "STORNO";
1770
    $form->save_history($form->dbconnect(\%myconfig));
1771
  }
1772
  # /saving the history 
1773

  
1774
  $lxdebug->leave_sub();
1775
}
locale/de/all
210 210
  'C'                           => 'G',
211 211
  'CANCELED'                    => 'Storniert',
212 212
  'Calculate'                   => 'Berechnen',
213
  'Cancel Accounts Payables Transaction' => 'Kreditorenbuchung stornieren',
213 214
  'Cancel Accounts Receivables Transaction' => 'Debitorenbuchung stornieren',
214 215
  'Cancel General Ledger Transaction' => 'Buchung stornieren',
215 216
  'Cannot create Lock!'         => 'System kann nicht gesperrt werden!',
locale/de/ap
18 18
  'Bin List'                    => 'Lagerliste',
19 19
  'Bis'                         => 'bis',
20 20
  'CANCELED'                    => 'Storniert',
21
  'Cancel Accounts Payables Transaction' => 'Kreditorenbuchung stornieren',
21 22
  'Cannot delete transaction!'  => 'Buchung kann nicht gel?scht werden!',
22 23
  'Cannot post payment for a closed period!' => 'Es k?nnen keine Zahlungen f?r abgeschlossene B?cher gebucht werden!',
23 24
  'Cannot post payment!'        => 'Zahlung kann nicht gebucht werden!',
......
141 142
  'September'                   => 'September',
142 143
  'Skip'                        => '?berspringen',
143 144
  'Source'                      => 'Beleg',
145
  'Storno'                      => 'Storno',
144 146
  'Storno Invoice'              => 'Stornorechnung',
145 147
  'Storno Packing List'         => 'Stornolieferschein',
146 148
  'Subtotal'                    => 'Zwischensumme',
......
150 152
  'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.',
151 153
  'Total'                       => 'Summe',
152 154
  'Transaction deleted!'        => 'Buchung gel?scht!',
155
  'Transaction has already been cancelled!' => 'Diese Buchung wurde bereits storniert.',
153 156
  'Transaction posted!'         => 'Buchung verbucht!',
154 157
  'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.',
155 158
  'Type'                        => 'Typ',
......
234 237
  'set_longdescription'         => 'set_longdescription',
235 238
  'show_history'                => 'show_history',
236 239
  'show_vc_details'             => 'show_vc_details',
240
  'storno'                      => 'storno',
237 241
  'update'                      => 'update',
238 242
  'use_as_template'             => 'use_as_template',
239 243
  'vendor_invoice'              => 'vendor_invoice',
......
249 253
  'zahlung_buchen'              => 'post_payment',
250 254
  'entwurf_speichern'           => 'save_draft',
251 255
  '?berspringen'                => 'skip',
256
  'storno'                      => 'storno',
252 257
  'erneuern'                    => 'update',
253 258
  'als_vorlage_verwenden'       => 'use_as_template',
254 259
  'einkaufsrechnung'            => 'vendor_invoice',

Auch abrufbar als: Unified diff