$main::lxdebug->leave_sub();
}
+sub setup_ar_search_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ $::locale->text('Search'),
+ submit => [ '#form' ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
+sub setup_ar_transactions_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ $::locale->text('Print'),
+ call => [ 'kivi.MassInvoiceCreatePrint.showMassPrintOptionsOrDownloadDirectly' ],
+ disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef,
+ ],
+
+ combobox => [
+ action => [ $::locale->text('Create new') ],
+ action => [
+ $::locale->text('AR Transaction'),
+ submit => [ '#create_new_form', { action => 'ar_transaction' } ],
+ ],
+ action => [
+ $::locale->text('Sales Invoice'),
+ submit => [ '#create_new_form', { action => 'sales_invoice' } ],
+ ],
+ ], # end of combobox "Create new"
+ );
+ }
+}
+
sub search {
$main::lxdebug->enter_sub();
$::request->layout->add_javascripts("autocomplete_project.js");
+ setup_ar_search_action_bar();
+
$form->header;
print $form->parse_html_template('ar/search', { %myconfig });
$report->add_separator();
$report->add_data(create_subtotal_row(\%totals, \@columns, \%column_alignment, \@subtotal_columns, 'listtotal'));
- $report->generate_with_headers();
+ $::request->layout->add_javascripts('kivi.MassInvoiceCreatePrint.js');
+ setup_ar_transactions_action_bar(num_rows => scalar(@{ $form->{AR} }));
+
+ $report->generate_with_headers(action_bar => 1);
$main::lxdebug->leave_sub();
}
alert(kivi.t8('No delivery orders have been selected.'));
return false;
};
+
this.checkInvoiceSelection = function() {
if ($("[data-checkall=1]:checked").size() > 0)
return true;
this.setup = function() {
$('#create_button').click(kivi.MassInvoiceCreatePrint.submitMassCreationForm);
$('#create_print_all_button').click(kivi.MassInvoiceCreatePrint.createPrintAllInitialize);
- $('#action_print').click(kivi.MassInvoiceCreatePrint.checkInvoiceSelection);
+ };
+
+ ns.showMassPrintOptions = function() {
+ $('#printer_options_printer_id').val($('#printer_id').val());
+
+ kivi.popup_dialog({
+ id: 'print_options',
+ dialog: {
+ title: kivi.t8('Print options'),
+ width: 600,
+ height: 200
+ }
+ });
+
+ return true;
+ };
+
+ ns.showMassPrintOptionsOrDownloadDirectly = function() {
+ if (!kivi.MassInvoiceCreatePrint.checkInvoiceSelection())
+ return false;
+
+ if ($('#print_options_printer_id').length === 0)
+ return kivi.MassInvoiceCreatePrint.massPrint();
+ return kivi.MassInvoiceCreatePrint.showMassPrintOptions();
+ };
+
+ ns.massPrint = function() {
+ $('#print_options').dialog('close');
+
+ $('#printer_id').val($('#print_options_printer_id').val());
+ $('#action').val('MassInvoiceCreatePrint/print');
+
+ $('#report_form').submit();
+
+ return true;
};
});
'The recipient, subject or body is missing.' => 'Der Empfäger, der Betreff oder der Text ist leer.',
'The record template \'#1\' has been loaded.' => 'Die Belegvorlage »#1« wurde geladen.',
'The record template \'#1\' has been saved.' => 'Die Belegvorlage »#1« wurde gespeichert.',
+ 'The report doesn\'t contain entries.' => 'Der Bericht enthält keine Einträge.',
'The required information consists of the IBAN and the BIC.' => 'Die benötigten Informationen bestehen aus der IBAN und der BIC. Zusätzlich wird die SEPA-Kreditoren-Identifikation aus der Mandantenkonfiguration benötigt.',
'The required information consists of the IBAN, the BIC, the mandator ID and the mandate\'s date of signature.' => 'Die benötigten Informationen bestehen aus IBAN, BIC, Mandanten-ID und dem Unterschriftsdatum des Mandates. Zusätzlich wird die SEPA-Kreditoren-Identifikation aus der Mandantenkonfiguration benötigt.',
'The requirement spec has been deleted.' => 'Das Pflichtenheft wurde gelöscht.',
[% USE T8 %][% USE HTML %][%- USE LxERP -%][%- USE L -%]
- [% IF ALL_PRINTERS.size %]
- <p>
- [% LxERP.t8("Print destination") %]:
- [% SET printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;
- CALL printers.import(ALL_PRINTERS);
- L.select_tag("printer_id", printers, title_key="description", default=printer_id) %]
- </p>
- [% END %]
-
- <p>
- [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
- [% L.submit_tag("action_print", LxERP.t8("Print")) %]
- </p>
+ [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
+ [% L.hidden_tag("printer_id") %]
</form>
- <form method="post" action="dispatcher.pl?M=ar">
-
- <input name="callback" type="hidden" value="[% callback %]">
-
- [% 'Create new' | $T8 %]<br>
+ <form method="post" action="ar.pl" id="create_new_form">
+ [% L.hidden_tag("callback", callback) %]
+ </form>
- <input class="submit" type="submit" name="A_ar_transaction" value="[%- 'AR Transaction' | $T8 %]">
- <input class="submit" type="submit" name="A_sales_invoice" value="[%- 'Sales Invoice' | $T8 %]">
+[% IF ALL_PRINTERS.size %]
+ <div id="print_options" class="hidden">
+ <p>
+ [% LxERP.t8("Print destination") %]:
+ [% SET printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;
+ CALL printers.import(ALL_PRINTERS);
+ L.select_tag("", printers, id="print_options_printer_id", title_key="description", default=printer_id) %]
+ </p>
- </form>
+ <p>
+ [% L.button_tag("kivi.MassInvoiceCreatePrint.massPrint()", LxERP.t8('Print')) %]
+ </p>
+ </div>
+[% END %]
-<form method="post" action="controller.pl">
+<form method="post" action="controller.pl" id="report_form">
[%- SET style="width: 250px" %]
<h1>[% title %]</h1>
- <form method=post name="search" action=[% script %]>
+ <form method=post name="search" id="form" action=[% script %]>
+ [% L.hidden_tag("action", nextsub) %]
<table width=100% border="0">
<tr>
</table>
</td>
</tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
</table>
- <input type=hidden name=nextsub value=[% nextsub %]>
- <br>
- <input class=submit type=submit name=action id="continue" value="[% 'Continue' | $T8 %]">
</form>