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.')
bin/mozilla/ar.pl
1441 1441
}
1442 1442

  
1443 1443
sub setup_ar_form_header_action_bar {
1444
  my $transdate               = $::form->datetonum($::form->{transdate}, \%::myconfig);
1445
  my $closedto                = $::form->datetonum($::form->{closedto},  \%::myconfig);
1446
  my $is_closed               = $transdate <= $closedto;
1444
  my $closedto  = $::locale->parse_date_to_object($::instance_conf->get_closedto);
1445
  my $transdate = $::locale->parse_date_to_object($::form->{transdate});
1446
  my $is_closed = ( ref $closedto && $transdate <= $closedto ? 1 : 0  );
1447 1447

  
1448 1448
  my $change_never            = $::instance_conf->get_ar_changeable == 0;
1449 1449
  my $change_on_same_day_only = $::instance_conf->get_ar_changeable == 2 && ($::form->current_date(\%::myconfig) ne $::form->{gldate});
......
1491 1491

  
1492 1492
      combobox => [
1493 1493
        action => [ t8('Storno'),
1494
          call     => [ 'kivi.SalesPurchase.stornoDialog', $transdate, $closedto, t8('AR Transaction #1 storno', $::form->{invnumber}) ],
1494
          call     => [ 'kivi.SalesPurchase.stornoDialog', $transdate->to_kivitendo, $closedto ? $closedto->to_kivitendo : '', t8('AR Transaction #1 storno', $::form->{invnumber}) ],
1495 1495
          checks   => [ 'kivi.validate_form', 'kivi.AR.check_fields_before_posting' ],
1496
          confirm  => t8('Do you really want to cancel this invoice?'),
1497 1496
          disabled => !$::form->{id}         ? t8('This invoice has not been posted yet.')
1498 1497
                      : $has_storno          ? t8('This invoice has been canceled already.')
1499 1498
                      : $is_storno           ? t8('Reversal invoices cannot be canceled.')
bin/mozilla/ir.pl
300 300
}
301 301

  
302 302
sub setup_ir_action_bar {
303
  my $closedto  = $::locale->parse_date_to_object($::instance_conf->get_closedto);
304
  my $transdate = $::locale->parse_date_to_object($::form->{transdate});
305
  my $is_closed = ( ref $closedto && $transdate <= $closedto ? 1 : 0  );
306

  
303 307
  my $form                    = $::form;
304 308
  my $change_never            = $::instance_conf->get_ir_changeable == 0;
305 309
  my $change_on_same_day_only = $::instance_conf->get_ir_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate});
......
348 352

  
349 353
      combobox => [
350 354
        action => [ t8('Storno'),
351
          call     => [ 'kivi.SalesPurchase.stornoDialog', $form->{gldate}, $form->current_date(\%::myconfig), t8('Invoice #1 storno', $::form->{invnumber}) ],
355
          call     => [ 'kivi.SalesPurchase.stornoDialog', $transdate->to_kivitendo, $closedto ? $closedto->to_kivitendo : '' , t8('Invoice #1 storno', $::form->{invnumber}) ],
352 356
          checks   => [ 'kivi.validate_form' ],
353
          confirm  => t8('Do you really want to cancel this invoice?'),
354 357
          disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
355 358
        ],
356 359
        action => [ t8('Delete'),
bin/mozilla/is.pl
281 281
}
282 282

  
283 283
sub setup_is_action_bar {
284
  my $closedto  = $::locale->parse_date_to_object($::instance_conf->get_closedto);
285
  my $transdate = $::locale->parse_date_to_object($::form->{transdate});
286
  my $is_closed = ( ref $closedto && $transdate <= $closedto ? 1 : 0  );
287

  
284 288
  my $form                    = $::form;
285 289
  my $change_never            = $::instance_conf->get_is_changeable == 0;
286 290
  my $change_on_same_day_only = $::instance_conf->get_is_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate});
......
330 334

  
331 335
      combobox => [
332 336
        action => [ t8('Storno'),
333
          call     => [ 'kivi.SalesPurchase.stornoDialog', $form->{gldate}, $form->current_date(\%::myconfig), t8('Invoice #1 storno', $::form->{invnumber}) ],
334
          confirm  => t8('Do you really want to cancel this invoice?'),
337
          call     => [ 'kivi.SalesPurchase.stornoDialog', $transdate->to_kivitendo, $closedto ? $closedto->to_kivitendo : '', t8('Invoice #1 storno', $::form->{invnumber}) ],
335 338
          checks   => [ 'kivi.validate_form' ],
336 339
          disabled => !$form->{id}        ? t8('This invoice has not been posted yet.')
337 340
                    : !$payments_balanced ? t8('Cancelling is disallowed. Either undo or balance the current payments until the open amount matches the invoice amount')
js/kivi.SalesPurchase.js
266 266
    else if ( $("#otherdate_cb").prop("checked") ) {
267 267
      stornodate = $("#storno_odate").val();
268 268
    }
269
    var closeto = $("#closedto").val();
270
    if (closeto !== '') {
269
    var closeto = $("#closeto_date").val();
270
    if (closeto && closeto !== '') {
271 271
      var closetoval = kivi.parse_date(closeto).valueOf();
272 272
      if ( kivi.parse_date(stornodate).valueOf() <= closetoval) {
273 273
        $("#storno_error").text(kivi.t8('Cannot storno this for a closed period until #1 !',[closeto]));
locale/de/all
1872 1872
  'Invnumber'                   => 'Rechnungsnummer',
1873 1873
  'Invnumber missing!'          => 'Rechnungsnummer fehlt!',
1874 1874
  'Invoice'                     => 'Rechnung',
1875
  'Invoice #1 storno'           => 'Rechung "#1" stornieren',
1875
  'Invoice #1 storno'           => 'Rechnung "#1" stornieren',
1876 1876
  'Invoice #1 was overpaid by #2.' => 'Rechnung #1 wurde um #2 überzahlt.',
1877 1877
  'Invoice (one letter abbreviation)' => 'R',
1878 1878
  'Invoice Amount'              => 'Rechnungsbetrag',
templates/webpages/generic/gl_storno_dialog.html
11 11
      <td>[%- LxERP.t8('Original Date of GL') %]</td></tr>
12 12
  <tr><td>[%- L.radio_button_tag('stornodate', id='actualdate_cb', class='radio') %]</td>
13 13
      <td><span id="storno_actdate">[%- today.to_kivitendo %]</span></td>
14
      <td>[%- LxERP.t8('Actual Date') %]</td></tr>
14
      <td>[%- LxERP.t8('Actual Date') %][% P.hidden_tag('closeto_date', '' ) %]</td></tr>
15 15
  <tr><td>[%- L.radio_button_tag('stornodate', id='otherdate_cb',  class='radio') %]</td>
16
      <td>[%- L.date_tag('storno_odate',today.to_kivitendo) %]</td>
16
      <td>[%- L.date_tag('storno_odate',today) %]</td>
17 17
      <td>[%- LxERP.t8('Other Date') %]</td></tr>
18 18
  <tr><td>[%- L.button_tag("return kivi.SalesPurchase.stornoAction();", LxERP.t8('Storno'), class => "submit") %]</td>
19 19
      <td>[%- L.button_tag("return kivi.SalesPurchase.stornoClose();", LxERP.t8('Cancel'), class => "submit") %]</td></tr>

Also available in: Unified diff