$bar->add(
action => [
t8('New invoice'),
- submit => [ '#orders_form' ],
- checks => [ [ 'kivi.check_if_entries_selected', '#orders_form tbody input[type=checkbox]' ] ],
+ submit => [ '#form', { action => 'invoice_multi' } ],
+ checks => [ [ 'kivi.check_if_entries_selected', '#form tbody input[type=checkbox]' ] ],
accesskey => 'enter',
],
+ action => [
+ t8('Print'),
+ call => [ 'kivi.SalesPurchase.show_print_dialog', 'js:kivi.MassDeliveryOrderPrint.submitMultiOrders' ],
+ checks => [ [ 'kivi.check_if_entries_selected', '#form tbody input[type=checkbox]' ] ],
+ ],
);
}
}
my $locale = $main::locale;
my $cgi = $::request->{cgi};
- $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.MassDeliveryOrderPrint));
+ $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.MassDeliveryOrderPrint kivi.SalesPurchase));
($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} });
report_generator_set_default_sort('transdate', 1);
$form->{printer_id} = $pr->id;
}
+ my $print_options = SL::Helper::PrintOptions->get_print_options(
+ options => {
+ hide_language_id => 1,
+ show_bothsided => 1,
+ show_headers => 1,
+ },
+ );
+
$report->set_options('top_info_text' => join("\n", @options),
'raw_top_info_text' => $form->parse_html_template('do/orders_top'),
- 'raw_bottom_info_text' => $form->parse_html_template('do/orders_bottom', { print_options => print_options(inline => 1,hide_language_id => 1) }),
+ 'raw_bottom_info_text' => $form->parse_html_template('do/orders_bottom', { print_options => $print_options }),
'output_format' => 'HTML',
'title' => $form->{title},
'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time),
namespace('kivi.MassDeliveryOrderPrint', function(ns) {
-
+ "use strict";
+
ns.massConversionFinishProcess = function() {
$('#mass_print_dialog').dialog('close');
};
};
ns.submitMultiOrders = function () {
- $("#old_table_id").remove();
- var checkboxes = $('input[type=checkbox]').filter(function () { return $(this).prop('checked'); });
- if (checkboxes.size() == 0) {
- alert(kivi.t8("No delievery orders selected, please set one checkbox!"));
- return false;
- }
-
- var tmpform = $("#report_table_id").clone();
- tmpform.hide();
- tmpform.attr('id',"old_table_id");
- tmpform.appendTo("#print_multi_id");
- return kivi.submit_ajax_form('controller.pl?action=MassDeliveryOrderPrint/mass_mdo_print',$('#print_multi_id'));
- };
-
- ns.setup = function() {
- $('#multi_all').checkall("input[name^='multi_id']");
- $('#print_multi_button').click(kivi.MassDeliveryOrderPrint.submitMultiOrders);
+ return kivi.submit_ajax_form('controller.pl?action=MassDeliveryOrderPrint/mass_mdo_print', $('#form'));
};
});
-
-$(kivi.MassDeliveryOrderPrint.setup);
this.print_record = function() {
$('#print_dialog').dialog('close');
- kivi.submit_form_with_action('#form', $('#form').data('print-action'));
+ var action = $('#form').data('print-action');
+ if (action.match("^js:"))
+ return kivi.run(action.substring(3));
+
+ kivi.submit_form_with_action('#form', action);
};
this.show_print_dialog = function(print_action) {
"More than one file selected, please set only one checkbox!":"Mehr als ein Element selektiert, bitte nur eine Box anklicken",
"No":"Nein",
"No article has been selected yet.":"Es wurde noch kein Artikel ausgewählt.",
-"No delievery orders selected, please set one checkbox!":"Kein Lieferschein selektiert, bitte eine Box anklicken!",
"No delivery orders have been selected.":"Es wurden keine Lieferscheine ausgewählt.",
"No entries have been selected.":"Es wurden keine Einträge ausgewählt.",
"No file selected, please set one checkbox!":"Kein Element selektiert,bitte eine Box anklicken",
'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.',
'No data was found.' => 'Es wurden keine Daten gefunden.',
'No default currency' => 'Keine Standardwährung',
- 'No delievery orders selected, please set one checkbox!' => 'Kein Lieferschein selektiert, bitte eine Box anklicken!',
'No delivery orders have been selected.' => 'Es wurden keine Lieferscheine ausgewählt.',
'No delivery term has been created yet.' => 'Es wurden noch keine Lieferbedingungen angelegt',
'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgewählt.',
'Print list' => 'Liste ausdrucken',
'Print options' => 'Druckoptionen',
'Print record' => 'Beleg drucken',
- 'Print selected' => 'Drucken',
- 'Print selected delivery orders both sided' => 'Ausgewählte Lieferscheine (ggf beidseitig)',
'Print template base file name' => 'Druckvorlagen-Basisdateiname',
'Print templates' => 'Druckvorlagen',
'Print templates to use' => 'Zu verwendende Druckvorlagen',
-[% USE HTML %][%- USE T8 -%]
- <input type="hidden" name="action" value="invoice_multi">
- <input type="hidden" name="type" value="[% HTML.escape(type) %]">
- <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
- <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
- <input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
+[% USE HTML %][%- USE T8 -%][%- USE LxERP -%][%- USE P -%]
+ [% P.hidden_tag("type", type) %]
+ [% P.hidden_tag("vc", vc) %]
+ [% P.hidden_tag("rowcount", rowcount) %]
+ [% P.hidden_tag("callback", callback) %]
+
+ <div id="print_options" class="hidden">
+ [% print_options %]
+ </div>
</form>
-<form method="post" id="print_multi_id">
-[% print_options %]
+
+<div id="print_dialog" class="hidden">
+ [%- PROCESS 'common/_print_dialog.html' %]
+</div>
<div id="mass_print_dialog" style="display: none"></div>
-<table width="100%">
- <tr><td width="300px" align="right">[% 'Print selected delivery orders both sided' | $T8 %]</td>
- <td><input type="checkbox" name="bothsided" value="1">
-<input type="hidden" name="type" value="[% HTML.escape(type) %]">
-<input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
-<input class="submit" type="button" name="action" id="print_multi_button" value="[% 'Print selected' | $T8 %]">
-</td><td></td></tr></table></form>
[%- INCLUDE 'common/flash.html' %]
-<form method="post" action="do.pl" id="orders_form">
+<form method="post" action="do.pl" id="form">
<input name="[%- name_prefix %]groupitems" id="[% id_prefix %]groupitems" type="checkbox" class="checkbox" [% groupitems_checked %]>
</td>
[%- END %]
+ [%- IF display_bothsided %]
+ <td id="print_options_input_bothsided">[%- IF !show_headers %][% 'Both-sided' | $T8 %][%- END %]
+ <input name="[%- name_prefix %]bothsided" id="[% id_prefix %]bothsided" type="checkbox" class="checkbox" [% bothsided_checked %]>
+ </td>
+ [%- END %]
[%- IF display_remove_draft %]
<td id="print_options_input_remove_draft">[%- IF !show_headers %][% 'Remove Draft' | $T8 %][%- END %]
<input name="[%- name_prefix %]remove_draft" id="[% id_prefix %]remove_draft" type="checkbox" class="checkbox" [% remove_draft_checked %]>