Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 31f98925

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 31f989254ce9f2ab881af7aee5d07dd63df0e004
  • Vorgänger 78efbe93
  • Nachfolger 8cba44f6

ActionBar: Verwendung beim Massenerzeugen von Rechnungen aus Lieferscheinen

Unterschiede anzeigen:

SL/Controller/MassInvoiceCreatePrint.pm
39 39

  
40 40
  # if a filter is choosen, the filter info should be visible
41 41
  $self->make_filter_summary;
42
  $self->sales_delivery_order_models->get;
42
  $self->setup_list_sales_delivery_orders_action_bar(show_creation_buttons => $show, num_rows => scalar(@{ $self->sales_delivery_order_models->get }));
43 43
  $self->render('mass_invoice_create_print_from_do/list_sales_delivery_orders',
44 44
                noshow  => $show,
45 45
                title   => $::locale->text('Open sales delivery orders'));
......
347 347
      ],
348 348
      action => [
349 349
        t8('Reset'),
350
        call => [ 'kivi.Project.reset_search_form' ],
350
        call => [ 'kivi.call_jquery', '#search_form', 'resetForm' ],
351 351
      ],
352 352
      action => [
353 353
        $::locale->text('Print'),
......
358 358
  }
359 359
}
360 360

  
361
sub setup_list_sales_delivery_orders_action_bar {
362
  my ($self, %params) = @_;
363

  
364
  for my $bar ($::request->layout->get('actionbar')) {
365
    $bar->add(
366
      action => [
367
        t8('Search'),
368
        submit    => [ '#search_form', { action => 'MassInvoiceCreatePrint/list_sales_delivery_orders' } ],
369
        accesskey => 'enter',
370
      ],
371
      action => [
372
        t8('Reset'),
373
        call => [ 'kivi.call_jquery', '#search_form', 'resetForm' ],
374
      ],
375

  
376
      combobox => [
377
        action => [
378
          t8('Invoices'),
379
          tooltip => t8("Create and print invoices")
380
        ],
381
        action => [
382
          t8('for selected entries'),
383
          call     => [ 'kivi.MassInvoiceCreatePrint.submitMassCreationForm' ],
384
          tooltip  => t8("Create and print invoices for all selected delivery orders"),
385
          disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef,
386
          only_if  => $params{show_creation_buttons},
387
        ],
388

  
389
        action => [
390
          t8('for all entries'),
391
          call     => [ 'kivi.MassInvoiceCreatePrint.createPrintAllInitialize' ],
392
          tooltip  => t8("Create and print invoices for all delivery orders matching the filter"),
393
          disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef,
394
          only_if  => $params{show_creation_buttons},
395
        ],
396
      ],
397
    );
398
  }
399
}
400

  
361 401
1;
362 402

  
363 403
__END__
......
483 523

  
484 524
=head1 TODO
485 525

  
486
Should be more generalized. Right now just one conversion (delivery order to invoice) is supported.
526
pShould be more generalized. Right now just one conversion (delivery order to invoice) is supported.
487 527
Using BackgroundJobs to mass create / transfer stuff is the way to do it. The original idea
488 528
was taken from one client project (mosu) with some extra (maybe not standard compliant) customized
489 529
stuff (using cvars for extra filters and a very compressed Controller for linking (ODSalesOrder.pm)).
bin/mozilla/do.pl
377 377
      action => [
378 378
        t8('New invoice'),
379 379
        submit    => [ '#orders_form' ],
380
        checks    => [ 'kivi.DeliveryOrder.multi_invoice_check_delivery_orders_selected' ],
380
        checks    => [ [ 'kivi.check_if_entries_selected', '#orders_form tbody input[type=checkbox]' ] ],
381 381
        accesskey => 'enter',
382 382
      ],
383 383
    );
......
843 843
    $idx++;
844 844
  }
845 845

  
846
  $::request->layout->add_javascripts('kivi.DeliveryOrder.js');
847

  
848 846
  setup_do_orders_action_bar();
849 847

  
850 848
  $report->generate_with_headers(action_bar => 1);
js/kivi.DeliveryOrder.js
1
namespace('kivi.DeliveryOrder', function(ns) {
2
  ns.multi_invoice_check_delivery_orders_selected = function() {
3
    if ($('#orders_form tbody input[type=checkbox]:checked').length > 0)
4
      return true;
5

  
6
    alert(kivi.t8('You have not selected any delivery order.'));
7

  
8
    return false;
9
  };
10
});
js/kivi.MassInvoiceCreatePrint.js
25 25
      return false;
26 26

  
27 27
    $('body').addClass('loading');
28
    $('form').submit();
28
    kivi.submit_form_with_action('form', 'MassInvoiceCreatePrint/create_invoices');
29 29
    return false;
30 30
  };
31 31

  
......
76 76
    $('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
77 77
  };
78 78

  
79
  this.setup = function() {
80
    $('#create_button').click(kivi.MassInvoiceCreatePrint.submitMassCreationForm);
81
    $('#create_print_all_button').click(kivi.MassInvoiceCreatePrint.createPrintAllInitialize);
82
  };
