Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 59adfa36

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 59adfa36c82c4e021011c84c70b9384badea33aa
  • Vorgänger b186a8eb
  • Nachfolger 405313d5

Alle Rechnungen: »als bezahlt markieren« auf neue Funktionen in SL::DB::(Purchase)Invoice umgestellt

Unterschiede anzeigen:

bin/mozilla/ap.pl
470 470
}
471 471

  
472 472
sub mark_as_paid {
473
  $main::lxdebug->enter_sub();
474

  
475
  my $form     = $main::form;
476
  my %myconfig = %main::myconfig;
477

  
478
  $main::auth->assert('ap_transactions');
473
  $::auth->assert('ap_transactions');
479 474

  
480
  &mark_as_paid_common(\%myconfig,"ap");
475
  SL::DB::PurchaseInvoice->new(id => $::form->{id})->load->mark_as_paid;
481 476

  
482
  $main::lxdebug->leave_sub();
477
  $::form->redirect($::locale->text("Marked as paid"));
483 478
}
484 479

  
485 480
sub show_draft {
bin/mozilla/ar.pl
443 443
}
444 444

  
445 445
sub mark_as_paid {
446
  $main::lxdebug->enter_sub();
446
  $::auth->assert('ar_transactions');
447 447

  
448
  $main::auth->assert('ar_transactions');
448
  SL::DB::Invoice->new(id => $::form->{id})->load->mark_as_paid;
449 449

  
450
  my $form     = $main::form;
451
  my %myconfig = %main::myconfig;
452

  
453
  &mark_as_paid_common(\%myconfig,"ar");
454

  
455
  $main::lxdebug->leave_sub();
450
  $::form->redirect($::locale->text("Marked as paid"));
456 451
}
457 452

  
458 453
sub show_draft {
bin/mozilla/common.pl
333 333

  
334 334
# -------------------------------------------------------------------------
335 335

  
336
sub mark_as_paid_common {
337
  $main::lxdebug->enter_sub();
338

  
339
  my ($myconfig, $db_name) = @_;
340

  
341
  my $form     = $main::form;
342
  my $locale   = $main::locale;
343

  
344
  if($form->{mark_as_paid}) {
345
    SL::DB->client->with_transaction(sub {
346
      my $dbh ||= SL::DB->client->dbh;
347
      my $query = qq|UPDATE $db_name SET paid = amount, datepaid = current_date WHERE id = ?|;
348
      do_query($form, $dbh, $query, $form->{id});
349
      1;
350
    }) or do { $::form->error(SL::DB->client->error) };
351
    $form->redirect($locale->text("Marked as paid"));
352

  
353
  } else {
354
    my $referer = $ENV{HTTP_REFERER};
355
    my $script;
356
    my $callback;
357
    if ($referer =~ /action/) {
358
      $referer =~ /^(.*)\?action\=[^\&]*(\&.*)$/;
359
      $script = $1;
360
      $callback = $2;
361
    } elsif ($referer =~ /RESTORE_FORM_FROM_SESSION_ID/){
362
      $referer =~ /^(.*)\?RESTORE_FORM_FROM_SESSION_ID\=(.*)$/;
363
      $script = $1;
364
      $callback = "";
365
    } else {
366
      $script = $referer;
367
      $callback = "";
368
    }
369
    $referer = $script . "?action=mark_as_paid&mark_as_paid=1&id=$form->{id}" . $callback;
370
    $form->header();
371
    print qq|<p><b>|.$locale->text('Mark as paid?').qq|</b></p>|;
372
    print qq|<input type="button" value="|.$locale->text('yes').qq|" onclick="document.location.href='|.$referer.qq|'">&nbsp;|;
373
    print qq|<input type="button" value="|.$locale->text('no').qq|" onclick="javascript:history.back();">|;
374
  }
375

  
376
  $main::lxdebug->leave_sub();
377
}
378

  
379 336
sub cov_selection_internal {
380 337
  $main::lxdebug->enter_sub();
381 338

  
bin/mozilla/ir.pl
468 468
}
469 469

  
470 470
sub mark_as_paid {
471
  $main::lxdebug->enter_sub();
472

  
473
  my $form     = $main::form;
474
  my %myconfig = %main::myconfig;
475

  
476
  $main::auth->assert('vendor_invoice_edit');
471
  $::auth->assert('vendor_invoice_edit');
477 472

  
478
  &mark_as_paid_common(\%myconfig,"ap");
473
  SL::DB::PurchaseInvoice->new(id => $::form->{id})->load->mark_as_paid;
479 474

  
480
  $main::lxdebug->leave_sub();
475
  $::form->redirect($::locale->text("Marked as paid"));
481 476
}
482 477

  
483 478
sub show_draft {
bin/mozilla/is.pl
45 45

  
46 46
use SL::DB::Default;
47 47
use SL::DB::Customer;
48
use SL::DB::Invoice;
48 49
use SL::DB::PaymentTerm;
49 50

  
50 51
require "bin/mozilla/io.pl";
......
535 536
}
536 537

  
537 538
sub mark_as_paid {
538
  $main::lxdebug->enter_sub();
539

  
540
  my $form     = $main::form;
541
  my %myconfig = %main::myconfig;
542

  
543
  $main::auth->assert('invoice_edit');
539
  $::auth->assert('invoice_edit');
544 540

  
545
  &mark_as_paid_common(\%myconfig,"ar");
541
  SL::DB::Invoice->new(id => $::form->{id})->load->mark_as_paid;
546 542

  
547
  $main::lxdebug->leave_sub();
543
  $::form->redirect($::locale->text("Marked as paid"));
548 544
}
549 545

  
550 546
sub show_draft {
locale/de/all
1711 1711
  'Margetotal'                  => 'Ertrag',
1712 1712
  'Margins'                     => 'Seitenr&auml;nder',
1713 1713
  'Mark as closed'              => 'Abschließen',
1714
  'Mark as paid?'               => 'Als bezahlt markieren?',
1715 1714
  'Mark as shop article if column missing' => 'Als Shopartikel setzen, falls Spalte nicht vorhanden',
1716 1715
  'Mark closed'                 => 'Als geschlossen markieren',
1717 1716
  'Marked as paid'              => 'Als bezahlt markiert',
......
3230 3229
  'This will be treated as a discount in percent points.' => 'Diese Option schlägt den Wert in Prozentpunkten als Rabatt vor.',
3231 3230
  'This will happen before the price is offered, and the reduction will not be printed in documents.' => 'Das passiert, bevor der Preis vorgeschlagen wird, und der Abschlag wird nicht in Belegen ausgewiesen.',
3232 3231
  'This will reduce the appropriate Master Data price by this in percent points.' => 'Diese Option reduziert den zugehörigen Stammdatenpreis um den angegebenen Wert in Prozentpunkten.',
3232
  'This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?' => 'Dies wird die Rechnung nicht mehr als offen anzeigen, auch wenn der unbezahlte Betrag nicht dem Rechnungsbetrag entspricht. Fortfahren?',
3233 3233
  'This will set an exact price.' => 'Diese Option setzt einen festen Preis.',
3234 3234
  'Three Options:'              => 'Drei Optionen:',
3235 3235
  'Time'                        => 'Zeit',
templates/webpages/ap/form_footer.html
38 38
[%- IF id %]
39 39
  <input type=button class=submit onclick="set_history_window([% id %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
40 40
  [% IF INSTANCE_CONF.get_ap_show_mark_as_paid %]
41
    <input type="submit" name="action" value="[% 'mark as paid' | $T8 %]">
41
    [% L.submit_tag("action", LxERP.t8('mark as paid'), confirm=LxERP.t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?')) %]
42 42
  [% END %]
43 43
[%- END %]
44 44

  
templates/webpages/ar/form_footer.html
40 40
  [% END %]
41 41

  
42 42
  [% IF ( show_mark_as_paid_button ) %]
43
    <input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]">
43
    [% L.submit_tag("action", LxERP.t8('mark as paid'), confirm=LxERP.t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?')) %]
44 44
  [% END %]
45 45

  
46 46
</form>
templates/webpages/ir/form_footer.html
146 146
      <input type="button" class="submit" onclick="set_history_window([% id | html %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
147 147

  
148 148
      [% IF INSTANCE_CONF.get_ir_show_mark_as_paid %]
149
          <input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]">
149
        [% L.submit_tag("action", LxERP.t8('mark as paid'), confirm=LxERP.t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?')) %]
150 150
      [% END %]
151 151
  [% END %]
152 152

  
templates/webpages/is/form_footer.html
190 190
      [%#- button for saving history %]
191 191
      <input type="button" class="submit" onclick="set_history_window([% id | html %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
192 192
      [% IF INSTANCE_CONF.get_is_show_mark_as_paid %]
193
          <input type="submit" class="submit" name="action_mark_as_paid" value="[% 'mark as paid' | $T8 %]">
193
        [% L.submit_tag("action_mark_as_paid", LxERP.t8('mark as paid'), confirm=LxERP.t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?')) %]
194 194
      [% END %]
195 195
  [% END %]
196 196

  

Auch abrufbar als: Unified diff