Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 890e057f

Von Bernd Blessmann vor mehr als 13 Jahren hinzugefügt

  • ID 890e057f52343ca24bbc74becb2bd715ac2ba3da
  • Vorgänger 5d8dbe98
  • Nachfolger b02735f5

Änderbarkeit bei Zahlungen f. Kreditorenbuchungen konfigurierbar machen.

Nie, immer oder am selben Tag, einstellbar in der lx_office.conf

Unterschiede anzeigen:

SL/AP.pm
249 249

  
250 250
  # add paid transactions
251 251
  for my $i (1 .. $form->{paidaccounts}) {
252

  
253
    if ($form->{"acc_trans_id_$i"} && $payments_only &&  ($::lx_office_conf{features}->{payments_changeable} == 0)) {
254
      next;
255
    }
256

  
252 257
    if ($form->{"paid_$i"} != 0) {
253 258
      my $project_id = conv_i($form->{"paid_project_id_$i"});
254 259

  
......
566 571
  $old_form = save_form();
567 572

  
568 573
  # Delete all entries in acc_trans from prior payments.
569
  $self->_delete_payments($form, $dbh);
574
  if ($::lx_office_conf{features}->{payments_changeable} != 0) {
575
    $self->_delete_payments($form, $dbh);
576
  }
570 577

  
571 578
  # Save the new payments the user made before cleaning up $form.
572
  my $payments_re = '^datepaid_\d+$|^gldate_\d+$|^memo_\d+$|^source_\d+$|^exchangerate_\d+$|^paid_\d+$|^paid_project_id_\d+$|^AP_paid_\d+$|^paidaccounts$';
579
  my $payments_re = '^datepaid_\d+$|^gldate_\d+$|^acc_trans_id_\d+$|^memo_\d+$|^source_\d+$|^exchangerate_\d+$|^paid_\d+$|^paid_project_id_\d+$|^AP_paid_\d+$|^paidaccounts$';
573 580
  map { $payments{$_} = $form->{$_} } grep m/$payments_re/, keys %{ $form };
574 581

  
575 582
  # Clean up $form so that old content won't tamper the results.
......
648 655
      if ($key eq "AP_paid") {
649 656
        $j++;
650 657
        $form->{"AP_paid_$j"}         = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
658
        $form->{"acc_trans_id_$j"}    = $form->{acc_trans}{$key}->[$i - 1]->{acc_trans_id};
651 659
        $form->{"paid_$j"}            = $form->{acc_trans}{$key}->[$i - 1]->{amount};
652 660
        $form->{"datepaid_$j"}        = $form->{acc_trans}{$key}->[$i - 1]->{transdate};
653 661
        $form->{"gldate_$j"}          = $form->{acc_trans}{$key}->[$i - 1]->{gldate};
SL/Form.pm
842 842
  $additional_params->{"conf_parts_image_css"}        = $::lx_office_conf{features}->{parts_image_css};
843 843
  $additional_params->{"conf_parts_listing_images"}   = $::lx_office_conf{features}->{parts_listing_images};
844 844
  $additional_params->{"conf_parts_show_image"}       = $::lx_office_conf{features}->{parts_show_image};
845
  $additional_params->{"conf_payments_changeable"}    = $::lx_office_conf{features}->{payments_changeable};
845 846
  $additional_params->{"INSTANCE_CONF"}               = $::instance_conf;
846 847

  
847 848
  if (%main::debug_options) {
......
2991 2992
    $query =
2992 2993
      qq|SELECT
2993 2994
           c.accno, c.description,
2994
           a.source, a.amount, a.memo, a.transdate, a.gldate, a.cleared, a.project_id, a.taxkey,
2995
           a.acc_trans_id, a.source, a.amount, a.memo, a.transdate, a.gldate, a.cleared, a.project_id, a.taxkey,
2995 2996
           p.projectnumber,
2996 2997
           t.rate, t.id
2997 2998
         FROM acc_trans a
bin/mozilla/ap.pl
693 693
        $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
694 694
    }
695 695

  
696
    print qq|<input type=hidden name="acc_trans_id_$i" value=$form->{"acc_trans_id_$i"}>\n|;
696 697
    print qq|<input type=hidden name="gldate_$i" value=$form->{"gldate_$i"}>\n|;
697
    my $changeable = (($form->{"gldate_$i"} eq '') || $form->current_date(\%myconfig) eq $form->{"gldate_$i"});
698
    $form->{"payment_readonly_$i"} = ($changeable)? 0 : 1;
699
    print qq|<input type=hidden name="payment_readonly_$i" value=$form->{"payment_readonly_$i"}>\n|;
698
    my $changeable = 1;
699
    if ($::lx_office_conf{features}->{payments_changeable} == 0) {
700
      # never
701
      $changeable = ($form->{"acc_trans_id_$i"})? 0 : 1;
702
    }
703
    if ($::lx_office_conf{features}->{payments_changeable} == 2) {
704
      # on the same day
705
      $changeable = (($form->{"gldate_$i"} eq '') || $form->current_date(\%myconfig) eq $form->{"gldate_$i"});
706
    }
700 707

  
701 708
    $exchangerate = qq|&nbsp;|;
702 709
    if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
......
1183 1190

  
1184 1191
  $main::auth->assert('general_ledger');
1185 1192

  
1186
  map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_1 gldate_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno);
1193
  map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno);
1187 1194
  $form->{paidaccounts} = 1;
1188 1195
  $form->{rowcount}--;
1189 1196
  $form->{invdate} = $form->current_date(\%myconfig);
config/lx_office.conf.default
86 86
# Show the picture in the results when you search for parts
87 87
parts_listing_images = 0
88 88

  
89
# Should payments be changeable after posting (0 = never; 1 = every time; 2 = on the same day)
90
payments_changeable = 1
91

  
89 92
[paths]
90 93
# path to temporary files (must be writeable by the web server)
91 94
userspath = users

Auch abrufbar als: Unified diff