83

  
84 79
  ns.showMassPrintOptions = function() {
85 80
    $('#printer_options_printer_id').val($('#printer_id').val());
86 81

  
......
120 115
    $("#filter_table input").val("");
121 116
  };
122 117
});
123

  
124
$(kivi.MassInvoiceCreatePrint.setup);
js/locale/de.js
121 121
"Update quotation/order":"Auftrag/Angebot aktualisieren",
122 122
"Version actions":"Aktionen für Versionen",
123 123
"Yes":"Ja",
124
"You have not selected any delivery order.":"Sie haben keinen Lieferschein ausgewählt.",
125 124
"filename has not uploadable characters ":"Bitte Dateinamen ändern. Er hat für den Upload nicht verwendbare Sonderzeichen ",
126 125
"filesize too big: ":"Datei zu groß: ",
127 126
"flat-rate position":"Pauschalposition",
locale/de/all
700 700
  'Create and edit sales quotations' => 'Angebote erfassen und bearbeiten',
701 701
  'Create and edit vendor invoices' => 'Eingangsrechnungen erfassen und bearbeiten',
702 702
  'Create and print all invoices' => 'Alle Rechnungen erzeugen und ausdrucken',
703
  'Create and print invoices'   => 'Rechnungen erzeugen und ausdrucken',
704
  'Create and print invoices for all delivery orders matching the filter' => 'Rechnungen für alle den Suchkriterien entsprechenden Lieferscheine erzeugen und ausdrucken',
705
  'Create and print invoices for all selected delivery orders' => 'Rechnungen für alle Lieferscheine erzeugen und ausdrucken',
703 706
  'Create bank collection'      => 'Bankeinzug erstellen',
704 707
  'Create bank collection via SEPA XML' => 'Bankeinzug via SEPA XML erstellen',
705 708
  'Create bank transfer'        => 'Überweisung erstellen',
......
709 712
  'Create first invoice on'     => 'Erste Rechnung erzeugen am',
710 713
  'Create invoice'              => 'Buchung erstellen',
711 714
  'Create invoice?'             => 'Rechnung erstellen?',
712
  'Create invoices'             => 'Rechnungen erzeugen',
713 715
  'Create new'                  => 'Neu erfassen',
714 716
  'Create new background job'   => 'Neuen Hintergrund-Job anlegen',
715 717
  'Create new client #1'        => 'Neuen Mandanten #1 anlegen',
......
1359 1361
  'Font size'                   => 'Schriftgröße',
1360 1362
  'For AP transactions it will replace the sales taxkeys with input taxkeys with the same tax rate.' => 'Bei Kreditorenbuchungen werden die Umsatzsteuer-Steuerschlüssel durch Vorsteuer-Steuerschlüssel mit demselben Steuersatz ersetzt.',
1361 1363
  'For AR transactions it will replace the input taxkeys with sales taxkeys with the same tax rate.' => 'Bei Debitorenbuchungen werden die Vorsteuer-Steuerschlüssel durch Umsatzsteuer-Steuerschlüssel mit demselben Steuersatz ersetzt.',
1362
  'For all delivery orders create and print invoices' => 'Erstelle und drucke Rechnungen für alle Lieferscheine',
1363 1364
  'For changeing goto USTVA Config' => 'Zum Verändern bitte zu den UStVa Einstellungen gehen',
1364 1365
  'For further information read this: ' => 'Für weitere Informationen zu diesem Thema lesen Sie bitte: ',
1365 1366
  'For part "#1" there are missing #2 #3 in the default warehouse/bin "#4/#5".' => 'Es fehlen #2 #3 des Artikels "#1" im Standardlager "#4/#5".',
......
3678 3679
  'for Document types'          => 'für unterschiedliche ERP Dokumententypen',
3679 3680
  'for Period'                  => 'für den Zeitraum',
3680 3681
  'for all'                     => 'für alle',
3682
  'for all entries'             => 'für alle Einträge',
3681 3683
  'for date'                    => 'zum Stichtag',
3684
  'for selected entries'        => 'für ausgewählte Einträge',
3682 3685
  'found'                       => 'Gefunden',
3683 3686
  'found_br'                    => 'Gef.',
3684 3687
  'from \'#1\' imported Files'  => 'Von \'#1\' importierte Dateien',
templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html
45 45

  
46 46
    [% L.paginate_controls %]
47 47

  
48
    <hr size="3" noshade>
49

  
50
    <p>
51
     [% L.hidden_tag("action", "MassInvoiceCreatePrint/create_invoices") %]
52
     [% L.button_tag("", LxERP.t8("Create invoices"), name="create_button") %]
53
     [% L.button_tag("", LxERP.t8("For all delivery orders create and print invoices"), name="create_print_all_button") %]
54
    </p>
55 48
    <div id="create_print_all_dialog" style="display: none;">
56 49
     [%- INCLUDE 'mass_invoice_create_print_from_do/_create_print_all_step_1.html' %]
57 50
    </div>

Auch abrufbar als: Unified diff