Revision e23617cc
Von root vor mehr als 8 Jahren hinzugefügt
ShopOrder.js | ||
---|---|---|
1 |
namespace('kivi.ShopOrder', function(ns) { |
|
2 |
|
|
3 |
this.massTransferInitialize = function() { |
|
4 |
kivi.popup_dialog({ |
|
5 |
id: 'status_mass_transfer', |
|
6 |
dialog: { |
|
7 |
title: kivi.t8('Status Shoptransfer') |
|
8 |
} |
|
9 |
}); |
|
10 |
} |
|
11 |
|
|
12 |
this.massTransferStarted = function() { |
|
13 |
$('#status_mass_transfer').data('timerId', setInterval(function() { |
|
14 |
$.get("controller.pl", { |
|
15 |
action: 'ShopOrderMassTransfer/_transfer_status', |
|
16 |
job_id: $('smt_job_id').val() |
|
17 |
}, kivi.eval_json_result); |
|
18 |
}, 5000)); |
|
19 |
}; |
|
20 |
|
|
21 |
this.setup = function() { |
|
22 |
alert('HALLO'); |
|
23 |
$('#mass_transfer').click(kivi.ShopOrderMassTransfer.massTransferInitialize); |
|
24 |
}; |
|
25 |
}); |
|
26 |
|
|
27 |
$(kivi.ShopOrderMassTransfer.setup); |
js/kivi.ShopOrder.js | ||
---|---|---|
1 |
namespace('kivi.ShopOrder', function(ns) { |
|
2 |
this.massTransferInitialize = function() { |
|
3 |
kivi.popup_dialog({ |
|
4 |
id: 'status_mass_transfer', |
|
5 |
dialog: { |
|
6 |
title: kivi.t8('Status Shoptransfer') |
|
7 |
} |
|
8 |
}); |
|
9 |
alert('Hallo'); |
|
10 |
}; |
|
11 |
|
|
12 |
this.massTransferStarted = function() { |
|
13 |
$('#status_mass_transfer').data('timerId', setInterval(function() { |
|
14 |
$.get("controller.pl", { |
|
15 |
action: 'ShopOrder/transfer_status', |
|
16 |
job_id: $('#smt_job_id').val() |
|
17 |
}, kivi.eval_json_result); |
|
18 |
}, 5000)); |
|
19 |
}; |
|
20 |
|
|
21 |
this.massTransferFinished = function() { |
|
22 |
clearInterval($('#status_mass_transfer').data('timerId')); |
|
23 |
$('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '') |
|
24 |
}; |
|
25 |
|
|
26 |
this.setup = function() { |
|
27 |
kivi.ShopOrder.massTransferInitialize(); |
|
28 |
kivi.submit_ajax_form('controller.pl?action=ShopOrder/mass_transfer','[name=shop_orders]'); |
|
29 |
}; |
|
30 |
|
|
31 |
}); |
|
32 |
//$(kivi.ShopOrder.setup); |
templates/webpages/shop_order/_transfer_status.html | ||
---|---|---|
1 |
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%] |
|
2 |
[%- USE Dumper -%] |
|
3 |
[% SET data = job.data_as_hash %] |
|
4 |
|
|
5 |
|
|
6 |
<h2>[% LxERP.t8("Watch status") %]</h2> |
|
7 |
|
|
8 |
[% L.hidden_tag('', job.id, id="smt_job_id") %] |
|
9 |
|
|
10 |
JOBID: [% job.id %] <p> |
|
11 |
[% LxERP.t8("This status output will be refreshed every five seconds.") %] |
|
12 |
</p> |
|
13 |
xx |
|
14 |
<p> |
|
15 |
[% Dumper.dump_html(data) %] |
|
16 |
</p> |
|
17 |
xx |
|
18 |
<p> |
|
19 |
<table> |
|
20 |
<tr> |
|
21 |
<th valign="top" align="left">[% LxERP.t8("Current status:") %]</th> |
|
22 |
<td valign="top"> |
|
23 |
[% IF !data.status %] |
|
24 |
[% LxERP.t8("waiting for job to be started") %] |
|
25 |
[% ELSIF data.status == 1 %] |
|
26 |
[% LxERP.t8("Creating invoices") %] |
|
27 |
[% ELSIF data.status == 2 %] |
|
28 |
[% LxERP.t8("Printing invoices (this can take a while)") %] |
|
29 |
[% ELSE %] |
|
30 |
[% LxERP.t8("Done.") %] |
|
31 |
[% IF data.pdf_file_name %] |
|
32 |
[% LxERP.t8("The file is available for download.") %] |
|
33 |
[% ELSIF data.printer_id %] |
|
34 |
[% LxERP.t8("The file has been sent to the printer.") %] |
|
35 |
[% END %] |
|
36 |
[% END %] |
|
37 |
</td> |
|
38 |
</tr> |
|
39 |
<tr> |
|
40 |
<th valign="top" align="left">[% LxERP.t8("Number of invoices created:") %]</th> |
|
41 |
<td valign="top">[% IF data.status > 0 %][% HTML.escape(data.num_created) %] / [% HTML.escape(data.record_ids.size) %][% ELSE %]–[% END %]</td> |
|
42 |
</tr> |
|
43 |
|
|
44 |
<tr> |
|
45 |
<th valign="top" align="left">[% LxERP.t8("Number of invoices printed:") %]</th> |
|
46 |
<td valign="top">[% IF data.status > 1 %][% HTML.escape(data.num_printed) %] / [% HTML.escape(data.invoice_ids.size) %][% ELSE %]–[% END %]</td> |
|
47 |
</tr> |
|
48 |
|
|
49 |
<tr> |
|
50 |
<th valign="top" align="left">[% LxERP.t8("Errors during conversion:") %]</th> |
|
51 |
<td valign="top"> |
|
52 |
[% IF !data.status %] |
|
53 |
– |
|
54 |
[% ELSIF !data.conversion_errors.size %] |
|
55 |
[% LxERP.t8("No errors have occurred.") %] |
|
56 |
[% ELSE %] |
|
57 |
<table> |
|
58 |
<tr class="listheader"> |
|
59 |
<th>[% LxERP.t8("Delivery Order") %]</th> |
|
60 |
<th>[% LxERP.t8("Error") %]</th> |
|
61 |
</tr> |
|
62 |
|
|
63 |
[% FOREACH error = data.conversion_errors %] |
|
64 |
<tr> |
|
65 |
<td valign="top">[% IF error.id %][% L.link(SELF.url_for(controller='do.pl', action='edit', type='sales_delivery_order', id=error.id), HTML.escape(error.number), target="_blank") %][% ELSE %]–[% END %]</td> |
|
66 |
<td valign="top">[% HTML.escape(error.message) %]</td> |
|
67 |
</tr> |
|
68 |
[% END %] |
|
69 |
</table> |
|
70 |
[% END %] |
|
71 |
</td> |
|
72 |
</tr> |
|
73 |
|
|
74 |
<tr> |
|
75 |
<th valign="top" align="left">[% LxERP.t8("Errors during printing:") %]</th> |
|
76 |
<td valign="top"> |
|
77 |
[% IF data.status < 2 %] |
|
78 |
– |
|
79 |
[% ELSIF !data.print_errors.size %] |
|
80 |
[% LxERP.t8("No errors have occurred.") %] |
|
81 |
[% ELSE %] |
|
82 |
<table> |
|
83 |
<tr class="listheader"> |
|
84 |
<th>[% LxERP.t8("Invoice") %]</th> |
|
85 |
<th>[% LxERP.t8("Error") %]</th> |
|
86 |
</tr> |
|
87 |
|
|
88 |
[% FOREACH error = data.print_errors %] |
|
89 |
<tr> |
|
90 |
<td valign="top">[% IF error.id %][% L.link(SELF.url_for(controller='is.pl', action='edit', type='sales_invoice',id=error.id), HTML.escape(error.number), target="_blank") %][% ELSE %]–[% END %]</td> |
|
91 |
<td valign="top">[% HTML.escape(error.message) %]</td> |
|
92 |
</tr> |
|
93 |
[% END %] |
|
94 |
</table> |
|
95 |
[% END %] |
|
96 |
</td> |
|
97 |
</tr> |
|
98 |
|
|
99 |
</table> |
|
100 |
</p> |
Auch abrufbar als: Unified diff
Shoporder Anfang Fehlerabfrage