action => [ t8('Export') ],
action => [
($form->{id} ? t8('Print') : t8('Preview')),
- submit => [ '#form', { action => "print" } ],
+ call => [ 'kivi.SalesPurchase.show_print_dialog', $form->{id} ? 'print' : 'preview' ],
checks => [ @req_trans_desc ],
disabled => !$form->{id} && $form->{locked} ? t8('The billing period has already been locked.') : undef,
],
this.print_record = function() {
$('#print_dialog').dialog('close');
- kivi.submit_form_with_action('#form', 'print');
+ kivi.submit_form_with_action('#form', $('#form').data('print-action'));
};
- this.show_print_dialog = function() {
+ this.show_print_dialog = function(print_action) {
+ $('#form').data('print-action', print_action || 'print');
+
kivi.popup_dialog({
id: 'print_dialog',
dialog: {
</script>
<div id="shipto_dialog" class="hidden"></div>
+<div id="print_dialog" class="hidden">
+ [%- PROCESS 'common/_print_dialog.html' %]
+</div>