Project

General

Profile

Revision cb3e6027

Added by Martin Helmling martin.helmling@octosoft.eu over 1 year ago

Kreditorenbuchung: kein Storno möglich

Actionbar - Aufruf angepasst

fix #7269

View differences:

bin/mozilla/ap.pl
659 659
  $::form->header;
660 660
  print $::form->parse_html_template('ap/form_footer', {
661 661
#TODO?    num_due           => $num_due,
662
    today             => DateTime->today,
662 663
    num_follow_ups    => $num_follow_ups,
663 664
    num_due_follow_ups => $num_due_follow_ups,
664 665
    num_open_follow_ups => $num_open_follow_ups,
......
1514 1515
}
1515 1516

  
1516 1517
sub setup_ap_display_form_action_bar {
1517
  my $transdate               = $::form->datetonum($::form->{transdate}, \%::myconfig);
1518
  my $closedto                = $::form->datetonum($::form->{closedto},  \%::myconfig);
1519
  my $is_closed               = $transdate <= $closedto;
1518
  my $closedto  = $::locale->parse_date_to_object($::instance_conf->get_closedto);
1519
  my $transdate = $::locale->parse_date_to_object($::form->{transdate});
1520
  my $is_closed = ( ref $closedto && $transdate <= $closedto ? 1 : 0  );
1520 1521

  
1521 1522
  my $change_never            = $::instance_conf->get_ap_changeable == 0;
1522 1523
  my $change_on_same_day_only = $::instance_conf->get_ap_changeable == 2 && ($::form->current_date(\%::myconfig) ne $::form->{gldate});
......
1565 1566

  
1566 1567
      combobox => [
1567 1568
        action => [ t8('Storno'),
1568
          call     => [ 'kivi.SalesPurchase.stornoDialog', $transdate, $closedto, t8('AP Transaction #1 storno', $::form->{invnumber}) ],
1569
          call     => [ 'kivi.SalesPurchase.stornoDialog', $transdate->to_kivitendo, $closedto ? $closedto->to_kivitendo : '' , t8('AP Transaction #1 storno', $::form->{invnumber}) ],
1569 1570
          checks   => [ 'kivi.validate_form', 'kivi.AP.check_fields_before_posting' ],
1570
          confirm  => t8('Do you really want to cancel this invoice?'),
1571 1571
          disabled => !$::form->{id}         ? t8('This invoice has not been posted yet.')
1572 1572
                      : $has_storno          ? t8('This invoice has been canceled already.')
1573 1573
                      : $is_storno           ? t8('Reversal invoices cannot be canceled.')

Also available in: Unified diff