# if a filter is choosen, the filter info should be visible
$self->make_filter_summary;
- $self->sales_delivery_order_models->get;
+ $self->setup_list_sales_delivery_orders_action_bar(show_creation_buttons => $show, num_rows => scalar(@{ $self->sales_delivery_order_models->get }));
$self->render('mass_invoice_create_print_from_do/list_sales_delivery_orders',
noshow => $show,
title => $::locale->text('Open sales delivery orders'));
],
action => [
t8('Reset'),
- call => [ 'kivi.Project.reset_search_form' ],
+ call => [ 'kivi.call_jquery', '#search_form', 'resetForm' ],
],
action => [
$::locale->text('Print'),
}
}
+sub setup_list_sales_delivery_orders_action_bar {
+ my ($self, %params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Search'),
+ submit => [ '#search_form', { action => 'MassInvoiceCreatePrint/list_sales_delivery_orders' } ],
+ accesskey => 'enter',
+ ],
+ action => [
+ t8('Reset'),
+ call => [ 'kivi.call_jquery', '#search_form', 'resetForm' ],
+ ],
+
+ combobox => [
+ action => [
+ t8('Invoices'),
+ tooltip => t8("Create and print invoices")
+ ],
+ action => [
+ t8('for selected entries'),
+ call => [ 'kivi.MassInvoiceCreatePrint.submitMassCreationForm' ],
+ tooltip => t8("Create and print invoices for all selected delivery orders"),
+ disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef,
+ only_if => $params{show_creation_buttons},
+ ],
+
+ action => [
+ t8('for all entries'),
+ call => [ 'kivi.MassInvoiceCreatePrint.createPrintAllInitialize' ],
+ tooltip => t8("Create and print invoices for all delivery orders matching the filter"),
+ disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef,
+ only_if => $params{show_creation_buttons},
+ ],
+ ],
+ );
+ }
+}
+
1;
__END__
=head1 TODO
-Should be more generalized. Right now just one conversion (delivery order to invoice) is supported.
+pShould be more generalized. Right now just one conversion (delivery order to invoice) is supported.
Using BackgroundJobs to mass create / transfer stuff is the way to do it. The original idea
was taken from one client project (mosu) with some extra (maybe not standard compliant) customized
stuff (using cvars for extra filters and a very compressed Controller for linking (ODSalesOrder.pm)).
action => [
t8('New invoice'),
submit => [ '#orders_form' ],
- checks => [ 'kivi.DeliveryOrder.multi_invoice_check_delivery_orders_selected' ],
+ checks => [ [ 'kivi.check_if_entries_selected', '#orders_form tbody input[type=checkbox]' ] ],
accesskey => 'enter',
],
);
$idx++;
}
- $::request->layout->add_javascripts('kivi.DeliveryOrder.js');
-
setup_do_orders_action_bar();
$report->generate_with_headers(action_bar => 1);
+++ /dev/null
-namespace('kivi.DeliveryOrder', function(ns) {
- ns.multi_invoice_check_delivery_orders_selected = function() {
- if ($('#orders_form tbody input[type=checkbox]:checked').length > 0)
- return true;
-
- alert(kivi.t8('You have not selected any delivery order.'));
-
- return false;
- };
-});
return false;
$('body').addClass('loading');
- $('form').submit();
+ kivi.submit_form_with_action('form', 'MassInvoiceCreatePrint/create_invoices');
return false;
};
$('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
};
- this.setup = function() {
- $('#create_button').click(kivi.MassInvoiceCreatePrint.submitMassCreationForm);
- $('#create_print_all_button').click(kivi.MassInvoiceCreatePrint.createPrintAllInitialize);
- };
-
ns.showMassPrintOptions = function() {
$('#printer_options_printer_id').val($('#printer_id').val());
$("#filter_table input").val("");
};
});
-
-$(kivi.MassInvoiceCreatePrint.setup);
"Update quotation/order":"Auftrag/Angebot aktualisieren",
"Version actions":"Aktionen für Versionen",
"Yes":"Ja",
-"You have not selected any delivery order.":"Sie haben keinen Lieferschein ausgewählt.",
"filename has not uploadable characters ":"Bitte Dateinamen ändern. Er hat für den Upload nicht verwendbare Sonderzeichen ",
"filesize too big: ":"Datei zu groß: ",
"flat-rate position":"Pauschalposition",
'Create and edit sales quotations' => 'Angebote erfassen und bearbeiten',
'Create and edit vendor invoices' => 'Eingangsrechnungen erfassen und bearbeiten',
'Create and print all invoices' => 'Alle Rechnungen erzeugen und ausdrucken',
+ 'Create and print invoices' => 'Rechnungen erzeugen und ausdrucken',
+ 'Create and print invoices for all delivery orders matching the filter' => 'Rechnungen für alle den Suchkriterien entsprechenden Lieferscheine erzeugen und ausdrucken',
+ 'Create and print invoices for all selected delivery orders' => 'Rechnungen für alle Lieferscheine erzeugen und ausdrucken',
'Create bank collection' => 'Bankeinzug erstellen',
'Create bank collection via SEPA XML' => 'Bankeinzug via SEPA XML erstellen',
'Create bank transfer' => 'Überweisung erstellen',
'Create first invoice on' => 'Erste Rechnung erzeugen am',
'Create invoice' => 'Buchung erstellen',
'Create invoice?' => 'Rechnung erstellen?',
- 'Create invoices' => 'Rechnungen erzeugen',
'Create new' => 'Neu erfassen',
'Create new background job' => 'Neuen Hintergrund-Job anlegen',
'Create new client #1' => 'Neuen Mandanten #1 anlegen',
'Font size' => 'Schriftgröße',
'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.',
'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.',
- 'For all delivery orders create and print invoices' => 'Erstelle und drucke Rechnungen für alle Lieferscheine',
'For changeing goto USTVA Config' => 'Zum Verändern bitte zu den UStVa Einstellungen gehen',
'For further information read this: ' => 'Für weitere Informationen zu diesem Thema lesen Sie bitte: ',
'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".',
'for Document types' => 'für unterschiedliche ERP Dokumententypen',
'for Period' => 'für den Zeitraum',
'for all' => 'für alle',
+ 'for all entries' => 'für alle Einträge',
'for date' => 'zum Stichtag',
+ 'for selected entries' => 'für ausgewählte Einträge',
'found' => 'Gefunden',
'found_br' => 'Gef.',
'from \'#1\' imported Files' => 'Von \'#1\' importierte Dateien',
[% L.paginate_controls %]
- <hr size="3" noshade>
-
- <p>
- [% L.hidden_tag("action", "MassInvoiceCreatePrint/create_invoices") %]
- [% L.button_tag("", LxERP.t8("Create invoices"), name="create_button") %]
- [% L.button_tag("", LxERP.t8("For all delivery orders create and print invoices"), name="create_print_all_button") %]
- </p>
<div id="create_print_all_dialog" style="display: none;">
[%- INCLUDE 'mass_invoice_create_print_from_do/_create_print_all_step_1.html' %]
</div>